ChemicalsCatalogMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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="cn.gov.customs.wxjy.base.dao.ChemicalsCatalogMapper">
  6. <resultMap type="ChemicalsCatalog" id="ChemicalsCatalogResult">
  7. <result property="id" column="ID"/>
  8. <result property="dangerName" column="DANGER_NAME"/>
  9. <result property="enName" column="EN_NAME"/>
  10. <result property="chAlias" column="CH_ALIAS"/>
  11. <result property="enAlias" column="EN_ALIAS"/>
  12. <result property="chemicalsEq" column="CHEMICALS_EQ"/>
  13. <result property="cas" column="CAS"/>
  14. <result property="unCode" column="UN_CODE"/>
  15. <result property="dangerStatement" column="DANGER_STATEMENT"/>
  16. <result property="preventStatement" column="PREVENT_STATEMENT"/>
  17. <result property="chSignalWord" column="CH_SIGNAL_WORD"/>
  18. <result property="enSignalWord" column="EN_SIGNAL_WORD"/>
  19. <result property="signs" column="SIGNS"/>
  20. <result property="remark" column="REMARK"/>
  21. <result property="createUser" column="CREATE_USER"/>
  22. <result property="createDept" column="CREATE_DEPT"/>
  23. <result property="createTime" column="CREATE_TIME"/>
  24. <result property="updateUser" column="UPDATE_USER"/>
  25. <result property="updateTime" column="UPDATE_TIME"/>
  26. <result property="isDeleted" column="IS_DELETED"/>
  27. <result property="status" column="STATUS"/>
  28. <result property="indexNum" column="INDEX_NUM"/>
  29. </resultMap>
  30. <sql id="baseVo">
  31. select ID, DANGER_NAME, EN_NAME, CH_ALIAS, EN_ALIAS, CHEMICALS_EQ, CAS, UN_CODE, DANGER_STATEMENT, PREVENT_STATEMENT, CH_SIGNAL_WORD, EN_SIGNAL_WORD, SIGNS, REMARK, CREATE_USER, CREATE_DEPT, CREATE_TIME, UPDATE_USER, UPDATE_TIME, IS_DELETED, STATUS, INDEX_NUM
  32. from WXJY_CHEMICALS_CATALOG
  33. </sql>
  34. <select id="selectList" parameterType="ChemicalsCatalogQuery" resultMap="ChemicalsCatalogResult">
  35. <include refid="baseVo"/>
  36. <where>
  37. and IS_DELETED = 0
  38. <if test="dangerName != null and dangerName != ''">
  39. and DANGER_NAME like concat('%', #{dangerName}, '%')
  40. </if>
  41. <if test="enName != null and enName != ''">
  42. and EN_NAME like concat('%', #{enName}, '%')
  43. </if>
  44. <if test="chAlias != null and chAlias != ''">
  45. and CH_ALIAS = #{chAlias}
  46. </if>
  47. <if test="enAlias != null and enAlias != ''">
  48. and EN_ALIAS = #{enAlias}
  49. </if>
  50. <if test="chemicalsEq != null and chemicalsEq != ''">
  51. and CHEMICALS_EQ = #{chemicalsEq}
  52. </if>
  53. <if test="cas != null and cas != ''">
  54. and CAS like concat('%', #{cas}, '%')
  55. </if>
  56. <if test="unCode != null and unCode != ''">
  57. and UN_CODE = #{unCode}
  58. </if>
  59. <if test="dangerStatement != null and dangerStatement != ''">
  60. and DANGER_STATEMENT = #{dangerStatement}
  61. </if>
  62. <if test="preventStatement != null and preventStatement != ''">
  63. and PREVENT_STATEMENT = #{preventStatement}
  64. </if>
  65. <if test="chSignalWord != null and chSignalWord != ''">
  66. and CH_SIGNAL_WORD = #{chSignalWord}
  67. </if>
  68. <if test="enSignalWord != null and enSignalWord != ''">
  69. and EN_SIGNAL_WORD = #{enSignalWord}
  70. </if>
  71. <if test="signs != null and signs != ''">
  72. and SIGNS = #{signs}
  73. </if>
  74. <if test="remark != null and remark != ''">
  75. and REMARK = #{remark}
  76. </if>
  77. <if test="createUser != null and createUser != ''">
  78. and CREATE_USER = #{createUser}
  79. </if>
  80. <if test="createDept != null and createDept != ''">
  81. and CREATE_DEPT = #{createDept}
  82. </if>
  83. <if test="createTime != null and createTime != ''">
  84. and CREATE_TIME = #{createTime}
  85. </if>
  86. <if test="updateUser != null and updateUser != ''">
  87. and UPDATE_USER = #{updateUser}
  88. </if>
  89. <if test="updateTime != null ">
  90. and UPDATE_TIME &gt;= #{updateTime}
  91. </if>
  92. <if test="isDeleted != null and isDeleted != ''">
  93. and IS_DELETED = #{isDeleted}
  94. </if>
  95. <if test="status != null and status != ''">
  96. and STATUS = #{status}
  97. </if>
  98. <if test="indexNum != null and indexNum != ''">
  99. and INDEX_NUM = #{indexNum}
  100. </if>
  101. </where>
  102. order by update_time desc
  103. </select>
  104. <select id="selectByID" parameterType="String"
  105. resultMap="ChemicalsCatalogResult">
  106. <include refid="baseVo"/>
  107. where ID = #{ID}
  108. </select>
  109. <insert id="insert" parameterType="ChemicalsCatalog">
  110. insert into WXJY_CHEMICALS_CATALOG
  111. <trim prefix="(" suffix=")" suffixOverrides=",">
  112. <if test="id != null and id != ''">id,
  113. </if>
  114. <if test="dangerName != null">DANGER_NAME,
  115. </if>
  116. <if test="enName != null">EN_NAME,
  117. </if>
  118. <if test="chAlias != null">CH_ALIAS,
  119. </if>
  120. <if test="enAlias != null">EN_ALIAS,
  121. </if>
  122. <if test="chemicalsEq != null">CHEMICALS_EQ,
  123. </if>
  124. <if test="cas != null">CAS,
  125. </if>
  126. <if test="unCode != null">UN_CODE,
  127. </if>
  128. <if test="dangerStatement != null">DANGER_STATEMENT,
  129. </if>
  130. <if test="preventStatement != null">PREVENT_STATEMENT,
  131. </if>
  132. <if test="chSignalWord != null">CH_SIGNAL_WORD,
  133. </if>
  134. <if test="enSignalWord != null">EN_SIGNAL_WORD,
  135. </if>
  136. <if test="signs != null">SIGNS,
  137. </if>
  138. <if test="remark != null">REMARK,
  139. </if>
  140. <if test="createUser != null">CREATE_USER,
  141. </if>
  142. <if test="createDept != null">CREATE_DEPT,
  143. </if>
  144. <if test="createTime != null">CREATE_TIME,
  145. </if>
  146. <if test="updateUser != null">UPDATE_USER,
  147. </if>
  148. <if test="updateTime != null">UPDATE_TIME,
  149. </if>
  150. <if test="isDeleted != null">IS_DELETED,
  151. </if>
  152. <if test="status != null">STATUS,
  153. </if>
  154. <if test="indexNum != null">INDEX_NUM,
  155. </if>
  156. </trim>
  157. <trim prefix="values (" suffix=")" suffixOverrides=",">
  158. <if test="id != null and id != ''">#{id},
  159. </if>
  160. <if test="dangerName != null">#{dangerName},
  161. </if>
  162. <if test="enName != null">#{enName},
  163. </if>
  164. <if test="chAlias != null">#{chAlias},
  165. </if>
  166. <if test="enAlias != null">#{enAlias},
  167. </if>
  168. <if test="chemicalsEq != null">#{chemicalsEq},
  169. </if>
  170. <if test="cas != null">#{cas},
  171. </if>
  172. <if test="unCode != null">#{unCode},
  173. </if>
  174. <if test="dangerStatement != null">#{dangerStatement},
  175. </if>
  176. <if test="preventStatement != null">#{preventStatement},
  177. </if>
  178. <if test="chSignalWord != null">#{chSignalWord},
  179. </if>
  180. <if test="enSignalWord != null">#{enSignalWord},
  181. </if>
  182. <if test="signs != null">#{signs},
  183. </if>
  184. <if test="remark != null">#{remark},
  185. </if>
  186. <if test="createUser != null">#{createUser},
  187. </if>
  188. <if test="createDept != null">#{createDept},
  189. </if>
  190. <if test="createTime != null">#{createTime},
  191. </if>
  192. <if test="updateUser != null">#{updateUser},
  193. </if>
  194. <if test="updateTime != null">#{updateTime},
  195. </if>
  196. <if test="isDeleted != null">#{isDeleted},
  197. </if>
  198. <if test="status != null">#{status},
  199. </if>
  200. <if test="indexNum != null">#{indexNum},
  201. </if>
  202. </trim>
  203. </insert>
  204. <update id="update" parameterType="ChemicalsCatalog">
  205. update WXJY_CHEMICALS_CATALOG
  206. <trim prefix="SET" suffixOverrides=",">
  207. <if test="dangerName != null">DANGER_NAME =
  208. #{dangerName},
  209. </if>
  210. <if test="enName != null">EN_NAME =
  211. #{enName},
  212. </if>
  213. <if test="chAlias != null">CH_ALIAS =
  214. #{chAlias},
  215. </if>
  216. <if test="enAlias != null">EN_ALIAS =
  217. #{enAlias},
  218. </if>
  219. <if test="chemicalsEq != null">CHEMICALS_EQ =
  220. #{chemicalsEq},
  221. </if>
  222. <if test="cas != null">CAS =
  223. #{cas},
  224. </if>
  225. <if test="unCode != null">UN_CODE =
  226. #{unCode},
  227. </if>
  228. <if test="dangerStatement != null">DANGER_STATEMENT =
  229. #{dangerStatement},
  230. </if>
  231. <if test="preventStatement != null">PREVENT_STATEMENT =
  232. #{preventStatement},
  233. </if>
  234. <if test="chSignalWord != null">CH_SIGNAL_WORD =
  235. #{chSignalWord},
  236. </if>
  237. <if test="enSignalWord != null">EN_SIGNAL_WORD =
  238. #{enSignalWord},
  239. </if>
  240. <if test="signs != null">SIGNS =
  241. #{signs},
  242. </if>
  243. <if test="remark != null">REMARK =
  244. #{remark},
  245. </if>
  246. <if test="createUser != null">CREATE_USER =
  247. #{createUser},
  248. </if>
  249. <if test="createDept != null">CREATE_DEPT =
  250. #{createDept},
  251. </if>
  252. <if test="createTime != null">CREATE_TIME =
  253. #{createTime},
  254. </if>
  255. <if test="updateUser != null">UPDATE_USER =
  256. #{updateUser},
  257. </if>
  258. <if test="updateTime != null">UPDATE_TIME =
  259. #{updateTime},
  260. </if>
  261. <if test="isDeleted != null">IS_DELETED =
  262. #{isDeleted},
  263. </if>
  264. <if test="status != null">STATUS =
  265. #{status},
  266. </if>
  267. <if test="indexNum != null">INDEX_NUM =
  268. #{indexNum},
  269. </if>
  270. </trim>
  271. where ID = #{id}
  272. </update>
  273. <delete id="deleteByID" parameterType="String">
  274. delete
  275. from WXJY_CHEMICALS_CATALOG where ID = #{id}
  276. </delete>
  277. <delete id="deleteByIDs" parameterType="String">
  278. delete from WXJY_CHEMICALS_CATALOG where ID in
  279. <foreach item="id" collection="array" open="(" separator="," close=")">
  280. #{id}
  281. </foreach>
  282. </delete>
  283. <delete id="logicDelete" parameterType="String">
  284. update WXJY_CHEMICALS_CATALOG set is_del = 1 where ID = #{id}
  285. </delete>
  286. </mapper>