WmsOffSiteLibraryInboundMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  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.WmsOffSiteLibraryInboundMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.WmsOffSiteLibraryInbound">
  5. <id column="INBOUND_ID" jdbcType="DECIMAL" property="inboundId" />
  6. <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
  7. <result column="INBOUND_NO" jdbcType="VARCHAR" property="inboundNo" />
  8. <result column="INBOUND_SCAN_TAG" jdbcType="VARCHAR" property="inboundScanTag" />
  9. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  10. <result column="INBOUND_MATERIAL_WEIGHT" jdbcType="DECIMAL" property="inboundMaterialWeight" />
  11. <result column="INBOUND_MATERIAL_NUMBER" jdbcType="DECIMAL" property="inboundMaterialNumber" />
  12. <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId" />
  13. <result column="INBOUND_TIME" jdbcType="TIMESTAMP" property="inboundTime" />
  14. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  15. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  16. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  17. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  18. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  19. </resultMap>
  20. <sql id="columns">
  21. INBOUND_ID, WAREHOUSE_ID, INBOUND_NO, INBOUND_SCAN_TAG, MATERIAL_ID, INBOUND_MATERIAL_WEIGHT,
  22. INBOUND_MATERIAL_NUMBER, LOADER_ID, INBOUND_TIME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  23. UPDATE_TIME, INSERT_UPDATE_REMARK
  24. </sql>
  25. <sql id="columns_alias">
  26. t.INBOUND_ID, t.WAREHOUSE_ID, t.INBOUND_NO, t.INBOUND_SCAN_TAG, t.MATERIAL_ID, t.INBOUND_MATERIAL_WEIGHT,
  27. t.INBOUND_MATERIAL_NUMBER, t.LOADER_ID, t.INBOUND_TIME, t.INSERT_USERNAME, t.INSERT_TIME,
  28. t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
  29. </sql>
  30. <sql id="select">
  31. SELECT <include refid="columns"/> FROM WMS_OFF_SITE_LIBRARY_INBOUND
  32. </sql>
  33. <sql id="select_alias">
  34. SELECT <include refid="columns_alias"/> FROM WMS_OFF_SITE_LIBRARY_INBOUND t
  35. </sql>
  36. <sql id="where">
  37. <where>
  38. <if test="inboundId != null">
  39. and INBOUND_ID = #{inboundId}
  40. </if>
  41. <if test="warehouseId != null">
  42. and WAREHOUSE_ID = #{warehouseId}
  43. </if>
  44. <if test="inboundNo != null and inboundNo != ''">
  45. and INBOUND_NO = #{inboundNo}
  46. </if>
  47. <if test="inboundScanTag != null and inboundScanTag != ''">
  48. and INBOUND_SCAN_TAG = #{inboundScanTag}
  49. </if>
  50. <if test="materialId != null">
  51. and MATERIAL_ID = #{materialId}
  52. </if>
  53. <if test="inboundMaterialWeight != null">
  54. and INBOUND_MATERIAL_WEIGHT = #{inboundMaterialWeight}
  55. </if>
  56. <if test="inboundMaterialNumber != null">
  57. and INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber}
  58. </if>
  59. <if test="loaderId != null">
  60. and LOADER_ID = #{loaderId}
  61. </if>
  62. <if test="inboundTime != null">
  63. and TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = #{inboundTime}
  64. </if>
  65. <if test="insertUsername != null and insertUsername != ''">
  66. and INSERT_USERNAME = #{insertUsername}
  67. </if>
  68. <if test="insertTime != null">
  69. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  70. </if>
  71. <if test="updateUsername != null and updateUsername != ''">
  72. and UPDATE_USERNAME = #{updateUsername}
  73. </if>
  74. <if test="updateTime != null">
  75. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  76. </if>
  77. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  78. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  79. </if>
  80. </where>
  81. </sql>
  82. <sql id="whereLike">
  83. <where>
  84. <if test="inboundId != null">
  85. and INBOUND_ID = #{inboundId}
  86. </if>
  87. <if test="warehouseId != null">
  88. and WAREHOUSE_ID = #{warehouseId}
  89. </if>
  90. <if test="inboundNo != null and inboundNo != ''">
  91. and INBOUND_NO LIKE '%${inboundNo}%'
  92. </if>
  93. <if test="inboundScanTag != null and inboundScanTag != ''">
  94. and INBOUND_SCAN_TAG LIKE '%${inboundScanTag}%'
  95. </if>
  96. <if test="materialId != null">
  97. and MATERIAL_ID = #{materialId}
  98. </if>
  99. <if test="inboundMaterialWeight != null">
  100. and INBOUND_MATERIAL_WEIGHT = #{inboundMaterialWeight}
  101. </if>
  102. <if test="inboundMaterialNumber != null">
  103. and INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber}
  104. </if>
  105. <if test="loaderId != null">
  106. and LOADER_ID = #{loaderId}
  107. </if>
  108. <if test="inboundTime != null">
  109. and TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = #{inboundTime}
  110. </if>
  111. <if test="insertUsername != null and insertUsername != ''">
  112. and INSERT_USERNAME LIKE '%${insertUsername}%'
  113. </if>
  114. <if test="insertTime != null">
  115. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  116. </if>
  117. <if test="updateUsername != null and updateUsername != ''">
  118. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  119. </if>
  120. <if test="updateTime != null">
  121. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  122. </if>
  123. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  124. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  125. </if>
  126. </where>
  127. </sql>
  128. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  129. delete from WMS_OFF_SITE_LIBRARY_INBOUND
  130. where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
  131. </delete>
  132. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  133. delete from WMS_OFF_SITE_LIBRARY_INBOUND
  134. where 1!=1
  135. <if test="warehouseId != null">
  136. or WAREHOUSE_ID = #{warehouseId}
  137. </if>
  138. <if test="inboundNo != null and inboundNo != ''">
  139. or INBOUND_NO = #{inboundNo}
  140. </if>
  141. <if test="inboundScanTag != null and inboundScanTag != ''">
  142. or INBOUND_SCAN_TAG = #{inboundScanTag}
  143. </if>
  144. <if test="materialId != null">
  145. or MATERIAL_ID = #{materialId}
  146. </if>
  147. <if test="inboundMaterialWeight != null">
  148. or INBOUND_MATERIAL_WEIGHT = #{inboundMaterialWeight}
  149. </if>
  150. <if test="inboundMaterialNumber != null">
  151. or INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber}
  152. </if>
  153. <if test="loaderId != null">
  154. or LOADER_ID = #{loaderId}
  155. </if>
  156. <if test="inboundTime != null">
  157. or TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = '#{inboundTime}'
  158. </if>
  159. <if test="insertUsername != null and insertUsername != ''">
  160. or INSERT_USERNAME = #{insertUsername}
  161. </if>
  162. <if test="insertTime != null">
  163. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  164. </if>
  165. <if test="updateUsername != null and updateUsername != ''">
  166. or UPDATE_USERNAME = #{updateUsername}
  167. </if>
  168. <if test="updateTime != null">
  169. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  170. </if>
  171. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  172. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  173. </if>
  174. </delete>
  175. <insert id="insert" parameterType="com.steerinfo.dil.model.WmsOffSiteLibraryInbound">
  176. insert into WMS_OFF_SITE_LIBRARY_INBOUND (INBOUND_ID, WAREHOUSE_ID, INBOUND_NO,
  177. INBOUND_SCAN_TAG, MATERIAL_ID, INBOUND_MATERIAL_WEIGHT,
  178. INBOUND_MATERIAL_NUMBER, LOADER_ID, INBOUND_TIME,
  179. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  180. UPDATE_TIME, INSERT_UPDATE_REMARK)
  181. values (#{inboundId,jdbcType=DECIMAL}, #{warehouseId,jdbcType=DECIMAL}, #{inboundNo,jdbcType=VARCHAR},
  182. #{inboundScanTag,jdbcType=VARCHAR}, #{materialId,jdbcType=DECIMAL}, #{inboundMaterialWeight,jdbcType=DECIMAL},
  183. #{inboundMaterialNumber,jdbcType=DECIMAL}, #{loaderId,jdbcType=DECIMAL}, #{inboundTime,jdbcType=TIMESTAMP},
  184. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  185. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
  186. </insert>
  187. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.WmsOffSiteLibraryInbound">
  188. insert into WMS_OFF_SITE_LIBRARY_INBOUND
  189. <trim prefix="(" suffix=")" suffixOverrides=",">
  190. <if test="inboundId != null">
  191. INBOUND_ID,
  192. </if>
  193. <if test="warehouseId != null">
  194. WAREHOUSE_ID,
  195. </if>
  196. <if test="inboundNo != null">
  197. INBOUND_NO,
  198. </if>
  199. <if test="inboundScanTag != null">
  200. INBOUND_SCAN_TAG,
  201. </if>
  202. <if test="materialId != null">
  203. MATERIAL_ID,
  204. </if>
  205. <if test="inboundMaterialWeight != null">
  206. INBOUND_MATERIAL_WEIGHT,
  207. </if>
  208. <if test="inboundMaterialNumber != null">
  209. INBOUND_MATERIAL_NUMBER,
  210. </if>
  211. <if test="loaderId != null">
  212. LOADER_ID,
  213. </if>
  214. <if test="inboundTime != null">
  215. INBOUND_TIME,
  216. </if>
  217. <if test="insertUsername != null">
  218. INSERT_USERNAME,
  219. </if>
  220. <if test="insertTime != null">
  221. INSERT_TIME,
  222. </if>
  223. <if test="updateUsername != null">
  224. UPDATE_USERNAME,
  225. </if>
  226. <if test="updateTime != null">
  227. UPDATE_TIME,
  228. </if>
  229. <if test="insertUpdateRemark != null">
  230. INSERT_UPDATE_REMARK,
  231. </if>
  232. </trim>
  233. <trim prefix="values (" suffix=")" suffixOverrides=",">
  234. <if test="inboundId != null">
  235. #{inboundId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="warehouseId != null">
  238. #{warehouseId,jdbcType=DECIMAL},
  239. </if>
  240. <if test="inboundNo != null">
  241. #{inboundNo,jdbcType=VARCHAR},
  242. </if>
  243. <if test="inboundScanTag != null">
  244. #{inboundScanTag,jdbcType=VARCHAR},
  245. </if>
  246. <if test="materialId != null">
  247. #{materialId,jdbcType=DECIMAL},
  248. </if>
  249. <if test="inboundMaterialWeight != null">
  250. #{inboundMaterialWeight,jdbcType=DECIMAL},
  251. </if>
  252. <if test="inboundMaterialNumber != null">
  253. #{inboundMaterialNumber,jdbcType=DECIMAL},
  254. </if>
  255. <if test="loaderId != null">
  256. #{loaderId,jdbcType=DECIMAL},
  257. </if>
  258. <if test="inboundTime != null">
  259. #{inboundTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="insertUsername != null">
  262. #{insertUsername,jdbcType=VARCHAR},
  263. </if>
  264. <if test="insertTime != null">
  265. #{insertTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="updateUsername != null">
  268. #{updateUsername,jdbcType=VARCHAR},
  269. </if>
  270. <if test="updateTime != null">
  271. #{updateTime,jdbcType=TIMESTAMP},
  272. </if>
  273. <if test="insertUpdateRemark != null">
  274. #{insertUpdateRemark,jdbcType=VARCHAR},
  275. </if>
  276. </trim>
  277. </insert>
  278. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.WmsOffSiteLibraryInbound">
  279. update WMS_OFF_SITE_LIBRARY_INBOUND
  280. set WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  281. INBOUND_NO = #{inboundNo,jdbcType=VARCHAR},
  282. INBOUND_SCAN_TAG = #{inboundScanTag,jdbcType=VARCHAR},
  283. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  284. INBOUND_MATERIAL_WEIGHT = #{inboundMaterialWeight,jdbcType=DECIMAL},
  285. INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber,jdbcType=DECIMAL},
  286. LOADER_ID = #{loaderId,jdbcType=DECIMAL},
  287. INBOUND_TIME = #{inboundTime,jdbcType=TIMESTAMP},
  288. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  289. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  290. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  291. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  292. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
  293. where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
  294. </update>
  295. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.WmsOffSiteLibraryInbound">
  296. update WMS_OFF_SITE_LIBRARY_INBOUND
  297. <set>
  298. <if test="warehouseId != null">
  299. WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  300. </if>
  301. <if test="inboundNo != null">
  302. INBOUND_NO = #{inboundNo,jdbcType=VARCHAR},
  303. </if>
  304. <if test="inboundScanTag != null">
  305. INBOUND_SCAN_TAG = #{inboundScanTag,jdbcType=VARCHAR},
  306. </if>
  307. <if test="materialId != null">
  308. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  309. </if>
  310. <if test="inboundMaterialWeight != null">
  311. INBOUND_MATERIAL_WEIGHT = #{inboundMaterialWeight,jdbcType=DECIMAL},
  312. </if>
  313. <if test="inboundMaterialNumber != null">
  314. INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber,jdbcType=DECIMAL},
  315. </if>
  316. <if test="loaderId != null">
  317. LOADER_ID = #{loaderId,jdbcType=DECIMAL},
  318. </if>
  319. <if test="inboundTime != null">
  320. INBOUND_TIME = #{inboundTime,jdbcType=TIMESTAMP},
  321. </if>
  322. <if test="insertUsername != null">
  323. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  324. </if>
  325. <if test="insertTime != null">
  326. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  327. </if>
  328. <if test="updateUsername != null">
  329. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  330. </if>
  331. <if test="updateTime != null">
  332. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  333. </if>
  334. <if test="insertUpdateRemark != null">
  335. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  336. </if>
  337. </set>
  338. where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
  339. </update>
  340. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  341. <include refid="select"/>
  342. where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
  343. </select>
  344. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  345. <include refid="select"/>
  346. <include refid="where"/>
  347. </select>
  348. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  349. <include refid="select"/>
  350. <include refid="whereLike"/>
  351. </select>
  352. <insert id="batchInsert" parameterType="java.util.List">
  353. insert into WMS_OFF_SITE_LIBRARY_INBOUND
  354. (INBOUND_ID,
  355. WAREHOUSE_ID, INBOUND_NO, INBOUND_SCAN_TAG,
  356. MATERIAL_ID, INBOUND_MATERIAL_WEIGHT,
  357. INBOUND_MATERIAL_NUMBER, LOADER_ID,
  358. INBOUND_TIME, INSERT_USERNAME,
  359. INSERT_TIME, UPDATE_USERNAME,
  360. UPDATE_TIME, INSERT_UPDATE_REMARK
  361. )
  362. ( <foreach collection="list" item="item" separator="union all">
  363. select
  364. #{item.inboundId,jdbcType=DECIMAL},
  365. #{item.warehouseId,jdbcType=DECIMAL}, #{item.inboundNo,jdbcType=VARCHAR}, #{item.inboundScanTag,jdbcType=VARCHAR},
  366. #{item.materialId,jdbcType=DECIMAL}, #{item.inboundMaterialWeight,jdbcType=DECIMAL},
  367. #{item.inboundMaterialNumber,jdbcType=DECIMAL}, #{item.loaderId,jdbcType=DECIMAL},
  368. #{item.inboundTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
  369. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  370. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}
  371. from dual
  372. </foreach> )
  373. </insert>
  374. <update id="batchUpdate" parameterType="java.util.List">
  375. update WMS_OFF_SITE_LIBRARY_INBOUND
  376. set
  377. INBOUND_ID=
  378. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  379. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundId,jdbcType=DECIMAL}
  380. </foreach>
  381. ,WAREHOUSE_ID=
  382. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  383. when #{item.inboundId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
  384. </foreach>
  385. ,INBOUND_NO=
  386. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  387. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundNo,jdbcType=VARCHAR}
  388. </foreach>
  389. ,INBOUND_SCAN_TAG=
  390. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  391. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundScanTag,jdbcType=VARCHAR}
  392. </foreach>
  393. ,MATERIAL_ID=
  394. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  395. when #{item.inboundId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  396. </foreach>
  397. ,INBOUND_MATERIAL_WEIGHT=
  398. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  399. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundMaterialWeight,jdbcType=DECIMAL}
  400. </foreach>
  401. ,INBOUND_MATERIAL_NUMBER=
  402. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  403. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundMaterialNumber,jdbcType=DECIMAL}
  404. </foreach>
  405. ,LOADER_ID=
  406. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  407. when #{item.inboundId,jdbcType=DECIMAL} then #{item.loaderId,jdbcType=DECIMAL}
  408. </foreach>
  409. ,INBOUND_TIME=
  410. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  411. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundTime,jdbcType=TIMESTAMP}
  412. </foreach>
  413. ,INSERT_USERNAME=
  414. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  415. when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  416. </foreach>
  417. ,INSERT_TIME=
  418. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  419. when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  420. </foreach>
  421. ,UPDATE_USERNAME=
  422. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  423. when #{item.inboundId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  424. </foreach>
  425. ,UPDATE_TIME=
  426. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  427. when #{item.inboundId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  428. </foreach>
  429. ,INSERT_UPDATE_REMARK=
  430. <foreach collection="list" item="item" index="index" separator=" " open="case INBOUND_ID" close="end">
  431. when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  432. </foreach>
  433. where INBOUND_ID in
  434. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  435. #{item.inboundId,jdbcType=DECIMAL}
  436. </foreach>
  437. </update>
  438. <delete id="batchDelete" parameterType="java.util.List">
  439. delete from WMS_OFF_SITE_LIBRARY_INBOUND
  440. where INBOUND_ID in
  441. <foreach collection="list" item="id" open="(" close=")" separator=",">
  442. #{id}
  443. </foreach>
  444. </delete>
  445. <!-- 友情提示!!!-->
  446. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  447. <!-- 根据物资编码查找物资信息-->
  448. <select id="selectMaterialInfoByMaterialCode" resultType="java.util.LinkedHashMap" parameterType="java.lang.String">
  449. select
  450. RMS.MATERIAL_FURNACE_NUMBER "FurnaceNumber",
  451. RM.MATERIAL_SPECIFICATION || '(' || RM.MATERIAL_MODEL || ')' "specification",
  452. RM.MATERIAL_LENGTH "length",
  453. RM.MATERIAL_CODE "code",
  454. RM.MATERIAL_NAME "name",
  455. RMS.MATERIAL_THEORETICAL_WEIGHT "weight",
  456. RMS.MATERIAL_PRODUCTION_DATE "date",
  457. RMS.MATERIAL_STEEL_ID "steelId"
  458. from RMS_MATERIAL_STEEL RMS
  459. left join RMS_MATERIAL RM
  460. on RM.MATERIAL_ID=RMS.MATERIAL_STEEL_ID
  461. where RMS.MATERIAL_ONLY_CODE=#{materialonlyCode}
  462. </select>
  463. <!-- 根据钢材物资id查找运输订单类别-->
  464. <select id="selectOrderTypeByMaterialSteelId" resultType="java.lang.Integer" parameterType="java.lang.Integer">
  465. select DISTINCT OO.ORDER_TYPE "orderType"
  466. from RMS_MATERIAL_STEEL RMS
  467. left join OMSTRUCK_ORDER_MATERIAL OOM
  468. on OOM.MATERIAL_ID=RMS.MATERIAL_STEEL_ID
  469. left join OMSTRUCK_ORDER OO
  470. on OO.ORDER_PLAN_ID=OOM.ORDER_MATERIAL_ID
  471. where RMS.MATERIAL_STEEL_ID=#{materialSteelId}
  472. </select>
  473. <!-- 根据钢材物资id查找收货单位id-->
  474. <select id="selectWarehouseIdByMaterialSteeelId" resultType="java.lang.Integer" parameterType="java.lang.Integer">
  475. select RW.WAREHOUSE_ID "warehouseId"
  476. from RMS_MATERIAL_STEEL RMS
  477. left join AMSTRUCK_RAIL_DAYPLAN ARD
  478. on ARD.MATERIAL_ID=RMS.MATERIAL_STEEL_ID
  479. left join RMS_WAREHOUSE RW
  480. on RW.WAREHOUSE_NAME=ARD.DAYPLAN_RECEIVE_UNIT
  481. where RMS.MATERIAL_STEEL_ID=#{materialSteelId}
  482. </select>
  483. <!--查找最大id-->
  484. <!-- <select id="selectMaxId" resultType="DECIMAL">-->
  485. <!-- select MAX(INBOUND_ID)+1 from WMS_OFF_SITE_LIBRARY_INBOUND-->
  486. <!-- </select>-->
  487. <!-- 根据物资唯一编码查找在途库存id-->
  488. <select id="selectTransitByMaterialOnlyCode" parameterType="java.lang.String" resultType="java.lang.Integer">
  489. select WII.INVENTORY_ID "inverntoryId"
  490. from RMS_MATERIAL RM
  491. left join RMS_MATERIAL_STEEL RMS
  492. on RMS.MATERIAL_STEEL_ID=RM.MATERIAL_ID
  493. left join OMSTRUCK_ORDER_MATERIAL OOM
  494. on OOM.MATERIAL_ID=RMS.MATERIAL_STEEL_ID
  495. left join OMSTRUCK_ORDER OO
  496. on OO.ORDER_ID=OOM.ORDER_ID
  497. left join AMSTRUCK_RAIL_DAYPLAN ARD
  498. on ARD.MATERIAL_ID=RMS.MATERIAL_ID
  499. left join WMSP_INTRANSIT_INVENTORY WII
  500. on WII.RAIL_DAYPLAY_ID=ARD.DAYPLAN_ID
  501. where RMS.MATERIAL_ONLY_CODE=#{materialOnlyCode}
  502. </select>
  503. <select id="selectInboundList" resultType="java.util.LinkedHashMap" parameterType="java.util.LinkedHashMap">
  504. select *FROM (select
  505. RW.WAREHOUSE_NAME "warehouseName",
  506. RM.MATERIAL_NAME "materialName",
  507. RM.MATERIAL_SPECIFICATION || '(' || RM.MATERIAL_MODEL || ')' "specification",
  508. WOSLI.INBOUND_TIME "inboundTime",
  509. RP.PERSONNEL_NAME "name",
  510. WOSLI.INBOUND_MATERIAL_NUMBER "materialNumber",
  511. WOSLI.INBOUND_MATERIAL_WEIGHT "materialWeight",
  512. WOSLI.INBOUND_NO "inboundNo",
  513. CASE
  514. WHEN RMS.MATERIAL_QUALIFIED = 0 THEN
  515. '不合格且判废'
  516. WHEN RMS.MATERIAL_QUALIFIED = 1 THEN
  517. '不合格且降级'
  518. WHEN RMS.MATERIAL_QUALIFIED = 2 THEN
  519. '不合格且卖本地经销商'
  520. WHEN RMS.MATERIAL_QUALIFIED = 3 THEN
  521. '合格'
  522. END materialQualified,
  523. RMS.MATERIAL_FURNACE_NUMBER "furnaceNumber",
  524. RM.MATERIAL_CODE "materialCode"
  525. from WMS_OFF_SITE_LIBRARY_INBOUND WOSLI
  526. left join RMS_WAREHOUSE RW
  527. on WOSLI.WAREHOUSE_ID=RW.WAREHOUSE_ID
  528. left join RMS_MATERIAL_STEEL RMS
  529. on RMS.MATERIAL_STEEL_ID=WOSLI.MATERIAL_ID
  530. left join RMS_MATERIAL RM
  531. on RM.MATERIAL_ID=RMS.MATERIAL_ID
  532. left join RMS_PERSONNEL RP
  533. on RP.PERSONNEL_ID=WOSLI.LOADER_ID
  534. )
  535. <where>
  536. <if test="warehouseName != null">
  537. and
  538. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  539. "warehouseName" like '%${item}%'
  540. </foreach>
  541. </if>
  542. <if test="materialName != null">
  543. and
  544. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  545. "materialName" like '%${item}%'
  546. </foreach>
  547. </if>
  548. <if test="specification != null">
  549. and
  550. <foreach collection="specification" item="item" open="(" separator="or" close=")">
  551. "specification" like '%${item}%'
  552. </foreach>
  553. </if>
  554. <if test="inboundTime != null">
  555. and
  556. <foreach collection="inboundTime" item="item" open="(" separator="or" close=")">
  557. "inboundTime" like '%${item}%'
  558. </foreach>
  559. </if>
  560. <if test="name != null">
  561. and
  562. <foreach collection="name" item="item" open="(" separator="or" close=")">
  563. "name" like '%${item}%'
  564. </foreach>
  565. </if>
  566. <if test="materialNumber != null">
  567. and
  568. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  569. "materialNumber" like '%${item}%'
  570. </foreach>
  571. </if>
  572. <if test="materialWeight != null">
  573. and
  574. <foreach collection="materialWeight" item="item" open="(" separator="or" close=")">
  575. "materialWeight" like '%${item}%'
  576. </foreach>
  577. </if>
  578. <if test="inboundNo != null">
  579. and
  580. <foreach collection="inboundNo" item="item" open="(" separator="or" close=")">
  581. "inboundNo" like '%${item}%'
  582. </foreach>
  583. </if>
  584. <if test="materialQualified != null">
  585. and
  586. <foreach collection="materialQualified" item="item" open="(" separator="or" close=")">
  587. "materialQualified" like '%${item}%'
  588. </foreach>
  589. </if>
  590. <if test="furnaceNumber != null">
  591. and
  592. <foreach collection="furnaceNumber" item="item" open="(" separator="or" close=")">
  593. "furnaceNumber" like '%${item}%'
  594. </foreach>
  595. </if>
  596. <if test="materialCode != null">
  597. and
  598. <foreach collection="materialCode" item="item" open="(" separator="or" close=")">
  599. "materialCode" like '%${item}%'
  600. </foreach>
  601. </if>
  602. </where>
  603. </select>
  604. </mapper>