RmsStackingMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  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.RmsStackingMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsStacking">
  5. <id column="STACKING_ID" jdbcType="DECIMAL" property="stackingId" />
  6. <result column="STACKING_NO" jdbcType="VARCHAR" property="stackingNo" />
  7. <result column="STACKING_SEQUENCE" jdbcType="DECIMAL" property="stackingSequence" />
  8. <result column="STACKING_REMARKS" jdbcType="VARCHAR" property="stackingRemarks" />
  9. <result column="STACKING_TYPE" jdbcType="DECIMAL" property="stackingType" />
  10. <result column="STACKING_MATERIAL_NUMBER" jdbcType="DECIMAL" property="stackingMaterialNumber" />
  11. <result column="STACKING_REMAIN_NUMBER" jdbcType="DECIMAL" property="stackingRemainNumber" />
  12. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  13. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  14. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  15. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  16. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  17. <result column="STACKING_ARRIVAL" jdbcType="DECIMAL" property="stackingArrival" />
  18. <result column="STACKING_MAX_LAYERS" jdbcType="DECIMAL" property="stackingMaxLayers" />
  19. <result column="STACKING_STATUS" jdbcType="DECIMAL" property="stackingStatus" />
  20. </resultMap>
  21. <sql id="columns">
  22. STACKING_ID, STACKING_NO, STACKING_SEQUENCE, STACKING_REMARKS, STACKING_TYPE, STACKING_MATERIAL_NUMBER,
  23. STACKING_REMAIN_NUMBER, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  24. INSERT_UPDATE_REMARK, STACKING_ARRIVAL, STACKING_MAX_LAYERS, STACKING_STATUS
  25. </sql>
  26. <sql id="columns_alias">
  27. t.STACKING_ID, t.STACKING_NO, t.STACKING_SEQUENCE, t.STACKING_REMARKS, t.STACKING_TYPE,
  28. t.STACKING_MATERIAL_NUMBER, t.STACKING_REMAIN_NUMBER, t.INSERT_USERNAME, t.INSERT_TIME,
  29. t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.STACKING_ARRIVAL, t.STACKING_MAX_LAYERS,
  30. t.STACKING_STATUS
  31. </sql>
  32. <sql id="select">
  33. SELECT <include refid="columns" /> FROM RMS_STACKING
  34. </sql>
  35. <sql id="select_alias">
  36. SELECT <include refid="columns_alias" /> FROM RMS_STACKING t
  37. </sql>
  38. <sql id="where">
  39. <where>
  40. <if test="stackingId != null">
  41. and STACKING_ID = #{stackingId}
  42. </if>
  43. <if test="stackingNo != null and stackingNo != ''">
  44. and STACKING_NO = #{stackingNo}
  45. </if>
  46. <if test="stackingSequence != null">
  47. and STACKING_SEQUENCE = #{stackingSequence}
  48. </if>
  49. <if test="stackingRemarks != null and stackingRemarks != ''">
  50. and STACKING_REMARKS = #{stackingRemarks}
  51. </if>
  52. <if test="stackingType != null">
  53. and STACKING_TYPE = #{stackingType}
  54. </if>
  55. <if test="stackingMaterialNumber != null">
  56. and STACKING_MATERIAL_NUMBER = #{stackingMaterialNumber}
  57. </if>
  58. <if test="stackingRemainNumber != null">
  59. and STACKING_REMAIN_NUMBER = #{stackingRemainNumber}
  60. </if>
  61. <if test="insertUsername != null and insertUsername != ''">
  62. and INSERT_USERNAME = #{insertUsername}
  63. </if>
  64. <if test="insertTime != null">
  65. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  66. </if>
  67. <if test="updateUsername != null and updateUsername != ''">
  68. and UPDATE_USERNAME = #{updateUsername}
  69. </if>
  70. <if test="updateTime != null">
  71. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  72. </if>
  73. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  74. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  75. </if>
  76. <if test="stackingArrival != null">
  77. and STACKING_ARRIVAL = #{stackingArrival}
  78. </if>
  79. <if test="stackingMaxLayers != null">
  80. and STACKING_MAX_LAYERS = #{stackingMaxLayers}
  81. </if>
  82. <if test="stackingStatus != null">
  83. and STACKING_STATUS = #{stackingStatus}
  84. </if>
  85. </where>
  86. </sql>
  87. <sql id="whereLike">
  88. <where>
  89. <if test="stackingId != null">
  90. and STACKING_ID = #{stackingId}
  91. </if>
  92. <if test="stackingNo != null and stackingNo != ''">
  93. and STACKING_NO LIKE '%${stackingNo}%'
  94. </if>
  95. <if test="stackingSequence != null">
  96. and STACKING_SEQUENCE = #{stackingSequence}
  97. </if>
  98. <if test="stackingRemarks != null and stackingRemarks != ''">
  99. and STACKING_REMARKS LIKE '%${stackingRemarks}%'
  100. </if>
  101. <if test="stackingType != null">
  102. and STACKING_TYPE = #{stackingType}
  103. </if>
  104. <if test="stackingMaterialNumber != null">
  105. and STACKING_MATERIAL_NUMBER = #{stackingMaterialNumber}
  106. </if>
  107. <if test="stackingRemainNumber != null">
  108. and STACKING_REMAIN_NUMBER = #{stackingRemainNumber}
  109. </if>
  110. <if test="insertUsername != null and insertUsername != ''">
  111. and INSERT_USERNAME LIKE '%${insertUsername}%'
  112. </if>
  113. <if test="insertTime != null">
  114. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  115. </if>
  116. <if test="updateUsername != null and updateUsername != ''">
  117. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  118. </if>
  119. <if test="updateTime != null">
  120. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  121. </if>
  122. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  123. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  124. </if>
  125. <if test="stackingArrival != null">
  126. and STACKING_ARRIVAL = #{stackingArrival}
  127. </if>
  128. <if test="stackingMaxLayers != null">
  129. and STACKING_MAX_LAYERS = #{stackingMaxLayers}
  130. </if>
  131. <if test="stackingStatus != null">
  132. and STACKING_STATUS = #{stackingStatus}
  133. </if>
  134. </where>
  135. </sql>
  136. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  137. delete from RMS_STACKING
  138. where STACKING_ID = #{stackingId,jdbcType=DECIMAL}
  139. </delete>
  140. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  141. delete from RMS_STACKING
  142. where 1!=1
  143. <if test="stackingNo != null and stackingNo != ''">
  144. or STACKING_NO = #{stackingNo}
  145. </if>
  146. <if test="stackingSequence != null">
  147. or STACKING_SEQUENCE = #{stackingSequence}
  148. </if>
  149. <if test="stackingRemarks != null and stackingRemarks != ''">
  150. or STACKING_REMARKS = #{stackingRemarks}
  151. </if>
  152. <if test="stackingType != null">
  153. or STACKING_TYPE = #{stackingType}
  154. </if>
  155. <if test="stackingMaterialNumber != null">
  156. or STACKING_MATERIAL_NUMBER = #{stackingMaterialNumber}
  157. </if>
  158. <if test="stackingRemainNumber != null">
  159. or STACKING_REMAIN_NUMBER = #{stackingRemainNumber}
  160. </if>
  161. <if test="insertUsername != null and insertUsername != ''">
  162. or INSERT_USERNAME = #{insertUsername}
  163. </if>
  164. <if test="insertTime != null">
  165. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  166. </if>
  167. <if test="updateUsername != null and updateUsername != ''">
  168. or UPDATE_USERNAME = #{updateUsername}
  169. </if>
  170. <if test="updateTime != null">
  171. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  172. </if>
  173. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  174. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  175. </if>
  176. <if test="stackingArrival != null">
  177. or STACKING_ARRIVAL = #{stackingArrival}
  178. </if>
  179. <if test="stackingMaxLayers != null">
  180. or STACKING_MAX_LAYERS = #{stackingMaxLayers}
  181. </if>
  182. <if test="stackingStatus != null">
  183. or STACKING_STATUS = #{stackingStatus}
  184. </if>
  185. </delete>
  186. <insert id="insert" parameterType="com.steerinfo.dil.model.RmsStacking">
  187. insert into RMS_STACKING (STACKING_ID, STACKING_NO, STACKING_SEQUENCE,
  188. STACKING_REMARKS, STACKING_TYPE, STACKING_MATERIAL_NUMBER,
  189. STACKING_REMAIN_NUMBER, INSERT_USERNAME, INSERT_TIME,
  190. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  191. STACKING_ARRIVAL, STACKING_MAX_LAYERS, STACKING_STATUS
  192. )
  193. values (#{stackingId,jdbcType=DECIMAL}, #{stackingNo,jdbcType=VARCHAR}, #{stackingSequence,jdbcType=DECIMAL},
  194. #{stackingRemarks,jdbcType=VARCHAR}, #{stackingType,jdbcType=DECIMAL}, #{stackingMaterialNumber,jdbcType=DECIMAL},
  195. #{stackingRemainNumber,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  196. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  197. #{stackingArrival,jdbcType=DECIMAL}, #{stackingMaxLayers,jdbcType=DECIMAL}, #{stackingStatus,jdbcType=DECIMAL}
  198. )
  199. </insert>
  200. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsStacking">
  201. insert into RMS_STACKING
  202. <trim prefix="(" suffix=")" suffixOverrides=",">
  203. <if test="stackingId != null">
  204. STACKING_ID,
  205. </if>
  206. <if test="stackingNo != null">
  207. STACKING_NO,
  208. </if>
  209. <if test="stackingSequence != null">
  210. STACKING_SEQUENCE,
  211. </if>
  212. <if test="stackingRemarks != null">
  213. STACKING_REMARKS,
  214. </if>
  215. <if test="stackingType != null">
  216. STACKING_TYPE,
  217. </if>
  218. <if test="stackingMaterialNumber != null">
  219. STACKING_MATERIAL_NUMBER,
  220. </if>
  221. <if test="stackingRemainNumber != null">
  222. STACKING_REMAIN_NUMBER,
  223. </if>
  224. <if test="insertUsername != null">
  225. INSERT_USERNAME,
  226. </if>
  227. <if test="insertTime != null">
  228. INSERT_TIME,
  229. </if>
  230. <if test="updateUsername != null">
  231. UPDATE_USERNAME,
  232. </if>
  233. <if test="updateTime != null">
  234. UPDATE_TIME,
  235. </if>
  236. <if test="insertUpdateRemark != null">
  237. INSERT_UPDATE_REMARK,
  238. </if>
  239. <if test="stackingArrival != null">
  240. STACKING_ARRIVAL,
  241. </if>
  242. <if test="stackingMaxLayers != null">
  243. STACKING_MAX_LAYERS,
  244. </if>
  245. <if test="stackingStatus != null">
  246. STACKING_STATUS,
  247. </if>
  248. </trim>
  249. <trim prefix="values (" suffix=")" suffixOverrides=",">
  250. <if test="stackingId != null">
  251. #{stackingId,jdbcType=DECIMAL},
  252. </if>
  253. <if test="stackingNo != null">
  254. #{stackingNo,jdbcType=VARCHAR},
  255. </if>
  256. <if test="stackingSequence != null">
  257. #{stackingSequence,jdbcType=DECIMAL},
  258. </if>
  259. <if test="stackingRemarks != null">
  260. #{stackingRemarks,jdbcType=VARCHAR},
  261. </if>
  262. <if test="stackingType != null">
  263. #{stackingType,jdbcType=DECIMAL},
  264. </if>
  265. <if test="stackingMaterialNumber != null">
  266. #{stackingMaterialNumber,jdbcType=DECIMAL},
  267. </if>
  268. <if test="stackingRemainNumber != null">
  269. #{stackingRemainNumber,jdbcType=DECIMAL},
  270. </if>
  271. <if test="insertUsername != null">
  272. #{insertUsername,jdbcType=VARCHAR},
  273. </if>
  274. <if test="insertTime != null">
  275. #{insertTime,jdbcType=TIMESTAMP},
  276. </if>
  277. <if test="updateUsername != null">
  278. #{updateUsername,jdbcType=VARCHAR},
  279. </if>
  280. <if test="updateTime != null">
  281. #{updateTime,jdbcType=TIMESTAMP},
  282. </if>
  283. <if test="insertUpdateRemark != null">
  284. #{insertUpdateRemark,jdbcType=VARCHAR},
  285. </if>
  286. <if test="stackingArrival != null">
  287. #{stackingArrival,jdbcType=DECIMAL},
  288. </if>
  289. <if test="stackingMaxLayers != null">
  290. #{stackingMaxLayers,jdbcType=DECIMAL},
  291. </if>
  292. <if test="stackingStatus != null">
  293. #{stackingStatus,jdbcType=DECIMAL},
  294. </if>
  295. </trim>
  296. </insert>
  297. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsStacking">
  298. update RMS_STACKING
  299. set STACKING_NO = #{stackingNo,jdbcType=VARCHAR},
  300. STACKING_SEQUENCE = #{stackingSequence,jdbcType=DECIMAL},
  301. STACKING_REMARKS = #{stackingRemarks,jdbcType=VARCHAR},
  302. STACKING_TYPE = #{stackingType,jdbcType=DECIMAL},
  303. STACKING_MATERIAL_NUMBER = #{stackingMaterialNumber,jdbcType=DECIMAL},
  304. STACKING_REMAIN_NUMBER = #{stackingRemainNumber,jdbcType=DECIMAL},
  305. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  306. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  307. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  308. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  309. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  310. STACKING_ARRIVAL = #{stackingArrival,jdbcType=DECIMAL},
  311. STACKING_MAX_LAYERS = #{stackingMaxLayers,jdbcType=DECIMAL},
  312. STACKING_STATUS = #{stackingStatus,jdbcType=DECIMAL}
  313. where STACKING_ID = #{stackingId,jdbcType=DECIMAL}
  314. </update>
  315. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsStacking">
  316. update RMS_STACKING
  317. <set>
  318. <if test="stackingNo != null">
  319. STACKING_NO = #{stackingNo,jdbcType=VARCHAR},
  320. </if>
  321. <if test="stackingSequence != null">
  322. STACKING_SEQUENCE = #{stackingSequence,jdbcType=DECIMAL},
  323. </if>
  324. <if test="stackingRemarks != null">
  325. STACKING_REMARKS = #{stackingRemarks,jdbcType=VARCHAR},
  326. </if>
  327. <if test="stackingType != null">
  328. STACKING_TYPE = #{stackingType,jdbcType=DECIMAL},
  329. </if>
  330. <if test="stackingMaterialNumber != null">
  331. STACKING_MATERIAL_NUMBER = #{stackingMaterialNumber,jdbcType=DECIMAL},
  332. </if>
  333. <if test="stackingRemainNumber != null">
  334. STACKING_REMAIN_NUMBER = #{stackingRemainNumber,jdbcType=DECIMAL},
  335. </if>
  336. <if test="insertUsername != null">
  337. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  338. </if>
  339. <if test="insertTime != null">
  340. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  341. </if>
  342. <if test="updateUsername != null">
  343. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  344. </if>
  345. <if test="updateTime != null">
  346. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  347. </if>
  348. <if test="insertUpdateRemark != null">
  349. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  350. </if>
  351. <if test="stackingArrival != null">
  352. STACKING_ARRIVAL = #{stackingArrival,jdbcType=DECIMAL},
  353. </if>
  354. <if test="stackingMaxLayers != null">
  355. STACKING_MAX_LAYERS = #{stackingMaxLayers,jdbcType=DECIMAL},
  356. </if>
  357. <if test="stackingStatus != null">
  358. STACKING_STATUS = #{stackingStatus,jdbcType=DECIMAL},
  359. </if>
  360. </set>
  361. where STACKING_ID = #{stackingId,jdbcType=DECIMAL}
  362. </update>
  363. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  364. <include refid="select" />
  365. where STACKING_ID = #{stackingId,jdbcType=DECIMAL}
  366. </select>
  367. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  368. <include refid="select" />
  369. <include refid="where" />
  370. </select>
  371. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  372. <include refid="select" />
  373. <include refid="whereLike" />
  374. </select>
  375. <insert id="batchInsert" parameterType="java.util.List">
  376. insert into RMS_STACKING
  377. (STACKING_ID,
  378. STACKING_NO, STACKING_SEQUENCE,
  379. STACKING_REMARKS, STACKING_TYPE,
  380. STACKING_MATERIAL_NUMBER, STACKING_REMAIN_NUMBER,
  381. INSERT_USERNAME, INSERT_TIME,
  382. UPDATE_USERNAME, UPDATE_TIME,
  383. INSERT_UPDATE_REMARK, STACKING_ARRIVAL,
  384. STACKING_MAX_LAYERS, STACKING_STATUS
  385. )
  386. ( <foreach collection="list" item="item" separator="union all">
  387. select
  388. #{item.stackingId,jdbcType=DECIMAL},
  389. #{item.stackingNo,jdbcType=VARCHAR}, #{item.stackingSequence,jdbcType=DECIMAL},
  390. #{item.stackingRemarks,jdbcType=VARCHAR}, #{item.stackingType,jdbcType=DECIMAL},
  391. #{item.stackingMaterialNumber,jdbcType=DECIMAL}, #{item.stackingRemainNumber,jdbcType=DECIMAL},
  392. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  393. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  394. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.stackingArrival,jdbcType=DECIMAL},
  395. #{item.stackingMaxLayers,jdbcType=DECIMAL}, #{item.stackingStatus,jdbcType=DECIMAL}
  396. from dual
  397. </foreach> )
  398. </insert>
  399. <update id="batchUpdate" parameterType="java.util.List">
  400. update RMS_STACKING
  401. set
  402. STACKING_ID=
  403. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  404. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingId,jdbcType=DECIMAL}
  405. </foreach>
  406. ,STACKING_NO=
  407. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  408. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingNo,jdbcType=VARCHAR}
  409. </foreach>
  410. ,STACKING_SEQUENCE=
  411. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  412. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingSequence,jdbcType=DECIMAL}
  413. </foreach>
  414. ,STACKING_REMARKS=
  415. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  416. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingRemarks,jdbcType=VARCHAR}
  417. </foreach>
  418. ,STACKING_TYPE=
  419. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  420. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingType,jdbcType=DECIMAL}
  421. </foreach>
  422. ,STACKING_MATERIAL_NUMBER=
  423. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  424. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingMaterialNumber,jdbcType=DECIMAL}
  425. </foreach>
  426. ,STACKING_REMAIN_NUMBER=
  427. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  428. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingRemainNumber,jdbcType=DECIMAL}
  429. </foreach>
  430. ,INSERT_USERNAME=
  431. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  432. when #{item.stackingId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  433. </foreach>
  434. ,INSERT_TIME=
  435. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  436. when #{item.stackingId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  437. </foreach>
  438. ,UPDATE_USERNAME=
  439. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  440. when #{item.stackingId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  441. </foreach>
  442. ,UPDATE_TIME=
  443. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  444. when #{item.stackingId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  445. </foreach>
  446. ,INSERT_UPDATE_REMARK=
  447. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  448. when #{item.stackingId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  449. </foreach>
  450. ,STACKING_ARRIVAL=
  451. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  452. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingArrival,jdbcType=DECIMAL}
  453. </foreach>
  454. ,STACKING_MAX_LAYERS=
  455. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  456. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingMaxLayers,jdbcType=DECIMAL}
  457. </foreach>
  458. ,STACKING_STATUS=
  459. <foreach close="end" collection="list" index="index" item="item" open="case STACKING_ID" separator=" ">
  460. when #{item.stackingId,jdbcType=DECIMAL} then #{item.stackingStatus,jdbcType=DECIMAL}
  461. </foreach>
  462. where STACKING_ID in
  463. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  464. #{item.stackingId,jdbcType=DECIMAL}
  465. </foreach>
  466. </update>
  467. <delete id="batchDelete" parameterType="java.util.List">
  468. delete from RMS_STACKING
  469. where STACKING_ID in
  470. <foreach close=")" collection="list" item="id" open="(" separator=",">
  471. #{id}
  472. </foreach>
  473. </delete>
  474. <!-- 友情提示!!!-->
  475. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  476. <!-- 根据垛位查询垛位存放物资件数和剩余数量 -->
  477. <select id="selectStacking" resultType="java.util.Map">
  478. select sum(wgm.gm_number) "materialNumber",
  479. (select max(rpg.grid_gradation_number) * 24
  480. from rms_pwarehouse_grid rpg
  481. join rms_stacking rs
  482. on rs.stacking_id = rpg.stacking_id) -
  483. sum(wgm.gm_number) "remainNumber"
  484. from rms_pwarehouse_grid rpg
  485. join wmsp_grid_material wgm
  486. on wgm.grid_id = rpg.grid_id
  487. join rms_stacking rs
  488. on rs.stacking_id = rpg.stacking_id
  489. where rs.stacking_id = rpg.stacking_id
  490. group by rpg.stacking_id
  491. </select>
  492. <!--根据垛位查询已堆放的物资剩余数量 -->
  493. <select id="selectMaterialNumber" resultType="java.lang.Integer">
  494. select rs.stacking_material_number
  495. from rms_stacking rs
  496. where rs.stacking_id = #{stackingId}
  497. </select>
  498. <!--根据垛位id查询垛位-->
  499. <select id="selectStackNo" resultType="java.lang.String">
  500. select rs.stacking_no
  501. from rms_stacking rs
  502. where rs.stacking_id = #{stackingId}
  503. </select>
  504. <!--更新垛位剩余数量和垛位存放物资数量-->
  505. <update id="updateRmsStacking">
  506. update rms_stacking
  507. set stacking_material_number = #{materialNumber},
  508. stacking_remain_number = #{remainNumber}
  509. </update>
  510. <!--更新垛位 -->
  511. <update id="updateStack">
  512. update
  513. rms_stacking rs
  514. set (rs.stacking_material_number, rs.stacking_remain_number)=
  515. (select rs.stacking_material_number + 1,
  516. rs.stacking_remain_number - 1
  517. from rms_stacking rs
  518. where rs.stacking_id = #{stackId})
  519. where rs.stacking_id = #{stackId}
  520. </update>
  521. <select id="getStackingMessage" parameterType="DECIMAL" resultType="java.util.Map">
  522. SELECT DISTINCT RS.STACKING_ID AS "stackingId",
  523. RS.STACKING_NO AS "stackingNo",
  524. RS.STACKING_SEQUENCE AS "stackingSequence",
  525. RS.STACKING_REMAIN_NUMBER AS "stackingRemainNumber",
  526. RS.STACKING_MATERIAL_NUMBER AS "stackingMaterialNumber"
  527. FROM RMS_PWAREHOUSE_GRID RPG
  528. LEFT JOIN RMS_STACKING RS
  529. ON RS.STACKING_ID = RPG.STACKING_ID
  530. WHERE RPG.WAREHOUSE_ID = #{warehouseId}
  531. AND RS.STACKING_SEQUENCE IS NOT NULL
  532. ORDER BY RS.STACKING_SEQUENCE ASC
  533. </select>
  534. <update id="updateNumber">
  535. update rms_stacking
  536. set stacking_Material_Number = #{stackingMaterialNumber},
  537. stacking_remain_number = #{stackingRemainNumber}
  538. where STACKING_ID=#{stackingId}
  539. </update>
  540. </mapper>