This commit is contained in:
sxu 2023-12-10 00:03:06 +08:00
parent ce8e5aac7d
commit 8853d69234
2 changed files with 12 additions and 1 deletions

View File

@ -25,6 +25,8 @@ public interface DevInfoMapper
*/ */
public DevInfoVo selectDevInfoByMaId(Long maId); public DevInfoVo selectDevInfoByMaId(Long maId);
public int getHotSearchCountByMaId(Long maId);
public int insertHotSearch(Long maId);
public int updateHotSearchByMaId(Long maId); public int updateHotSearchByMaId(Long maId);
/** /**

View File

@ -56,7 +56,7 @@ public class DevInfoServiceImpl implements IDevInfoService
{ {
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId); DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId);
//更新搜索量 //更新搜索量
devInfoMapper.updateHotSearchByMaId(maId); updateHotSearch(maId);
try { try {
List<SysFile> files = devInfoMapper.getFilesByMaId(maId); List<SysFile> files = devInfoMapper.getFilesByMaId(maId);
if (!CollectionUtils.isEmpty(files) && files.get(0) != null) { if (!CollectionUtils.isEmpty(files) && files.get(0) != null) {
@ -103,6 +103,15 @@ public class DevInfoServiceImpl implements IDevInfoService
return devInfoVo; return devInfoVo;
} }
private void updateHotSearch(Long maId) {
int count = devInfoMapper.getHotSearchCountByMaId(maId);
if (count == 0) {
devInfoMapper.insertHotSearch(maId);
} else {
devInfoMapper.updateHotSearchByMaId(maId);
}
}
/** /**
* 查询设备信息列表 * 查询设备信息列表
* *