This commit is contained in:
sxu 2023-12-09 14:44:36 +08:00
parent 0c34b37fd6
commit be6ce9ea06
2 changed files with 27 additions and 5 deletions

View File

@ -107,6 +107,7 @@ public class DevInfoServiceImpl implements IDevInfoService
{ {
List<DevInfoVo> list = devInfoMapper.selectDevInfoList(devInfo); List<DevInfoVo> list = devInfoMapper.selectDevInfoList(devInfo);
fillInMaStatusStr(list); fillInMaStatusStr(list);
fillInCityStr(list);
return list; return list;
} }
@ -115,13 +116,14 @@ public class DevInfoServiceImpl implements IDevInfoService
{ {
List<DevInfoVo> hotList = devInfoMapper.selectDevInfoHotList(devInfo); List<DevInfoVo> hotList = devInfoMapper.selectDevInfoHotList(devInfo);
fillInMaStatusStr(hotList); fillInMaStatusStr(hotList);
fillInCityStr(hotList);
return hotList; return hotList;
} }
private void fillInMaStatusStr(List<DevInfoVo> hotList) { private void fillInMaStatusStr(List<DevInfoVo> list) {
List<SysDic> sysDics = devInfoMapper.getSysDic(); List<SysDic> sysDicList = devInfoMapper.getSysDic();
for (DevInfoVo devInfoVo : hotList) { for (DevInfoVo devInfoVo : list) {
for (SysDic sysDic : sysDics) { for (SysDic sysDic : sysDicList) {
if (devInfoVo.getMaStatus().equals(String.valueOf(sysDic.getId()))) { if (devInfoVo.getMaStatus().equals(String.valueOf(sysDic.getId()))) {
devInfoVo.setMaStatusStr(sysDic.getName()); devInfoVo.setMaStatusStr(sysDic.getName());
} }
@ -129,6 +131,23 @@ public class DevInfoServiceImpl implements IDevInfoService
} }
} }
private void fillInCityStr(List<DevInfoVo> list) {
List<BaseAddress> addressList = devInfoMapper.getBaseAddress();
for (DevInfoVo devInfoVo : list) {
for (BaseAddress address : addressList) {
// if (String.valueOf(devInfoVo.getProvinceId()).equals(String.valueOf(address.getId()))) {
// devInfoVo.setProvinceStr(address.getName());
// }
if (String.valueOf(devInfoVo.getCityId()).equals(String.valueOf(address.getId()))) {
devInfoVo.setCityStr(address.getName());
}
// if (String.valueOf(devInfoVo.getAreaId()).equals(String.valueOf(address.getId()))) {
// devInfoVo.setAreaStr(address.getName());
// }
}
}
}
/** /**
* 新增设备信息 * 新增设备信息
* *

View File

@ -139,7 +139,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bm_company_info c on d.own_co = c.company_id left join bm_company_info c on d.own_co = c.company_id
left join ma_hot_search h on d.ma_id = h.ma_id left join ma_hot_search h on d.ma_id = h.ma_id
left join ma_type_info ti on d.type_id = ti.type_id left join ma_type_info ti on d.type_id = ti.type_id
where d.is_active='1' <where>
d.is_active='1'
<if test="maStatus != null and maStatus != ''"> and d.ma_status = #{maStatus}</if>
</where>
order by h.search_num order by h.search_num
</select> </select>
<!-- <select id="selectDevInfoHotList" parameterType="com.bonus.zlpt.equip.api.domain.vo.DevInfoVo" resultType="com.bonus.zlpt.equip.api.domain.vo.DevInfoVo">--> <!-- <select id="selectDevInfoHotList" parameterType="com.bonus.zlpt.equip.api.domain.vo.DevInfoVo" resultType="com.bonus.zlpt.equip.api.domain.vo.DevInfoVo">-->