PdmStopTargeMapper.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.powerdistribution.mapper.PdmStopTargeMapper">
  6. <resultMap type="PdmStopTarge" id="PdmStopTargeResult">
  7. <result property="id" column="id" />
  8. <result property="reportYear" column="report_year" />
  9. <result property="companyNo" column="company_no" />
  10. <result property="companyName" column="company_name" />
  11. <result property="stopTimeAvg" column="stop_time_avg" />
  12. <result property="userTotal" column="user_total" />
  13. <result property="stopTimeTotal" column="stop_time_total" />
  14. <result property="threeYearRatio" column="three_year_ratio" />
  15. <result property="planStopTimeTotal" column="plan_stop_time_total" />
  16. <result property="planStopTimeAvg" column="plan_stop_time_avg" />
  17. <result property="errorStopTimeTotal" column="error_stop_time_total" />
  18. <result property="errorStopTimeAvg" column="error_stop_time_avg" />
  19. <result property="stopTimeMonth01" column="stop_time_month_01" />
  20. <result property="stopTimeMonth02" column="stop_time_month_02" />
  21. <result property="stopTimeMonth03" column="stop_time_month_03" />
  22. <result property="stopTimeMonth04" column="stop_time_month_04" />
  23. <result property="stopTimeMonth05" column="stop_time_month_05" />
  24. <result property="stopTimeMonth06" column="stop_time_month_06" />
  25. <result property="stopTimeMonth07" column="stop_time_month_07" />
  26. <result property="stopTimeMonth08" column="stop_time_month_08" />
  27. <result property="stopTimeMonth09" column="stop_time_month_09" />
  28. <result property="stopTimeMonth10" column="stop_time_month_10" />
  29. <result property="stopTimeMonth11" column="stop_time_month_11" />
  30. <result property="stopTimeMonth12" column="stop_time_month_12" />
  31. <result property="planStopTimeMonth01" column="plan_stop_time_month_01" />
  32. <result property="planStopTimeMonth02" column="plan_stop_time_month_02" />
  33. <result property="planStopTimeMonth03" column="plan_stop_time_month_03" />
  34. <result property="planStopTimeMonth04" column="plan_stop_time_month_04" />
  35. <result property="planStopTimeMonth05" column="plan_stop_time_month_05" />
  36. <result property="planStopTimeMonth06" column="plan_stop_time_month_06" />
  37. <result property="planStopTimeMonth07" column="plan_stop_time_month_07" />
  38. <result property="planStopTimeMonth08" column="plan_stop_time_month_08" />
  39. <result property="planStopTimeMonth09" column="plan_stop_time_month_09" />
  40. <result property="planStopTimeMonth10" column="plan_stop_time_month_10" />
  41. <result property="planStopTimeMonth11" column="plan_stop_time_month_11" />
  42. <result property="planStopTimeMonth12" column="plan_stop_time_month_12" />
  43. <result property="errorStopTimeMonth01" column="error_stop_time_month_01" />
  44. <result property="errorStopTimeMonth02" column="error_stop_time_month_02" />
  45. <result property="errorStopTimeMonth03" column="error_stop_time_month_03" />
  46. <result property="errorStopTimeMonth04" column="error_stop_time_month_04" />
  47. <result property="errorStopTimeMonth05" column="error_stop_time_month_05" />
  48. <result property="errorStopTimeMonth06" column="error_stop_time_month_06" />
  49. <result property="errorStopTimeMonth07" column="error_stop_time_month_07" />
  50. <result property="errorStopTimeMonth08" column="error_stop_time_month_08" />
  51. <result property="errorStopTimeMonth09" column="error_stop_time_month_09" />
  52. <result property="errorStopTimeMonth10" column="error_stop_time_month_10" />
  53. <result property="errorStopTimeMonth11" column="error_stop_time_month_11" />
  54. <result property="errorStopTimeMonth12" column="error_stop_time_month_12" />
  55. <result property="createBy" column="create_by" />
  56. <result property="createTime" column="create_time" />
  57. <result property="updateBy" column="update_by" />
  58. <result property="updateTime" column="update_time" />
  59. </resultMap>
  60. <sql id="selectPdmStopTargeVo">
  61. select id, report_year, company_no, company_name, stop_time_avg, user_total, stop_time_total, three_year_ratio, plan_stop_time_total, plan_stop_time_avg, error_stop_time_total, error_stop_time_avg, stop_time_month_01, stop_time_month_02, stop_time_month_03, stop_time_month_04, stop_time_month_05, stop_time_month_06, stop_time_month_07, stop_time_month_08, stop_time_month_09, stop_time_month_10, stop_time_month_11, stop_time_month_12, plan_stop_time_month_01, plan_stop_time_month_02, plan_stop_time_month_03, plan_stop_time_month_04, plan_stop_time_month_05, plan_stop_time_month_06, plan_stop_time_month_07, plan_stop_time_month_08, plan_stop_time_month_09, plan_stop_time_month_10, plan_stop_time_month_11, plan_stop_time_month_12, error_stop_time_month_01, error_stop_time_month_02, error_stop_time_month_03, error_stop_time_month_04, error_stop_time_month_05, error_stop_time_month_06, error_stop_time_month_07, error_stop_time_month_08, error_stop_time_month_09, error_stop_time_month_10, error_stop_time_month_11, error_stop_time_month_12, create_by, create_time, update_by, update_time from pdm_stop_targe
  62. </sql>
  63. <select id="selectPdmStopTargeList" parameterType="PdmStopTarge" resultMap="PdmStopTargeResult">
  64. <include refid="selectPdmStopTargeVo"/>
  65. <where>
  66. <if test="reportYear != null and reportYear != ''"> and report_year = #{reportYear}</if>
  67. <if test="companyNo != null and companyNo != ''"> and company_no = #{companyNo}</if>
  68. <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
  69. <if test="stopTimeAvg != null "> and stop_time_avg = #{stopTimeAvg}</if>
  70. <if test="userTotal != null "> and user_total = #{userTotal}</if>
  71. <if test="stopTimeTotal != null "> and stop_time_total = #{stopTimeTotal}</if>
  72. <if test="threeYearRatio != null and threeYearRatio != ''"> and three_year_ratio = #{threeYearRatio}</if>
  73. <if test="planStopTimeTotal != null "> and plan_stop_time_total = #{planStopTimeTotal}</if>
  74. <if test="planStopTimeAvg != null "> and plan_stop_time_avg = #{planStopTimeAvg}</if>
  75. <if test="errorStopTimeTotal != null "> and error_stop_time_total = #{errorStopTimeTotal}</if>
  76. <if test="errorStopTimeAvg != null "> and error_stop_time_avg = #{errorStopTimeAvg}</if>
  77. <if test="stopTimeMonth01 != null "> and stop_time_month_01 = #{stopTimeMonth01}</if>
  78. <if test="stopTimeMonth02 != null "> and stop_time_month_02 = #{stopTimeMonth02}</if>
  79. <if test="stopTimeMonth03 != null "> and stop_time_month_03 = #{stopTimeMonth03}</if>
  80. <if test="stopTimeMonth04 != null "> and stop_time_month_04 = #{stopTimeMonth04}</if>
  81. <if test="stopTimeMonth05 != null "> and stop_time_month_05 = #{stopTimeMonth05}</if>
  82. <if test="stopTimeMonth06 != null "> and stop_time_month_06 = #{stopTimeMonth06}</if>
  83. <if test="stopTimeMonth07 != null "> and stop_time_month_07 = #{stopTimeMonth07}</if>
  84. <if test="stopTimeMonth08 != null "> and stop_time_month_08 = #{stopTimeMonth08}</if>
  85. <if test="stopTimeMonth09 != null "> and stop_time_month_09 = #{stopTimeMonth09}</if>
  86. <if test="stopTimeMonth10 != null "> and stop_time_month_10 = #{stopTimeMonth10}</if>
  87. <if test="stopTimeMonth11 != null "> and stop_time_month_11 = #{stopTimeMonth11}</if>
  88. <if test="stopTimeMonth12 != null "> and stop_time_month_12 = #{stopTimeMonth12}</if>
  89. <if test="planStopTimeMonth01 != null "> and plan_stop_time_month_01 = #{planStopTimeMonth01}</if>
  90. <if test="planStopTimeMonth02 != null "> and plan_stop_time_month_02 = #{planStopTimeMonth02}</if>
  91. <if test="planStopTimeMonth03 != null "> and plan_stop_time_month_03 = #{planStopTimeMonth03}</if>
  92. <if test="planStopTimeMonth04 != null "> and plan_stop_time_month_04 = #{planStopTimeMonth04}</if>
  93. <if test="planStopTimeMonth05 != null "> and plan_stop_time_month_05 = #{planStopTimeMonth05}</if>
  94. <if test="planStopTimeMonth06 != null "> and plan_stop_time_month_06 = #{planStopTimeMonth06}</if>
  95. <if test="planStopTimeMonth07 != null "> and plan_stop_time_month_07 = #{planStopTimeMonth07}</if>
  96. <if test="planStopTimeMonth08 != null "> and plan_stop_time_month_08 = #{planStopTimeMonth08}</if>
  97. <if test="planStopTimeMonth09 != null "> and plan_stop_time_month_09 = #{planStopTimeMonth09}</if>
  98. <if test="planStopTimeMonth10 != null "> and plan_stop_time_month_10 = #{planStopTimeMonth10}</if>
  99. <if test="planStopTimeMonth11 != null "> and plan_stop_time_month_11 = #{planStopTimeMonth11}</if>
  100. <if test="planStopTimeMonth12 != null "> and plan_stop_time_month_12 = #{planStopTimeMonth12}</if>
  101. <if test="errorStopTimeMonth01 != null "> and error_stop_time_month_01 = #{errorStopTimeMonth01}</if>
  102. <if test="errorStopTimeMonth02 != null "> and error_stop_time_month_02 = #{errorStopTimeMonth02}</if>
  103. <if test="errorStopTimeMonth03 != null "> and error_stop_time_month_03 = #{errorStopTimeMonth03}</if>
  104. <if test="errorStopTimeMonth04 != null "> and error_stop_time_month_04 = #{errorStopTimeMonth04}</if>
  105. <if test="errorStopTimeMonth05 != null "> and error_stop_time_month_05 = #{errorStopTimeMonth05}</if>
  106. <if test="errorStopTimeMonth06 != null "> and error_stop_time_month_06 = #{errorStopTimeMonth06}</if>
  107. <if test="errorStopTimeMonth07 != null "> and error_stop_time_month_07 = #{errorStopTimeMonth07}</if>
  108. <if test="errorStopTimeMonth08 != null "> and error_stop_time_month_08 = #{errorStopTimeMonth08}</if>
  109. <if test="errorStopTimeMonth09 != null "> and error_stop_time_month_09 = #{errorStopTimeMonth09}</if>
  110. <if test="errorStopTimeMonth10 != null "> and error_stop_time_month_10 = #{errorStopTimeMonth10}</if>
  111. <if test="errorStopTimeMonth11 != null "> and error_stop_time_month_11 = #{errorStopTimeMonth11}</if>
  112. <if test="errorStopTimeMonth12 != null "> and error_stop_time_month_12 = #{errorStopTimeMonth12}</if>
  113. </where>
  114. </select>
  115. <select id="selectPdmStopTargeById" parameterType="Long" resultMap="PdmStopTargeResult">
  116. <include refid="selectPdmStopTargeVo"/>
  117. where id = #{id}
  118. </select>
  119. <insert id="insertPdmStopTarge" parameterType="PdmStopTarge" useGeneratedKeys="true" keyProperty="id">
  120. insert into pdm_stop_targe
  121. <trim prefix="(" suffix=")" suffixOverrides=",">
  122. <if test="reportYear != null">report_year,</if>
  123. <if test="companyNo != null">company_no,</if>
  124. <if test="companyName != null">company_name,</if>
  125. <if test="stopTimeAvg != null">stop_time_avg,</if>
  126. <if test="userTotal != null">user_total,</if>
  127. <if test="stopTimeTotal != null">stop_time_total,</if>
  128. <if test="threeYearRatio != null">three_year_ratio,</if>
  129. <if test="planStopTimeTotal != null">plan_stop_time_total,</if>
  130. <if test="planStopTimeAvg != null">plan_stop_time_avg,</if>
  131. <if test="errorStopTimeTotal != null">error_stop_time_total,</if>
  132. <if test="errorStopTimeAvg != null">error_stop_time_avg,</if>
  133. <if test="stopTimeMonth01 != null">stop_time_month_01,</if>
  134. <if test="stopTimeMonth02 != null">stop_time_month_02,</if>
  135. <if test="stopTimeMonth03 != null">stop_time_month_03,</if>
  136. <if test="stopTimeMonth04 != null">stop_time_month_04,</if>
  137. <if test="stopTimeMonth05 != null">stop_time_month_05,</if>
  138. <if test="stopTimeMonth06 != null">stop_time_month_06,</if>
  139. <if test="stopTimeMonth07 != null">stop_time_month_07,</if>
  140. <if test="stopTimeMonth08 != null">stop_time_month_08,</if>
  141. <if test="stopTimeMonth09 != null">stop_time_month_09,</if>
  142. <if test="stopTimeMonth10 != null">stop_time_month_10,</if>
  143. <if test="stopTimeMonth11 != null">stop_time_month_11,</if>
  144. <if test="stopTimeMonth12 != null">stop_time_month_12,</if>
  145. <if test="planStopTimeMonth01 != null">plan_stop_time_month_01,</if>
  146. <if test="planStopTimeMonth02 != null">plan_stop_time_month_02,</if>
  147. <if test="planStopTimeMonth03 != null">plan_stop_time_month_03,</if>
  148. <if test="planStopTimeMonth04 != null">plan_stop_time_month_04,</if>
  149. <if test="planStopTimeMonth05 != null">plan_stop_time_month_05,</if>
  150. <if test="planStopTimeMonth06 != null">plan_stop_time_month_06,</if>
  151. <if test="planStopTimeMonth07 != null">plan_stop_time_month_07,</if>
  152. <if test="planStopTimeMonth08 != null">plan_stop_time_month_08,</if>
  153. <if test="planStopTimeMonth09 != null">plan_stop_time_month_09,</if>
  154. <if test="planStopTimeMonth10 != null">plan_stop_time_month_10,</if>
  155. <if test="planStopTimeMonth11 != null">plan_stop_time_month_11,</if>
  156. <if test="planStopTimeMonth12 != null">plan_stop_time_month_12,</if>
  157. <if test="errorStopTimeMonth01 != null">error_stop_time_month_01,</if>
  158. <if test="errorStopTimeMonth02 != null">error_stop_time_month_02,</if>
  159. <if test="errorStopTimeMonth03 != null">error_stop_time_month_03,</if>
  160. <if test="errorStopTimeMonth04 != null">error_stop_time_month_04,</if>
  161. <if test="errorStopTimeMonth05 != null">error_stop_time_month_05,</if>
  162. <if test="errorStopTimeMonth06 != null">error_stop_time_month_06,</if>
  163. <if test="errorStopTimeMonth07 != null">error_stop_time_month_07,</if>
  164. <if test="errorStopTimeMonth08 != null">error_stop_time_month_08,</if>
  165. <if test="errorStopTimeMonth09 != null">error_stop_time_month_09,</if>
  166. <if test="errorStopTimeMonth10 != null">error_stop_time_month_10,</if>
  167. <if test="errorStopTimeMonth11 != null">error_stop_time_month_11,</if>
  168. <if test="errorStopTimeMonth12 != null">error_stop_time_month_12,</if>
  169. <if test="createBy != null">create_by,</if>
  170. <if test="createTime != null">create_time,</if>
  171. <if test="updateBy != null">update_by,</if>
  172. <if test="updateTime != null">update_time,</if>
  173. </trim>
  174. <trim prefix="values (" suffix=")" suffixOverrides=",">
  175. <if test="reportYear != null">#{reportYear},</if>
  176. <if test="companyNo != null">#{companyNo},</if>
  177. <if test="companyName != null">#{companyName},</if>
  178. <if test="stopTimeAvg != null">#{stopTimeAvg},</if>
  179. <if test="userTotal != null">#{userTotal},</if>
  180. <if test="stopTimeTotal != null">#{stopTimeTotal},</if>
  181. <if test="threeYearRatio != null">#{threeYearRatio},</if>
  182. <if test="planStopTimeTotal != null">#{planStopTimeTotal},</if>
  183. <if test="planStopTimeAvg != null">#{planStopTimeAvg},</if>
  184. <if test="errorStopTimeTotal != null">#{errorStopTimeTotal},</if>
  185. <if test="errorStopTimeAvg != null">#{errorStopTimeAvg},</if>
  186. <if test="stopTimeMonth01 != null">#{stopTimeMonth01},</if>
  187. <if test="stopTimeMonth02 != null">#{stopTimeMonth02},</if>
  188. <if test="stopTimeMonth03 != null">#{stopTimeMonth03},</if>
  189. <if test="stopTimeMonth04 != null">#{stopTimeMonth04},</if>
  190. <if test="stopTimeMonth05 != null">#{stopTimeMonth05},</if>
  191. <if test="stopTimeMonth06 != null">#{stopTimeMonth06},</if>
  192. <if test="stopTimeMonth07 != null">#{stopTimeMonth07},</if>
  193. <if test="stopTimeMonth08 != null">#{stopTimeMonth08},</if>
  194. <if test="stopTimeMonth09 != null">#{stopTimeMonth09},</if>
  195. <if test="stopTimeMonth10 != null">#{stopTimeMonth10},</if>
  196. <if test="stopTimeMonth11 != null">#{stopTimeMonth11},</if>
  197. <if test="stopTimeMonth12 != null">#{stopTimeMonth12},</if>
  198. <if test="planStopTimeMonth01 != null">#{planStopTimeMonth01},</if>
  199. <if test="planStopTimeMonth02 != null">#{planStopTimeMonth02},</if>
  200. <if test="planStopTimeMonth03 != null">#{planStopTimeMonth03},</if>
  201. <if test="planStopTimeMonth04 != null">#{planStopTimeMonth04},</if>
  202. <if test="planStopTimeMonth05 != null">#{planStopTimeMonth05},</if>
  203. <if test="planStopTimeMonth06 != null">#{planStopTimeMonth06},</if>
  204. <if test="planStopTimeMonth07 != null">#{planStopTimeMonth07},</if>
  205. <if test="planStopTimeMonth08 != null">#{planStopTimeMonth08},</if>
  206. <if test="planStopTimeMonth09 != null">#{planStopTimeMonth09},</if>
  207. <if test="planStopTimeMonth10 != null">#{planStopTimeMonth10},</if>
  208. <if test="planStopTimeMonth11 != null">#{planStopTimeMonth11},</if>
  209. <if test="planStopTimeMonth12 != null">#{planStopTimeMonth12},</if>
  210. <if test="errorStopTimeMonth01 != null">#{errorStopTimeMonth01},</if>
  211. <if test="errorStopTimeMonth02 != null">#{errorStopTimeMonth02},</if>
  212. <if test="errorStopTimeMonth03 != null">#{errorStopTimeMonth03},</if>
  213. <if test="errorStopTimeMonth04 != null">#{errorStopTimeMonth04},</if>
  214. <if test="errorStopTimeMonth05 != null">#{errorStopTimeMonth05},</if>
  215. <if test="errorStopTimeMonth06 != null">#{errorStopTimeMonth06},</if>
  216. <if test="errorStopTimeMonth07 != null">#{errorStopTimeMonth07},</if>
  217. <if test="errorStopTimeMonth08 != null">#{errorStopTimeMonth08},</if>
  218. <if test="errorStopTimeMonth09 != null">#{errorStopTimeMonth09},</if>
  219. <if test="errorStopTimeMonth10 != null">#{errorStopTimeMonth10},</if>
  220. <if test="errorStopTimeMonth11 != null">#{errorStopTimeMonth11},</if>
  221. <if test="errorStopTimeMonth12 != null">#{errorStopTimeMonth12},</if>
  222. <if test="createBy != null">#{createBy},</if>
  223. <if test="createTime != null">#{createTime},</if>
  224. <if test="updateBy != null">#{updateBy},</if>
  225. <if test="updateTime != null">#{updateTime},</if>
  226. </trim>
  227. </insert>
  228. <update id="updatePdmStopTarge" parameterType="PdmStopTarge">
  229. update pdm_stop_targe
  230. <trim prefix="SET" suffixOverrides=",">
  231. <if test="reportYear != null">report_year = #{reportYear},</if>
  232. <if test="companyNo != null">company_no = #{companyNo},</if>
  233. <if test="companyName != null">company_name = #{companyName},</if>
  234. <if test="stopTimeAvg != null">stop_time_avg = #{stopTimeAvg},</if>
  235. <if test="userTotal != null">user_total = #{userTotal},</if>
  236. <if test="stopTimeTotal != null">stop_time_total = #{stopTimeTotal},</if>
  237. <if test="threeYearRatio != null">three_year_ratio = #{threeYearRatio},</if>
  238. <if test="planStopTimeTotal != null">plan_stop_time_total = #{planStopTimeTotal},</if>
  239. <if test="planStopTimeAvg != null">plan_stop_time_avg = #{planStopTimeAvg},</if>
  240. <if test="errorStopTimeTotal != null">error_stop_time_total = #{errorStopTimeTotal},</if>
  241. <if test="errorStopTimeAvg != null">error_stop_time_avg = #{errorStopTimeAvg},</if>
  242. <if test="stopTimeMonth01 != null">stop_time_month_01 = #{stopTimeMonth01},</if>
  243. <if test="stopTimeMonth02 != null">stop_time_month_02 = #{stopTimeMonth02},</if>
  244. <if test="stopTimeMonth03 != null">stop_time_month_03 = #{stopTimeMonth03},</if>
  245. <if test="stopTimeMonth04 != null">stop_time_month_04 = #{stopTimeMonth04},</if>
  246. <if test="stopTimeMonth05 != null">stop_time_month_05 = #{stopTimeMonth05},</if>
  247. <if test="stopTimeMonth06 != null">stop_time_month_06 = #{stopTimeMonth06},</if>
  248. <if test="stopTimeMonth07 != null">stop_time_month_07 = #{stopTimeMonth07},</if>
  249. <if test="stopTimeMonth08 != null">stop_time_month_08 = #{stopTimeMonth08},</if>
  250. <if test="stopTimeMonth09 != null">stop_time_month_09 = #{stopTimeMonth09},</if>
  251. <if test="stopTimeMonth10 != null">stop_time_month_10 = #{stopTimeMonth10},</if>
  252. <if test="stopTimeMonth11 != null">stop_time_month_11 = #{stopTimeMonth11},</if>
  253. <if test="stopTimeMonth12 != null">stop_time_month_12 = #{stopTimeMonth12},</if>
  254. <if test="planStopTimeMonth01 != null">plan_stop_time_month_01 = #{planStopTimeMonth01},</if>
  255. <if test="planStopTimeMonth02 != null">plan_stop_time_month_02 = #{planStopTimeMonth02},</if>
  256. <if test="planStopTimeMonth03 != null">plan_stop_time_month_03 = #{planStopTimeMonth03},</if>
  257. <if test="planStopTimeMonth04 != null">plan_stop_time_month_04 = #{planStopTimeMonth04},</if>
  258. <if test="planStopTimeMonth05 != null">plan_stop_time_month_05 = #{planStopTimeMonth05},</if>
  259. <if test="planStopTimeMonth06 != null">plan_stop_time_month_06 = #{planStopTimeMonth06},</if>
  260. <if test="planStopTimeMonth07 != null">plan_stop_time_month_07 = #{planStopTimeMonth07},</if>
  261. <if test="planStopTimeMonth08 != null">plan_stop_time_month_08 = #{planStopTimeMonth08},</if>
  262. <if test="planStopTimeMonth09 != null">plan_stop_time_month_09 = #{planStopTimeMonth09},</if>
  263. <if test="planStopTimeMonth10 != null">plan_stop_time_month_10 = #{planStopTimeMonth10},</if>
  264. <if test="planStopTimeMonth11 != null">plan_stop_time_month_11 = #{planStopTimeMonth11},</if>
  265. <if test="planStopTimeMonth12 != null">plan_stop_time_month_12 = #{planStopTimeMonth12},</if>
  266. <if test="errorStopTimeMonth01 != null">error_stop_time_month_01 = #{errorStopTimeMonth01},</if>
  267. <if test="errorStopTimeMonth02 != null">error_stop_time_month_02 = #{errorStopTimeMonth02},</if>
  268. <if test="errorStopTimeMonth03 != null">error_stop_time_month_03 = #{errorStopTimeMonth03},</if>
  269. <if test="errorStopTimeMonth04 != null">error_stop_time_month_04 = #{errorStopTimeMonth04},</if>
  270. <if test="errorStopTimeMonth05 != null">error_stop_time_month_05 = #{errorStopTimeMonth05},</if>
  271. <if test="errorStopTimeMonth06 != null">error_stop_time_month_06 = #{errorStopTimeMonth06},</if>
  272. <if test="errorStopTimeMonth07 != null">error_stop_time_month_07 = #{errorStopTimeMonth07},</if>
  273. <if test="errorStopTimeMonth08 != null">error_stop_time_month_08 = #{errorStopTimeMonth08},</if>
  274. <if test="errorStopTimeMonth09 != null">error_stop_time_month_09 = #{errorStopTimeMonth09},</if>
  275. <if test="errorStopTimeMonth10 != null">error_stop_time_month_10 = #{errorStopTimeMonth10},</if>
  276. <if test="errorStopTimeMonth11 != null">error_stop_time_month_11 = #{errorStopTimeMonth11},</if>
  277. <if test="errorStopTimeMonth12 != null">error_stop_time_month_12 = #{errorStopTimeMonth12},</if>
  278. <if test="createBy != null">create_by = #{createBy},</if>
  279. <if test="createTime != null">create_time = #{createTime},</if>
  280. <if test="updateBy != null">update_by = #{updateBy},</if>
  281. <if test="updateTime != null">update_time = #{updateTime},</if>
  282. </trim>
  283. where id = #{id}
  284. </update>
  285. <delete id="deletePdmStopTargeById" parameterType="Long">
  286. delete from pdm_stop_targe where id = #{id}
  287. </delete>
  288. <delete id="deletePdmStopTargeByIds" parameterType="String">
  289. delete from pdm_stop_targe where id in
  290. <foreach item="id" collection="array" open="(" separator="," close=")">
  291. #{id}
  292. </foreach>
  293. </delete>
  294. <select id="selectTargetAndActual" parameterType="java.lang.String" resultType="com.ruoyi.powerdistribution.domain.vo.StopTargetAndRecords">
  295. select * from pdm_stop_targe t1
  296. LEFT JOIN
  297. (
  298. select std_county_org_nm org_name ,
  299. SUM(poweroff_duration_tm) stop_total_actual,
  300. SUM(IF(poweroff_nature_cd in('2111','2112','2121','2122','2141'),poweroff_duration_tm,0)) as plan_stop_total_actual,
  301. SUM(IF(poweroff_nature_cd in('1101','1202'),poweroff_duration_tm,0)) as error_stop_total_actual,
  302. SUM(IF(SUBSTRING(data_dt,5,2)='01',poweroff_duration_tm,0)) as stop_month_01_actual,
  303. SUM(IF(SUBSTRING(data_dt,5,2)='02',poweroff_duration_tm,0)) as stop_month_02_actual,
  304. SUM(IF(SUBSTRING(data_dt,5,2)='03',poweroff_duration_tm,0)) as stop_month_03_actual,
  305. SUM(IF(SUBSTRING(data_dt,5,2)='04',poweroff_duration_tm,0)) as stop_month_04_actual,
  306. SUM(IF(SUBSTRING(data_dt,5,2)='05',poweroff_duration_tm,0)) as stop_month_05_actual,
  307. SUM(IF(SUBSTRING(data_dt,5,2)='06',poweroff_duration_tm,0)) as stop_month_06_actual,
  308. SUM(IF(SUBSTRING(data_dt,5,2)='07',poweroff_duration_tm,0)) as stop_month_07_actual,
  309. SUM(IF(SUBSTRING(data_dt,5,2)='08',poweroff_duration_tm,0)) as stop_month_08_actual,
  310. SUM(IF(SUBSTRING(data_dt,5,2)='09',poweroff_duration_tm,0)) as stop_month_09_actual,
  311. SUM(IF(SUBSTRING(data_dt,5,2)='10',poweroff_duration_tm,0)) as stop_month_10_actual,
  312. SUM(IF(SUBSTRING(data_dt,5,2)='11',poweroff_duration_tm,0)) as stop_month_11_actual,
  313. SUM(IF(SUBSTRING(data_dt,5,2)='12',poweroff_duration_tm,0)) as stop_month_12_actual,
  314. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='01'),poweroff_duration_tm,0)) as plan_stop_month_01_actual,
  315. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='02'),poweroff_duration_tm,0)) as plan_stop_month_02_actual,
  316. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='03'),poweroff_duration_tm,0)) as plan_stop_month_03_actual,
  317. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='04'),poweroff_duration_tm,0)) as plan_stop_month_04_actual,
  318. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='05'),poweroff_duration_tm,0)) as plan_stop_month_05_actual,
  319. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='06'),poweroff_duration_tm,0)) as plan_stop_month_06_actual,
  320. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='07'),poweroff_duration_tm,0)) as plan_stop_month_07_actual,
  321. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='08'),poweroff_duration_tm,0)) as plan_stop_month_08_actual,
  322. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='09'),poweroff_duration_tm,0)) as plan_stop_month_09_actual,
  323. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='10'),poweroff_duration_tm,0)) as plan_stop_month_10_actual,
  324. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='11'),poweroff_duration_tm,0)) as plan_stop_month_11_actual,
  325. SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141') and SUBSTRING(data_dt,5,2)='12'),poweroff_duration_tm,0)) as plan_stop_month_12_actual,
  326. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='01'),poweroff_duration_tm,0)) as error_stop_month_01_actual,
  327. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='02'),poweroff_duration_tm,0)) as error_stop_month_02_actual,
  328. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='03'),poweroff_duration_tm,0)) as error_stop_month_03_actual,
  329. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='04'),poweroff_duration_tm,0)) as error_stop_month_04_actual,
  330. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='05'),poweroff_duration_tm,0)) as error_stop_month_05_actual,
  331. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='06'),poweroff_duration_tm,0)) as error_stop_month_06_actual,
  332. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='07'),poweroff_duration_tm,0)) as error_stop_month_07_actual,
  333. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='08'),poweroff_duration_tm,0)) as error_stop_month_08_actual,
  334. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='09'),poweroff_duration_tm,0)) as error_stop_month_09_actual,
  335. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='10'),poweroff_duration_tm,0)) as error_stop_month_10_actual,
  336. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='11'),poweroff_duration_tm,0)) as error_stop_month_11_actual,
  337. SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='12'),poweroff_duration_tm,0)) as error_stop_month_12_actual
  338. from pdm_stop_records
  339. where SUBSTRING(data_dt,1,4) = #{reportYear}
  340. GROUP BY std_county_org_nm
  341. ) t2 on t1.company_name = t2.org_name
  342. where report_year = #{reportYear}
  343. </select>
  344. </mapper>