|
@@ -0,0 +1,177 @@
|
|
|
+<?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.welampiot.dao.CableDao">
|
|
|
+
|
|
|
+ <select id="getDevListByCableDTO" resultType="CableDTO">
|
|
|
+ select c.id,c.name,c.online,c.type,c.manhole1_X manhole1X,c.manhole1_Y manhole1Y,c.manhole1_Z manhole1Z,
|
|
|
+ c.manhole1_V manhole1V,c.manhole1_A manhole1A,c.manhole2_X manhole2X,c.manhole2_Y manhole2Y,c.manhole2_Z manhole2Z,
|
|
|
+ c.manhole2_V manhole2V,c.manhole2_A manhole2A,c.manhole3_X manhole3X,c.manhole3_Y manhole3Y,c.manhole3_Z manhole3Z,
|
|
|
+ c.manhole3_V manhole3V,c.manhole3_A manhole3A,c.manhole4_X manhole4X,c.manhole4_Y manhole4Y,c.manhole4_Z manhole4Z,
|
|
|
+ c.manhole4_V manhole4V,c.manhole4_A manhole4A,c.manhole5_X manhole5X,c.manhole5_Y manhole5Y,c.manhole5_Z manhole5Z,
|
|
|
+ c.manhole5_V manhole5V,c.manhole5_A manhole5A,c.temperature1_T temperature1T,c.temperature1_V temperature1V,
|
|
|
+ c.temperature1_A temperature1A,c.temperature2_T temperature2T,c.temperature2_V temperature2V,c.temperature2_A temperature2A,
|
|
|
+ c.temperature3_T temperature3T,c.temperature3_V temperature3V,c.temperature3_A temperature3A,c.water_W waterW,c.water_V waterV,
|
|
|
+ c.water_A waterA,c.ch4,c.co,c.h2s,c.o2,c.gas_V gasV,c.gas_A gasA,c.updatetime as updateTime,s.timezone
|
|
|
+ from cable c left join lamp_pole lp on lp.id = c.lamp_pole_id
|
|
|
+ left join section s on lp.sectionid = s.id
|
|
|
+ where 1=1
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.name like '%${keyword}%' or c.address like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ order by convert(c.name using gbk) asc,c.id desc
|
|
|
+ <if test="page >= 0 and count > 0">
|
|
|
+ limit #{page},#{count}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 设备总数 -->
|
|
|
+ <select id="getTotalByCableDTO" resultType="Integer">
|
|
|
+ select count(c.id) as total
|
|
|
+ from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
|
|
|
+ where 1=1
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 在线数 -->
|
|
|
+ <select id="getOnlineTotalByCableDTO" resultType="Integer">
|
|
|
+ select count(c.id) as total
|
|
|
+ from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
|
|
|
+ where c.online = 1
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 高温告警数 -->
|
|
|
+ <select id="getTempAlarmTotalByCableDTO" resultType="Integer">
|
|
|
+ select count(c.id) as total
|
|
|
+ from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
|
|
|
+ where c.online = 1 and (c.temperature1_A != 0 or c.temperature2_A != 0 or c.temperature3_A != 0)
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 水浸告警数 -->
|
|
|
+ <select id="getWaterAlarmTotalByCableDTO" resultType="Integer">
|
|
|
+ select count(c.id) as total
|
|
|
+ from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
|
|
|
+ where c.online = 1 and c.water_A != 0
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 井盖位移告警数 -->
|
|
|
+ <select id="getManholeAlarmTotalByCableDTO" resultType="Integer">
|
|
|
+ select count(c.id) as total
|
|
|
+ from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
|
|
|
+ where c.online = 1 and (c.manhole1_A != 0 or c.manhole2_A != 0 or c.manhole3_A != 0 or c.manhole4_A != 0 or c.manhole5_A != 0)
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- ch4告警数 -->
|
|
|
+ <select id="getCh4AlarmTotalByCableDTO" resultType="Integer">
|
|
|
+ select count(c.id) as total
|
|
|
+ from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
|
|
|
+ where c.online = 1 and c.gas_A = 1
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- co2告警数 -->
|
|
|
+ <select id="getCo2AlarmTotalByCableDTO" resultType="Integer">
|
|
|
+ select count(c.id) as total
|
|
|
+ from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
|
|
|
+ where c.online = 1 and c.gas_A = 2
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- h2s告警数 -->
|
|
|
+ <select id="getH2sAlarmTotalByCableDTO" resultType="Integer">
|
|
|
+ select count(c.id) as total
|
|
|
+ from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
|
|
|
+ where c.online = 1 and c.gas_A = 4
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- o2告警数 -->
|
|
|
+ <select id="getO2AlarmTotalByCableDTO" resultType="Integer">
|
|
|
+ select count(c.id) as total
|
|
|
+ from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
|
|
|
+ where c.online = 1 and c.gas_A = 8
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and lp.sectionid in
|
|
|
+ <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
|
|
|
+ #{dto}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|