TMocMapper.xml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  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.process.mapper.TMocMapper">
  6. <resultMap type="TMoc" id="TMocResult">
  7. <result property="id" column="id" />
  8. <result property="plantCode" column="plant_code" />
  9. <result property="mocNo" column="moc_no" />
  10. <result property="plantNumber" column="plant_number" />
  11. <result property="noticeLetter" column="notice_letter" />
  12. <result property="workLetter" column="work_letter" />
  13. <result property="cteNo" column="cte_no" />
  14. <result property="investCost" column="invest_cost" />
  15. <result property="category" column="category" />
  16. <result property="significance" column="significance" />
  17. <result property="classification" column="classification" />
  18. <result property="area" column="area" />
  19. <result property="dashControl" column="dash_control" />
  20. <result property="title" column="title" />
  21. <result property="owner" column="owner" />
  22. <result property="approveTime" column="approve_time" />
  23. <result property="estimateEndtime" column="estimate_endtime" />
  24. <result property="endtime" column="endtime" />
  25. <result property="trueState" column="true_state" />
  26. <result property="changeNature" column="change_nature" />
  27. <result property="overTime" column="over_time" />
  28. <result property="riskLevel" column="risk_level" />
  29. <result property="training" column="training" />
  30. <result property="pssr" column="pssr" />
  31. <result property="ehsCheck" column="ehs_check" />
  32. <result property="ehsDb" column="ehs_db" />
  33. <result property="pidMaster" column="pid_master" />
  34. <result property="pssrDb" column="pssr_db" />
  35. <result property="capex" column="capex" />
  36. <result property="delFlag" column="del_flag" />
  37. <result property="createrCode" column="creater_code" />
  38. <result property="createdate" column="createdate" />
  39. <result property="updaterCode" column="updater_code" />
  40. <result property="updatedate" column="updatedate" />
  41. <result property="deptId" column="dept_id" />
  42. <result property="remarks" column="remarks" />
  43. <result property="temporaryState" column="temporary_state" />
  44. <result property="sopUpdate" column="sop_update" />
  45. <result property="companyMocNo" column="company_moc_no" />
  46. <result property="projectNo" column="project_no" />
  47. <result property="mocType" column="moc_type" />
  48. <result property="mcTime" column="mc_time" />
  49. <result property="mcDetail" column="mc_detail" />
  50. <result property="docUpdate" column="doc_update" />
  51. <result property="pssrNo" column="pssr_no" />
  52. <result property="deptName" column="dept_name" />
  53. <result property="timeliness" column="timeliness" />
  54. <result property="tempCategory" column="temp_category" />
  55. <result property="expTime" column="exp_time" />
  56. <result property="tempState" column="temp_state" />
  57. <result property="location" column="location" />
  58. <result property="finishDate" column="finish_date" />
  59. <result property="processUnit" column="process_unit" />
  60. <result property="department" column="department" />
  61. <result property="leakLocation" column="leak_location" />
  62. <result property="pressure" column="pressure" />
  63. <result property="temperature" column="temperature" />
  64. <result property="leakFluid" column="leak_fluid" />
  65. <result property="materialType" column="material_type" />
  66. <result property="planDate" column="plan_date" />
  67. <result property="sealDate" column="seal_date" />
  68. <result property="extention1" column="extention1" />
  69. <result property="extention2" column="extention2" />
  70. <result property="extention3" column="extention3" />
  71. <result property="extention4" column="extention4" />
  72. <result property="extention5" column="extention5" />
  73. <result property="extention6" column="extention6" />
  74. <result property="extention7" column="extention7" />
  75. <result property="extention8" column="extention8" />
  76. <result property="extention9" column="extention9" />
  77. <result property="status" column="status" />
  78. <result property="removeTime" column="remove_time" />
  79. </resultMap>
  80. <sql id="selectTMocVo">
  81. select d.id, d.plant_code, d.moc_no, d.plant_number, d.notice_letter, d.work_letter, d.cte_no, d.invest_cost, d.category, d.significance, d.classification, d.area, d.dash_control, d.title, d.owner, d.approve_time, d.estimate_endtime, d.endtime, d.true_state, d.change_nature, d.over_time, d.risk_level, d.training, d.pssr, d.ehs_check, d.ehs_db, d.pid_master, d.pssr_db, d.capex, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.temporary_state, d.sop_update, d.company_moc_no, d.project_no, d.moc_type, d.mc_time, d.mc_detail, d.doc_update, d.pssr_no, d.timeliness, d.temp_category, d.exp_time, d.temp_state, d.location, d.finish_date, d.process_unit, d.department, d.leak_location, d.pressure, d.temperature, d.leak_fluid, d.material_type, d.plan_date, d.seal_date, d.extention1, d.extention2, d.extention3, d.extention4, d.extention5, d.extention6, d.extention7, d.extention8, d.extention9, d.status, d.remove_time ,s.dept_name from t_moc d
  82. left join sys_dept s on s.dept_id = d.dept_id
  83. </sql>
  84. <select id="selectTMocList" parameterType="TMoc" resultMap="TMocResult">
  85. <include refid="selectTMocVo"/>
  86. <where>
  87. <if test="mocNo != null and mocNo != ''"> and moc_no like concat(concat('%', #{mocNo}), '%')</if>
  88. <if test="plantNumber != null and plantNumber != ''"> and plant_number like concat(concat('%', #{plantNumber}), '%')</if>
  89. <if test="noticeLetter != null and noticeLetter != ''"> and notice_letter like concat(concat('%', #{noticeLetter}), '%')</if>
  90. <if test="workLetter != null and workLetter != ''"> and work_letter like concat(concat('%', #{workLetter}), '%')</if>
  91. <if test="cteNo != null and cteNo != ''"> and cte_no like concat(concat('%', #{cteNo}), '%')</if>
  92. <if test="investCost != null and investCost != ''"> and invest_cost like concat(concat('%', #{investCost}), '%')</if>
  93. <if test="category != null and category != ''"> and category like concat(concat('%', #{category}), '%')</if>
  94. <if test="significance != null and significance != ''"> and significance like concat(concat('%', #{significance}), '%')</if>
  95. <if test="classification != null and classification != ''"> and classification like concat(concat('%', #{classification}), '%')</if>
  96. <if test="area != null and area != ''"> and area like concat(concat('%', #{area}), '%')</if>
  97. <if test="dashControl != null and dashControl != ''"> and dash_control like concat(concat('%', #{dashControl}), '%')</if>
  98. <if test="title != null and title != ''"> and title like concat(concat('%', #{title}), '%')</if>
  99. <if test="owner != null and owner != ''"> and owner like concat(concat('%', #{owner}), '%')</if>
  100. <if test="approveTime != null "> and approve_time = #{approveTime}</if>
  101. <if test="estimateEndtime != null "> and estimate_endtime = #{estimateEndtime}</if>
  102. <if test="endtime != null "> and endtime = #{endtime}</if>
  103. <if test="trueState != null and trueState != ''"> and true_state like concat(concat('%', #{trueState}), '%')</if>
  104. <if test="changeNature != null and changeNature != ''"> and change_nature like concat(concat('%', #{changeNature}), '%')</if>
  105. <if test="overTime != null "> and over_time = #{overTime}</if>
  106. <if test="riskLevel != null and riskLevel != ''"> and risk_level like concat(concat('%', #{riskLevel}), '%')</if>
  107. <if test="training != null and training != ''"> and training like concat(concat('%', #{training}), '%')</if>
  108. <if test="pssr != null and pssr != ''"> and pssr like concat(concat('%', #{pssr}), '%')</if>
  109. <if test="ehsCheck != null and ehsCheck != ''"> and ehs_check like concat(concat('%', #{ehsCheck}), '%')</if>
  110. <if test="ehsDb != null and ehsDb != ''"> and ehs_db like concat(concat('%', #{ehsDb}), '%')</if>
  111. <if test="pidMaster != null and pidMaster != ''"> and pid_master like concat(concat('%', #{pidMaster}), '%')</if>
  112. <if test="pssrDb != null and pssrDb != ''"> and pssr_db like concat(concat('%', #{pssrDb}), '%')</if>
  113. <if test="capex != null and capex != ''"> and capex like concat(concat('%', #{capex}), '%')</if>
  114. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  115. <if test="companyMocNo != null and companyMocNo != ''"> and company_moc_no like concat(concat('%', #{companyMocNo}), '%') </if>
  116. <if test="projectNo != null and projectNo != ''"> and project_no like concat(concat('%', #{projectNo}), '%') </if>
  117. <if test="mocType != null and mocType != ''"> and moc_type = #{mocType}</if>
  118. <if test="mcTime != null "> and mc_time = #{mcTime}</if>
  119. <if test="mcDetail != null and mcDetail != ''"> and mc_detail like concat(concat('%', #{mcDetail}), '%') </if>
  120. <if test="docUpdate != null and docUpdate != ''"> and doc_update = #{docUpdate}</if>
  121. <if test="pssrNo != null and pssrNo != ''"> and pssr_no like concat(concat('%', #{pssrNo}), '%') </if>
  122. <if test="timeliness != null "> and timeliness = #{timeliness}</if>
  123. <if test="tempCategory != null "> and temp_category = #{tempCategory}</if>
  124. <if test="expTime != null "> and exp_time = #{expTime}</if>
  125. <if test="tempState != null "> and temp_state = #{tempState}</if>
  126. <if test="location != null and location != ''"> and location like concat(concat('%', #{location}), '%') </if>
  127. <if test="finishDate != null "> and finish_date = #{finishDate}</if>
  128. <if test="processUnit != null and processUnit != ''"> and process_unit = #{processUnit}</if>
  129. <if test="department != null "> and department = #{department}</if>
  130. <if test="leakLocation != null and leakLocation != ''"> and leak_location like concat(concat('%', #{leakLocation}), '%') </if>
  131. <if test="pressure != null and pressure != ''"> and pressure = #{pressure}</if>
  132. <if test="temperature != null and temperature != ''"> and temperature = #{temperature}</if>
  133. <if test="leakFluid != null and leakFluid != ''"> and leak_fluid like concat(concat('%', #{leakFluid}), '%') </if>
  134. <if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
  135. <if test="planDate != null "> and plan_date = #{planDate}</if>
  136. <if test="sealDate != null "> and seal_date = #{sealDate}</if>
  137. <if test="extention1 != null "> and extention1 = #{extention1}</if>
  138. <if test="extention2 != null "> and extention2 = #{extention2}</if>
  139. <if test="extention3 != null "> and extention3 = #{extention3}</if>
  140. <if test="extention4 != null "> and extention4 = #{extention4}</if>
  141. <if test="extention5 != null "> and extention5 = #{extention5}</if>
  142. <if test="extention6 != null "> and extention6 = #{extention6}</if>
  143. <if test="extention7 != null "> and extention7 = #{extention7}</if>
  144. <if test="extention8 != null "> and extention8 = #{extention8}</if>
  145. <if test="extention9 != null "> and extention9 = #{extention9}</if>
  146. <if test="status != null and status != ''"> and status = #{status}</if>
  147. <if test="removeTime != null "> and remove_time = #{removeTime}</if>
  148. and d.del_flag = 0
  149. </where>
  150. <!-- 数据范围过滤 -->
  151. ${params.dataScope}
  152. order by d.id desc
  153. </select>
  154. <select id="selectTMocById" parameterType="Long" resultMap="TMocResult">
  155. <include refid="selectTMocVo"/>
  156. where id = #{id}
  157. </select>
  158. <insert id="insertTMoc" parameterType="TMoc">
  159. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  160. SELECT seq_t_moc.NEXTVAL as id FROM DUAL
  161. </selectKey>
  162. insert into t_moc
  163. <trim prefix="(" suffix=")" suffixOverrides=",">
  164. <if test="id != null">id,</if>
  165. <if test="plantCode != null and plantCode != ''">plant_code,</if>
  166. <if test="mocNo != null">moc_no,</if>
  167. <if test="plantNumber != null">plant_number,</if>
  168. <if test="noticeLetter != null">notice_letter,</if>
  169. <if test="workLetter != null">work_letter,</if>
  170. <if test="cteNo != null">cte_no,</if>
  171. <if test="investCost != null">invest_cost,</if>
  172. <if test="category != null">category,</if>
  173. <if test="significance != null">significance,</if>
  174. <if test="classification != null">classification,</if>
  175. <if test="area != null">area,</if>
  176. <if test="dashControl != null">dash_control,</if>
  177. <if test="title != null">title,</if>
  178. <if test="owner != null">owner,</if>
  179. <if test="approveTime != null">approve_time,</if>
  180. <if test="estimateEndtime != null">estimate_endtime,</if>
  181. <if test="endtime != null">endtime,</if>
  182. <if test="trueState != null">true_state,</if>
  183. <if test="changeNature != null">change_nature,</if>
  184. <if test="overTime != null">over_time,</if>
  185. <if test="riskLevel != null">risk_level,</if>
  186. <if test="training != null">training,</if>
  187. <if test="pssr != null">pssr,</if>
  188. <if test="ehsCheck != null">ehs_check,</if>
  189. <if test="ehsDb != null">ehs_db,</if>
  190. <if test="pidMaster != null">pid_master,</if>
  191. <if test="pssrDb != null">pssr_db,</if>
  192. <if test="capex != null">capex,</if>
  193. <if test="delFlag != null">del_flag,</if>
  194. <if test="createrCode != null">creater_code,</if>
  195. <if test="createdate != null">createdate,</if>
  196. <if test="updaterCode != null">updater_code,</if>
  197. <if test="updatedate != null">updatedate,</if>
  198. <if test="deptId != null">dept_id,</if>
  199. <if test="remarks != null">remarks,</if>
  200. <if test="temporaryState != null">temporary_state,</if>
  201. <if test="sopUpdate != null">sop_update,</if>
  202. <if test="companyMocNo != null">company_moc_no,</if>
  203. <if test="projectNo != null">project_no,</if>
  204. <if test="mocType != null">moc_type,</if>
  205. <if test="mcTime != null">mc_time,</if>
  206. <if test="mcDetail != null">mc_detail,</if>
  207. <if test="docUpdate != null">doc_update,</if>
  208. <if test="pssrNo != null">pssr_no,</if>
  209. <if test="timeliness != null">timeliness,</if>
  210. <if test="tempCategory != null">temp_category,</if>
  211. <if test="expTime != null">exp_time,</if>
  212. <if test="tempState != null">temp_state,</if>
  213. <if test="location != null">location,</if>
  214. <if test="finishDate != null">finish_date,</if>
  215. <if test="processUnit != null">process_unit,</if>
  216. <if test="department != null">department,</if>
  217. <if test="leakLocation != null">leak_location,</if>
  218. <if test="pressure != null">pressure,</if>
  219. <if test="temperature != null">temperature,</if>
  220. <if test="leakFluid != null">leak_fluid,</if>
  221. <if test="materialType != null">material_type,</if>
  222. <if test="planDate != null">plan_date,</if>
  223. <if test="sealDate != null">seal_date,</if>
  224. <if test="extention1 != null">extention1,</if>
  225. <if test="extention2 != null">extention2,</if>
  226. <if test="extention3 != null">extention3,</if>
  227. <if test="extention4 != null">extention4,</if>
  228. <if test="extention5 != null">extention5,</if>
  229. <if test="extention6 != null">extention6,</if>
  230. <if test="extention7 != null">extention7,</if>
  231. <if test="extention8 != null">extention8,</if>
  232. <if test="extention9 != null">extention9,</if>
  233. <if test="status != null">status,</if>
  234. <if test="removeTime != null">remove_time,</if>
  235. </trim>
  236. <trim prefix="values (" suffix=")" suffixOverrides=",">
  237. <if test="id != null">#{id},</if>
  238. <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
  239. <if test="mocNo != null">#{mocNo},</if>
  240. <if test="plantNumber != null">#{plantNumber},</if>
  241. <if test="noticeLetter != null">#{noticeLetter},</if>
  242. <if test="workLetter != null">#{workLetter},</if>
  243. <if test="cteNo != null">#{cteNo},</if>
  244. <if test="investCost != null">#{investCost},</if>
  245. <if test="category != null">#{category},</if>
  246. <if test="significance != null">#{significance},</if>
  247. <if test="classification != null">#{classification},</if>
  248. <if test="area != null">#{area},</if>
  249. <if test="dashControl != null">#{dashControl},</if>
  250. <if test="title != null">#{title},</if>
  251. <if test="owner != null">#{owner},</if>
  252. <if test="approveTime != null">#{approveTime},</if>
  253. <if test="estimateEndtime != null">#{estimateEndtime},</if>
  254. <if test="endtime != null">#{endtime},</if>
  255. <if test="trueState != null">#{trueState},</if>
  256. <if test="changeNature != null">#{changeNature},</if>
  257. <if test="overTime != null">#{overTime},</if>
  258. <if test="riskLevel != null">#{riskLevel},</if>
  259. <if test="training != null">#{training},</if>
  260. <if test="pssr != null">#{pssr},</if>
  261. <if test="ehsCheck != null">#{ehsCheck},</if>
  262. <if test="ehsDb != null">#{ehsDb},</if>
  263. <if test="pidMaster != null">#{pidMaster},</if>
  264. <if test="pssrDb != null">#{pssrDb},</if>
  265. <if test="capex != null">#{capex},</if>
  266. <if test="delFlag != null">#{delFlag},</if>
  267. <if test="createrCode != null">#{createrCode},</if>
  268. <if test="createdate != null">#{createdate},</if>
  269. <if test="updaterCode != null">#{updaterCode},</if>
  270. <if test="updatedate != null">#{updatedate},</if>
  271. <if test="deptId != null">#{deptId},</if>
  272. <if test="remarks != null">#{remarks},</if>
  273. <if test="temporaryState != null">#{temporaryState},</if>
  274. <if test="sopUpdate != null">#{sopUpdate},</if>
  275. <if test="companyMocNo != null">#{companyMocNo},</if>
  276. <if test="projectNo != null">#{projectNo},</if>
  277. <if test="mocType != null">#{mocType},</if>
  278. <if test="mcTime != null">#{mcTime},</if>
  279. <if test="mcDetail != null">#{mcDetail},</if>
  280. <if test="docUpdate != null">#{docUpdate},</if>
  281. <if test="pssrNo != null">#{pssrNo},</if>
  282. <if test="timeliness != null">#{timeliness},</if>
  283. <if test="tempCategory != null">#{tempCategory},</if>
  284. <if test="expTime != null">#{expTime},</if>
  285. <if test="tempState != null">#{tempState},</if>
  286. <if test="location != null">#{location},</if>
  287. <if test="finishDate != null">#{finishDate},</if>
  288. <if test="processUnit != null">#{processUnit},</if>
  289. <if test="department != null">#{department},</if>
  290. <if test="leakLocation != null">#{leakLocation},</if>
  291. <if test="pressure != null">#{pressure},</if>
  292. <if test="temperature != null">#{temperature},</if>
  293. <if test="leakFluid != null">#{leakFluid},</if>
  294. <if test="materialType != null">#{materialType},</if>
  295. <if test="planDate != null">#{planDate},</if>
  296. <if test="sealDate != null">#{sealDate},</if>
  297. <if test="extention1 != null">#{extention1},</if>
  298. <if test="extention2 != null">#{extention2},</if>
  299. <if test="extention3 != null">#{extention3},</if>
  300. <if test="extention4 != null">#{extention4},</if>
  301. <if test="extention5 != null">#{extention5},</if>
  302. <if test="extention6 != null">#{extention6},</if>
  303. <if test="extention7 != null">#{extention7},</if>
  304. <if test="extention8 != null">#{extention8},</if>
  305. <if test="extention9 != null">#{extention9},</if>
  306. <if test="status != null">#{status},</if>
  307. <if test="removeTime != null">#{removeTime},</if>
  308. </trim>
  309. </insert>
  310. <update id="updateTMoc" parameterType="TMoc">
  311. update t_moc
  312. <trim prefix="SET" suffixOverrides=",">
  313. <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
  314. <if test="mocNo != null">moc_no = #{mocNo},</if>
  315. <if test="plantNumber != null">plant_number = #{plantNumber},</if>
  316. <if test="noticeLetter != null">notice_letter = #{noticeLetter},</if>
  317. <if test="workLetter != null">work_letter = #{workLetter},</if>
  318. <if test="cteNo != null">cte_no = #{cteNo},</if>
  319. <if test="investCost != null">invest_cost = #{investCost},</if>
  320. <if test="category != null">category = #{category},</if>
  321. <if test="significance != null">significance = #{significance},</if>
  322. <if test="classification != null">classification = #{classification},</if>
  323. <if test="area != null">area = #{area},</if>
  324. <if test="dashControl != null">dash_control = #{dashControl},</if>
  325. <if test="title != null">title = #{title},</if>
  326. <if test="owner != null">owner = #{owner},</if>
  327. <if test="approveTime != null">approve_time = #{approveTime},</if>
  328. <if test="estimateEndtime != null">estimate_endtime = #{estimateEndtime},</if>
  329. <if test="endtime != null">endtime = #{endtime},</if>
  330. <if test="approveTime == null">approve_time = NULL,</if>
  331. <if test="estimateEndtime == null">estimate_endtime = NULL,</if>
  332. <if test="endtime == null">endtime = NULL,</if>
  333. <if test="trueState != null">true_state = #{trueState},</if>
  334. <if test="changeNature != null">change_nature = #{changeNature},</if>
  335. <if test="overTime != null">over_time = #{overTime},</if>
  336. <if test="overTime == null">over_time = NULL,</if>
  337. <if test="riskLevel != null">risk_level = #{riskLevel},</if>
  338. <if test="training != null">training = #{training},</if>
  339. <if test="pssr != null">pssr = #{pssr},</if>
  340. <if test="ehsCheck != null">ehs_check = #{ehsCheck},</if>
  341. <if test="ehsDb != null">ehs_db = #{ehsDb},</if>
  342. <if test="pidMaster != null">pid_master = #{pidMaster},</if>
  343. <if test="pssrDb != null">pssr_db = #{pssrDb},</if>
  344. <if test="capex != null">capex = #{capex},</if>
  345. <if test="delFlag != null">del_flag = #{delFlag},</if>
  346. <if test="createrCode != null">creater_code = #{createrCode},</if>
  347. <if test="createdate != null">createdate = #{createdate},</if>
  348. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  349. <if test="updatedate != null">updatedate = #{updatedate},</if>
  350. <if test="deptId != null">dept_id = #{deptId},</if>
  351. <if test="remarks != null">remarks = #{remarks},</if>
  352. <if test="temporaryState != null">temporary_state = #{temporaryState},</if>
  353. <if test="sopUpdate != null">sop_update = #{sopUpdate},</if>
  354. <if test="companyMocNo != null">company_moc_no = #{companyMocNo},</if>
  355. <if test="projectNo != null">project_no = #{projectNo},</if>
  356. <if test="mocType != null">moc_type = #{mocType},</if>
  357. <if test="mcTime != null">mc_time = #{mcTime},</if>
  358. <if test="mcDetail != null">mc_detail = #{mcDetail},</if>
  359. <if test="docUpdate != null">doc_update = #{docUpdate},</if>
  360. <if test="pssrNo != null">pssr_no = #{pssrNo},</if>
  361. <if test="timeliness != null">timeliness = #{timeliness},</if>
  362. <if test="tempCategory != null">temp_category = #{tempCategory},</if>
  363. <if test="expTime != null">exp_time = #{expTime},</if>
  364. <if test="tempState != null">temp_state = #{tempState},</if>
  365. <if test="location != null">location = #{location},</if>
  366. <if test="finishDate != null">finish_date = #{finishDate},</if>
  367. <if test="processUnit != null">process_unit = #{processUnit},</if>
  368. <if test="department != null">department = #{department},</if>
  369. <if test="leakLocation != null">leak_location = #{leakLocation},</if>
  370. <if test="pressure != null">pressure = #{pressure},</if>
  371. <if test="temperature != null">temperature = #{temperature},</if>
  372. <if test="leakFluid != null">leak_fluid = #{leakFluid},</if>
  373. <if test="materialType != null">material_type = #{materialType},</if>
  374. <if test="planDate != null">plan_date = #{planDate},</if>
  375. <if test="sealDate != null">seal_date = #{sealDate},</if>
  376. <if test="extention1 != null">extention1 = #{extention1},</if>
  377. <if test="extention2 != null">extention2 = #{extention2},</if>
  378. <if test="extention3 != null">extention3 = #{extention3},</if>
  379. <if test="extention4 != null">extention4 = #{extention4},</if>
  380. <if test="extention5 != null">extention5 = #{extention5},</if>
  381. <if test="extention6 != null">extention6 = #{extention6},</if>
  382. <if test="extention7 != null">extention7 = #{extention7},</if>
  383. <if test="extention8 != null">extention8 = #{extention8},</if>
  384. <if test="extention9 != null">extention9 = #{extention9},</if>
  385. <if test="status != null">status = #{status},</if>
  386. <if test="removeTime != null">remove_time = #{removeTime},</if>
  387. <if test="removeTime == null">remove_time = null,</if>
  388. </trim>
  389. where id = #{id}
  390. </update>
  391. <update id="deleteTMocById" parameterType="Long">
  392. update t_moc set del_flag = 2 where id = #{id}
  393. </update>
  394. <update id="deleteTMocByIds" parameterType="String">
  395. update t_moc set del_flag = 2 where id in
  396. <foreach item="id" collection="array" open="(" separator="," close=")">
  397. #{id}
  398. </foreach>
  399. </update>
  400. <select id="selectYearData" resultType="com.ruoyi.project.common.domain.DataEntity">
  401. SELECT count(1) as dataNum,TO_CHAR(d.APPROVE_TIME,'YYYY') as dataName FROM t_moc d
  402. <where>
  403. and d.del_flag = 0
  404. </where>
  405. <!-- 数据范围过滤 -->
  406. ${params.dataScope}
  407. GROUP BY TO_CHAR(d.APPROVE_TIME,'YYYY')
  408. order by dataName
  409. </select>
  410. <select id="selectTrueStateData" resultType="com.ruoyi.project.common.domain.DataEntity">
  411. SELECT count(1) as dataNum,d.true_state as dataName FROM t_moc d
  412. <where>
  413. and d.del_flag = 0
  414. </where>
  415. <!-- 数据范围过滤 -->
  416. ${params.dataScope}
  417. GROUP BY true_state
  418. order by dataName
  419. </select>
  420. <select id="selectChangeData" resultType="com.ruoyi.project.common.domain.DataEntity">
  421. SELECT count(1) as dataNum,d.CHANGE_NATURE as dataName FROM t_moc d
  422. <where>
  423. and d.del_flag = 0
  424. </where>
  425. <!-- 数据范围过滤 -->
  426. ${params.dataScope}
  427. GROUP BY CHANGE_NATURE
  428. order by dataName
  429. </select>
  430. <select id="selectCategoryData" resultType="com.ruoyi.project.common.domain.DataEntity">
  431. SELECT count(1) as dataNum,d.CATEGORY as dataName FROM t_moc d
  432. <where>
  433. and d.del_flag = 0
  434. </where>
  435. <!-- 数据范围过滤 -->
  436. ${params.dataScope}
  437. GROUP BY CATEGORY
  438. order by dataName
  439. </select>
  440. <select id="selectRiskData" resultType="com.ruoyi.project.common.domain.DataEntity">
  441. SELECT count(1) as dataNum,d.RISK_LEVEL as dataName FROM t_moc d
  442. <where>
  443. and d.del_flag = 0
  444. </where>
  445. <!-- 数据范围过滤 -->
  446. ${params.dataScope}
  447. GROUP BY RISK_LEVEL
  448. order by dataName
  449. </select>
  450. <select id="selectMocData"
  451. parameterType="com.ruoyi.project.process.controller.vo.MocNoVO"
  452. resultType="com.ruoyi.project.common.domain.DataEntity">
  453. SELECT count(1) as dataNum, substr(d.MOC_NO, 7, 4) as dataName FROM t_moc d
  454. <where>
  455. and d.timeliness = #{timeliness}
  456. and d.del_flag = 0
  457. </where>
  458. GROUP BY substr(d.MOC_NO, 7, 4)
  459. order by dataName
  460. </select>
  461. <select id="selectAreaData"
  462. parameterType="com.ruoyi.project.process.controller.vo.AreaVO"
  463. resultType="com.ruoyi.project.common.domain.DataEntity">
  464. SELECT count(1) as dataNum, area as dataName FROM t_moc d
  465. <where>
  466. and d.timeliness = #{timeliness}
  467. and d.del_flag = 0
  468. </where>
  469. GROUP BY area
  470. order by dataName
  471. </select>
  472. <select id="selectMcDetailData"
  473. parameterType="com.ruoyi.project.process.controller.vo.McDetailVO"
  474. resultType="com.ruoyi.project.common.domain.DataEntity">
  475. SELECT count(1) as dataNum, MC_DETAIL as dataName FROM t_moc d
  476. <where>
  477. and d.timeliness = #{timeliness}
  478. and d.del_flag = 0
  479. </where>
  480. GROUP BY MC_DETAIL
  481. order by dataName
  482. </select>
  483. <select id="selectRiskLevelData"
  484. parameterType="com.ruoyi.project.process.controller.vo.RiskLevelVO"
  485. resultType="com.ruoyi.project.common.domain.DataEntity">
  486. SELECT count(1) as dataNum, RISK_LEVEL as dataName FROM t_moc d
  487. <where>
  488. and d.timeliness = #{timeliness}
  489. and d.del_flag = 0
  490. </where>
  491. GROUP BY RISK_LEVEL
  492. order by dataName
  493. </select>
  494. <select id="selectTempStateData"
  495. parameterType="com.ruoyi.project.process.controller.vo.TempStateVO"
  496. resultType="com.ruoyi.project.common.domain.DataEntity">
  497. SELECT count(1) as dataNum, TEMP_STATE as dataName FROM t_moc d
  498. <where>
  499. and d.timeliness = #{timeliness}
  500. <if test="tempCategory != null and tempCategory != ''"> and d.temp_category = #{tempCategory} </if>
  501. and d.del_flag = 0
  502. </where>
  503. GROUP BY TEMP_STATE
  504. order by dataName
  505. </select>
  506. <select id="selectStatusData"
  507. parameterType="com.ruoyi.project.process.controller.vo.StatusVO"
  508. resultType="com.ruoyi.project.common.domain.DataEntity">
  509. SELECT count(1) as dataNum, status as dataName FROM t_moc d
  510. <where>
  511. and d.timeliness = #{timeliness}
  512. and d.temp_category = #{tempCategory}
  513. and d.del_flag = 0
  514. </where>
  515. GROUP BY status
  516. order by dataName
  517. </select>
  518. <select id="selectDepartmentData"
  519. parameterType="com.ruoyi.project.process.controller.vo.DepartmentVO"
  520. resultType="com.ruoyi.project.common.domain.DataEntity">
  521. SELECT count(1) as dataNum, DEPARTMENT as dataName FROM t_moc d
  522. <where>
  523. and d.timeliness = #{timeliness}
  524. and d.temp_category = #{tempCategory}
  525. and d.del_flag = 0
  526. </where>
  527. GROUP BY DEPARTMENT
  528. order by dataName
  529. </select>
  530. <select id="selectLeakLocationData"
  531. parameterType="com.ruoyi.project.process.controller.vo.LeakLocationVO"
  532. resultType="com.ruoyi.project.common.domain.DataEntity">
  533. SELECT count(1) as dataNum, LEAK_LOCATION as dataName FROM t_moc d
  534. <where>
  535. and d.timeliness = #{timeliness}
  536. and d.temp_category = #{tempCategory}
  537. and d.del_flag = 0
  538. </where>
  539. GROUP BY LEAK_LOCATION
  540. order by dataName
  541. </select>
  542. <select id="selectMaterialTypeData"
  543. parameterType="com.ruoyi.project.process.controller.vo.MaterialTypeVO"
  544. resultType="com.ruoyi.project.common.domain.DataEntity">
  545. SELECT count(1) as dataNum, MATERIAL_TYPE as dataName FROM t_moc d
  546. <where>
  547. and d.timeliness = #{timeliness}
  548. and d.temp_category = #{tempCategory}
  549. and d.del_flag = 0
  550. </where>
  551. GROUP BY MATERIAL_TYPE
  552. order by dataName
  553. </select>
  554. <select id="selectSealDateData"
  555. parameterType="com.ruoyi.project.process.controller.vo.SealDateVO"
  556. resultType="com.ruoyi.project.common.domain.DataEntity">
  557. SELECT count(1) as dataNum, extract(year from SEAL_DATE) as dataName FROM t_moc d
  558. <where>
  559. and d.timeliness = #{timeliness}
  560. and d.temp_category = #{tempCategory}
  561. and d.del_flag = 0
  562. </where>
  563. GROUP BY extract(year from SEAL_DATE)
  564. order by dataName
  565. </select>
  566. </mapper>