SuperPowerDevInfoMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.welampiot.dao.SuperPowerDevInfoDao">
  4. <select id="getListBySuperPowerDevInfoDTO" resultType="SuperPowerDevInfoDTO">
  5. select s1.id,s1.number,s1.name,s1.lamp_pole_id lampPoleId,s2.name as section,gl.chinese_name chArea,
  6. s1.updatetime as updateTime,s1.install_date installDate,s1.expiration_date expirationDate,
  7. gl.english_name enArea,gl.ru_name ruArea,s1.model,s1.status,s1.remark1_status remark1Status,
  8. s1.remark2_status remark2Status,s1.remark3_status remark3Status,s1.remark4_status remark4Status,
  9. s1.remark5_status remark5Status,s1.remark6_status remark6Status,s1.remark7_status remark7Status,lp.name lampPoleName,
  10. s1.remark1_runnig_status remark1RunningStatus,s1.remark2_runnig_status remark2RunningStaus,s1.remark3_runnig_status remark3RunningStatus,
  11. s1.remark4_runnig_status remarkRunningStatus,s1.remark5_runnig_status remark5RunningStatus,s1.remark6_runnig_status remark6RunningStatus,
  12. s1.remark7_runnig_status remarkRunningStatus,s1.fault_info1 faultInfo1,s1.fault_info2 faultInfo2,s1.createtime as createTime,s2.timezone
  13. from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
  14. left join section s2 on lp.sectionid = s2.id
  15. left join global_location gl on s2.pid = gl.id
  16. where 1=1
  17. <if test="keyword != null and keyword != ''">
  18. and (s1.name like '%${keyword}%' or s1.number like '%${keyword}%')
  19. </if>
  20. <choose>
  21. <when test="online == 0">
  22. and s1.status = 0
  23. </when>
  24. <when test="online == 1">
  25. and s1.status = 1
  26. </when>
  27. </choose>
  28. <if test="sectionList != null and !sectionList.isEmpty()">
  29. and lp.sectionid in
  30. <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
  31. #{dto}
  32. </foreach>
  33. </if>
  34. order by convert(s1.name using gbk) asc,s1.id desc
  35. <if test="page >= 0 and count > 0">
  36. limit #{page},#{count}
  37. </if>
  38. </select>
  39. <select id="getTotalBySuperPowerDevInfoDTO" resultType="Integer">
  40. select count(s1.id) as total
  41. from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
  42. <if test="sectionList != null and !sectionList.isEmpty()">
  43. where lp.sectionid in
  44. <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
  45. #{dto}
  46. </foreach>
  47. </if>
  48. </select>
  49. <select id="getOnlineTotalBySuperPowerDevInfoDTO" resultType="Integer">
  50. select count(s1.id) as total
  51. from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
  52. where s1.status = 1
  53. <if test="sectionList != null and !sectionList.isEmpty()">
  54. and lp.sectionid in
  55. <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
  56. #{dto}
  57. </foreach>
  58. </if>
  59. </select>
  60. <select id="getFaultTotalBySuperPowerDevInfoDTO" resultType="Integer">
  61. select count(s1.id) as total
  62. from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
  63. where s1.status = 1
  64. and (s1.remark1_runnig_status = 4 or s1.remark2_runnig_status = 4 or s1.remark3_runnig_status = 4 or s1.remark4_runnig_status = 5
  65. or s1.remark5_runnig_status = 5 or s1.remark6_runnig_status = 5 or s1.remark7_runnig_status = 5)
  66. <if test="sectionList != null and !sectionList.isEmpty()">
  67. and lp.sectionid in
  68. <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
  69. #{dto}
  70. </foreach>
  71. </if>
  72. </select>
  73. <select id="getDayElectricBySuperPowerDevInfoDTO" resultType="SuperPowerDevInfoDTO">
  74. select s1.id,s1.day_electric dayElectric
  75. from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
  76. <if test="sectionList != null and !sectionList.isEmpty()">
  77. where lp.sectionid in
  78. <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
  79. #{dto}
  80. </foreach>
  81. </if>
  82. </select>
  83. <select id="getTotalElectricBySuperPowerDevInfoDTO" resultType="SuperPowerDevInfoDTO">
  84. select s1.id,s1.total_electric totalElectric
  85. from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
  86. <if test="sectionList != null and !sectionList.isEmpty()">
  87. where lp.sectionid in
  88. <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
  89. #{dto}
  90. </foreach>
  91. </if>
  92. </select>
  93. <select id="getPowerOutInfoByDTO" resultType="SuperPowerDevInfoDTO">
  94. select s1.remark1,s1.remark2,s1.remark3,s1.remark4,s1.remark5,s1.remark6,s1.remark7,s1.remark1_status remark1Status,
  95. s1.remark2_status remark2Status,s1.remark3_status remark3Status,s1.remark4_status remark4Status,s1.remark5_status remark5Status,
  96. s1.remark6_status remark6Status,s1.remark7_status remark7Status,s1.type1,s1.type2,s1.type3,s1.type4,s1.type5,s1.type6,s1.type7,
  97. s1.close_time1 closeTime1,s1.close_time2 closeTime2,s1.close_time3 closeTime3,s1.close_time4 closeTime4,s1.close_time5 closeTime5,
  98. s1.close_time6 closeTime6,s1.close_time7 closeTime7,s1.open_time1 openTime1,s1.open_time2 openTime2,s1.open_time3 openTime3,s1.open_time4 openTime4,
  99. s1.open_time5 openTime5,s1.open_time6 openTime6,s1.open_time7 openTime7
  100. from super_power_dev_info s1 left join lamp_pole lp on lp.id = s1.lamp_pole_id
  101. where s1.id = #{id}
  102. <if test="sectionList != null and !sectionList.isEmpty()">
  103. and lp.sectionid in
  104. <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
  105. #{dto}
  106. </foreach>
  107. </if>
  108. </select>
  109. </mapper>