This commit is contained in:
parent
acbb80b088
commit
3ab68877a7
|
|
@ -27,6 +27,11 @@ public class TypeCodeUtils {
|
||||||
*/
|
*/
|
||||||
public final static String TC_CODE="9000400";
|
public final static String TC_CODE="9000400";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 有限空间气体
|
||||||
|
*/
|
||||||
|
public final static String KJQT_CODE="9000500";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认查询球机类型
|
* 默认查询球机类型
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.bonus.base.basic.domain.CollectDevAttrVo;
|
||||||
import com.bonus.base.screen.domain.CollectDeviceHisVo;
|
import com.bonus.base.screen.domain.CollectDeviceHisVo;
|
||||||
import com.bonus.base.screen.mapper.ConfinedSpaceGasMapper;
|
import com.bonus.base.screen.mapper.ConfinedSpaceGasMapper;
|
||||||
import com.bonus.base.screen.service.ConfinedSpaceGasService;
|
import com.bonus.base.screen.service.ConfinedSpaceGasService;
|
||||||
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -37,7 +38,12 @@ public class ConfinedSpaceGasServiceImpl implements ConfinedSpaceGasService {
|
||||||
for (CollectDevAttrVo collectDevAttrVo : collectDevAttrVoList) {
|
for (CollectDevAttrVo collectDevAttrVo : collectDevAttrVoList) {
|
||||||
//获取每种属性的最新数据
|
//获取每种属性的最新数据
|
||||||
CollectDeviceHisVo collectDeviceHis = confinedSpaceGasMapper.getData(collectDevAttrVo);
|
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;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="getData" resultType="com.bonus.base.screen.domain.CollectDeviceHisVo">
|
<select id="getData" resultType="com.bonus.base.screen.domain.CollectDeviceHisVo">
|
||||||
select create_time,remark,attr_val
|
select create_time,remark,attr_val
|
||||||
from tb_collect_device_his
|
from tb_collect_device_his
|
||||||
|
where attr_name = #{attrName}
|
||||||
ORDER BY create_time desc limit 1
|
ORDER BY create_time desc limit 1
|
||||||
</select>
|
</select>
|
||||||
<select id="getCurveGraph" resultType="com.bonus.base.screen.domain.CollectDeviceHisVo">
|
<select id="getCurveGraph" resultType="com.bonus.base.screen.domain.CollectDeviceHisVo">
|
||||||
|
|
|
||||||
|
|
@ -8,18 +8,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="getCollectDeviceList" resultType="com.bonus.base.basic.domain.CollectDevVo">
|
<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
|
select tcd.id, tcd.dev_name,tcd.is_online,tcd.dev_location,tcd.dev_code
|
||||||
from tb_collect_device tcd
|
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>
|
||||||
<select id="getDevStatistics" resultType="com.bonus.base.basic.domain.CollectDevVo">
|
<select id="getDevStatistics" resultType="com.bonus.base.basic.domain.CollectDevVo">
|
||||||
SELECT count(1) num, IFNULL(tcd.is_online,0) isOnline
|
SELECT count(1) num, IFNULL(tcd.is_online,0) isOnline
|
||||||
FROM tb_collect_device tcd
|
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)
|
GROUP BY IFNULL( tcd.is_online,0)
|
||||||
</select>
|
</select>
|
||||||
<select id="concreteAlarmList" resultType="com.bonus.base.screen.domain.DeviceAlarmVo">
|
<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
|
select tcdh.create_time as createTime,tcdh.remark as remark,tcd.dev_name as devName
|
||||||
from tb_collect_device_his tcdh
|
from tb_collect_device_his tcdh
|
||||||
left join tb_collect_device tcd on tcdh.dev_id = tcd.id
|
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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -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,
|
select id,name,type_id,type_code,type_name,create_time,update_time,is_active,remark,background_image,
|
||||||
config_data,code
|
config_data,code
|
||||||
from tb_const_info where del_flag =0
|
from tb_const_info where del_flag =0
|
||||||
type_id = #{typeId}
|
type_code = #{typeCode}
|
||||||
</select>
|
</select>
|
||||||
<select id="getCollectDeviceList" resultType="com.bonus.base.basic.domain.CollectDevVo">
|
<select id="getCollectDeviceList" resultType="com.bonus.base.basic.domain.CollectDevVo">
|
||||||
select tcd.id, tcd.dev_name,tcd.is_online,tcd.dev_location
|
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
|
select name,count(tcd.id) num
|
||||||
from tb_const_info tci
|
from tb_const_info tci
|
||||||
left join tb_collect_device tcd on tcd.const_id = tci.id
|
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
|
group by tci.id
|
||||||
</select>
|
</select>
|
||||||
<select id="concreteAlarmList" resultType="com.bonus.base.screen.domain.DeviceAlarmVo">
|
<select id="concreteAlarmList" resultType="com.bonus.base.screen.domain.DeviceAlarmVo">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue