TSpecdevYlgdMapper.xml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  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.TSpecdevYlgdMapper">
  6. <resultMap type="TSpecdevYlgd" id="TSpecdevYlgdResult">
  7. <result property="id" column="id"/>
  8. <result property="plantCode" column="plant_code"/>
  9. <result property="unit" column="unit"/>
  10. <result property="devname" column="devname"/>
  11. <result property="devno" column="devno"/>
  12. <result property="submitdate" column="submitdate"/>
  13. <result property="status" column="status"/>
  14. <result property="delFlag" column="del_flag"/>
  15. <result property="createrCode" column="creater_code"/>
  16. <result property="createdate" column="createdate"/>
  17. <result property="updaterCode" column="updater_code"/>
  18. <result property="updatedate" column="updatedate"/>
  19. <result property="deptId" column="dept_id"/>
  20. <result property="remarks" column="remarks"/>
  21. <result property="remarks2" column="remarks2"/>
  22. <result property="approveStatus" column="approve_status"/>
  23. <result property="regno" column="regno"/>
  24. <result property="useno" column="useno"/>
  25. <result property="warnDate" column="warn_date"/>
  26. <result property="warnCycle" column="warn_cycle"/>
  27. <result property="nextWarnDate" column="next_warn_date"/>
  28. <result property="warnFlag" column="warn_flag"/>
  29. <result property="grade" column="grade"/>
  30. <result property="designer" column="designer"/>
  31. <result property="installer" column="installer"/>
  32. <result property="material" column="material"/>
  33. <result property="dia" column="dia"/>
  34. <result property="scheduleNo" column="schedule_no"/>
  35. <result property="length" column="length"/>
  36. <result property="starting" column="starting"/>
  37. <result property="ending" column="ending"/>
  38. <result property="desPressure" column="des_pressure"/>
  39. <result property="desTemp" column="des_temp"/>
  40. <result property="optPressure" column="opt_pressure"/>
  41. <result property="optTemp" column="opt_temp"/>
  42. <result property="medium" column="medium"/>
  43. <result property="checkConclusion" column="check_conclusion"/>
  44. <result property="checkUnit" column="check_unit"/>
  45. <result property="safeClass" column="safe_class"/>
  46. <result property="reportNo" column="report_no"/>
  47. <result property="approveTime" column="approve_time"/>
  48. <result property="changeTime" column="change_time"/>
  49. <result property="plantMaint" column="plant_maint"/>
  50. <result property="engineer" column="engineer"/>
  51. <result property="weldNumber" column="weld_number"/>
  52. <result property="layingMethod" column="laying_method"/>
  53. <result property="adiabatic" column="adiabatic"/>
  54. <result property="antiCorrosion" column="anti_corrosion"/>
  55. <result property="adiabaticThickness" column="adiabatic_thickness"/>
  56. <result property="isDanger" column="is_danger"/>
  57. <result property="installDate" column="install_date"/>
  58. <result property="yearWarnDate" column="year_warn_date"/>
  59. <result property="yearNextWarnDate" column="year_next_warn_date"/>
  60. <result property="yearReportNo" column="year_report_no"/>
  61. <result property="deptName" column="dept_name"/>
  62. <result property="hiFlag" column="hiFlag"/>
  63. <result property="isRepeat" column="is_repeat"/>
  64. </resultMap>
  65. <sql id="selectTSpecdevYlgdVo">
  66. select d.id,
  67. d.plant_code,
  68. d.unit,
  69. d.devname,
  70. d.devno,
  71. d.submitdate,
  72. d.status,
  73. d.del_flag,
  74. d.creater_code,
  75. d.createdate,
  76. d.updater_code,
  77. d.updatedate,
  78. d.dept_id,
  79. d.remarks,
  80. d.remarks2,
  81. d.approve_status,
  82. d.regno,
  83. d.useno,
  84. d.warn_date,
  85. d.warn_cycle,
  86. d.next_warn_date,
  87. d.warn_flag,
  88. d.grade,
  89. d.designer,
  90. d.installer,
  91. d.material,
  92. d.dia,
  93. d.schedule_no,
  94. d.length,
  95. d.starting,
  96. d.ending,
  97. d.des_pressure,
  98. d.des_temp,
  99. d.opt_pressure,
  100. d.opt_temp,
  101. d.medium,
  102. d.check_conclusion,
  103. d.check_unit,
  104. d.safe_class,
  105. d.report_no,
  106. d.approve_time,
  107. d.change_time,
  108. d.plant_maint,
  109. d.engineer,
  110. d.weld_number,
  111. d.laying_method,
  112. d.adiabatic,
  113. d.anti_corrosion,
  114. d.adiabatic_thickness,
  115. d.is_danger,
  116. d.install_date,
  117. d.year_warn_date,
  118. d.year_next_warn_date,
  119. d.year_report_no,
  120. s.dept_name,
  121. (SELECT COUNT(1) from T_SPECHI_YLGD h where h.DEV_ID = d.id and HI_TYPE = 0 ) as hiFlag,
  122. d.is_repeat
  123. from t_specdev_ylgd d
  124. left join sys_dept s on s.dept_id = d.dept_id
  125. </sql>
  126. <select id="selectTSpecdevYlgdList" parameterType="TSpecdevYlgd" resultMap="TSpecdevYlgdResult">
  127. <include refid="selectTSpecdevYlgdVo"/>
  128. <where>
  129. <if test="plantCode != null and plantCode != ''">and plant_code like concat(concat('%', #{plantCode}), '%') </if>
  130. <if test="unit != null and unit != ''">and unit like concat(concat('%', #{unit}), '%') </if>
  131. <if test="devname != null and devname != ''">and devname like concat(concat('%', #{devname}), '%')</if>
  132. <if test="devno != null and devno != ''">and devno like concat(concat('%', #{devno}), '%') </if>
  133. <if test="submitdate != null ">and submitdate = #{submitdate}</if>
  134. <if test="material != null and material != ''">and material like concat(concat('%', #{material}), '%') </if>
  135. <if test="dia != null and dia != ''">and dia like concat(concat('%', #{dia}), '%') </if>
  136. <if test="scheduleNo != null and scheduleNo != ''">and schedule_no like concat(concat('%', #{scheduleNo}), '%') </if>
  137. <if test="length != null and length != ''">and length like concat(concat('%', #{length}), '%') </if>
  138. <if test="starting != null and starting != ''">and starting like concat(concat('%', #{starting}), '%') </if>
  139. <if test="ending != null and ending != ''">and ending like concat(concat('%', #{ending}), '%') </if>
  140. <if test="desPressure != null and desPressure != ''">and des_pressure = #{desPressure}</if>
  141. <if test="desTemp != null and desTemp != ''">and des_temp = #{desTemp}</if>
  142. <if test="optPressure != null and optPressure != ''">and opt_pressure = #{optPressure}</if>
  143. <if test="optTemp != null and optTemp != ''">and opt_temp = #{optTemp}</if>
  144. <if test="medium != null and medium != ''">and medium = #{medium}</if>
  145. <if test="checkConclusion != null ">and check_conclusion = #{checkConclusion}</if>
  146. <if test="checkUnit != null and checkUnit != ''">and check_unit = #{checkUnit}</if>
  147. <if test="safeClass != null and safeClass != ''">and safe_class = #{safeClass}</if>
  148. <if test="reportNo != null and reportNo != ''">and report_no = #{reportNo}</if>
  149. <if test="approveTime != null ">and approve_time = #{approveTime}</if>
  150. <if test="changeTime != null ">and change_time = #{changeTime}</if>
  151. <if test="plantMaint != null and plantMaint != ''">and plant_maint = #{plantMaint}</if>
  152. <if test="engineer != null and engineer != ''">and engineer = #{engineer}</if>
  153. <if test="weldNumber != null and weldNumber != ''">and weld_number = #{weldNumber}</if>
  154. <if test="layingMethod != null and layingMethod != ''">and laying_method = #{layingMethod}</if>
  155. <if test="adiabatic != null and adiabatic != ''">and adiabatic = #{adiabatic}</if>
  156. <if test="antiCorrosion != null and antiCorrosion != ''">and anti_corrosion = #{antiCorrosion}</if>
  157. <if test="adiabaticThickness != null and adiabaticThickness != ''">and adiabatic_thickness =
  158. #{adiabaticThickness}
  159. </if>
  160. <if test="isDanger != null ">and is_danger = #{isDanger}</if>
  161. <if test="status != null ">and d.status = #{status}</if>
  162. <if test="approveStatus != null ">and approve_status = #{approveStatus}</if>
  163. <if test="warnFlag != null ">and warn_Flag = #{warnFlag}</if>
  164. <if test="searchValue != null and searchValue != ''">
  165. and
  166. (plant_code like concat(concat('%', #{searchValue}), '%')
  167. or unit like concat(concat('%', #{searchValue}), '%')
  168. or devname like concat(concat('%', #{searchValue}), '%')
  169. or material like concat(concat('%', #{searchValue}), '%')
  170. or devno like concat(concat('%', #{searchValue}), '%')
  171. or dia like concat(concat('%', #{searchValue}), '%')
  172. or schedule_no like concat(concat('%', #{searchValue}), '%')
  173. or length like concat(concat('%', #{searchValue}), '%')
  174. or starting like concat(concat('%', #{searchValue}), '%')
  175. or ending like concat(concat('%', #{searchValue}), '%')
  176. or des_pressure like concat(concat('%', #{searchValue}), '%')
  177. or des_temp like concat(concat('%', #{searchValue}), '%')
  178. or opt_pressure like concat(concat('%', #{searchValue}), '%')
  179. or opt_temp like concat(concat('%', #{searchValue}), '%')
  180. or remarks like concat(concat('%', #{searchValue}), '%')
  181. or remarks2 like concat(concat('%', #{searchValue}), '%')
  182. or report_no like concat(concat('%', #{searchValue}), '%')
  183. or year_report_no like concat(concat('%', #{searchValue}), '%')
  184. )
  185. </if>
  186. <if test="isRepeat != null and isRepeat != ''">
  187. <if test="isRepeat == 2 ">
  188. and (d.DEVNO,d.USENO, d.PLANT_CODE, d.DEL_FLAG, d.APPROVE_STATUS) IN (
  189. SELECT DEVNO,USENO, PLANT_CODE, DEL_FLAG, APPROVE_STATUS
  190. FROM T_SPECDEV_DZSB
  191. WHERE DEL_FLAG = 0 AND APPROVE_STATUS = 0
  192. GROUP BY DEVNO,USENO, PLANT_CODE, DEL_FLAG, APPROVE_STATUS
  193. HAVING COUNT(*) > 1
  194. )
  195. </if>
  196. </if>
  197. and d.del_flag = 0
  198. </where>
  199. <!-- 数据范围过滤 -->
  200. ${params.dataScopePlant}
  201. order by d.is_repeat desc, d.plant_code, d.unit, d.id
  202. </select>
  203. <select id="selectExpiredYlgd" parameterType="Integer" resultMap="TSpecdevYlgdResult">
  204. select d.id,
  205. d.plant_code,
  206. d.unit,
  207. d.devname,
  208. d.devno,
  209. d.submitdate,
  210. d.status,
  211. d.del_flag,
  212. d.creater_code,
  213. d.createdate,
  214. d.updater_code,
  215. d.updatedate,
  216. d.dept_id,
  217. d.remarks,
  218. d.remarks2,
  219. d.approve_status,
  220. d.regno,
  221. d.useno,
  222. d.warn_date,
  223. d.warn_cycle,
  224. d.next_warn_date,
  225. d.warn_flag,
  226. d.grade,
  227. d.designer,
  228. d.installer,
  229. d.material,
  230. d.dia,
  231. d.schedule_no,
  232. d.length,
  233. d.starting,
  234. d.ending,
  235. d.des_pressure,
  236. d.des_temp,
  237. d.opt_pressure,
  238. d.opt_temp,
  239. d.medium,
  240. d.check_conclusion,
  241. d.check_unit,
  242. d.safe_class,
  243. d.report_no,
  244. d.approve_time,
  245. d.change_time,
  246. d.plant_maint,
  247. d.engineer,
  248. d.weld_number,
  249. d.laying_method,
  250. d.adiabatic,
  251. d.anti_corrosion,
  252. d.adiabatic_thickness,
  253. d.is_danger,
  254. d.install_date,
  255. d.year_warn_date,
  256. d.year_next_warn_date,
  257. d.is_repeat
  258. from t_specdev_ylgd d
  259. <where>
  260. <if test="month == 0 ">and SYSDATE > NEXT_WARN_DATE</if>
  261. <if test="month == 3 ">and SYSDATE + INTERVAL '3' MONTH > NEXT_WARN_DATE and NEXT_WARN_DATE > SYSDATE </if>
  262. and DEL_FLAG = 0
  263. and STATUS = 1
  264. </where>
  265. order by d.plant_code asc
  266. </select>
  267. <select id="selectTSpecdevYlgdListByYear" parameterType="TSpecdevYlgd" resultMap="TSpecdevYlgdResult">
  268. <include refid="selectTSpecdevYlgdVo"/>
  269. <where>
  270. <if test="status != null ">and d.status = #{status}</if>
  271. <if test="checkYear != null ">and to_char(NEXT_WARN_DATE,'yyyy') = #{checkYear}</if>
  272. <if test="plantIds != null and plantIds != ''">
  273. and
  274. d.plant_code in
  275. <foreach collection="plantIds.split(',')" item="item" index="index"
  276. open="(" close=")" separator=",">
  277. #{item}
  278. </foreach>
  279. </if>
  280. <!--<if test="unitIds != null and unitIds != ''">
  281. and
  282. (
  283. d.unit in
  284. <foreach collection="unitIds.split(',')" item="item" index="index"
  285. open="(" close=")" separator=",">
  286. #{item}
  287. </foreach>
  288. )
  289. </if>-->
  290. and d.del_flag = 0
  291. </where>
  292. </select>
  293. <select id="selectTSpecdevYlgdById" parameterType="Long" resultMap="TSpecdevYlgdResult">
  294. <include refid="selectTSpecdevYlgdVo"/>
  295. where id = #{id}
  296. </select>
  297. <select id="selectTSpecdevYlgdByIds" parameterType="Long" resultMap="TSpecdevYlgdResult">
  298. <include refid="selectTSpecdevYlgdVo"/>
  299. where id in
  300. <foreach collection="ids" open="(" close=")" item="id" index="index">
  301. <if test="index != 0">
  302. <choose>
  303. <when test="index % 1000 == 999">) OR id in (</when>
  304. <otherwise>,</otherwise>
  305. </choose>
  306. </if>
  307. #{id}
  308. </foreach>
  309. </select>
  310. <insert id="insertTSpecdevYlgd" parameterType="TSpecdevYlgd">
  311. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  312. SELECT seq_t_specdev_ylrq.NEXTVAL as id FROM DUAL
  313. </selectKey>
  314. insert into t_specdev_ylgd
  315. <trim prefix="(" suffix=")" suffixOverrides=",">
  316. <if test="id != null">id,</if>
  317. <if test="plantCode != null">plant_code,</if>
  318. <if test="unit != null">unit,</if>
  319. <if test="devname != null">devname,</if>
  320. <if test="devno != null">devno,</if>
  321. <if test="submitdate != null">submitdate,</if>
  322. <if test="status != null">status,</if>
  323. <if test="delFlag != null">del_flag,</if>
  324. <if test="createrCode != null">creater_code,</if>
  325. <if test="createdate != null">createdate,</if>
  326. <if test="updaterCode != null">updater_code,</if>
  327. <if test="updatedate != null">updatedate,</if>
  328. <if test="deptId != null">dept_id,</if>
  329. <if test="remarks != null">remarks,</if>
  330. <if test="remarks2 != null">remarks2,</if>
  331. <if test="approveStatus != null">approve_status,</if>
  332. <if test="regno != null">regno,</if>
  333. <if test="useno != null">useno,</if>
  334. <if test="warnDate != null">warn_date,</if>
  335. <if test="warnCycle != null">warn_cycle,</if>
  336. <if test="nextWarnDate != null">next_warn_date,</if>
  337. <if test="warnFlag != null">warn_flag,</if>
  338. <if test="grade != null">grade,</if>
  339. <if test="designer != null">designer,</if>
  340. <if test="installer != null">installer,</if>
  341. <if test="material != null">material,</if>
  342. <if test="dia != null">dia,</if>
  343. <if test="scheduleNo != null">schedule_no,</if>
  344. <if test="length != null">length,</if>
  345. <if test="starting != null">starting,</if>
  346. <if test="ending != null">ending,</if>
  347. <if test="desPressure != null">des_pressure,</if>
  348. <if test="desTemp != null">des_temp,</if>
  349. <if test="optPressure != null">opt_pressure,</if>
  350. <if test="optTemp != null">opt_temp,</if>
  351. <if test="medium != null">medium,</if>
  352. <if test="checkConclusion != null">check_conclusion,</if>
  353. <if test="checkUnit != null">check_unit,</if>
  354. <if test="safeClass != null">safe_class,</if>
  355. <if test="reportNo != null">report_no,</if>
  356. <if test="approveTime != null">approve_time,</if>
  357. <if test="changeTime != null">change_time,</if>
  358. <if test="plantMaint != null">plant_maint,</if>
  359. <if test="engineer != null">engineer,</if>
  360. <if test="weldNumber != null">weld_number,</if>
  361. <if test="layingMethod != null">laying_method,</if>
  362. <if test="adiabatic != null">adiabatic,</if>
  363. <if test="antiCorrosion != null">anti_corrosion,</if>
  364. <if test="adiabaticThickness != null">adiabatic_thickness,</if>
  365. <if test="isDanger != null">is_danger,</if>
  366. <if test="installDate != null">install_date,</if>
  367. <if test="yearWarnDate != null">year_warn_date,</if>
  368. <if test="yearNextWarnDate != null">year_next_warn_date,</if>
  369. <if test="yearReportNo != null">year_report_no,</if>
  370. </trim>
  371. <trim prefix="values (" suffix=")" suffixOverrides=",">
  372. <if test="id != null">#{id},</if>
  373. <if test="plantCode != null">#{plantCode},</if>
  374. <if test="unit != null">#{unit},</if>
  375. <if test="devname != null">#{devname},</if>
  376. <if test="devno != null">#{devno},</if>
  377. <if test="submitdate != null">#{submitdate},</if>
  378. <if test="status != null">#{status},</if>
  379. <if test="delFlag != null">#{delFlag},</if>
  380. <if test="createrCode != null">#{createrCode},</if>
  381. <if test="createdate != null">#{createdate},</if>
  382. <if test="updaterCode != null">#{updaterCode},</if>
  383. <if test="updatedate != null">#{updatedate},</if>
  384. <if test="deptId != null">#{deptId},</if>
  385. <if test="remarks != null">#{remarks},</if>
  386. <if test="remarks2 != null">#{remarks2},</if>
  387. <if test="approveStatus != null">#{approveStatus},</if>
  388. <if test="regno != null">#{regno},</if>
  389. <if test="useno != null">#{useno},</if>
  390. <if test="warnDate != null">#{warnDate},</if>
  391. <if test="warnCycle != null">#{warnCycle},</if>
  392. <if test="nextWarnDate != null">#{nextWarnDate},</if>
  393. <if test="warnFlag != null">#{warnFlag},</if>
  394. <if test="grade != null">#{grade},</if>
  395. <if test="designer != null">#{designer},</if>
  396. <if test="installer != null">#{installer},</if>
  397. <if test="material != null">#{material},</if>
  398. <if test="dia != null">#{dia},</if>
  399. <if test="scheduleNo != null">#{scheduleNo},</if>
  400. <if test="length != null">#{length},</if>
  401. <if test="starting != null">#{starting},</if>
  402. <if test="ending != null">#{ending},</if>
  403. <if test="desPressure != null">#{desPressure},</if>
  404. <if test="desTemp != null">#{desTemp},</if>
  405. <if test="optPressure != null">#{optPressure},</if>
  406. <if test="optTemp != null">#{optTemp},</if>
  407. <if test="medium != null">#{medium},</if>
  408. <if test="checkConclusion != null">#{checkConclusion},</if>
  409. <if test="checkUnit != null">#{checkUnit},</if>
  410. <if test="safeClass != null">#{safeClass},</if>
  411. <if test="reportNo != null">#{reportNo},</if>
  412. <if test="approveTime != null">#{approveTime},</if>
  413. <if test="changeTime != null">#{changeTime},</if>
  414. <if test="plantMaint != null">#{plantMaint},</if>
  415. <if test="engineer != null">#{engineer},</if>
  416. <if test="weldNumber != null">#{weldNumber},</if>
  417. <if test="layingMethod != null">#{layingMethod},</if>
  418. <if test="adiabatic != null">#{adiabatic},</if>
  419. <if test="antiCorrosion != null">#{antiCorrosion},</if>
  420. <if test="adiabaticThickness != null">#{adiabaticThickness},</if>
  421. <if test="isDanger != null">#{isDanger},</if>
  422. <if test="installDate != null">#{installDate},</if>
  423. <if test="yearWarnDate != null">#{yearWarnDate},</if>
  424. <if test="yearNextWarnDate != null">#{yearNextWarnDate},</if>
  425. <if test="yearReportNo != null">#{yearReportNo},</if>
  426. </trim>
  427. </insert>
  428. <update id="updateTSpecdevYlgd" parameterType="TSpecdevYlgd">
  429. update t_specdev_ylgd
  430. <trim prefix="SET" suffixOverrides=",">
  431. <if test="plantCode != null">plant_code = #{plantCode},</if>
  432. <if test="unit != null">unit = #{unit},</if>
  433. <if test="devname != null">devname = #{devname},</if>
  434. <if test="devno != null">devno = #{devno},</if>
  435. <if test="submitdate != null">submitdate = #{submitdate},</if>
  436. <if test="status != null">status = #{status},</if>
  437. <if test="delFlag != null">del_flag = #{delFlag},</if>
  438. <if test="createrCode != null">creater_code = #{createrCode},</if>
  439. <if test="createdate != null">createdate = #{createdate},</if>
  440. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  441. <if test="updatedate != null">updatedate = #{updatedate},</if>
  442. <if test="deptId != null">dept_id = #{deptId},</if>
  443. <if test="remarks != null">remarks = #{remarks},</if>
  444. <if test="remarks2 != null">remarks2 = #{remarks2},</if>
  445. <if test="approveStatus != null">approve_status = #{approveStatus},</if>
  446. <if test="regno != null">regno = #{regno},</if>
  447. <if test="useno != null">useno = #{useno},</if>
  448. <if test="warnDate != null">warn_date = #{warnDate},</if>
  449. <if test="warnCycle != null">warn_cycle = #{warnCycle},</if>
  450. <if test="nextWarnDate != null">next_warn_date = #{nextWarnDate},</if>
  451. <if test="warnFlag != null">warn_flag = #{warnFlag},</if>
  452. <if test="grade != null">grade = #{grade},</if>
  453. <if test="designer != null">designer = #{designer},</if>
  454. <if test="installer != null">installer = #{installer},</if>
  455. <if test="material != null">material = #{material},</if>
  456. <if test="dia != null">dia = #{dia},</if>
  457. <if test="scheduleNo != null">schedule_no = #{scheduleNo},</if>
  458. <if test="length != null">length = #{length},</if>
  459. <if test="starting != null">starting = #{starting},</if>
  460. <if test="ending != null">ending = #{ending},</if>
  461. <if test="desPressure != null">des_pressure = #{desPressure},</if>
  462. <if test="desTemp != null">des_temp = #{desTemp},</if>
  463. <if test="optPressure != null">opt_pressure = #{optPressure},</if>
  464. <if test="optTemp != null">opt_temp = #{optTemp},</if>
  465. <if test="medium != null">medium = #{medium},</if>
  466. <if test="checkConclusion != null">check_conclusion = #{checkConclusion},</if>
  467. <if test="checkUnit != null">check_unit = #{checkUnit},</if>
  468. <if test="safeClass != null">safe_class = #{safeClass},</if>
  469. <if test="reportNo != null">report_no = #{reportNo},</if>
  470. <if test="approveTime != null">approve_time = #{approveTime},</if>
  471. <if test="changeTime != null">change_time = #{changeTime},</if>
  472. <if test="plantMaint != null">plant_maint = #{plantMaint},</if>
  473. <if test="engineer != null">engineer = #{engineer},</if>
  474. <if test="weldNumber != null">weld_number = #{weldNumber},</if>
  475. <if test="layingMethod != null">laying_method = #{layingMethod},</if>
  476. <if test="adiabatic != null">adiabatic = #{adiabatic},</if>
  477. <if test="antiCorrosion != null">anti_corrosion = #{antiCorrosion},</if>
  478. <if test="adiabaticThickness != null">adiabatic_thickness = #{adiabaticThickness},</if>
  479. <if test="isDanger != null">is_danger = #{isDanger},</if>
  480. <if test="installDate != null">install_date = #{installDate},</if>
  481. <if test="yearWarnDate != null">year_warn_date = #{yearWarnDate},</if>
  482. <if test="yearNextWarnDate != null">year_next_warn_date = #{yearNextWarnDate},</if>
  483. <if test="yearReportNo != null">year_report_no = #{yearReportNo},</if>
  484. <if test="isRepeat != null">is_repeat = #{isRepeat},</if>
  485. </trim>
  486. where id = #{id}
  487. </update>
  488. <!--ylgd updateByHi-->
  489. <update id="updateTSpecdevYlgdByHi" parameterType="TSpechiYlgd">
  490. update t_specdev_ylgd
  491. <trim prefix="SET" suffixOverrides=",">
  492. <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
  493. <if test="unit != null">unit = #{unit},</if>
  494. <if test="devname != null">devname = #{devname},</if>
  495. <if test="devno != null">devno = #{devno},</if>
  496. <if test="submitdate != null">submitdate = #{submitdate},</if>
  497. <if test="status != null">status = #{status},</if>
  498. <if test="delFlag != null">del_flag = #{delFlag},</if>
  499. <if test="createrCode != null">creater_code = #{createrCode},</if>
  500. <if test="createdate != null">createdate = #{createdate},</if>
  501. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  502. <if test="updatedate != null">updatedate = #{updatedate},</if>
  503. <if test="deptId != null">dept_id = #{deptId},</if>
  504. <if test="remarks != null">remarks = #{remarks},</if>
  505. <if test="remarks2 != null">remarks2 = #{remarks2},</if>
  506. <if test="approveStatus != null">approve_status = #{approveStatus},</if>
  507. <if test="regno != null">regno = #{regno},</if>
  508. <if test="useno != null">useno = #{useno},</if>
  509. <if test="warnDate != null">warn_date = #{warnDate},</if>
  510. <if test="warnCycle != null">warn_cycle = #{warnCycle},</if>
  511. <if test="nextWarnDate != null">next_warn_date = #{nextWarnDate},</if>
  512. <if test="warnFlag != null">warn_flag = #{warnFlag},</if>
  513. <if test="grade != null">grade = #{grade},</if>
  514. <if test="designer != null">designer = #{designer},</if>
  515. <if test="installer != null">installer = #{installer},</if>
  516. <if test="material != null">material = #{material},</if>
  517. <if test="dia != null">dia = #{dia},</if>
  518. <if test="scheduleNo != null">schedule_no = #{scheduleNo},</if>
  519. <if test="length != null">length = #{length},</if>
  520. <if test="starting != null">starting = #{starting},</if>
  521. <if test="ending != null">ending = #{ending},</if>
  522. <if test="desPressure != null">des_pressure = #{desPressure},</if>
  523. <if test="desTemp != null">des_temp = #{desTemp},</if>
  524. <if test="optPressure != null">opt_pressure = #{optPressure},</if>
  525. <if test="optTemp != null">opt_temp = #{optTemp},</if>
  526. <if test="medium != null">medium = #{medium},</if>
  527. <if test="checkConclusion != null">check_conclusion = #{checkConclusion},</if>
  528. <if test="checkUnit != null">check_unit = #{checkUnit},</if>
  529. <if test="safeClass != null">safe_class = #{safeClass},</if>
  530. <if test="reportNo != null">report_no = #{reportNo},</if>
  531. <if test="approveTime != null">approve_time = #{approveTime},</if>
  532. <if test="changeTime != null">change_time = #{changeTime},</if>
  533. <if test="plantMaint != null">plant_maint = #{plantMaint},</if>
  534. <if test="engineer != null">engineer = #{engineer},</if>
  535. <if test="weldNumber != null">weld_number = #{weldNumber},</if>
  536. <if test="layingMethod != null">laying_method = #{layingMethod},</if>
  537. <if test="adiabatic != null">adiabatic = #{adiabatic},</if>
  538. <if test="antiCorrosion != null">anti_corrosion = #{antiCorrosion},</if>
  539. <if test="adiabaticThickness != null">adiabatic_thickness = #{adiabaticThickness},</if>
  540. <if test="isDanger != null">is_danger = #{isDanger},</if>
  541. <if test="installDate != null">install_date = #{installDate},</if>
  542. <if test="yearWarnDate != null">year_warn_date = #{yearWarnDate},</if>
  543. <if test="yearNextWarnDate != null">year_next_warn_date = #{yearNextWarnDate},</if>
  544. <if test="yearReportNo != null">year_report_no = #{yearReportNo},</if>
  545. </trim>
  546. where id = #{devId}
  547. </update>
  548. <update id="updateTSpecdevYlgdByIds" parameterType="TSpecdevYlgd">
  549. update t_specdev_ylgd
  550. <trim prefix="SET" suffixOverrides=",">
  551. <if test="remarks != null">remarks = #{remarks},</if>
  552. <if test="remarks2 != null">remarks2 = #{remarks2},</if>
  553. <if test="engineer != null">engineer = #{engineer},</if>
  554. </trim>
  555. where id in
  556. <foreach item="id" collection="ids" open="(" separator="," close=")">
  557. #{id}
  558. </foreach>
  559. </update>
  560. <update id="deleteTSpecdevYlgdById" parameterType="Long">
  561. update t_specdev_ylgd
  562. set del_flag = 2
  563. where id = #{id}
  564. </update>
  565. <update id="deleteTSpecdevYlgdByIds" parameterType="String">
  566. update t_specdev_ylgd set del_flag = 2 where id in
  567. <foreach item="id" collection="array" open="(" close=")" separator="," index="index">
  568. #{id}
  569. </foreach>
  570. </update>
  571. <update id="duplicateTSpecdevYlgd" >
  572. UPDATE T_SPECDEV_YLGD set DEL_FLAG = 2
  573. where rowid !=( select max(rowid)
  574. from T_SPECDEV_YLGD b
  575. where b.useno = T_SPECDEV_YLGD.useno and b.DEVNO = T_SPECDEV_YLGD.DEVNO and b.plant_code = T_SPECDEV_YLGD.plant_code and T_SPECDEV_YLGD.DEL_FLAG = 0 and b.DEL_FLAG = 0
  576. and T_SPECDEV_YLGD.APPROVE_STATUS = 0
  577. )
  578. </update>
  579. <select id="selectYlgdLengthList" fetchSize="1000" parameterType="TSpecdevYlgd" resultMap="TSpecdevYlgdResult">
  580. SELECT *
  581. FROM T_SPECDEV_YLGD
  582. <where>
  583. and del_flag=0
  584. and status=1
  585. and plant_code in
  586. <foreach collection="plantCodes" item="item" open="(" separator="," close=")" index="index">
  587. #{item}
  588. </foreach>
  589. </where>
  590. --${params.dataScopePlant}
  591. </select>
  592. <select id="selectTSpecdevYlgdListForPssr" parameterType="Integer" resultMap="TSpecdevYlgdResult">
  593. select d.id,
  594. d.plant_code,
  595. d.unit,
  596. d.devname,
  597. d.devno,
  598. d.submitdate,
  599. d.status,
  600. d.del_flag,
  601. d.creater_code,
  602. d.createdate,
  603. d.updater_code,
  604. d.updatedate,
  605. d.dept_id,
  606. d.remarks,
  607. d.remarks2,
  608. d.approve_status,
  609. d.regno,
  610. d.useno,
  611. d.warn_date,
  612. d.warn_cycle,
  613. d.next_warn_date,
  614. d.warn_flag,
  615. d.grade,
  616. d.designer,
  617. d.installer,
  618. d.material,
  619. d.dia,
  620. d.schedule_no,
  621. d.length,
  622. d.starting,
  623. d.ending,
  624. d.des_pressure,
  625. d.des_temp,
  626. d.opt_pressure,
  627. d.opt_temp,
  628. d.medium,
  629. d.check_conclusion,
  630. d.check_unit,
  631. d.safe_class,
  632. d.report_no,
  633. d.approve_time,
  634. d.change_time,
  635. d.plant_maint,
  636. d.engineer,
  637. d.weld_number,
  638. d.laying_method,
  639. d.adiabatic,
  640. d.anti_corrosion,
  641. d.adiabatic_thickness,
  642. d.is_danger,
  643. d.install_date,
  644. d.year_warn_date,
  645. d.year_next_warn_date,
  646. d.is_repeat
  647. from t_specdev_ylgd d
  648. <where>
  649. <if test="plantCode != null and plantCode != ''">and plant_code = #{plantCode} </if>
  650. <if test="unit != null and unit != ''">and unit like concat(concat('%', #{unit}), '%') </if>
  651. <if test="devname != null and devname != ''">and devname like concat(concat('%', #{devname}), '%')</if>
  652. <if test="devno != null and devno != ''">and devno like concat(concat('%', #{devno}), '%') </if>
  653. <if test="submitdate != null ">and submitdate = #{submitdate}</if>
  654. and DEL_FLAG = 0
  655. and STATUS = 1
  656. </where>
  657. order by d.plant_code asc
  658. </select>
  659. </mapper>