TSpecdevGlMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  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.TSpecdevGlMapper">
  6. <resultMap type="TSpecdevGl" id="TSpecdevGlResult">
  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="createUnit" column="create_unit" />
  30. <result property="burnMode" column="burn_mode" />
  31. <result property="burnKind" column="burn_kind" />
  32. <result property="ratedPower" column="rated_power" />
  33. <result property="desPressure" column="des_pressure" />
  34. <result property="desTemp" column="des_temp" />
  35. <result property="optPressure" column="opt_pressure" />
  36. <result property="optTemp" column="opt_temp" />
  37. <result property="checkUnit" column="check_unit" />
  38. <result property="checkConclusion" column="check_conclusion" />
  39. <result property="model" column="model" />
  40. <result property="waterMode" column="water_mode" />
  41. <result property="reportNo" column="report_no" />
  42. <result property="approveTime" column="approve_time" />
  43. <result property="changeTime" column="change_time" />
  44. <result property="plantMaint" column="plant_maint" />
  45. <result property="outWarnDate" column="out_warn_date" />
  46. <result property="outNextWarnDate" column="out_next_warn_date" />
  47. <result property="outCheckConclusion" column="out_check_conclusion" />
  48. <result property="outReportNo" column="out_report_no" />
  49. <result property="engineer" column="engineer" />
  50. <result property="hiFlag" column="hiFlag" />
  51. <result property="isRepeat" column="is_repeat"/>
  52. </resultMap>
  53. <sql id="selectTSpecdevGlVo">
  54. select d.id, d.plant_code, d.unit, d.devname, d.devno, d.submitdate, d.status, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks,d.remarks2, d.approve_status, d.regno, d.useno, d.warn_date, d.warn_cycle, d.next_warn_date, d.warn_flag, d.create_unit, d.burn_mode, d.burn_kind, d.rated_power, d.des_pressure, d.des_temp, d.opt_pressure, d.opt_temp, d.check_unit, d.check_conclusion, d.model, d.water_mode, d.report_no, d.approve_time, d.change_time, d.plant_maint, d.out_warn_date, d.out_next_warn_date, d.out_check_conclusion, d.out_report_no, d.engineer ,s.dept_name,
  55. (SELECT COUNT(1) from T_SPECHI_GL h where h.DEV_ID = d.id and HI_TYPE = 0 ) as hiFlag
  56. ,d.is_repeat
  57. from t_specdev_gl d
  58. left join sys_dept s on s.dept_id = d.dept_id
  59. </sql>
  60. <select id="selectTSpecdevGlList" parameterType="TSpecdevGl" resultMap="TSpecdevGlResult">
  61. <include refid="selectTSpecdevGlVo"/>
  62. <where>
  63. <if test="plantCode != null and plantCode != ''"> and plant_code like concat(concat('%', #{plantCode}), '%') </if>
  64. <if test="unit != null and unit != ''"> and unit like concat(concat('%', #{unit}), '%') </if>
  65. <if test="devname != null and devname != ''"> and devname like concat(concat('%', #{devname}), '%')</if>
  66. <if test="devno != null and devno != ''"> and devno like concat(concat('%', #{devno}), '%') </if>
  67. <if test="regno != null and regno != ''"> and regno like concat(concat('%', #{regno}), '%') </if>
  68. <if test="useno != null and useno != ''"> and useno like concat(concat('%', #{useno}), '%') </if>
  69. <if test="warnDate != null "> and warn_date = #{warnDate}</if>
  70. <if test="nextWarnDate != null "> and next_warn_date = #{nextWarnDate}</if>
  71. <if test="warnFlag != null "> and warn_flag = #{warnFlag}</if>
  72. <if test="createUnit != null and createUnit != ''"> and create_unit = #{createUnit}</if>
  73. <if test="burnMode != null and burnMode != ''"> and burn_mode = #{burnMode}</if>
  74. <if test="burnKind != null and burnKind != ''"> and burn_kind = #{burnKind}</if>
  75. <if test="ratedPower != null and ratedPower != ''"> and rated_power = #{ratedPower}</if>
  76. <if test="desPressure != null and desPressure != ''"> and des_pressure = #{desPressure}</if>
  77. <if test="desTemp != null and desTemp != ''"> and des_temp = #{desTemp}</if>
  78. <if test="optPressure != null and optPressure != ''"> and opt_pressure = #{optPressure}</if>
  79. <if test="optTemp != null and optTemp != ''"> and opt_temp = #{optTemp}</if>
  80. <if test="checkUnit != null and checkUnit != ''"> and check_unit = #{checkUnit}</if>
  81. <if test="checkConclusion != null and checkConclusion != ''"> and check_conclusion = #{checkConclusion}</if>
  82. <if test="model != null and model != ''"> and model = #{model}</if>
  83. <if test="waterMode != null and waterMode != ''"> and water_mode = #{waterMode}</if>
  84. <if test="reportNo != null and reportNo != ''"> and report_no = #{reportNo}</if>
  85. <if test="approveTime != null "> and approve_time = #{approveTime}</if>
  86. <if test="changeTime != null "> and change_time = #{changeTime}</if>
  87. <if test="plantMaint != null and plantMaint != ''"> and plant_maint = #{plantMaint}</if>
  88. <if test="status != null "> and d.status = #{status}</if>
  89. <if test="approveStatus != null ">and approve_status = #{approveStatus}</if>
  90. <if test="warnFlag != null ">and warn_Flag = #{warnFlag}</if>
  91. <if test="searchValue != null and searchValue != ''">
  92. and
  93. (plant_code like concat(concat('%', #{searchValue}), '%')
  94. or unit like concat(concat('%', #{searchValue}), '%')
  95. or devname like concat(concat('%', #{searchValue}), '%')
  96. or regno like concat(concat('%', #{searchValue}), '%')
  97. or devno like concat(concat('%', #{searchValue}), '%')
  98. or useno like concat(concat('%', #{searchValue}), '%')
  99. or remarks like concat(concat('%', #{searchValue}), '%')
  100. or remarks2 like concat(concat('%', #{searchValue}), '%')
  101. or report_no like concat(concat('%', #{searchValue}), '%')
  102. or out_report_no like concat(concat('%', #{searchValue}), '%')
  103. )
  104. </if>
  105. <if test="isRepeat != null and isRepeat != ''">
  106. <if test="isRepeat == 2 ">
  107. and (d.DEVNO, d.PLANT_CODE, d.DEL_FLAG, d.APPROVE_STATUS) IN (
  108. SELECT DEVNO, PLANT_CODE, DEL_FLAG, APPROVE_STATUS
  109. FROM T_SPECDEV_GL
  110. WHERE DEL_FLAG = 0 AND APPROVE_STATUS = 0
  111. GROUP BY DEVNO, PLANT_CODE, DEL_FLAG, APPROVE_STATUS
  112. HAVING COUNT(*) > 1
  113. )
  114. </if>
  115. </if>
  116. and d.del_flag = 0
  117. </where>
  118. <!-- 数据范围过滤 -->
  119. ${params.dataScopePlant}
  120. order by d.is_repeat desc, d.plant_code, d.unit, d.id
  121. </select>
  122. <select id="selectExpiredGl" parameterType="Integer" resultMap="TSpecdevGlResult">
  123. select d.id, d.plant_code, d.unit, d.devname, d.devno, d.submitdate, d.status, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks,d.remarks2, d.approve_status, d.regno, d.useno, d.warn_date, d.warn_cycle, d.next_warn_date, d.warn_flag, d.create_unit, d.burn_mode, d.burn_kind, d.rated_power, d.des_pressure, d.des_temp, d.opt_pressure, d.opt_temp, d.check_unit, d.check_conclusion, d.model, d.water_mode, d.report_no, d.approve_time, d.change_time, d.plant_maint, d.out_warn_date, d.out_next_warn_date, d.out_check_conclusion, d.out_report_no, d.engineer
  124. from t_specdev_gl d
  125. <where>
  126. <if test="month == 0 ">and SYSDATE > NEXT_WARN_DATE</if>
  127. <if test="month == 3 ">and SYSDATE + INTERVAL '3' MONTH > NEXT_WARN_DATE and NEXT_WARN_DATE > SYSDATE </if>
  128. and DEL_FLAG = 0
  129. and STATUS = 1
  130. </where>
  131. order by d.plant_code asc
  132. </select>
  133. <select id="selectTSpecdevGlListByYear" parameterType="TSpecdevGl" resultMap="TSpecdevGlResult">
  134. <include refid="selectTSpecdevGlVo"/>
  135. <where>
  136. <if test="status != null ">and d.status = #{status}</if>
  137. <if test="hiType == 1 ">and to_char(NEXT_WARN_DATE,'yyyy') = #{checkYear}</if>
  138. <if test="hiType == 2 ">and to_char(out_next_warn_date,'yyyy') = #{checkYear}</if>
  139. <if test="plantIds != null and plantIds != ''">
  140. and
  141. d.plant_code in
  142. <foreach collection="plantIds.split(',')" item="item" index="index"
  143. open="(" close=")" separator=",">
  144. #{item}
  145. </foreach>
  146. </if>
  147. <!--<if test="unitIds != null and unitIds != ''">
  148. and
  149. (
  150. d.unit in
  151. <foreach collection="unitIds.split(',')" item="item" index="index"
  152. open="(" close=")" separator=",">
  153. #{item}
  154. </foreach>
  155. )
  156. </if>-->
  157. and d.del_flag = 0
  158. </where>
  159. </select>
  160. <select id="selectTSpecdevGlById" parameterType="Long" resultMap="TSpecdevGlResult">
  161. <include refid="selectTSpecdevGlVo"/>
  162. where id = #{id}
  163. </select>
  164. <insert id="insertTSpecdevGl" parameterType="TSpecdevGl">
  165. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  166. SELECT seq_t_specdev_ylrq.NEXTVAL as id FROM DUAL
  167. </selectKey>
  168. insert into t_specdev_gl
  169. <trim prefix="(" suffix=")" suffixOverrides=",">
  170. <if test="id != null">id,</if>
  171. <if test="plantCode != null and plantCode != ''">plant_code,</if>
  172. <if test="unit != null">unit,</if>
  173. <if test="devname != null">devname,</if>
  174. <if test="devno != null">devno,</if>
  175. <if test="submitdate != null">submitdate,</if>
  176. <if test="status != null">status,</if>
  177. <if test="delFlag != null">del_flag,</if>
  178. <if test="createrCode != null">creater_code,</if>
  179. <if test="createdate != null">createdate,</if>
  180. <if test="updaterCode != null">updater_code,</if>
  181. <if test="updatedate != null">updatedate,</if>
  182. <if test="deptId != null">dept_id,</if>
  183. <if test="remarks != null">remarks,</if>
  184. <if test="remarks2 != null">remarks2,</if>
  185. <if test="approveStatus != null">approve_status,</if>
  186. <if test="regno != null">regno,</if>
  187. <if test="useno != null">useno,</if>
  188. <if test="warnDate != null">warn_date,</if>
  189. <if test="warnCycle != null">warn_cycle,</if>
  190. <if test="nextWarnDate != null">next_warn_date,</if>
  191. <if test="warnFlag != null">warn_flag,</if>
  192. <if test="createUnit != null">create_unit,</if>
  193. <if test="burnMode != null">burn_mode,</if>
  194. <if test="burnKind != null">burn_kind,</if>
  195. <if test="ratedPower != null">rated_power,</if>
  196. <if test="desPressure != null">des_pressure,</if>
  197. <if test="desTemp != null">des_temp,</if>
  198. <if test="optPressure != null">opt_pressure,</if>
  199. <if test="optTemp != null">opt_temp,</if>
  200. <if test="checkUnit != null">check_unit,</if>
  201. <if test="checkConclusion != null">check_conclusion,</if>
  202. <if test="model != null">model,</if>
  203. <if test="waterMode != null">water_mode,</if>
  204. <if test="reportNo != null">report_no,</if>
  205. <if test="approveTime != null">approve_time,</if>
  206. <if test="changeTime != null">change_time,</if>
  207. <if test="plantMaint != null">plant_maint,</if>
  208. <if test="outWarnDate != null">out_warn_date,</if>
  209. <if test="outNextWarnDate != null">out_next_warn_date,</if>
  210. <if test="outCheckConclusion != null">out_check_conclusion,</if>
  211. <if test="outReportNo != null">out_report_no,</if>
  212. <if test="engineer != null">engineer,</if>
  213. </trim>
  214. <trim prefix="values (" suffix=")" suffixOverrides=",">
  215. <if test="id != null">#{id},</if>
  216. <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
  217. <if test="unit != null">#{unit},</if>
  218. <if test="devname != null">#{devname},</if>
  219. <if test="devno != null">#{devno},</if>
  220. <if test="submitdate != null">#{submitdate},</if>
  221. <if test="status != null">#{status},</if>
  222. <if test="delFlag != null">#{delFlag},</if>
  223. <if test="createrCode != null">#{createrCode},</if>
  224. <if test="createdate != null">#{createdate},</if>
  225. <if test="updaterCode != null">#{updaterCode},</if>
  226. <if test="updatedate != null">#{updatedate},</if>
  227. <if test="deptId != null">#{deptId},</if>
  228. <if test="remarks != null">#{remarks},</if>
  229. <if test="remarks2 != null">#{remarks2},</if>
  230. <if test="approveStatus != null">#{approveStatus},</if>
  231. <if test="regno != null">#{regno},</if>
  232. <if test="useno != null">#{useno},</if>
  233. <if test="warnDate != null">#{warnDate},</if>
  234. <if test="warnCycle != null">#{warnCycle},</if>
  235. <if test="nextWarnDate != null">#{nextWarnDate},</if>
  236. <if test="warnFlag != null">#{warnFlag},</if>
  237. <if test="createUnit != null">#{createUnit},</if>
  238. <if test="burnMode != null">#{burnMode},</if>
  239. <if test="burnKind != null">#{burnKind},</if>
  240. <if test="ratedPower != null">#{ratedPower},</if>
  241. <if test="desPressure != null">#{desPressure},</if>
  242. <if test="desTemp != null">#{desTemp},</if>
  243. <if test="optPressure != null">#{optPressure},</if>
  244. <if test="optTemp != null">#{optTemp},</if>
  245. <if test="checkUnit != null">#{checkUnit},</if>
  246. <if test="checkConclusion != null">#{checkConclusion},</if>
  247. <if test="model != null">#{model},</if>
  248. <if test="waterMode != null">#{waterMode},</if>
  249. <if test="reportNo != null">#{reportNo},</if>
  250. <if test="approveTime != null">#{approveTime},</if>
  251. <if test="changeTime != null">#{changeTime},</if>
  252. <if test="plantMaint != null">#{plantMaint},</if>
  253. <if test="outWarnDate != null">#{outWarnDate},</if>
  254. <if test="outNextWarnDate != null">#{outNextWarnDate},</if>
  255. <if test="outCheckConclusion != null">#{outCheckConclusion},</if>
  256. <if test="outReportNo != null">#{outReportNo},</if>
  257. <if test="engineer != null">#{engineer},</if>
  258. </trim>
  259. </insert>
  260. <update id="updateTSpecdevGl" parameterType="TSpecdevGl">
  261. update t_specdev_gl
  262. <trim prefix="SET" suffixOverrides=",">
  263. <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
  264. <if test="unit != null">unit = #{unit},</if>
  265. <if test="devname != null">devname = #{devname},</if>
  266. <if test="devno != null">devno = #{devno},</if>
  267. <if test="submitdate != null">submitdate = #{submitdate},</if>
  268. <if test="status != null">status = #{status},</if>
  269. <if test="delFlag != null">del_flag = #{delFlag},</if>
  270. <if test="createrCode != null">creater_code = #{createrCode},</if>
  271. <if test="createdate != null">createdate = #{createdate},</if>
  272. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  273. <if test="updatedate != null">updatedate = #{updatedate},</if>
  274. <if test="deptId != null">dept_id = #{deptId},</if>
  275. <if test="remarks != null">remarks = #{remarks},</if>
  276. <if test="remarks2 != null">remarks2 = #{remarks2},</if>
  277. <if test="approveStatus != null">approve_status = #{approveStatus},</if>
  278. <if test="regno != null">regno = #{regno},</if>
  279. <if test="useno != null">useno = #{useno},</if>
  280. <if test="warnDate != null">warn_date = #{warnDate},</if>
  281. <if test="warnCycle != null">warn_cycle = #{warnCycle},</if>
  282. <if test="nextWarnDate != null">next_warn_date = #{nextWarnDate},</if>
  283. <if test="warnFlag != null">warn_flag = #{warnFlag},</if>
  284. <if test="createUnit != null">create_unit = #{createUnit},</if>
  285. <if test="burnMode != null">burn_mode = #{burnMode},</if>
  286. <if test="burnKind != null">burn_kind = #{burnKind},</if>
  287. <if test="ratedPower != null">rated_power = #{ratedPower},</if>
  288. <if test="desPressure != null">des_pressure = #{desPressure},</if>
  289. <if test="desTemp != null">des_temp = #{desTemp},</if>
  290. <if test="optPressure != null">opt_pressure = #{optPressure},</if>
  291. <if test="optTemp != null">opt_temp = #{optTemp},</if>
  292. <if test="checkUnit != null">check_unit = #{checkUnit},</if>
  293. <if test="checkConclusion != null">check_conclusion = #{checkConclusion},</if>
  294. <if test="model != null">model = #{model},</if>
  295. <if test="waterMode != null">water_mode = #{waterMode},</if>
  296. <if test="reportNo != null">report_no = #{reportNo},</if>
  297. <if test="approveTime != null">approve_time = #{approveTime},</if>
  298. <if test="changeTime != null">change_time = #{changeTime},</if>
  299. <if test="plantMaint != null">plant_maint = #{plantMaint},</if>
  300. <if test="outWarnDate != null">out_warn_date = #{outWarnDate},</if>
  301. <if test="outNextWarnDate != null">out_next_warn_date = #{outNextWarnDate},</if>
  302. <if test="outCheckConclusion != null">out_check_conclusion = #{outCheckConclusion},</if>
  303. <if test="outReportNo != null">out_report_no = #{outReportNo},</if>
  304. <if test="engineer != null">engineer = #{engineer},</if>
  305. <if test="isRepeat != null">is_repeat = #{isRepeat},</if>
  306. </trim>
  307. where id = #{id}
  308. </update>
  309. <update id="updateTSpecdevGlByHi" parameterType="TSpechiGl">
  310. update t_specdev_gl
  311. <trim prefix="SET" suffixOverrides=",">
  312. <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
  313. <if test="unit != null">unit = #{unit},</if>
  314. <if test="devname != null">devname = #{devname},</if>
  315. <if test="devno != null">devno = #{devno},</if>
  316. <if test="submitdate != null">submitdate = #{submitdate},</if>
  317. <if test="status != null">status = #{status},</if>
  318. <if test="delFlag != null">del_flag = #{delFlag},</if>
  319. <if test="createrCode != null">creater_code = #{createrCode},</if>
  320. <if test="createdate != null">createdate = #{createdate},</if>
  321. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  322. <if test="updatedate != null">updatedate = #{updatedate},</if>
  323. <if test="deptId != null">dept_id = #{deptId},</if>
  324. <if test="remarks != null">remarks = #{remarks},</if>
  325. <if test="remarks2 != null">remarks2 = #{remarks2},</if>
  326. <if test="approveStatus != null">approve_status = #{approveStatus},</if>
  327. <if test="regno != null">regno = #{regno},</if>
  328. <if test="useno != null">useno = #{useno},</if>
  329. <if test="warnDate != null">warn_date = #{warnDate},</if>
  330. <if test="warnCycle != null">warn_cycle = #{warnCycle},</if>
  331. <if test="nextWarnDate != null">next_warn_date = #{nextWarnDate},</if>
  332. <if test="warnFlag != null">warn_flag = #{warnFlag},</if>
  333. <if test="createUnit != null">create_unit = #{createUnit},</if>
  334. <if test="burnMode != null">burn_mode = #{burnMode},</if>
  335. <if test="burnKind != null">burn_kind = #{burnKind},</if>
  336. <if test="ratedPower != null">rated_power = #{ratedPower},</if>
  337. <if test="desPressure != null">des_pressure = #{desPressure},</if>
  338. <if test="desTemp != null">des_temp = #{desTemp},</if>
  339. <if test="optPressure != null">opt_pressure = #{optPressure},</if>
  340. <if test="optTemp != null">opt_temp = #{optTemp},</if>
  341. <if test="checkUnit != null">check_unit = #{checkUnit},</if>
  342. <if test="checkConclusion != null">check_conclusion = #{checkConclusion},</if>
  343. <if test="model != null">model = #{model},</if>
  344. <if test="waterMode != null">water_mode = #{waterMode},</if>
  345. <if test="reportNo != null">report_no = #{reportNo},</if>
  346. <if test="approveTime != null">approve_time = #{approveTime},</if>
  347. <if test="changeTime != null">change_time = #{changeTime},</if>
  348. <if test="plantMaint != null">plant_maint = #{plantMaint},</if>
  349. <if test="outWarnDate != null">out_warn_date = #{outWarnDate},</if>
  350. <if test="outNextWarnDate != null">out_next_warn_date = #{outNextWarnDate},</if>
  351. <if test="outCheckConclusion != null">out_check_conclusion = #{outCheckConclusion},</if>
  352. <if test="outReportNo != null">out_report_no = #{outReportNo},</if>
  353. <if test="engineer != null">engineer = #{engineer},</if>
  354. </trim>
  355. where id = #{devId}
  356. </update>
  357. <update id="deleteTSpecdevGlById" parameterType="Long">
  358. update t_specdev_gl set del_flag = 2 where id = #{id}
  359. </update>
  360. <update id="deleteTSpecdevGlByIds" parameterType="String">
  361. update t_specdev_gl set del_flag = 2 where id in
  362. <foreach item="id" collection="array" open="(" separator="," close=")">
  363. #{id}
  364. </foreach>
  365. </update>
  366. <update id="duplicateTSpecdevGl" >
  367. UPDATE T_SPECDEV_GL set DEL_FLAG = 2
  368. where rowid !=( select max(rowid)
  369. from T_SPECDEV_GL b
  370. where b.DEVNO = T_SPECDEV_GL.DEVNO and b.plant_code = T_SPECDEV_GL.plant_code and T_SPECDEV_GL.DEL_FLAG = 0 and b.DEL_FLAG = 0
  371. and T_SPECDEV_GL.APPROVE_STATUS = 0
  372. )
  373. </update>
  374. </mapper>