This commit is contained in:
马三炮 2025-04-24 18:04:23 +08:00
parent acbb80b088
commit 3ab68877a7
5 changed files with 21 additions and 6 deletions

View File

@ -27,6 +27,11 @@ public class TypeCodeUtils {
*/
public final static String TC_CODE="9000400";
/**
* 有限空间气体
*/
public final static String KJQT_CODE="9000500";
/**
* 默认查询球机类型
*/

View File

@ -4,6 +4,7 @@ import com.bonus.base.basic.domain.CollectDevAttrVo;
import com.bonus.base.screen.domain.CollectDeviceHisVo;
import com.bonus.base.screen.mapper.ConfinedSpaceGasMapper;
import com.bonus.base.screen.service.ConfinedSpaceGasService;
import com.bonus.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -37,7 +38,12 @@ public class ConfinedSpaceGasServiceImpl implements ConfinedSpaceGasService {
for (CollectDevAttrVo collectDevAttrVo : collectDevAttrVoList) {
//获取每种属性的最新数据
CollectDeviceHisVo collectDeviceHis = confinedSpaceGasMapper.getData(collectDevAttrVo);
map.put(collectDevAttrVo.getAttrName(),collectDeviceHis.getAttrVal());
if (StringUtils.isNotNull(collectDeviceHis)){
map.put(collectDevAttrVo.getAttrName(),collectDeviceHis.getAttrVal());
}else {
map.put(collectDevAttrVo.getAttrName(),null);
}
}
return map;
}

View File

@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getData" resultType="com.bonus.base.screen.domain.CollectDeviceHisVo">
select create_time,remark,attr_val
from tb_collect_device_his
where attr_name = #{attrName}
ORDER BY create_time desc limit 1
</select>
<select id="getCurveGraph" resultType="com.bonus.base.screen.domain.CollectDeviceHisVo">

View File

@ -8,18 +8,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getCollectDeviceList" resultType="com.bonus.base.basic.domain.CollectDevVo">
select tcd.id, tcd.dev_name,tcd.is_online,tcd.dev_location,tcd.dev_code
from tb_collect_device tcd
where tcd.del_flag =0 and tcd.dev_type_id = #{typeId}
left join tb_dev_type tdt on tcd.dev_type_id = tdt.id
where tcd.del_flag =0 and tdt.type_code = #{typeCode}
</select>
<select id="getDevStatistics" resultType="com.bonus.base.basic.domain.CollectDevVo">
SELECT count(1) num, IFNULL(tcd.is_online,0) isOnline
FROM tb_collect_device tcd
where tcd.is_active=1 and tcd.del_flag=0 and tcd.dev_type_id = #{typeId}
left join tb_dev_type tdt on tcd.dev_type_id = tdt.id
where tcd.is_active=1 and tcd.del_flag=0 and tdt.type_code = #{typeCode}
GROUP BY IFNULL( tcd.is_online,0)
</select>
<select id="concreteAlarmList" resultType="com.bonus.base.screen.domain.DeviceAlarmVo">
select tcdh.create_time as createTime,tcdh.remark as remark,tcd.dev_name as devName
from tb_collect_device_his tcdh
left join tb_collect_device tcd on tcdh.dev_id = tcd.id
where tcdh.is_warn =1 and tcd.dev_type_id = #{typeId}
left join tb_dev_type tdt on tcd.dev_type_id = tdt.id
where tcdh.is_warn =1 and tdt.type_code = #{typeCode}
</select>
</mapper>

View File

@ -9,7 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id,name,type_id,type_code,type_name,create_time,update_time,is_active,remark,background_image,
config_data,code
from tb_const_info where del_flag =0
type_id = #{typeId}
type_code = #{typeCode}
</select>
<select id="getCollectDeviceList" resultType="com.bonus.base.basic.domain.CollectDevVo">
select tcd.id, tcd.dev_name,tcd.is_online,tcd.dev_location
@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select name,count(tcd.id) num
from tb_const_info tci
left join tb_collect_device tcd on tcd.const_id = tci.id
where tci.type_id = #{typeId}
where tci.type_code = #{typeCode}
group by tci.id
</select>
<select id="concreteAlarmList" resultType="com.bonus.base.screen.domain.DeviceAlarmVo">