bns-zhgd-service/bonus-modules/bonus-base/src/main/resources/mapper/screen.basic/ExcavationDetectionMapper.xml

26 lines
1.2 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.base.screen.mapper.ExcavationDetectionMapper">
<select id="getCollectDeviceList" resultType="com.bonus.base.basic.domain.CollectDevVo">
select tcd.id, tcd.dev_name,tcd.is_online,tcd.dev_location
from tb_collect_device tcd
where tcd.del_flag =0 and tcd.dev_type_id = #{typeId}
</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}
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}
</select>
</mapper>