TReportHiYlrqMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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.project.sems.mapper.TReportHiYlrqMapper">
  6. <resultMap type="TReportHiYlrq" id="TReportHiYlrqResult">
  7. <result property="id" column="id" />
  8. <result property="reportId" column="report_id" />
  9. <result property="plantCode" column="plant_code" />
  10. <result property="unit" column="unit" />
  11. <result property="devno" column="devno" />
  12. <result property="devname" column="devname" />
  13. <result property="useno" column="useno" />
  14. <result property="regno" column="regno" />
  15. <result property="medium" column="medium" />
  16. <result property="desPressure" column="des_pressure" />
  17. <result property="desTemp" column="des_temp" />
  18. <result property="optPressure" column="opt_pressure" />
  19. <result property="optTemp" column="opt_temp" />
  20. <result property="safeClass" column="safe_class" />
  21. <result property="nextWarnDate" column="next_warn_date" />
  22. <result property="yearReportNo" column="year_report_no" />
  23. <result property="pj1" column="pj1" />
  24. <result property="pj2" column="pj2" />
  25. <result property="pj3" column="pj3" />
  26. <result property="pj4" column="pj4" />
  27. <result property="pj5" column="pj5" />
  28. <result property="pj6" column="pj6" />
  29. <result property="pj7" column="pj7" />
  30. <result property="pj8" column="pj8" />
  31. <result property="pj9" column="pj9" />
  32. <result property="pj10" column="pj10" />
  33. <result property="pj11" column="pj11" />
  34. <result property="pj12" column="pj12" />
  35. <result property="pj13" column="pj13" />
  36. <result property="pj14" column="pj14" />
  37. <result property="pj15" column="pj15" />
  38. <result property="pj16" column="pj16" />
  39. <result property="pj17" column="pj17" />
  40. <result property="pj18" column="pj18" />
  41. <result property="pj19" column="pj19" />
  42. <result property="pj20" column="pj20" />
  43. <result property="pj21" column="pj21" />
  44. <result property="pj22" column="pj22" />
  45. <result property="pj23" column="pj23" />
  46. <result property="pj24" column="pj24" />
  47. <result property="pj25" column="pj25" />
  48. <result property="pj26" column="pj26" />
  49. <result property="pj27" column="pj27" />
  50. <result property="pj28" column="pj28" />
  51. <result property="pj29" column="pj29" />
  52. <result property="pj30" column="pj30" />
  53. <result property="pj31" column="pj31" />
  54. <result property="pj32" column="pj32" />
  55. <result property="remarks" column="remarks" />
  56. <result property="checkDate" column="check_date" />
  57. <result property="nextCheckDate" column="next_check_date" />
  58. <result property="problem" column="problem" />
  59. <result property="con" column="con" />
  60. <result property="buildDate" column="build_date" />
  61. <result property="approveId" column="approve_id" />
  62. <result property="delFlag" column="del_flag" />
  63. <result property="createrCode" column="creater_code" />
  64. <result property="createdate" column="createdate" />
  65. <result property="updaterCode" column="updater_code" />
  66. <result property="updatedate" column="updatedate" />
  67. <result property="reportUrl" column="report_url" />
  68. </resultMap>
  69. <sql id="selectTReportHiYlrqVo">
  70. select d.id, d.report_id, d.plant_code,d.report_url, d.unit, d.devno, d.devname, d.useno, d.regno, d.medium, d.des_pressure, d.des_temp, d.opt_pressure, d.opt_temp, d.safe_class, d.next_warn_date, d.year_report_no, d.pj1, d.pj2, d.pj3, d.pj4, d.pj5, d.pj6, d.pj7, d.pj8, d.pj9, d.pj10, d.pj11, d.pj12, d.pj13, d.pj14, d.pj15, d.pj16, d.pj17, d.pj18, d.pj19, d.pj20, d.pj21, d.pj22, d.pj23, d.pj24, d.pj25, d.pj26, d.pj27, d.pj28, d.pj29, d.pj30, d.pj31, d.pj32, d.remarks, d.check_date, d.next_check_date, d.problem, d.con, d.build_date, d.approve_id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate from t_report_hi_ylrq d
  71. </sql>
  72. <select id="selectTReportHiYlrqList" parameterType="TReportHiYlrq" resultMap="TReportHiYlrqResult">
  73. <include refid="selectTReportHiYlrqVo"/>
  74. <where>
  75. <if test="reportId != null "> and report_id = #{reportId}</if>
  76. and d.del_flag = 0
  77. </where>
  78. <!-- 数据范围过滤 -->
  79. ${params.dataScopePlant}
  80. </select>
  81. <select id="selectTReportHiYlrqById" parameterType="Long" resultMap="TReportHiYlrqResult">
  82. <include refid="selectTReportHiYlrqVo"/>
  83. where id = #{id}
  84. </select>
  85. <select id="selectTReportHiYlrqForYear" parameterType="String" resultMap="TReportHiYlrqResult">
  86. <include refid="selectTReportHiYlrqVo"/>
  87. where TO_CHAR(check_date,'yyyy') = #{params.year}
  88. and d.del_flag = 0
  89. <!-- 数据范围过滤 -->
  90. ${params.dataScopePlant}
  91. </select>
  92. <insert id="insertTReportHiYlrq" parameterType="TReportHiYlrq">
  93. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  94. SELECT seq_t_report_hi_ylrq.NEXTVAL as id FROM DUAL
  95. </selectKey>
  96. insert into t_report_hi_ylrq
  97. <trim prefix="(" suffix=")" suffixOverrides=",">
  98. <if test="id != null">id,</if>
  99. <if test="reportId != null">report_id,</if>
  100. <if test="plantCode != null">plant_code,</if>
  101. <if test="unit != null">unit,</if>
  102. <if test="devno != null">devno,</if>
  103. <if test="devname != null">devname,</if>
  104. <if test="useno != null">useno,</if>
  105. <if test="regno != null">regno,</if>
  106. <if test="medium != null">medium,</if>
  107. <if test="desPressure != null">des_pressure,</if>
  108. <if test="desTemp != null">des_temp,</if>
  109. <if test="optPressure != null">opt_pressure,</if>
  110. <if test="optTemp != null">opt_temp,</if>
  111. <if test="safeClass != null">safe_class,</if>
  112. <if test="nextWarnDate != null">next_warn_date,</if>
  113. <if test="yearReportNo != null">year_report_no,</if>
  114. <if test="pj1 != null">pj1,</if>
  115. <if test="pj2 != null">pj2,</if>
  116. <if test="pj3 != null">pj3,</if>
  117. <if test="pj4 != null">pj4,</if>
  118. <if test="pj5 != null">pj5,</if>
  119. <if test="pj6 != null">pj6,</if>
  120. <if test="pj7 != null">pj7,</if>
  121. <if test="pj8 != null">pj8,</if>
  122. <if test="pj9 != null">pj9,</if>
  123. <if test="pj10 != null">pj10,</if>
  124. <if test="pj11 != null">pj11,</if>
  125. <if test="pj12 != null">pj12,</if>
  126. <if test="pj13 != null">pj13,</if>
  127. <if test="pj14 != null">pj14,</if>
  128. <if test="pj15 != null">pj15,</if>
  129. <if test="pj16 != null">pj16,</if>
  130. <if test="pj17 != null">pj17,</if>
  131. <if test="pj18 != null">pj18,</if>
  132. <if test="pj19 != null">pj19,</if>
  133. <if test="pj20 != null">pj20,</if>
  134. <if test="pj21 != null">pj21,</if>
  135. <if test="pj22 != null">pj22,</if>
  136. <if test="pj23 != null">pj23,</if>
  137. <if test="pj24 != null">pj24,</if>
  138. <if test="pj25 != null">pj25,</if>
  139. <if test="pj26 != null">pj26,</if>
  140. <if test="pj27 != null">pj27,</if>
  141. <if test="pj28 != null">pj28,</if>
  142. <if test="pj29 != null">pj29,</if>
  143. <if test="pj30 != null">pj30,</if>
  144. <if test="pj31 != null">pj31,</if>
  145. <if test="pj32 != null">pj32,</if>
  146. <if test="remarks != null">remarks,</if>
  147. <if test="checkDate != null">check_date,</if>
  148. <if test="nextCheckDate != null">next_check_date,</if>
  149. <if test="problem != null">problem,</if>
  150. <if test="con != null">con,</if>
  151. <if test="buildDate != null">build_date,</if>
  152. <if test="approveId != null">approve_id,</if>
  153. <if test="delFlag != null">del_flag,</if>
  154. <if test="createrCode != null">creater_code,</if>
  155. <if test="createdate != null">createdate,</if>
  156. <if test="updaterCode != null">updater_code,</if>
  157. <if test="updatedate != null">updatedate,</if>
  158. </trim>
  159. <trim prefix="values (" suffix=")" suffixOverrides=",">
  160. <if test="id != null">#{id},</if>
  161. <if test="reportId != null">#{reportId},</if>
  162. <if test="plantCode != null">#{plantCode},</if>
  163. <if test="unit != null">#{unit},</if>
  164. <if test="devno != null">#{devno},</if>
  165. <if test="devname != null">#{devname},</if>
  166. <if test="useno != null">#{useno},</if>
  167. <if test="regno != null">#{regno},</if>
  168. <if test="medium != null">#{medium},</if>
  169. <if test="desPressure != null">#{desPressure},</if>
  170. <if test="desTemp != null">#{desTemp},</if>
  171. <if test="optPressure != null">#{optPressure},</if>
  172. <if test="optTemp != null">#{optTemp},</if>
  173. <if test="safeClass != null">#{safeClass},</if>
  174. <if test="nextWarnDate != null">#{nextWarnDate},</if>
  175. <if test="yearReportNo != null">#{yearReportNo},</if>
  176. <if test="pj1 != null">#{pj1},</if>
  177. <if test="pj2 != null">#{pj2},</if>
  178. <if test="pj3 != null">#{pj3},</if>
  179. <if test="pj4 != null">#{pj4},</if>
  180. <if test="pj5 != null">#{pj5},</if>
  181. <if test="pj6 != null">#{pj6},</if>
  182. <if test="pj7 != null">#{pj7},</if>
  183. <if test="pj8 != null">#{pj8},</if>
  184. <if test="pj9 != null">#{pj9},</if>
  185. <if test="pj10 != null">#{pj10},</if>
  186. <if test="pj11 != null">#{pj11},</if>
  187. <if test="pj12 != null">#{pj12},</if>
  188. <if test="pj13 != null">#{pj13},</if>
  189. <if test="pj14 != null">#{pj14},</if>
  190. <if test="pj15 != null">#{pj15},</if>
  191. <if test="pj16 != null">#{pj16},</if>
  192. <if test="pj17 != null">#{pj17},</if>
  193. <if test="pj18 != null">#{pj18},</if>
  194. <if test="pj19 != null">#{pj19},</if>
  195. <if test="pj20 != null">#{pj20},</if>
  196. <if test="pj21 != null">#{pj21},</if>
  197. <if test="pj22 != null">#{pj22},</if>
  198. <if test="pj23 != null">#{pj23},</if>
  199. <if test="pj24 != null">#{pj24},</if>
  200. <if test="pj25 != null">#{pj25},</if>
  201. <if test="pj26 != null">#{pj26},</if>
  202. <if test="pj27 != null">#{pj27},</if>
  203. <if test="pj28 != null">#{pj28},</if>
  204. <if test="pj29 != null">#{pj29},</if>
  205. <if test="pj30 != null">#{pj30},</if>
  206. <if test="pj31 != null">#{pj31},</if>
  207. <if test="pj32 != null">#{pj32},</if>
  208. <if test="remarks != null">#{remarks},</if>
  209. <if test="checkDate != null">#{checkDate},</if>
  210. <if test="nextCheckDate != null">#{nextCheckDate},</if>
  211. <if test="problem != null">#{problem},</if>
  212. <if test="con != null">#{con},</if>
  213. <if test="buildDate != null">#{buildDate},</if>
  214. <if test="approveId != null">#{approveId},</if>
  215. <if test="delFlag != null">#{delFlag},</if>
  216. <if test="createrCode != null">#{createrCode},</if>
  217. <if test="createdate != null">#{createdate},</if>
  218. <if test="updaterCode != null">#{updaterCode},</if>
  219. <if test="updatedate != null">#{updatedate},</if>
  220. </trim>
  221. </insert>
  222. <update id="updateTReportHiYlrq" parameterType="TReportHiYlrq">
  223. update t_report_hi_ylrq
  224. <trim prefix="SET" suffixOverrides=",">
  225. <if test="reportId != null">report_id = #{reportId},</if>
  226. <if test="plantCode != null">plant_code = #{plantCode},</if>
  227. <if test="unit != null">unit = #{unit},</if>
  228. <if test="devno != null">devno = #{devno},</if>
  229. <if test="devname != null">devname = #{devname},</if>
  230. <if test="useno != null">useno = #{useno},</if>
  231. <if test="regno != null">regno = #{regno},</if>
  232. <if test="medium != null">medium = #{medium},</if>
  233. <if test="desPressure != null">des_pressure = #{desPressure},</if>
  234. <if test="desTemp != null">des_temp = #{desTemp},</if>
  235. <if test="optPressure != null">opt_pressure = #{optPressure},</if>
  236. <if test="optTemp != null">opt_temp = #{optTemp},</if>
  237. <if test="safeClass != null">safe_class = #{safeClass},</if>
  238. <if test="nextWarnDate != null">next_warn_date = #{nextWarnDate},</if>
  239. <if test="yearReportNo != null">year_report_no = #{yearReportNo},</if>
  240. <if test="pj1 != null">pj1 = #{pj1},</if>
  241. <if test="pj2 != null">pj2 = #{pj2},</if>
  242. <if test="pj3 != null">pj3 = #{pj3},</if>
  243. <if test="pj4 != null">pj4 = #{pj4},</if>
  244. <if test="pj5 != null">pj5 = #{pj5},</if>
  245. <if test="pj6 != null">pj6 = #{pj6},</if>
  246. <if test="pj7 != null">pj7 = #{pj7},</if>
  247. <if test="pj8 != null">pj8 = #{pj8},</if>
  248. <if test="pj9 != null">pj9 = #{pj9},</if>
  249. <if test="pj10 != null">pj10 = #{pj10},</if>
  250. <if test="pj11 != null">pj11 = #{pj11},</if>
  251. <if test="pj12 != null">pj12 = #{pj12},</if>
  252. <if test="pj13 != null">pj13 = #{pj13},</if>
  253. <if test="pj14 != null">pj14 = #{pj14},</if>
  254. <if test="pj15 != null">pj15 = #{pj15},</if>
  255. <if test="pj16 != null">pj16 = #{pj16},</if>
  256. <if test="pj17 != null">pj17 = #{pj17},</if>
  257. <if test="pj18 != null">pj18 = #{pj18},</if>
  258. <if test="pj19 != null">pj19 = #{pj19},</if>
  259. <if test="pj20 != null">pj20 = #{pj20},</if>
  260. <if test="pj21 != null">pj21 = #{pj21},</if>
  261. <if test="pj22 != null">pj22 = #{pj22},</if>
  262. <if test="pj23 != null">pj23 = #{pj23},</if>
  263. <if test="pj24 != null">pj24 = #{pj24},</if>
  264. <if test="pj25 != null">pj25 = #{pj25},</if>
  265. <if test="pj26 != null">pj26 = #{pj26},</if>
  266. <if test="pj27 != null">pj27 = #{pj27},</if>
  267. <if test="pj28 != null">pj28 = #{pj28},</if>
  268. <if test="pj29 != null">pj29 = #{pj29},</if>
  269. <if test="pj30 != null">pj30 = #{pj30},</if>
  270. <if test="pj31 != null">pj31 = #{pj31},</if>
  271. <if test="pj32 != null">pj32 = #{pj32},</if>
  272. <if test="remarks != null">remarks = #{remarks},</if>
  273. <if test="checkDate != null">check_date = #{checkDate},</if>
  274. <if test="nextCheckDate != null">next_check_date = #{nextCheckDate},</if>
  275. <if test="problem != null">problem = #{problem},</if>
  276. <if test="con != null">con = #{con},</if>
  277. <if test="buildDate != null">build_date = #{buildDate},</if>
  278. <if test="approveId != null">approve_id = #{approveId},</if>
  279. <if test="delFlag != null">del_flag = #{delFlag},</if>
  280. <if test="createrCode != null">creater_code = #{createrCode},</if>
  281. <if test="createdate != null">createdate = #{createdate},</if>
  282. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  283. <if test="updatedate != null">updatedate = #{updatedate},</if>
  284. <if test="reportUrl != null">report_url = #{reportUrl},</if>
  285. </trim>
  286. where id = #{id}
  287. </update>
  288. <update id="deleteTReportHiYlrqById" parameterType="Long">
  289. update t_report_hi_ylrq set del_flag = 2 where id = #{id}
  290. </update>
  291. <update id="deleteTReportHiYlrqByIds" parameterType="String">
  292. update t_report_hi_ylrq set del_flag = 2 where id in
  293. <foreach item="id" collection="array" open="(" separator="," close=")">
  294. #{id}
  295. </foreach>
  296. </update>
  297. </mapper>