RmsCheckInfoMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.steerinfo.dil.mapper.RmsCheckInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsCheckInfo">
  5. <id column="CHECK_ID" jdbcType="DECIMAL" property="checkId" />
  6. <result column="CHECK_LUNO" jdbcType="VARCHAR" property="checkLuno" />
  7. <result column="CHECK_COUNT" jdbcType="DECIMAL" property="checkCount" />
  8. <result column="CHECK_WEIGHT" jdbcType="DECIMAL" property="checkWeight" />
  9. <result column="CHECK_SINGLE_WEIGHT" jdbcType="DECIMAL" property="checkSingleWeight" />
  10. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  11. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  12. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  13. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  14. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  15. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  16. </resultMap>
  17. <sql id="columns">
  18. CHECK_ID, CHECK_LUNO, CHECK_COUNT, CHECK_WEIGHT, CHECK_SINGLE_WEIGHT, INSERT_USERNAME,
  19. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
  20. </sql>
  21. <sql id="columns_alias">
  22. t.CHECK_ID, t.CHECK_LUNO, t.CHECK_COUNT, t.CHECK_WEIGHT, t.CHECK_SINGLE_WEIGHT, t.INSERT_USERNAME,
  23. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED
  24. </sql>
  25. <sql id="select">
  26. SELECT <include refid="columns"/> FROM RMS_CHECK_INFO
  27. </sql>
  28. <sql id="select_alias">
  29. SELECT <include refid="columns_alias"/> FROM RMS_CHECK_INFO t
  30. </sql>
  31. <sql id="where">
  32. <where>
  33. <if test="checkId != null">
  34. and CHECK_ID = #{checkId}
  35. </if>
  36. <if test="checkLuno != null and checkLuno != ''">
  37. and CHECK_LUNO = #{checkLuno}
  38. </if>
  39. <if test="checkCount != null">
  40. and CHECK_COUNT = #{checkCount}
  41. </if>
  42. <if test="checkWeight != null">
  43. and CHECK_WEIGHT = #{checkWeight}
  44. </if>
  45. <if test="checkSingleWeight != null">
  46. and CHECK_SINGLE_WEIGHT = #{checkSingleWeight}
  47. </if>
  48. <if test="insertUsername != null and insertUsername != ''">
  49. and INSERT_USERNAME = #{insertUsername}
  50. </if>
  51. <if test="insertTime != null">
  52. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  53. </if>
  54. <if test="updateUsername != null and updateUsername != ''">
  55. and UPDATE_USERNAME = #{updateUsername}
  56. </if>
  57. <if test="updateTime != null">
  58. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  59. </if>
  60. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  61. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  62. </if>
  63. <if test="deleted != null">
  64. and DELETED = #{deleted}
  65. </if>
  66. </where>
  67. </sql>
  68. <sql id="whereLike">
  69. <where>
  70. <if test="checkId != null">
  71. and CHECK_ID = #{checkId}
  72. </if>
  73. <if test="checkLuno != null and checkLuno != ''">
  74. and CHECK_LUNO LIKE '%${checkLuno}%'
  75. </if>
  76. <if test="checkCount != null">
  77. and CHECK_COUNT = #{checkCount}
  78. </if>
  79. <if test="checkWeight != null">
  80. and CHECK_WEIGHT = #{checkWeight}
  81. </if>
  82. <if test="checkSingleWeight != null">
  83. and CHECK_SINGLE_WEIGHT = #{checkSingleWeight}
  84. </if>
  85. <if test="insertUsername != null and insertUsername != ''">
  86. and INSERT_USERNAME LIKE '%${insertUsername}%'
  87. </if>
  88. <if test="insertTime != null">
  89. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  90. </if>
  91. <if test="updateUsername != null and updateUsername != ''">
  92. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  93. </if>
  94. <if test="updateTime != null">
  95. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  96. </if>
  97. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  98. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  99. </if>
  100. <if test="deleted != null">
  101. and DELETED = #{deleted}
  102. </if>
  103. </where>
  104. </sql>
  105. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  106. delete from RMS_CHECK_INFO
  107. where CHECK_ID = #{checkId,jdbcType=DECIMAL}
  108. </delete>
  109. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  110. delete from RMS_CHECK_INFO
  111. where 1!=1
  112. <if test="checkLuno != null and checkLuno != ''">
  113. or CHECK_LUNO = #{checkLuno}
  114. </if>
  115. <if test="checkCount != null">
  116. or CHECK_COUNT = #{checkCount}
  117. </if>
  118. <if test="checkWeight != null">
  119. or CHECK_WEIGHT = #{checkWeight}
  120. </if>
  121. <if test="checkSingleWeight != null">
  122. or CHECK_SINGLE_WEIGHT = #{checkSingleWeight}
  123. </if>
  124. <if test="insertUsername != null and insertUsername != ''">
  125. or INSERT_USERNAME = #{insertUsername}
  126. </if>
  127. <if test="insertTime != null">
  128. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  129. </if>
  130. <if test="updateUsername != null and updateUsername != ''">
  131. or UPDATE_USERNAME = #{updateUsername}
  132. </if>
  133. <if test="updateTime != null">
  134. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  135. </if>
  136. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  137. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  138. </if>
  139. <if test="deleted != null">
  140. or DELETED = #{deleted}
  141. </if>
  142. </delete>
  143. <insert id="insert" parameterType="com.steerinfo.dil.model.RmsCheckInfo">
  144. insert into RMS_CHECK_INFO (CHECK_ID, CHECK_LUNO, CHECK_COUNT,
  145. CHECK_WEIGHT, CHECK_SINGLE_WEIGHT, INSERT_USERNAME,
  146. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  147. INSERT_UPDATE_REMARK, DELETED)
  148. values (#{checkId,jdbcType=DECIMAL}, #{checkLuno,jdbcType=VARCHAR}, #{checkCount,jdbcType=DECIMAL},
  149. #{checkWeight,jdbcType=DECIMAL}, #{checkSingleWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR},
  150. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  151. #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL})
  152. </insert>
  153. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsCheckInfo">
  154. insert into RMS_CHECK_INFO
  155. <trim prefix="(" suffix=")" suffixOverrides=",">
  156. <if test="checkId != null">
  157. CHECK_ID,
  158. </if>
  159. <if test="checkLuno != null">
  160. CHECK_LUNO,
  161. </if>
  162. <if test="checkCount != null">
  163. CHECK_COUNT,
  164. </if>
  165. <if test="checkWeight != null">
  166. CHECK_WEIGHT,
  167. </if>
  168. <if test="checkSingleWeight != null">
  169. CHECK_SINGLE_WEIGHT,
  170. </if>
  171. <if test="insertUsername != null">
  172. INSERT_USERNAME,
  173. </if>
  174. <if test="insertTime != null">
  175. INSERT_TIME,
  176. </if>
  177. <if test="updateUsername != null">
  178. UPDATE_USERNAME,
  179. </if>
  180. <if test="updateTime != null">
  181. UPDATE_TIME,
  182. </if>
  183. <if test="insertUpdateRemark != null">
  184. INSERT_UPDATE_REMARK,
  185. </if>
  186. <if test="deleted != null">
  187. DELETED,
  188. </if>
  189. </trim>
  190. <trim prefix="values (" suffix=")" suffixOverrides=",">
  191. <if test="checkId != null">
  192. #{checkId,jdbcType=DECIMAL},
  193. </if>
  194. <if test="checkLuno != null">
  195. #{checkLuno,jdbcType=VARCHAR},
  196. </if>
  197. <if test="checkCount != null">
  198. #{checkCount,jdbcType=DECIMAL},
  199. </if>
  200. <if test="checkWeight != null">
  201. #{checkWeight,jdbcType=DECIMAL},
  202. </if>
  203. <if test="checkSingleWeight != null">
  204. #{checkSingleWeight,jdbcType=DECIMAL},
  205. </if>
  206. <if test="insertUsername != null">
  207. #{insertUsername,jdbcType=VARCHAR},
  208. </if>
  209. <if test="insertTime != null">
  210. #{insertTime,jdbcType=TIMESTAMP},
  211. </if>
  212. <if test="updateUsername != null">
  213. #{updateUsername,jdbcType=VARCHAR},
  214. </if>
  215. <if test="updateTime != null">
  216. #{updateTime,jdbcType=TIMESTAMP},
  217. </if>
  218. <if test="insertUpdateRemark != null">
  219. #{insertUpdateRemark,jdbcType=VARCHAR},
  220. </if>
  221. <if test="deleted != null">
  222. #{deleted,jdbcType=DECIMAL},
  223. </if>
  224. </trim>
  225. </insert>
  226. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsCheckInfo">
  227. update RMS_CHECK_INFO
  228. set CHECK_LUNO = #{checkLuno,jdbcType=VARCHAR},
  229. CHECK_COUNT = #{checkCount,jdbcType=DECIMAL},
  230. CHECK_WEIGHT = #{checkWeight,jdbcType=DECIMAL},
  231. CHECK_SINGLE_WEIGHT = #{checkSingleWeight,jdbcType=DECIMAL},
  232. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  233. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  234. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  235. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  236. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  237. DELETED = #{deleted,jdbcType=DECIMAL}
  238. where CHECK_ID = #{checkId,jdbcType=DECIMAL}
  239. </update>
  240. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsCheckInfo">
  241. update RMS_CHECK_INFO
  242. <set>
  243. <if test="checkLuno != null">
  244. CHECK_LUNO = #{checkLuno,jdbcType=VARCHAR},
  245. </if>
  246. <if test="checkCount != null">
  247. CHECK_COUNT = #{checkCount,jdbcType=DECIMAL},
  248. </if>
  249. <if test="checkWeight != null">
  250. CHECK_WEIGHT = #{checkWeight,jdbcType=DECIMAL},
  251. </if>
  252. <if test="checkSingleWeight != null">
  253. CHECK_SINGLE_WEIGHT = #{checkSingleWeight,jdbcType=DECIMAL},
  254. </if>
  255. <if test="insertUsername != null">
  256. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  257. </if>
  258. <if test="insertTime != null">
  259. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="updateUsername != null">
  262. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  263. </if>
  264. <if test="updateTime != null">
  265. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="insertUpdateRemark != null">
  268. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  269. </if>
  270. <if test="deleted != null">
  271. DELETED = #{deleted,jdbcType=DECIMAL},
  272. </if>
  273. </set>
  274. where CHECK_ID = #{checkId,jdbcType=DECIMAL}
  275. </update>
  276. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  277. <include refid="select"/>
  278. where CHECK_ID = #{checkId,jdbcType=DECIMAL}
  279. </select>
  280. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  281. <include refid="select"/>
  282. <include refid="where"/>
  283. </select>
  284. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  285. <include refid="select"/>
  286. <include refid="whereLike"/>
  287. </select>
  288. <insert id="batchInsert" parameterType="java.util.List">
  289. insert into RMS_CHECK_INFO
  290. (CHECK_ID,
  291. CHECK_LUNO, CHECK_COUNT, CHECK_WEIGHT,
  292. CHECK_SINGLE_WEIGHT, INSERT_USERNAME,
  293. INSERT_TIME, UPDATE_USERNAME,
  294. UPDATE_TIME, INSERT_UPDATE_REMARK,
  295. DELETED)
  296. ( <foreach collection="list" item="item" separator="union all">
  297. select
  298. #{item.checkId,jdbcType=DECIMAL},
  299. #{item.checkLuno,jdbcType=VARCHAR}, #{item.checkCount,jdbcType=DECIMAL}, #{item.checkWeight,jdbcType=DECIMAL},
  300. #{item.checkSingleWeight,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
  301. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  302. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  303. #{item.deleted,jdbcType=DECIMAL} from dual
  304. </foreach> )
  305. </insert>
  306. <update id="batchUpdate" parameterType="java.util.List">
  307. update RMS_CHECK_INFO
  308. set
  309. CHECK_ID=
  310. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  311. when #{item.checkId,jdbcType=DECIMAL} then #{item.checkId,jdbcType=DECIMAL}
  312. </foreach>
  313. ,CHECK_LUNO=
  314. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  315. when #{item.checkId,jdbcType=DECIMAL} then #{item.checkLuno,jdbcType=VARCHAR}
  316. </foreach>
  317. ,CHECK_COUNT=
  318. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  319. when #{item.checkId,jdbcType=DECIMAL} then #{item.checkCount,jdbcType=DECIMAL}
  320. </foreach>
  321. ,CHECK_WEIGHT=
  322. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  323. when #{item.checkId,jdbcType=DECIMAL} then #{item.checkWeight,jdbcType=DECIMAL}
  324. </foreach>
  325. ,CHECK_SINGLE_WEIGHT=
  326. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  327. when #{item.checkId,jdbcType=DECIMAL} then #{item.checkSingleWeight,jdbcType=DECIMAL}
  328. </foreach>
  329. ,INSERT_USERNAME=
  330. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  331. when #{item.checkId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  332. </foreach>
  333. ,INSERT_TIME=
  334. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  335. when #{item.checkId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  336. </foreach>
  337. ,UPDATE_USERNAME=
  338. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  339. when #{item.checkId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  340. </foreach>
  341. ,UPDATE_TIME=
  342. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  343. when #{item.checkId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  344. </foreach>
  345. ,INSERT_UPDATE_REMARK=
  346. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  347. when #{item.checkId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  348. </foreach>
  349. ,DELETED=
  350. <foreach collection="list" item="item" index="index" separator=" " open="case CHECK_ID" close="end">
  351. when #{item.checkId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  352. </foreach>
  353. where CHECK_ID in
  354. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  355. #{item.checkId,jdbcType=DECIMAL}
  356. </foreach>
  357. </update>
  358. <delete id="batchDelete" parameterType="java.util.List">
  359. delete from RMS_CHECK_INFO
  360. where CHECK_ID in
  361. <foreach collection="list" item="id" open="(" close=")" separator=",">
  362. #{id}
  363. </foreach>
  364. </delete>
  365. <!-- 友情提示!!!-->
  366. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  367. <select id="getMaxId" resultType="java.lang.Integer">
  368. select nvl(max(CHECK_ID),0) + 1 from RMS_CHECK_INFO
  369. </select>
  370. <select id="selectCheckLuNo" resultType="java.lang.Integer" parameterType="string">
  371. select count(rci.CHECK_ID) from RMS_CHECK_INFO RCI
  372. where rci.CHECK_LUNO = #{checkHeatNo}
  373. </select>
  374. </mapper>