| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <?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.SuperPowerDevInfoDao">
- <select id="getListBySuperPowerDevInfoDTO" resultType="SuperPowerDevInfoDTO">
- select s1.id,s1.number,s1.name,s1.lamp_pole_id lampPoleId,s2.name as section,gl.chinese_name chArea,
- s1.updatetime as updateTime,s1.install_date installDate,s1.expiration_date expirationDate,
- gl.english_name enArea,gl.ru_name ruArea,s1.model,s1.status,s1.remark1_status remark1Status,
- s1.remark2_status remark2Status,s1.remark3_status remark3Status,s1.remark4_status remark4Status,
- s1.remark5_status remark5Status,s1.remark6_status remark6Status,s1.remark7_status remark7Status,lp.name lampPoleName,
- s1.remark1_runnig_status remark1RunningStatus,s1.remark2_runnig_status remark2RunningStaus,s1.remark3_runnig_status remark3RunningStatus,
- s1.remark4_runnig_status remarkRunningStatus,s1.remark5_runnig_status remark5RunningStatus,s1.remark6_runnig_status remark6RunningStatus,
- s1.remark7_runnig_status remarkRunningStatus,s1.fault_info1 faultInfo1,s1.fault_info2 faultInfo2,s1.createtime as createTime,s2.timezone
- from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
- left join section s2 on lp.sectionid = s2.id
- left join global_location gl on s2.pid = gl.id
- where 1=1
- <if test="keyword != null and keyword != ''">
- and (s1.name like '%${keyword}%' or s1.number like '%${keyword}%')
- </if>
- <choose>
- <when test="online == 0">
- and s1.status = 0
- </when>
- <when test="online == 1">
- and s1.status = 1
- </when>
- </choose>
- <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(s1.name using gbk) asc,s1.id desc
- <if test="page >= 0 and count > 0">
- limit #{page},#{count}
- </if>
- </select>
- <select id="getTotalBySuperPowerDevInfoDTO" resultType="Integer">
- select count(s1.id) as total
- from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
- <if test="sectionList != null and !sectionList.isEmpty()">
- where lp.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getOnlineTotalBySuperPowerDevInfoDTO" resultType="Integer">
- select count(s1.id) as total
- from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
- where s1.status = 1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and lp.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getFaultTotalBySuperPowerDevInfoDTO" resultType="Integer">
- select count(s1.id) as total
- from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
- where s1.status = 1
- and (s1.remark1_runnig_status = 4 or s1.remark2_runnig_status = 4 or s1.remark3_runnig_status = 4 or s1.remark4_runnig_status = 5
- or s1.remark5_runnig_status = 5 or s1.remark6_runnig_status = 5 or s1.remark7_runnig_status = 5)
- <if test="sectionList != null and !sectionList.isEmpty()">
- and lp.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getDayElectricBySuperPowerDevInfoDTO" resultType="SuperPowerDevInfoDTO">
- select s1.id,s1.day_electric dayElectric
- from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
- <if test="sectionList != null and !sectionList.isEmpty()">
- where lp.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getTotalElectricBySuperPowerDevInfoDTO" resultType="SuperPowerDevInfoDTO">
- select s1.id,s1.total_electric totalElectric
- from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
- <if test="sectionList != null and !sectionList.isEmpty()">
- where lp.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getPowerOutInfoByDTO" resultType="SuperPowerDevInfoDTO">
- select s1.remark1,s1.remark2,s1.remark3,s1.remark4,s1.remark5,s1.remark6,s1.remark7,s1.remark1_status remark1Status,
- s1.remark2_status remark2Status,s1.remark3_status remark3Status,s1.remark4_status remark4Status,s1.remark5_status remark5Status,
- s1.remark6_status remark6Status,s1.remark7_status remark7Status,s1.type1,s1.type2,s1.type3,s1.type4,s1.type5,s1.type6,s1.type7,
- s1.close_time1 closeTime1,s1.close_time2 closeTime2,s1.close_time3 closeTime3,s1.close_time4 closeTime4,s1.close_time5 closeTime5,
- s1.close_time6 closeTime6,s1.close_time7 closeTime7,s1.open_time1 openTime1,s1.open_time2 openTime2,s1.open_time3 openTime3,s1.open_time4 openTime4,
- s1.open_time5 openTime5,s1.open_time6 openTime6,s1.open_time7 openTime7
- from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
- where s1.id = #{id}
- <if test="sectionList != null and !sectionList.isEmpty()">
- and lp.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
-
- </mapper>
|