| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?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.ManholeDao">
- <select id="getTotalBySectionList" resultType="Integer">
- select count(m.id) as total from manhole m
- where m.type=0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and m.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getOnlineTotalBySectionList" resultType="Integer">
- select count(m.id) as onlineTotal from manhole m
- where m.online = 1 and m.type=0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and m.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getAlarmTotalBySectionList" resultType="Integer">
- select count(m.id) as alarmTotal from manhole m
- where m.type=0 and m.online = 1 and (m.openAlarm = 1 or m.overAlarm = 1 or m.airAlarm = 1 or m.dismanAlarm = 1)
- <if test="sectionList != null and !sectionList.isEmpty()">
- and m.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getNormalTotalBySectionList" resultType="Integer">
- select count(m.id) as normalTotal from manhole m
- where m.type=0 and m.online = 1 and m.overAlarm = 0 and m.openAlarm = 0 and m.airAlarm = 0 and m.dismanAlarm = 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and m.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getNewTotalBySectionList" resultType="ManholeDTO">
- select m.id,m.createTime from manhole m
- where m.type=0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and m.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getListByDTO" resultType="com.welampiot.dto.ManholeDTO" parameterType="com.welampiot.dto.ManholeDTO">
- select m.id,m.name,m.areaid as areaId,m.sectionid as sectionId,m.model,m.address,
- m.online,m.angle,m.longitude,m.latitude,m.batteryVol,m.alarmStatus,m.alarmInfo,
- m.updateTime,m.createTime,m.status,m.install_date installDate,
- m.expiration_date expirationDate,g.chinese_name chArea,g.english_name enArea,g.ru_name ruArea,
- p.chinese_name chCity,p.english_name enCity,p.ru_name ruCity,s.timezone,s.name as section
- from manhole m left join section s on m.sectionid = s.id
- left join global_location g on m.areaid = g.id
- left join global_location p on g.pid = p.id
- where m.type=0 <if test="sectionList != null and !sectionList.isEmpty()">
- and m.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- <if test="keywords != null and keywords != ''">
- and (m.name like '%${keywords}%' or m.address like '%${keywords}%')
- </if>
- order by convert(m.name using gbk) asc,m.id desc
- <if test="page >= 0 and count > 0">
- limit #{page},#{count}
- </if>
- </select>
-
- <select id="getHistoryListByDTO" resultType="ManholeDTO">
- select m.angle,m.batteryVol,m.alarmStatus,m.alarmInfo,
- m.updateTime,m.status,s.timezone
- from manhole m left join section s on m.sectionid = s.id
- where m.id = #{id}
- <if test="sectionList != null and !sectionList.isEmpty()">
- and m.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- <if test="page >= 0 and count > 0">
- limit #{page},#{count}
- </if>
- </select>
- </mapper>
|