TSpechiCcMapper.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  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.his.mapper.TSpechiCcMapper">
  6. <resultMap type="TSpechiCc" id="TSpechiCcResult">
  7. <result property="id" column="id"/>
  8. <result property="plantCode" column="plant_code"/>
  9. <result property="unit" column="unit"/>
  10. <result property="carNo" column="car_no"/>
  11. <result property="devname" column="devname"/>
  12. <result property="devno" column="devno"/>
  13. <result property="submitdate" column="submitdate"/>
  14. <result property="status" column="status"/>
  15. <result property="delFlag" column="del_flag"/>
  16. <result property="createrCode" column="creater_code"/>
  17. <result property="createdate" column="createdate"/>
  18. <result property="updaterCode" column="updater_code"/>
  19. <result property="updatedate" column="updatedate"/>
  20. <result property="deptId" column="dept_id"/>
  21. <result property="remarks" column="remarks"/>
  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="checkStrategy" column="check_strategy"/>
  31. <result property="firstWarnDate" column="first_warn_date"/>
  32. <result property="checkUnit" column="check_unit"/>
  33. <result property="docno" column="docno"/>
  34. <result property="approveTime" column="approve_time"/>
  35. <result property="changeTime" column="change_time"/>
  36. <result property="engineNo" column="engine_no"/>
  37. <result property="color" column="color"/>
  38. <result property="capacity" column="capacity"/>
  39. <result property="model" column="model"/>
  40. <result property="engineType" column="engine_type"/>
  41. <result property="devClass" column="dev_class"/>
  42. <result property="exUnit" column="ex_unit"/>
  43. <result property="useDept" column="use_dept"/>
  44. <result property="engineer" column="engineer"/>
  45. <result property="exGrade" column="ex_grade"/>
  46. <result property="reportNo" column="report_no"/>
  47. <result property="frameNo" column="frame_no"/>
  48. <result property="productNo" column="product_no"/>
  49. <result property="assetOwner" column="asset_owner"/>
  50. <result property="devId" column="dev_id"/>
  51. <result property="hiType" column="hi_type"/>
  52. <result property="deptName" column="dept_name"/>
  53. <result property="plantMaint" column="plant_maint"/>
  54. <result property="operName" column="oper_name"/>
  55. <result property="operTime" column="oper_time"/>
  56. <result property="operType" column="oper_type"/>
  57. <result property="deptName" column="dept_name"/>
  58. </resultMap>
  59. <sql id="selectTSpechiCcVo">
  60. select d.id,
  61. d.plant_code,
  62. d.oper_name,
  63. d.oper_time,
  64. d.oper_type,
  65. d.unit,
  66. d.plant_maint,
  67. d.car_no,
  68. d.devname,
  69. d.devno,
  70. d.submitdate,
  71. d.status,
  72. d.del_flag,
  73. d.creater_code,
  74. d.createdate,
  75. d.updater_code,
  76. d.updatedate,
  77. d.dept_id,
  78. d.remarks,
  79. d.approve_status,
  80. d.regno,
  81. d.useno,
  82. d.warn_date,
  83. d.warn_cycle,
  84. d.next_warn_date,
  85. d.warn_flag,
  86. d.create_unit,
  87. d.check_strategy,
  88. d.first_warn_date,
  89. d.check_unit,
  90. d.docno,
  91. d.approve_time,
  92. d.change_time,
  93. d.engine_no,
  94. d.color,
  95. d.capacity,
  96. d.model,
  97. d.engine_type,
  98. d.dev_class,
  99. d.ex_unit,
  100. d.use_dept,
  101. d.engineer,
  102. d.ex_grade,
  103. d.report_no,
  104. d.frame_no,
  105. d.product_no,
  106. d.asset_owner,
  107. d.dev_id,
  108. d.hi_type,
  109. s.dept_name
  110. from t_spechi_cc d
  111. left join sys_dept s on s.dept_id = d.dept_id
  112. </sql>
  113. <select id="selectTSpechiCcList" parameterType="TSpechiCc" resultMap="TSpechiCcResult">
  114. <include refid="selectTSpechiCcVo"/>
  115. <where>
  116. <if test="operName != null and operName != ''"> and oper_name like concat(concat('%', #{operName}), '%')</if>
  117. <if test="operTime != null "> and to_CHAR(oper_time,'YYYY-MM-DD') = to_CHAR(#{operTime} , 'YYYY-MM-DD')</if>
  118. <if test="operType != null and operType != ''"> and oper_type like concat(concat('%', #{operType}), '%')</if>
  119. and d.del_flag = 0
  120. and d.hi_type = 2
  121. </where>
  122. order by d.oper_time desc
  123. </select>
  124. <select id="selectTSpechiCcById" parameterType="Long" resultMap="TSpechiCcResult">
  125. <include refid="selectTSpechiCcVo"/>
  126. where d.dev_id = #{id}
  127. and d.hi_type = 1
  128. and d.del_flag = 0
  129. </select>
  130. <select id="selectTSpechiCcByReform" parameterType="Long" resultMap="TSpechiCcResult">
  131. <include refid="selectTSpechiCcVo"/>
  132. where d.dev_id = #{devId}
  133. and d.hi_type = 0
  134. and d.del_flag = 0
  135. </select>
  136. <insert id="insertTSpechiCc" parameterType="TSpechiCc">
  137. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  138. SELECT seq_t_spechi_cc.NEXTVAL as id FROM DUAL
  139. </selectKey>
  140. insert into t_spechi_cc
  141. <trim prefix="(" suffix=")" suffixOverrides=",">
  142. <if test="id != null">id,</if>
  143. <if test="plantCode != null and plantCode != ''">plant_code,</if>
  144. <if test="unit != null">unit,</if>
  145. <if test="carNo != null">car_no,</if>
  146. <if test="devname != null">devname,</if>
  147. <if test="devno != null">devno,</if>
  148. <if test="submitdate != null">submitdate,</if>
  149. <if test="status != null">status,</if>
  150. <if test="createrCode != null">creater_code,</if>
  151. <if test="createdate != null">createdate,</if>
  152. <if test="updaterCode != null">updater_code,</if>
  153. <if test="updatedate != null">updatedate,</if>
  154. <if test="deptId != null">dept_id,</if>
  155. <if test="remarks != null">remarks,</if>
  156. <if test="approveStatus != null">approve_status,</if>
  157. <if test="regno != null">regno,</if>
  158. <if test="useno != null">useno,</if>
  159. <if test="warnDate != null">warn_date,</if>
  160. <if test="warnCycle != null">warn_cycle,</if>
  161. <if test="nextWarnDate != null">next_warn_date,</if>
  162. <if test="warnFlag != null">warn_flag,</if>
  163. <if test="createUnit != null">create_unit,</if>
  164. <if test="checkStrategy != null">check_strategy,</if>
  165. <if test="firstWarnDate != null">first_warn_date,</if>
  166. <if test="checkUnit != null">check_unit,</if>
  167. <if test="docno != null">docno,</if>
  168. <if test="approveTime != null">approve_time,</if>
  169. <if test="changeTime != null">change_time,</if>
  170. <if test="engineNo != null">engine_no,</if>
  171. <if test="color != null">color,</if>
  172. <if test="capacity != null">capacity,</if>
  173. <if test="model != null">model,</if>
  174. <if test="engineType != null">engine_type,</if>
  175. <if test="devClass != null">dev_class,</if>
  176. <if test="exUnit != null">ex_unit,</if>
  177. <if test="useDept != null">use_dept,</if>
  178. <if test="engineer != null">engineer,</if>
  179. <if test="exGrade != null">ex_grade,</if>
  180. <if test="reportNo != null">report_no,</if>
  181. <if test="frameNo != null">frame_no,</if>
  182. <if test="productNo != null">product_no,</if>
  183. <if test="assetOwner != null">asset_owner,</if>
  184. <if test="devId != null">dev_id,</if>
  185. <if test="hiType != null">hi_type,</if>
  186. <if test="plantMaint != null">plant_maint,</if>
  187. </trim>
  188. <trim prefix="values (" suffix=")" suffixOverrides=",">
  189. <if test="id != null">#{id},</if>
  190. <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
  191. <if test="unit != null">#{unit},</if>
  192. <if test="carNo != null">#{carNo},</if>
  193. <if test="devname != null">#{devname},</if>
  194. <if test="devno != null">#{devno},</if>
  195. <if test="submitdate != null">#{submitdate},</if>
  196. <if test="status != null">#{status},</if>
  197. <if test="createrCode != null">#{createrCode},</if>
  198. <if test="createdate != null">#{createdate},</if>
  199. <if test="updaterCode != null">#{updaterCode},</if>
  200. <if test="updatedate != null">#{updatedate},</if>
  201. <if test="deptId != null">#{deptId},</if>
  202. <if test="remarks != null">#{remarks},</if>
  203. <if test="approveStatus != null">#{approveStatus},</if>
  204. <if test="regno != null">#{regno},</if>
  205. <if test="useno != null">#{useno},</if>
  206. <if test="warnDate != null">#{warnDate},</if>
  207. <if test="warnCycle != null">#{warnCycle},</if>
  208. <if test="nextWarnDate != null">#{nextWarnDate},</if>
  209. <if test="warnFlag != null">#{warnFlag},</if>
  210. <if test="createUnit != null">#{createUnit},</if>
  211. <if test="checkStrategy != null">#{checkStrategy},</if>
  212. <if test="firstWarnDate != null">#{firstWarnDate},</if>
  213. <if test="checkUnit != null">#{checkUnit},</if>
  214. <if test="docno != null">#{docno},</if>
  215. <if test="approveTime != null">#{approveTime},</if>
  216. <if test="changeTime != null">#{changeTime},</if>
  217. <if test="engineNo != null">#{engineNo},</if>
  218. <if test="color != null">#{color},</if>
  219. <if test="capacity != null">#{capacity},</if>
  220. <if test="model != null">#{model},</if>
  221. <if test="engineType != null">#{engineType},</if>
  222. <if test="devClass != null">#{devClass},</if>
  223. <if test="exUnit != null">#{exUnit},</if>
  224. <if test="useDept != null">#{useDept},</if>
  225. <if test="engineer != null">#{engineer},</if>
  226. <if test="exGrade != null">#{exGrade},</if>
  227. <if test="reportNo != null">#{reportNo},</if>
  228. <if test="frameNo != null">#{frameNo},</if>
  229. <if test="productNo != null">#{productNo},</if>
  230. <if test="assetOwner != null">#{assetOwner},</if>
  231. <if test="devId != null">#{devId},</if>
  232. <if test="hiType != null">#{hiType},</if>
  233. <if test="plantMaint != null">#{plantMaint},</if>
  234. </trim>
  235. </insert>
  236. <insert id="insertTSpechiCcByDev" parameterType="com.ruoyi.project.sems.domain.TSpecdevCc">
  237. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  238. SELECT seq_t_spechi_cc.NEXTVAL as id FROM DUAL
  239. </selectKey>
  240. insert into t_spechi_cc
  241. <trim prefix="(" suffix=")" suffixOverrides=",">
  242. <if test="id != null">id,</if>
  243. <if test="plantCode != null and plantCode != ''">plant_code,</if>
  244. <if test="unit != null">unit,</if>
  245. <if test="carNo != null">car_no,</if>
  246. <if test="devname != null">devname,</if>
  247. <if test="devno != null">devno,</if>
  248. <if test="submitdate != null">submitdate,</if>
  249. <if test="status != null">status,</if>
  250. <if test="createrCode != null">creater_code,</if>
  251. <if test="createdate != null">createdate,</if>
  252. <if test="updaterCode != null">updater_code,</if>
  253. <if test="updatedate != null">updatedate,</if>
  254. <if test="deptId != null">dept_id,</if>
  255. <if test="remarks != null">remarks,</if>
  256. <if test="approveStatus != null">approve_status,</if>
  257. <if test="regno != null">regno,</if>
  258. <if test="useno != null">useno,</if>
  259. <if test="warnDate != null">warn_date,</if>
  260. <if test="warnCycle != null">warn_cycle,</if>
  261. <if test="nextWarnDate != null">next_warn_date,</if>
  262. <if test="warnFlag != null">warn_flag,</if>
  263. <if test="createUnit != null">create_unit,</if>
  264. <if test="checkStrategy != null">check_strategy,</if>
  265. <if test="firstWarnDate != null">first_warn_date,</if>
  266. <if test="checkUnit != null">check_unit,</if>
  267. <if test="docno != null">docno,</if>
  268. <if test="approveTime != null">approve_time,</if>
  269. <if test="changeTime != null">change_time,</if>
  270. <if test="engineNo != null">engine_no,</if>
  271. <if test="color != null">color,</if>
  272. <if test="capacity != null">capacity,</if>
  273. <if test="model != null">model,</if>
  274. <if test="engineType != null">engine_type,</if>
  275. <if test="devClass != null">dev_class,</if>
  276. <if test="exUnit != null">ex_unit,</if>
  277. <if test="useDept != null">use_dept,</if>
  278. <if test="engineer != null">engineer,</if>
  279. <if test="exGrade != null">ex_grade,</if>
  280. <if test="reportNo != null">report_no,</if>
  281. <if test="frameNo != null">frame_no,</if>
  282. <if test="productNo != null">product_no,</if>
  283. <if test="assetOwner != null">asset_owner,</if>
  284. <if test="devId != null">dev_id,</if>
  285. <if test="hiType != null">hi_type,</if>
  286. <if test="plantMaint != null">plant_maint,</if>
  287. <if test="createBy != null">oper_name,</if>
  288. <if test="createTime != null">oper_time,</if>
  289. <if test="remark != null">oper_type,</if>
  290. </trim>
  291. <trim prefix="values (" suffix=")" suffixOverrides=",">
  292. <if test="id != null">#{id},</if>
  293. <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
  294. <if test="unit != null">#{unit},</if>
  295. <if test="carNo != null">#{carNo},</if>
  296. <if test="devname != null">#{devname},</if>
  297. <if test="devno != null">#{devno},</if>
  298. <if test="submitdate != null">#{submitdate},</if>
  299. <if test="status != null">#{status},</if>
  300. <if test="createrCode != null">#{createrCode},</if>
  301. <if test="createdate != null">#{createdate},</if>
  302. <if test="updaterCode != null">#{updaterCode},</if>
  303. <if test="updatedate != null">#{updatedate},</if>
  304. <if test="deptId != null">#{deptId},</if>
  305. <if test="remarks != null">#{remarks},</if>
  306. <if test="approveStatus != null">#{approveStatus},</if>
  307. <if test="regno != null">#{regno},</if>
  308. <if test="useno != null">#{useno},</if>
  309. <if test="warnDate != null">#{warnDate},</if>
  310. <if test="warnCycle != null">#{warnCycle},</if>
  311. <if test="nextWarnDate != null">#{nextWarnDate},</if>
  312. <if test="warnFlag != null">#{warnFlag},</if>
  313. <if test="createUnit != null">#{createUnit},</if>
  314. <if test="checkStrategy != null">#{checkStrategy},</if>
  315. <if test="firstWarnDate != null">#{firstWarnDate},</if>
  316. <if test="checkUnit != null">#{checkUnit},</if>
  317. <if test="docno != null">#{docno},</if>
  318. <if test="approveTime != null">#{approveTime},</if>
  319. <if test="changeTime != null">#{changeTime},</if>
  320. <if test="engineNo != null">#{engineNo},</if>
  321. <if test="color != null">#{color},</if>
  322. <if test="capacity != null">#{capacity},</if>
  323. <if test="model != null">#{model},</if>
  324. <if test="engineType != null">#{engineType},</if>
  325. <if test="devClass != null">#{devClass},</if>
  326. <if test="exUnit != null">#{exUnit},</if>
  327. <if test="useDept != null">#{useDept},</if>
  328. <if test="engineer != null">#{engineer},</if>
  329. <if test="exGrade != null">#{exGrade},</if>
  330. <if test="reportNo != null">#{reportNo},</if>
  331. <if test="frameNo != null">#{frameNo},</if>
  332. <if test="productNo != null">#{productNo},</if>
  333. <if test="assetOwner != null">#{assetOwner},</if>
  334. <if test="devId != null">#{devId},</if>
  335. <if test="hiType != null">#{hiType},</if>
  336. <if test="plantMaint != null">#{plantMaint},</if>
  337. <if test="createBy != null">#{createBy},</if>
  338. <if test="createTime != null">#{createTime},</if>
  339. <if test="remark != null">#{remark},</if>
  340. </trim>
  341. </insert>
  342. <update id="updateTSpechiCc" parameterType="TSpechiCc">
  343. update t_spechi_cc
  344. <trim prefix="SET" suffixOverrides=",">
  345. <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
  346. <if test="unit != null">unit = #{unit},</if>
  347. <if test="carNo != null">car_no = #{carNo},</if>
  348. <if test="devname != null">devname = #{devname},</if>
  349. <if test="devno != null">devno = #{devno},</if>
  350. <if test="submitdate != null">submitdate = #{submitdate},</if>
  351. <if test="status != null">status = #{status},</if>
  352. <if test="delFlag != null">del_flag = #{delFlag},</if>
  353. <if test="createrCode != null">creater_code = #{createrCode},</if>
  354. <if test="createdate != null">createdate = #{createdate},</if>
  355. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  356. <if test="updatedate != null">updatedate = #{updatedate},</if>
  357. <if test="deptId != null">dept_id = #{deptId},</if>
  358. <if test="remarks != null">remarks = #{remarks},</if>
  359. <if test="approveStatus != null">approve_status = #{approveStatus},</if>
  360. <if test="regno != null">regno = #{regno},</if>
  361. <if test="useno != null">useno = #{useno},</if>
  362. <if test="warnDate != null">warn_date = #{warnDate},</if>
  363. <if test="warnCycle != null">warn_cycle = #{warnCycle},</if>
  364. <if test="nextWarnDate != null">next_warn_date = #{nextWarnDate},</if>
  365. <if test="warnFlag != null">warn_flag = #{warnFlag},</if>
  366. <if test="createUnit != null">create_unit = #{createUnit},</if>
  367. <if test="checkStrategy != null">check_strategy = #{checkStrategy},</if>
  368. <if test="firstWarnDate != null">first_warn_date = #{firstWarnDate},</if>
  369. <if test="checkUnit != null">check_unit = #{checkUnit},</if>
  370. <if test="docno != null">docno = #{docno},</if>
  371. <if test="approveTime != null">approve_time = #{approveTime},</if>
  372. <if test="changeTime != null">change_time = #{changeTime},</if>
  373. <if test="engineNo != null">engine_no = #{engineNo},</if>
  374. <if test="color != null">color = #{color},</if>
  375. <if test="capacity != null">capacity = #{capacity},</if>
  376. <if test="model != null">model = #{model},</if>
  377. <if test="engineType != null">engine_type = #{engineType},</if>
  378. <if test="devClass != null">dev_class = #{devClass},</if>
  379. <if test="exUnit != null">ex_unit = #{exUnit},</if>
  380. <if test="useDept != null">use_dept = #{useDept},</if>
  381. <if test="engineer != null">engineer = #{engineer},</if>
  382. <if test="exGrade != null">ex_grade = #{exGrade},</if>
  383. <if test="reportNo != null">report_no = #{reportNo},</if>
  384. <if test="frameNo != null">frame_no = #{frameNo},</if>
  385. <if test="productNo != null">product_no = #{productNo},</if>
  386. <if test="assetOwner != null">asset_owner = #{assetOwner},</if>
  387. <if test="devId != null">dev_id = #{devId},</if>
  388. <if test="hiType != null">hi_type = #{hiType},</if>
  389. <if test="plantMaint != null">plant_maint = #{plantMaint},</if>
  390. </trim>
  391. where id = #{id}
  392. </update>
  393. <update id="deleteTSpechiCcById" parameterType="Long">
  394. update t_spechi_cc
  395. set del_flag = 2
  396. where id = #{id}
  397. </update>
  398. <update id="deleteTSpechiCcByIds" parameterType="String">
  399. update t_spechi_cc set del_flag = 2 where id in
  400. <foreach item="id" collection="array" open="(" separator="," close=")">
  401. #{id}
  402. </foreach>
  403. </update>
  404. <update id="deleteTSpechiCcByDevId" parameterType="Long">
  405. update t_spechi_cc
  406. set del_flag = 2
  407. where dev_id = #{devId}
  408. and hi_type = 1
  409. </update>
  410. </mapper>