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

54 lines
1.8 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.TowerCraneDetectionMapper">
<select id="getConstDeviceList" resultType="com.bonus.base.basic.domain.ConstInfoVo">
SELECT
tci.id,
tci.`name`,
tci.`code`,
tcd.is_online,
tcd.dev_location
FROM
tb_const_info tci
LEFT JOIN tb_collect_device tcd ON tci.id = tcd.const_id
WHERE
tci.type_code = #{typeCode}
</select>
<select id="getConstDeviceMsgById" resultType="com.bonus.base.basic.domain.ConstInfoVo">
SELECT
tci.config_data
FROM
tb_const_info tci
WHERE
tci.id = #{id}
</select>
<select id="getTowerCraneRunMsgById" resultType="com.bonus.base.screen.domain.MapValueVo">
SELECT
tcda.attr_name as `name`,
tcda.attr_val as `value`
FROM
tb_const_info tci
LEFT JOIN tb_collect_device tcd ON tci.id = tcd.const_id
LEFT JOIN tb_collect_device_attr tcda ON tcda.dev_id = tcd.id
WHERE
tci.id = #{id}
</select>
<select id="getTowerCraneAlarmList" resultType="com.bonus.base.screen.domain.DeviceAlarmVo">
SELECT
tcdh.create_time AS createTime,
tcdh.remark AS remark,
tcd.dev_name AS devName
FROM
tb_const_info tci
LEFT JOIN tb_collect_device tcd ON tci.id = tcd.const_id
LEFT JOIN tb_collect_device_his tcdh ON tcdh.dev_id = tcd.id
WHERE
tci.type_code = #{typeCode}
</select>
</mapper>