TByxWorklicenseMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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.training.mapper.TByxWorklicenseMapper">
  6. <resultMap type="TByxWorklicense" id="TByxWorklicenseResult">
  7. <result property="id" column="id" />
  8. <result property="plantCode" column="plant_code" />
  9. <result property="name" column="name" />
  10. <result property="employeeid" column="employeeid" />
  11. <result property="classes" column="classes" />
  12. <result property="post" column="post" />
  13. <result property="idtype" column="idtype" />
  14. <result property="containerIdnum" column="container_idnum" />
  15. <result property="boiler" column="boiler" />
  16. <result property="container" column="container" />
  17. <result property="pipe" column="pipe" />
  18. <result property="alkylation" column="alkylation" />
  19. <result property="aromatic" column="aromatic" />
  20. <result property="recertificatedate" column="recertificatedate" />
  21. <result property="validity" column="validity" />
  22. <result property="delFlag" column="del_flag" />
  23. <result property="createrCode" column="creater_code" />
  24. <result property="createdate" column="createdate" />
  25. <result property="updaterCode" column="updater_code" />
  26. <result property="updatedate" column="updatedate" />
  27. <result property="remarks" column="remarks" />
  28. <result property="deptId" column="dept_id" />
  29. <result property="pipeIdnum" column="pipe_idnum" />
  30. <result property="alkylationIdnum" column="alkylation_idnum" />
  31. <result property="pipeDate" column="pipe_date" />
  32. <result property="alkylationDate" column="alkylation_date" />
  33. <result property="containerDate" column="container_date" />
  34. <result property="boilerIdnum" column="boiler_idnum" />
  35. <result property="boilerDate" column="boiler_date" />
  36. <result property="deptName" column="dept_name" />
  37. </resultMap>
  38. <sql id="selectTByxWorklicenseVo">
  39. select d.id, d.plant_code, d.name, d.employeeid, d.classes, d.post, d.idtype, d.container_idnum, d.boiler, d.container, d.pipe, d.alkylation, d.aromatic, d.recertificatedate, d.validity, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id, d.pipe_idnum, d.alkylation_idnum, d.pipe_date, d.alkylation_date, d.container_date, d.boiler_idnum, d.boiler_date ,s.dept_name from t_byx_worklicense d
  40. left join sys_dept s on s.dept_id = d.dept_id
  41. </sql>
  42. <select id="selectTByxWorklicenseList" parameterType="TByxWorklicense" resultMap="TByxWorklicenseResult">
  43. <include refid="selectTByxWorklicenseVo"/>
  44. <where>
  45. <if test="plantCode != null and plantCode != ''"> and plant_code = #{plantCode}</if>
  46. <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
  47. <if test="employeeid != null and employeeid != ''"> and employeeid = #{employeeid}</if>
  48. <if test="classes != null and classes != ''"> and classes = #{classes}</if>
  49. <if test="post != null and post != ''"> and post = #{post}</if>
  50. <if test="idtype != null and idtype != ''"> and idtype = #{idtype}</if>
  51. <if test="containerIdnum != null and containerIdnum != ''"> and container_idnum = #{containerIdnum}</if>
  52. <if test="boiler != null and boiler != ''"> and boiler = #{boiler}</if>
  53. <if test="container != null and container != ''"> and container = #{container}</if>
  54. <if test="pipe != null and pipe != ''"> and pipe = #{pipe}</if>
  55. <if test="alkylation != null and alkylation != ''"> and alkylation = #{alkylation}</if>
  56. <if test="aromatic != null and aromatic != ''"> and aromatic = #{aromatic}</if>
  57. <if test="recertificatedate != null "> and recertificatedate = #{recertificatedate}</if>
  58. <if test="validity != null "> and validity = #{validity}</if>
  59. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  60. <if test="createdate != null "> and createdate = #{createdate}</if>
  61. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  62. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  63. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  64. <if test="deptId != null "> and dept_id = #{deptId}</if>
  65. <if test="pipeIdnum != null and pipeIdnum != ''"> and pipe_idnum = #{pipeIdnum}</if>
  66. <if test="alkylationIdnum != null and alkylationIdnum != ''"> and alkylation_idnum = #{alkylationIdnum}</if>
  67. <if test="pipeDate != null "> and pipe_date = #{pipeDate}</if>
  68. <if test="alkylationDate != null "> and alkylation_date = #{alkylationDate}</if>
  69. <if test="containerDate != null "> and container_date = #{containerDate}</if>
  70. <if test="boilerIdnum != null and boilerIdnum != ''"> and boiler_idnum = #{boilerIdnum}</if>
  71. <if test="boilerDate != null "> and boiler_date = #{boilerDate}</if>
  72. and d.del_flag = 0
  73. </where>
  74. <!-- 数据范围过滤 -->
  75. ${params.dataScope}
  76. order by d.id desc
  77. </select>
  78. <select id="selectList" parameterType="TByxWorklicense" resultMap="TByxWorklicenseResult">
  79. <include refid="selectTByxWorklicenseVo"/>
  80. <where>
  81. and d.del_flag = 0
  82. </where>
  83. <!-- 数据范围过滤 -->
  84. ${params.dataScope}
  85. order by d.id desc
  86. </select>
  87. <select id="selectTByxWorklicenseById" parameterType="Long" resultMap="TByxWorklicenseResult">
  88. <include refid="selectTByxWorklicenseVo"/>
  89. where id = #{id}
  90. </select>
  91. <select id="selectTByxWorklicenseByEmployeeid" parameterType="String" resultMap="TByxWorklicenseResult">
  92. <include refid="selectTByxWorklicenseVo"/>
  93. where employeeid = #{employeeid}
  94. </select>
  95. <insert id="insertTByxWorklicense" parameterType="TByxWorklicense">
  96. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  97. SELECT seq_t_byx_worklicense.NEXTVAL as id FROM DUAL
  98. </selectKey>
  99. insert into t_byx_worklicense
  100. <trim prefix="(" suffix=")" suffixOverrides=",">
  101. <if test="id != null">id,</if>
  102. <if test="plantCode != null and plantCode != ''">plant_code,</if>
  103. <if test="name != null">name,</if>
  104. <if test="employeeid != null">employeeid,</if>
  105. <if test="classes != null">classes,</if>
  106. <if test="post != null">post,</if>
  107. <if test="idtype != null">idtype,</if>
  108. <if test="containerIdnum != null">container_idnum,</if>
  109. <if test="boiler == 'false'">boiler,</if>
  110. <if test="container == 'false'">container,</if>
  111. <if test="pipe == 'false'">pipe,</if>
  112. <if test="alkylation == 'false'">alkylation,</if>
  113. <if test="aromatic != null">aromatic,</if>
  114. <if test="recertificatedate != null">recertificatedate,</if>
  115. <if test="validity != null">validity,</if>
  116. <if test="delFlag != null">del_flag,</if>
  117. <if test="createrCode != null">creater_code,</if>
  118. <if test="createdate != null">createdate,</if>
  119. <if test="updaterCode != null">updater_code,</if>
  120. <if test="updatedate != null">updatedate,</if>
  121. <if test="remarks != null">remarks,</if>
  122. <if test="deptId != null">dept_id,</if>
  123. <if test="pipeIdnum != null">pipe_idnum,</if>
  124. <if test="alkylationIdnum != null">alkylation_idnum,</if>
  125. <if test="pipeDate != null">pipe_date,</if>
  126. <if test="alkylationDate != null">alkylation_date,</if>
  127. <if test="containerDate != null">container_date,</if>
  128. <if test="boilerIdnum != null">boiler_idnum,</if>
  129. <if test="boilerDate != null">boiler_date,</if>
  130. </trim>
  131. <trim prefix="values (" suffix=")" suffixOverrides=",">
  132. <if test="id != null">#{id},</if>
  133. <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
  134. <if test="name != null">#{name},</if>
  135. <if test="employeeid != null">#{employeeid},</if>
  136. <if test="classes != null">#{classes},</if>
  137. <if test="post != null">#{post},</if>
  138. <if test="idtype != null">#{idtype},</if>
  139. <if test="containerIdnum != null">#{containerIdnum},</if>
  140. <if test="boiler == 'false'">0,</if>
  141. <if test="container == 'false'">0,</if>
  142. <if test="pipe == 'false'">0,</if>
  143. <if test="alkylation == 'false'">0,</if>
  144. <if test="boiler == 'true'">1,</if>
  145. <if test="container == 'true'">1,</if>
  146. <if test="pipe == 'true'">1,</if>
  147. <if test="alkylation == 'true'">1,</if>
  148. <if test="recertificatedate != null">#{recertificatedate},</if>
  149. <if test="validity != null">#{validity},</if>
  150. <if test="delFlag != null">#{delFlag},</if>
  151. <if test="createrCode != null">#{createrCode},</if>
  152. <if test="createdate != null">#{createdate},</if>
  153. <if test="updaterCode != null">#{updaterCode},</if>
  154. <if test="updatedate != null">#{updatedate},</if>
  155. <if test="remarks != null">#{remarks},</if>
  156. <if test="deptId != null">#{deptId},</if>
  157. <if test="pipeIdnum != null">#{pipeIdnum},</if>
  158. <if test="alkylationIdnum != null">#{alkylationIdnum},</if>
  159. <if test="pipeDate != null">#{pipeDate},</if>
  160. <if test="alkylationDate != null">#{alkylationDate},</if>
  161. <if test="containerDate != null">#{containerDate},</if>
  162. <if test="boilerIdnum != null">#{boilerIdnum},</if>
  163. <if test="boilerDate != null">#{boilerDate},</if>
  164. </trim>
  165. </insert>
  166. <update id="updateTByxWorklicense" parameterType="TByxWorklicense">
  167. update t_byx_worklicense
  168. <trim prefix="SET" suffixOverrides=",">
  169. <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
  170. <if test="name != null">name = #{name},</if>
  171. <if test="employeeid != null">employeeid = #{employeeid},</if>
  172. <if test="classes != null">classes = #{classes},</if>
  173. <if test="post != null">post = #{post},</if>
  174. <if test="idtype != null">idtype = #{idtype},</if>
  175. <if test="containerIdnum != null">container_idnum = #{containerIdnum},</if>
  176. <if test="boiler == 'false'">boiler =0,</if>
  177. <if test="container == 'false'">container =0,</if>
  178. <if test="pipe == 'false'">pipe =0,</if>
  179. <if test="alkylation == 'false'">alkylation =0,</if>
  180. <if test="boiler == 'true'">boiler =1,</if>
  181. <if test="container == 'true'">container =1,</if>
  182. <if test="pipe == 'true'">pipe =1,</if>
  183. <if test="alkylation == 'true'">alkylation =1,</if>
  184. <if test="aromatic != null">aromatic = #{aromatic},</if>
  185. <if test="recertificatedate != null">recertificatedate = #{recertificatedate},</if>
  186. <if test="validity != null">validity = #{validity},</if>
  187. <if test="delFlag != null">del_flag = #{delFlag},</if>
  188. <if test="createrCode != null">creater_code = #{createrCode},</if>
  189. <if test="createdate != null">createdate = #{createdate},</if>
  190. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  191. <if test="updatedate != null">updatedate = #{updatedate},</if>
  192. <if test="remarks != null">remarks = #{remarks},</if>
  193. <if test="deptId != null">dept_id = #{deptId},</if>
  194. <if test="pipeIdnum != null">pipe_idnum = #{pipeIdnum},</if>
  195. <if test="alkylationIdnum != null">alkylation_idnum = #{alkylationIdnum},</if>
  196. <if test="pipeDate != null">pipe_date = #{pipeDate},</if>
  197. <if test="alkylationDate != null">alkylation_date = #{alkylationDate},</if>
  198. <if test="containerDate != null">container_date = #{containerDate},</if>
  199. <if test="boilerIdnum != null">boiler_idnum = #{boilerIdnum},</if>
  200. <if test="boilerDate != null">boiler_date = #{boilerDate},</if>
  201. </trim>
  202. where id = #{id}
  203. </update>
  204. <update id="deleteTByxWorklicenseById" parameterType="Long">
  205. update t_byx_worklicense set del_flag = 2 where id = #{id}
  206. </update>
  207. <update id="deleteTByxWorklicenseByIds" parameterType="String">
  208. update t_byx_Worklicense set del_flag = 2 where id in
  209. <foreach item="id" collection="array" open="(" separator="," close=")">
  210. #{id}
  211. </foreach>
  212. </update>
  213. <select id="selectLicenseData" resultType="com.ruoyi.project.common.domain.DataEntity">
  214. SELECT count(1) as dataNum from t_byx_worklicense
  215. <where>
  216. <if test="type == 1">
  217. and boiler = 1
  218. </if>
  219. <if test="type == 2">
  220. and container = 1
  221. </if>
  222. <if test="type == 3">
  223. and pipe = 1
  224. </if>
  225. <if test="type == 4">
  226. and alkylation = 1
  227. </if>
  228. </where>
  229. </select>
  230. </mapper>