| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?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
- <if test="sectionList != null and !sectionList.isEmpty()">
- where 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
- <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.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.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
- <if test="sectionList != null and !sectionList.isEmpty()">
- where 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,count(m.id) as total,
- 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 1=1 <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,count(m.id) as total,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>
|