Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
nmy 2023-12-10 00:04:45 +08:00
commit e3e65ef562
2 changed files with 12 additions and 1 deletions

View File

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

View File

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