WmspRestackScanResultMapper.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  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.WmspRestackScanResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.WmspRestackScanResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="RESULT_RESTACK_ID" jdbcType="DECIMAL" property="resultRestackId" />
  7. <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId" />
  8. <result column="RESULT_SCAN_TAG" jdbcType="VARCHAR" property="resultScanTag" />
  9. <result column="RESULT_LOADER_AUDIT" jdbcType="DECIMAL" property="resultLoaderAudit" />
  10. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  11. <result column="MATERIAL_ONLY_CODE" jdbcType="VARCHAR" property="materialOnlyCode" />
  12. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  13. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  14. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  15. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  16. <result column="ISSUE_TIME" jdbcType="TIMESTAMP" property="issueTime" />
  17. </resultMap>
  18. <sql id="columns">
  19. RESULT_ID, RESULT_RESTACK_ID, LOADER_ID, RESULT_SCAN_TAG, RESULT_LOADER_AUDIT, INSERT_USERNAME, MATERIAL_ONLY_CODE,
  20. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, ISSUE_TIME
  21. </sql>
  22. <sql id="columns_alias">
  23. t.RESULT_ID, t.RESULT_RESTACK_ID, t.LOADER_ID, t.RESULT_SCAN_TAG, t.RESULT_LOADER_AUDIT,
  24. t.INSERT_USERNAME,t.MATERIAL_ONLY_CODE, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  25. t.ISSUE_TIME
  26. </sql>
  27. <sql id="select">
  28. SELECT <include refid="columns"/> FROM WMSP_RESTACK_SCAN_RESULT
  29. </sql>
  30. <sql id="select_alias">
  31. SELECT <include refid="columns_alias"/> FROM WMSP_RESTACK_SCAN_RESULT t
  32. </sql>
  33. <sql id="where">
  34. <where>
  35. <if test="resultId != null">
  36. and RESULT_ID = #{resultId}
  37. </if>
  38. <if test="resultRestackId != null">
  39. and RESULT_RESTACK_ID = #{resultRestackId}
  40. </if>
  41. <if test="loaderId != null">
  42. and LOADER_ID = #{loaderId}
  43. </if>
  44. <if test="resultScanTag != null and resultScanTag != ''">
  45. and RESULT_SCAN_TAG = #{resultScanTag}
  46. </if>
  47. <if test="resultLoaderAudit != null">
  48. and RESULT_LOADER_AUDIT = #{resultLoaderAudit}
  49. </if>
  50. <if test="insertUsername != null and insertUsername != ''">
  51. and INSERT_USERNAME = #{insertUsername}
  52. </if>
  53. <if test="materialOnlyCode != null and materialOnlyCode != ''">
  54. and MATERIAL_ONLY_CODE = #{materialOnlyCode}
  55. </if>
  56. <if test="insertTime != null">
  57. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  58. </if>
  59. <if test="updateUsername != null and updateUsername != ''">
  60. and UPDATE_USERNAME = #{updateUsername}
  61. </if>
  62. <if test="updateTime != null">
  63. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  64. </if>
  65. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  66. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  67. </if>
  68. <if test="issueTime != null">
  69. and TO_CHAR(ISSUE_TIME,'yyyy-MM-dd') = #{issueTime}
  70. </if>
  71. </where>
  72. </sql>
  73. <sql id="whereLike">
  74. <where>
  75. <if test="resultId != null">
  76. and RESULT_ID = #{resultId}
  77. </if>
  78. <if test="resultRestackId != null">
  79. and RESULT_RESTACK_ID = #{resultRestackId}
  80. </if>
  81. <if test="loaderId != null">
  82. and LOADER_ID = #{loaderId}
  83. </if>
  84. <if test="resultScanTag != null and resultScanTag != ''">
  85. and RESULT_SCAN_TAG LIKE '%${resultScanTag}%'
  86. </if>
  87. <if test="resultLoaderAudit != null">
  88. and RESULT_LOADER_AUDIT = #{resultLoaderAudit}
  89. </if>
  90. <if test="insertUsername != null and insertUsername != ''">
  91. and INSERT_USERNAME LIKE '%${insertUsername}%'
  92. </if>
  93. <if test="materialOnlyCode != null and materialOnlyCode != ''">
  94. and MATERIAL_ONLY_CODE LIKE '%${materialOnlyCode}%'
  95. </if>
  96. <if test="insertTime != null">
  97. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  98. </if>
  99. <if test="updateUsername != null and updateUsername != ''">
  100. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  101. </if>
  102. <if test="updateTime != null">
  103. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  104. </if>
  105. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  106. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  107. </if>
  108. <if test="issueTime != null">
  109. and TO_CHAR(ISSUE_TIME,'yyyy-MM-dd') = #{issueTime}
  110. </if>
  111. </where>
  112. </sql>
  113. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  114. delete from WMSP_RESTACK_SCAN_RESULT
  115. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  116. </delete>
  117. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  118. delete from WMSP_RESTACK_SCAN_RESULT
  119. where 1!=1
  120. <if test="resultRestackId != null">
  121. or RESULT_RESTACK_ID = #{resultRestackId}
  122. </if>
  123. <if test="loaderId != null">
  124. or LOADER_ID = #{loaderId}
  125. </if>
  126. <if test="resultScanTag != null and resultScanTag != ''">
  127. or RESULT_SCAN_TAG = #{resultScanTag}
  128. </if>
  129. <if test="resultLoaderAudit != null">
  130. or RESULT_LOADER_AUDIT = #{resultLoaderAudit}
  131. </if>
  132. <if test="insertUsername != null and insertUsername != ''">
  133. or INSERT_USERNAME = #{insertUsername}
  134. </if>
  135. <if test="materialOnlyCode != null and materialOnlyCode != ''">
  136. or MATERIAL_ONLY_CODE = #{materialOnlyCode}
  137. </if>
  138. <if test="insertTime != null">
  139. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  140. </if>
  141. <if test="updateUsername != null and updateUsername != ''">
  142. or UPDATE_USERNAME = #{updateUsername}
  143. </if>
  144. <if test="updateTime != null">
  145. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  146. </if>
  147. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  148. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  149. </if>
  150. <if test="issueTime != null">
  151. or TO_CHAR(ISSUE_TIME,'yyyy-MM-dd') = '#{issueTime}'
  152. </if>
  153. </delete>
  154. <insert id="insert" parameterType="com.steerinfo.dil.model.WmspRestackScanResult">
  155. insert into WMSP_RESTACK_SCAN_RESULT (RESULT_ID, RESULT_RESTACK_ID, LOADER_ID,
  156. RESULT_SCAN_TAG, RESULT_LOADER_AUDIT, INSERT_USERNAME,MATERIAL_ONLY_CODE,
  157. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  158. INSERT_UPDATE_REMARK, ISSUE_TIME)
  159. values (#{resultId,jdbcType=DECIMAL}, #{resultRestackId,jdbcType=DECIMAL}, #{loaderId,jdbcType=DECIMAL},
  160. #{resultScanTag,jdbcType=VARCHAR}, #{resultLoaderAudit,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{materialOnlyCode,jdbcType=VARCHAR},
  161. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  162. #{insertUpdateRemark,jdbcType=VARCHAR}, #{issueTime,jdbcType=TIMESTAMP})
  163. </insert>
  164. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.WmspRestackScanResult">
  165. insert into WMSP_RESTACK_SCAN_RESULT
  166. <trim prefix="(" suffix=")" suffixOverrides=",">
  167. <if test="resultId != null">
  168. RESULT_ID,
  169. </if>
  170. <if test="resultRestackId != null">
  171. RESULT_RESTACK_ID,
  172. </if>
  173. <if test="loaderId != null">
  174. LOADER_ID,
  175. </if>
  176. <if test="resultScanTag != null">
  177. RESULT_SCAN_TAG,
  178. </if>
  179. <if test="resultLoaderAudit != null">
  180. RESULT_LOADER_AUDIT,
  181. </if>
  182. <if test="insertUsername != null">
  183. INSERT_USERNAME,
  184. </if>
  185. <if test="materialOnlyCode != null">
  186. MATERIAL_ONLY_CODE,
  187. </if>
  188. <if test="insertTime != null">
  189. INSERT_TIME,
  190. </if>
  191. <if test="updateUsername != null">
  192. UPDATE_USERNAME,
  193. </if>
  194. <if test="updateTime != null">
  195. UPDATE_TIME,
  196. </if>
  197. <if test="insertUpdateRemark != null">
  198. INSERT_UPDATE_REMARK,
  199. </if>
  200. <if test="issueTime != null">
  201. ISSUE_TIME,
  202. </if>
  203. </trim>
  204. <trim prefix="values (" suffix=")" suffixOverrides=",">
  205. <if test="resultId != null">
  206. #{resultId,jdbcType=DECIMAL},
  207. </if>
  208. <if test="resultRestackId != null">
  209. #{resultRestackId,jdbcType=DECIMAL},
  210. </if>
  211. <if test="loaderId != null">
  212. #{loaderId,jdbcType=DECIMAL},
  213. </if>
  214. <if test="resultScanTag != null">
  215. #{resultScanTag,jdbcType=VARCHAR},
  216. </if>
  217. <if test="resultLoaderAudit != null">
  218. #{resultLoaderAudit,jdbcType=DECIMAL},
  219. </if>
  220. <if test="insertUsername != null">
  221. #{insertUsername,jdbcType=VARCHAR},
  222. </if>
  223. <if test="materialOnlyCode != null">
  224. #{materialOnlyCode,jdbcType=VARCHAR},
  225. </if>
  226. <if test="insertTime != null">
  227. #{insertTime,jdbcType=TIMESTAMP},
  228. </if>
  229. <if test="updateUsername != null">
  230. #{updateUsername,jdbcType=VARCHAR},
  231. </if>
  232. <if test="updateTime != null">
  233. #{updateTime,jdbcType=TIMESTAMP},
  234. </if>
  235. <if test="insertUpdateRemark != null">
  236. #{insertUpdateRemark,jdbcType=VARCHAR},
  237. </if>
  238. <if test="issueTime != null">
  239. #{issueTime,jdbcType=TIMESTAMP},
  240. </if>
  241. </trim>
  242. </insert>
  243. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.WmspRestackScanResult">
  244. update WMSP_RESTACK_SCAN_RESULT
  245. set RESULT_RESTACK_ID = #{resultRestackId,jdbcType=DECIMAL},
  246. LOADER_ID = #{loaderId,jdbcType=DECIMAL},
  247. RESULT_SCAN_TAG = #{resultScanTag,jdbcType=VARCHAR},
  248. RESULT_LOADER_AUDIT = #{resultLoaderAudit,jdbcType=DECIMAL},
  249. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  250. MATERIAL_ONLY_CODE = #{materialOnlyCode,jdbcType=VARCHAR},
  251. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  252. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  253. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  254. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  255. ISSUE_TIME = #{issueTime,jdbcType=TIMESTAMP}
  256. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  257. </update>
  258. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.WmspRestackScanResult">
  259. update WMSP_RESTACK_SCAN_RESULT
  260. <set>
  261. <if test="resultRestackId != null">
  262. RESULT_RESTACK_ID = #{resultRestackId,jdbcType=DECIMAL},
  263. </if>
  264. <if test="loaderId != null">
  265. LOADER_ID = #{loaderId,jdbcType=DECIMAL},
  266. </if>
  267. <if test="resultScanTag != null">
  268. RESULT_SCAN_TAG = #{resultScanTag,jdbcType=VARCHAR},
  269. </if>
  270. <if test="resultLoaderAudit != null">
  271. RESULT_LOADER_AUDIT = #{resultLoaderAudit,jdbcType=DECIMAL},
  272. </if>
  273. <if test="insertUsername != null">
  274. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  275. </if>
  276. <if test="materialOnlyCode != null">
  277. MATERIAL_ONLY_CODE = #{materialOnlyCode,jdbcType=VARCHAR},
  278. </if>
  279. <if test="insertTime != null">
  280. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  281. </if>
  282. <if test="updateUsername != null">
  283. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  284. </if>
  285. <if test="updateTime != null">
  286. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  287. </if>
  288. <if test="insertUpdateRemark != null">
  289. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  290. </if>
  291. <if test="issueTime != null">
  292. ISSUE_TIME = #{issueTime,jdbcType=TIMESTAMP},
  293. </if>
  294. </set>
  295. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  296. </update>
  297. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  298. <include refid="select"/>
  299. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  300. </select>
  301. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  302. <include refid="select"/>
  303. <include refid="where"/>
  304. </select>
  305. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  306. <include refid="select"/>
  307. <include refid="whereLike"/>
  308. </select>
  309. <insert id="batchInsert" parameterType="java.util.List">
  310. insert into WMSP_RESTACK_SCAN_RESULT
  311. (RESULT_ID,
  312. RESULT_RESTACK_ID, LOADER_ID, RESULT_SCAN_TAG,
  313. RESULT_LOADER_AUDIT, INSERT_USERNAME,MATERIAL_ONLY_CODE,
  314. INSERT_TIME, UPDATE_USERNAME,
  315. UPDATE_TIME, INSERT_UPDATE_REMARK,
  316. ISSUE_TIME)
  317. ( <foreach collection="list" item="item" separator="union all">
  318. select
  319. #{item.resultId,jdbcType=DECIMAL},
  320. #{item.resultRestackId,jdbcType=DECIMAL}, #{item.loaderId,jdbcType=DECIMAL}, #{item.resultScanTag,jdbcType=VARCHAR},
  321. #{item.resultLoaderAudit,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},#{item.materialOnlyCode,jdbcType=VARCHAR},
  322. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  323. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  324. #{item.issueTime,jdbcType=TIMESTAMP} from dual
  325. </foreach> )
  326. </insert>
  327. <update id="batchUpdate" parameterType="java.util.List">
  328. update WMSP_RESTACK_SCAN_RESULT
  329. set
  330. RESULT_ID=
  331. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  332. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  333. </foreach>
  334. ,RESULT_RESTACK_ID=
  335. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  336. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultRestackId,jdbcType=DECIMAL}
  337. </foreach>
  338. ,LOADER_ID=
  339. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  340. when #{item.resultId,jdbcType=DECIMAL} then #{item.loaderId,jdbcType=DECIMAL}
  341. </foreach>
  342. ,RESULT_SCAN_TAG=
  343. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  344. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultScanTag,jdbcType=VARCHAR}
  345. </foreach>
  346. ,RESULT_LOADER_AUDIT=
  347. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  348. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoaderAudit,jdbcType=DECIMAL}
  349. </foreach>
  350. ,INSERT_USERNAME=
  351. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  352. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  353. </foreach>
  354. ,MATERIAL_ONLY_CODE=
  355. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  356. when #{item.resultId,jdbcType=DECIMAL} then #{item.materialOnlyCode,jdbcType=VARCHAR}
  357. </foreach>
  358. ,INSERT_TIME=
  359. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  360. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  361. </foreach>
  362. ,UPDATE_USERNAME=
  363. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  364. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  365. </foreach>
  366. ,UPDATE_TIME=
  367. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  368. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  369. </foreach>
  370. ,INSERT_UPDATE_REMARK=
  371. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  372. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  373. </foreach>
  374. ,ISSUE_TIME=
  375. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  376. when #{item.resultId,jdbcType=DECIMAL} then #{item.issueTime,jdbcType=TIMESTAMP}
  377. </foreach>
  378. where RESULT_ID in
  379. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  380. #{item.resultId,jdbcType=DECIMAL}
  381. </foreach>
  382. </update>
  383. <delete id="batchDelete" parameterType="java.util.List">
  384. delete from WMSP_RESTACK_SCAN_RESULT
  385. where RESULT_ID in
  386. <foreach collection="list" item="id" open="(" close=")" separator=",">
  387. #{id}
  388. </foreach>
  389. </delete>
  390. <!-- 友情提示!!!-->
  391. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  392. <!--根据装卸工id查找数据 -->
  393. <select id="selectByLoaderId" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  394. select *
  395. from (
  396. select
  397. t4.RESULT_STACK_NUMBER "stackNumber",
  398. t1.INSERT_TIME "insertTime",
  399. t3.PERSONNEL_NAME "personnelName",
  400. t9.MATERIAL_FURNACE_NUMBER "materialFunaceNumber",
  401. t8.MATERIAL_CODE "materialCode",
  402. t8.MATERIAL_NAME "materialName",
  403. t8.MATERIAL_SPECIFICATION "materialSpecifition",
  404. t9.MATERIAL_PRODUCTION_DATE "materialProductionDate",
  405. t9.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  406. t7.MAKE_MATERIAL_NUMBER "makematerialNumber"
  407. from WMSP_RESTACK_SCAN_RESULT t1
  408. left join RMS_PERSONNEL t3
  409. on t3.PERSONNEL_ID=t1.LOADER_ID
  410. left join WMSP_RESTACK_MAKE_RESULT t4
  411. on t4.RESULT_ID=t1.RESULT_ID
  412. left join RMS_WAREHOUSE t6
  413. on t6.WAREHOUSE_ID=t4.AFTER_WAREHOUSE_ID
  414. left join WMSP_RESTACK_MAKE_MATERIAL t7
  415. on t4.RESULT_ID = t7.MAKE_RESULT_ID
  416. left join RMS_MATERIAL_STEEL t9
  417. on t9.MATERIAL_STEEL_ID=t7.MATERIAL_ID
  418. left join RMS_MATERIAL t8
  419. on t8.MATERIAL_ID=t9.MATERIAL_ID
  420. where t1.RESULT_SCAN_TAG='null'
  421. and t1.LOADER_ID=#{loaderId}
  422. )
  423. <if test="stackNumber != null">
  424. and
  425. <foreach collection="stackNumber" item="item" open="(" separator="or" close=")">
  426. "stackNumber" like '%${item}%'
  427. </foreach>
  428. </if>
  429. <if test="insertTime != null">
  430. and
  431. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  432. "insertTime" like '%${item}%'
  433. </foreach>
  434. </if>
  435. <if test="personnelName != null">
  436. and
  437. <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
  438. "personnelName" like '%${item}%'
  439. </foreach>
  440. </if>
  441. <if test="materialFunaceNumber != null">
  442. and
  443. <foreach collection="materialFunaceNumber" item="item" open="(" separator="or" close=")">
  444. "materialFunaceNumber" like '%${item}%'
  445. </foreach>
  446. </if>
  447. <if test="materialCode != null">
  448. and
  449. <foreach collection="materialCode" item="item" open="(" separator="or" close=")">
  450. "materialCode" like '%${item}%'
  451. </foreach>
  452. </if>
  453. <if test="materialName != null">
  454. and
  455. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  456. "materialName" like '%${item}%'
  457. </foreach>
  458. </if>
  459. <if test="materialSpecifition != null">
  460. and
  461. <foreach collection="materialSpecifition" item="item" open="(" separator="or" close=")">
  462. "materialSpecifition" like '%${item}%'
  463. </foreach>
  464. </if>
  465. <if test="materialProductionDate != null">
  466. and
  467. <foreach collection="materialProductionDate" item="item" open="(" separator="or" close=")">
  468. "materialProductionDate" like '%${item}%'
  469. </foreach>
  470. </if>
  471. <if test="materialTheoreticalWeight != null">
  472. and
  473. <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
  474. "materialTheoreticalWeight" like '%${item}%'
  475. </foreach>
  476. </if>
  477. <if test="makematerialNumber != null">
  478. and
  479. <foreach collection="makematerialNumber" item="item" open="(" separator="or" close=")">
  480. "makematerialNumber" like '%${item}%'
  481. </foreach>
  482. </if>
  483. </select>
  484. <!-- 查询最大id-->
  485. <!-- <select id="selectMaxId" parameterType="int" resultType="DECIMAL">-->
  486. <!-- select MAX(RESULT_ID) FROM WMSP_RESTACK_SCAN_RESULT-->
  487. <!-- </select>-->
  488. <!-- 根据物资唯一编码查询钢材物资表主键id -->
  489. <select id="selectRestackAudit" parameterType="java.lang.String" resultType="java.lang.Integer">
  490. SELECT
  491. gcwz.MATERIAL_STEEL_ID
  492. FROM
  493. RMS_MATERIAL_STEEL gcwz
  494. WHERE
  495. gcwz.MATERIAL_ONLY_CODE = #{materialOnlyCode}
  496. </select>
  497. <!-- 根据物资编码查找钢材物资id -->
  498. <select id="selectMaterialSteelId" parameterType="java.lang.String" resultType="java.lang.Integer">
  499. select RMS.MATERIAL_STEEL_ID "mateialsteelId"
  500. from RMS_MATERIAL RM
  501. left join RMS_MATERIAL_STEEL RMS
  502. on RMS.MATERIAL_STEEL_ID=RM.MATERIAL_ID
  503. WHERE RMS.MATERIAL_ONLY_CODE=#{materialOnlyCode}
  504. </select>
  505. <!-- 根据倒垛单实绩id查找物资id-->
  506. <select id="selectMaterialIdByResultId" parameterType="java.lang.Integer" resultType="java.util.Map">
  507. SELECT
  508. gcwz.MATERIAL_STEEL_ID
  509. FROM
  510. WMSP_RESTACK_MAKE_RESULT d
  511. LEFT JOIN WMSP_RESTACK_MAKE_MATERIAL dwz ON d.RESULT_ID = dwz.MAKE_RESULT_ID
  512. LEFT JOIN RMS_MATERIAL_STEEL gcwz ON dwz.MATERIAL_ID = gcwz.MATERIAL_STEEL_ID
  513. WHERE
  514. d.RESULT_ID = #{retultId}
  515. </select>
  516. <!--根据稽核结果进行统计订单数量-->
  517. <select id="CountByAuditResult" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  518. SELECT
  519. COUNT( * )
  520. FROM
  521. WMSP_RESTACK_SCAN_RESULT sm
  522. WHERE
  523. sm.RESULT_RESTACK_ID = #{retultId}
  524. AND sm.RESULT_LOADER_AUDIT = 1
  525. </select>
  526. <!-- 查询垛位已堆放物资件数-->
  527. <select id="selectNumber" parameterType="int" resultType="int" >
  528. select RS.STACKING_MATERIAL_NUMBER "materialNumber"
  529. from RMS_STACKING RS
  530. where RS.STACKING_ID=#{stackingId1}
  531. </select>
  532. <!-- 根据稽核成功查询物资信息列表-->
  533. <select id="selectListByAuditResult" parameterType="java.lang.Integer" resultType="java.util.LinkedHashMap" >
  534. select *
  535. from (select
  536. RMS.MATERIAL_FURNACE_NUMBER "materialFurnaceNumber",
  537. RM.MATERIAL_CODE "materialCode",
  538. RM.MATERIAL_NAME "materialName",
  539. RM.MATERIAL_SPECIFICATION "materialSpecocation",
  540. RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  541. RM.MATERIAL_SPECIFICATION "materialSpecification",
  542. RM.MATERIAL_LENGTH "materialLength"
  543. from RMS_MATERIAL RM
  544. left join RMS_MATERIAL_STEEL RMS
  545. on RM.MATERIAL_ID=RMS.MATERIAL_ID
  546. where RM.MATERIAL_ID=#{mateialId}
  547. )
  548. <where>
  549. <if test="materialFurnaceNumber != null">
  550. and
  551. <foreach collection="materialFurnaceNumber" item="item" open="(" separator="or" close=")">
  552. "materialFurnaceNumber" like '%${item}%'
  553. </foreach>
  554. </if>
  555. <if test="materialCode != null">
  556. and
  557. <foreach collection="materialCode" item="item" open="(" separator="or" close=")">
  558. "materialCode" like '%${item}%'
  559. </foreach>
  560. </if>
  561. <if test="materialName != null">
  562. and
  563. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  564. "materialName" like '%${item}%'
  565. </foreach>
  566. </if>
  567. <if test="materialSpecocation != null">
  568. and
  569. <foreach collection="materialSpecocation" item="item" open="(" separator="or" close=")">
  570. "materialSpecocation" like '%${item}%'
  571. </foreach>
  572. </if>
  573. <if test="materialLength != null">
  574. and
  575. <foreach collection="materialLength" item="item" open="(" separator="or" close=")">
  576. "materialLength" like '%${item}%'
  577. </foreach>
  578. </if>
  579. </where>
  580. </select>
  581. <!-- 根据垛位和层次以及层序及仓库id计算倒垛后的仓库网格id -->
  582. <select id="selectGridIdByStakingNoAndGrandationnumber" parameterType="java.util.Map" resultType="java.lang.Integer">
  583. SELECT RPG.GRID_ID "gridId"
  584. FROM RMS_PWAREHOUSE_GRID RPG
  585. LEFT JOIN RMS_WAREHOUSE RW
  586. ON RW.WAREHOUSE_ID=RPG.WAREHOUSE_ID
  587. LEFT JOIN RMS_STACKING RS
  588. ON RPG.STACKING_ID = RS.STACKING_ID
  589. WHERE RW.WAREHOUSE_ID=#{warehouseId}
  590. and RS.STACKING_ID=#{stakingId}
  591. and RPG.GRID_GRADATION_NUMBER=#{gradationNumber}
  592. and RPG.GRID_SEQUENCE_NUMBER=#{sequenceNumber}
  593. </select>
  594. <!-- 根据实绩id查找倒垛后的仓库和垛位 -->
  595. <select id="selectWarehouseIdAndStakingId" resultType="java.util.LinkedHashMap" parameterType="DECIMAL">
  596. SELECT WRMR.AFTER_WAREHOUSE_ID "warehouseId",
  597. WRMR.AFTER_STACKING_ID "stakingId"
  598. FROM WMSP_RESTACK_MAKE_RESULT WRMR
  599. WHERE WRMR.RESULT_ID=#{resultId}
  600. </select>
  601. <!-- 根据实绩id查找倒垛后的仓库和垛位 -->
  602. <select id="selectResultScanTag" resultType="java.lang.Integer" parameterType="java.lang.String">
  603. SELECT
  604. count( * )
  605. FROM WMSP_RESTACK_SCAN_RESULT sm
  606. WHERE sm.RESULT_SCAN_TAG = #{resultScanTag}
  607. </select>
  608. <!--根据网格id和物资id查找主键id -->
  609. <select id="selectGmIdByGridIdAndMaterialId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  610. select WGM.GM_ID "gmId"
  611. from WMSP_GRID_MATERIAL WGM
  612. where WGM.GRID_ID=#{gridId} and WGM.MATERIAL_ID=#{materialId}
  613. </select>
  614. <!-- 根据实绩id查找倒垛前的仓储网格id -->
  615. <select id="selectGridIdByResultId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  616. select WRMM.BEFORE_GRID_ID "BeforegridId"
  617. from WMSP_RESTACK_MAKE_MATERIAL WRMM
  618. where WRMM.MAKE_RESULT_ID=#{resultId}
  619. </select>
  620. <!--根据网格id查找倒垛前的物资-->
  621. <select id="selectMaterialIdByGridId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  622. select WGM.MATERIAL_ID "materialId"
  623. from WMSP_GRID_MATERIAL WGM
  624. where WGM.GRID_ID=#{gridId}
  625. </select>
  626. <select id="selectTagByResultId" parameterType="java.lang.Integer" resultType="java.util.Map">
  627. select WRSR.RESULT_SCAN_TAG "tag"
  628. from WMSP_RESTACK_SCAN_RESULT WRSR
  629. where WRSR.RESULT_RESTACK_ID=#{resultId} AND WRSR.RESULT_LOADER_AUDIT=1
  630. </select>
  631. <select id="getWmspRestackScanResultCount" resultType="java.lang.Integer">
  632. select count(*) from WMSP_RESTACK_SCAN_RESULT WRSR
  633. where WRSR.MATERIAL_ONLY_CODE=#{onlyCode}
  634. </select>
  635. </mapper>