WmspInboundScanResultMapper.xml 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045
  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.WmspInboundScanResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.WmspInboundScanResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="INBOUND_RESULT_ID" jdbcType="DECIMAL" property="inboundResultId" />
  7. <result column="LOAD_ID" jdbcType="DECIMAL" property="loadId" />
  8. <result column="RESULT_MATERIAL" jdbcType="VARCHAR" property="resultMaterial" />
  9. <result column="INBOUND_GROUP_ID" jdbcType="DECIMAL" property="inboundGroupId" />
  10. <result column="RESULT_LOAD_TIME" jdbcType="TIMESTAMP" property="resultLoadTime" />
  11. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  12. <result column="INBOUND_ABNORMALIS" jdbcType="DECIMAL" property="inboundAbnormalis" />
  13. <result column="INBOUND_MATERIAL_NUMBER" jdbcType="DECIMAL" property="inboundMaterialNumber" />
  14. <result column="RESULT_STATUS_" jdbcType="DECIMAL" property="resultStatus" />
  15. <result column="RESULT_NUMBER" jdbcType="DECIMAL" property="resultNumber" />
  16. <result column="RESULT_DELETED" jdbcType="DECIMAL" property="resultDeleted" />
  17. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  18. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  19. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  20. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  21. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  22. </resultMap>
  23. <sql id="columns">
  24. RESULT_ID, INBOUND_RESULT_ID, LOAD_ID, RESULT_MATERIAL,INBOUND_GROUP_ID, RESULT_LOAD_TIME, MATERIAL_ID,
  25. INBOUND_ABNORMALIS, INBOUND_MATERIAL_NUMBER, RESULT_STATUS_, RESULT_NUMBER, RESULT_DELETED,
  26. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
  27. </sql>
  28. <sql id="columns_alias">
  29. t.RESULT_ID, t.INBOUND_RESULT_ID, t.LOAD_ID, t.RESULT_MATERIAL,INBOUND_GROUP_ID, t.RESULT_LOAD_TIME,
  30. t.MATERIAL_ID, t.INBOUND_ABNORMALIS, t.INBOUND_MATERIAL_NUMBER, t.RESULT_STATUS_,
  31. t.RESULT_NUMBER, t.RESULT_DELETED, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
  32. t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
  33. </sql>
  34. <sql id="select">
  35. SELECT <include refid="columns" /> FROM WMSP_INBOUND_SCAN_RESULT
  36. </sql>
  37. <sql id="select_alias">
  38. SELECT <include refid="columns_alias" /> FROM WMSP_INBOUND_SCAN_RESULT t
  39. </sql>
  40. <sql id="where">
  41. <where>
  42. <if test="resultId != null">
  43. and RESULT_ID = #{resultId}
  44. </if>
  45. <if test="inboundResultId != null">
  46. and INBOUND_RESULT_ID = #{inboundResultId}
  47. </if>
  48. <if test="loadId != null">
  49. and LOAD_ID = #{loadId}
  50. </if>
  51. <if test="resultMaterial != null and resultMaterial != ''">
  52. and RESULT_MATERIAL = #{resultMaterial}
  53. </if>
  54. <if test="inboundGroupId != null and inboundGroupId != ''">
  55. and INBOUND_GROUP_ID = #{inboundGroupId}
  56. </if>
  57. <if test="resultLoadTime != null">
  58. and TO_CHAR(RESULT_LOAD_TIME,'yyyy-MM-dd') = #{resultLoadTime}
  59. </if>
  60. <if test="materialId != null">
  61. and MATERIAL_ID = #{materialId}
  62. </if>
  63. <if test="inboundAbnormalis != null">
  64. and INBOUND_ABNORMALIS = #{inboundAbnormalis}
  65. </if>
  66. <if test="inboundMaterialNumber != null">
  67. and INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber}
  68. </if>
  69. <if test="resultStatus != null">
  70. and RESULT_STATUS_ = #{resultStatus}
  71. </if>
  72. <if test="resultNumber != null">
  73. and RESULT_NUMBER = #{resultNumber}
  74. </if>
  75. <if test="resultDeleted != null">
  76. and RESULT_DELETED = #{resultDeleted}
  77. </if>
  78. <if test="insertUsername != null and insertUsername != ''">
  79. and INSERT_USERNAME = #{insertUsername}
  80. </if>
  81. <if test="insertTime != null">
  82. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  83. </if>
  84. <if test="updateUsername != null and updateUsername != ''">
  85. and UPDATE_USERNAME = #{updateUsername}
  86. </if>
  87. <if test="updateTime != null">
  88. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  89. </if>
  90. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  91. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  92. </if>
  93. </where>
  94. </sql>
  95. <sql id="whereLike">
  96. <where>
  97. <if test="resultId != null">
  98. and RESULT_ID = #{resultId}
  99. </if>
  100. <if test="inboundResultId != null">
  101. and INBOUND_RESULT_ID = #{inboundResultId}
  102. </if>
  103. <if test="loadId != null">
  104. and LOAD_ID = #{loadId}
  105. </if>
  106. <if test="resultMaterial != null and resultMaterial != ''">
  107. and RESULT_MATERIAL LIKE '%${resultMaterial}%'
  108. </if>
  109. <if test="inboundGroupId != null and inboundGroupId != ''">
  110. and INBOUND_GROUP_ID LIKE '%${inboundGroupId}%'
  111. </if>
  112. <if test="resultLoadTime != null">
  113. and TO_CHAR(RESULT_LOAD_TIME,'yyyy-MM-dd') = #{resultLoadTime}
  114. </if>
  115. <if test="materialId != null">
  116. and MATERIAL_ID = #{materialId}
  117. </if>
  118. <if test="inboundAbnormalis != null">
  119. and INBOUND_ABNORMALIS = #{inboundAbnormalis}
  120. </if>
  121. <if test="inboundMaterialNumber != null">
  122. and INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber}
  123. </if>
  124. <if test="resultStatus != null">
  125. and RESULT_STATUS_ = #{resultStatus}
  126. </if>
  127. <if test="resultNumber != null">
  128. and RESULT_NUMBER = #{resultNumber}
  129. </if>
  130. <if test="resultDeleted != null">
  131. and RESULT_DELETED = #{resultDeleted}
  132. </if>
  133. <if test="insertUsername != null and insertUsername != ''">
  134. and INSERT_USERNAME LIKE '%${insertUsername}%'
  135. </if>
  136. <if test="insertTime != null">
  137. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  138. </if>
  139. <if test="updateUsername != null and updateUsername != ''">
  140. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  141. </if>
  142. <if test="updateTime != null">
  143. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  144. </if>
  145. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  146. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  147. </if>
  148. </where>
  149. </sql>
  150. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  151. delete from WMSP_INBOUND_SCAN_RESULT
  152. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  153. </delete>
  154. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  155. delete from WMSP_INBOUND_SCAN_RESULT
  156. where 1!=1
  157. <if test="inboundResultId != null">
  158. or INBOUND_RESULT_ID = #{inboundResultId}
  159. </if>
  160. <if test="loadId != null">
  161. or LOAD_ID = #{loadId}
  162. </if>
  163. <if test="resultMaterial != null and resultMaterial != ''">
  164. or RESULT_MATERIAL = #{resultMaterial}
  165. </if>
  166. <if test="inboundGroupId != null and inboundGroupId != ''">
  167. or INBOUND_GROUP_ID = #{inboundGroupId}
  168. </if>
  169. <if test="resultLoadTime != null">
  170. or TO_CHAR(RESULT_LOAD_TIME,'yyyy-MM-dd') = '#{resultLoadTime}'
  171. </if>
  172. <if test="materialId != null">
  173. or MATERIAL_ID = #{materialId}
  174. </if>
  175. <if test="inboundAbnormalis != null">
  176. or INBOUND_ABNORMALIS = #{inboundAbnormalis}
  177. </if>
  178. <if test="inboundMaterialNumber != null">
  179. or INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber}
  180. </if>
  181. <if test="resultStatus != null">
  182. or RESULT_STATUS_ = #{resultStatus}
  183. </if>
  184. <if test="resultNumber != null">
  185. or RESULT_NUMBER = #{resultNumber}
  186. </if>
  187. <if test="resultDeleted != null">
  188. or RESULT_DELETED = #{resultDeleted}
  189. </if>
  190. <if test="insertUsername != null and insertUsername != ''">
  191. or INSERT_USERNAME = #{insertUsername}
  192. </if>
  193. <if test="insertTime != null">
  194. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  195. </if>
  196. <if test="updateUsername != null and updateUsername != ''">
  197. or UPDATE_USERNAME = #{updateUsername}
  198. </if>
  199. <if test="updateTime != null">
  200. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  201. </if>
  202. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  203. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  204. </if>
  205. </delete>
  206. <insert id="insert" parameterType="com.steerinfo.dil.model.WmspInboundScanResult">
  207. insert into WMSP_INBOUND_SCAN_RESULT (RESULT_ID, INBOUND_RESULT_ID, LOAD_ID,
  208. RESULT_MATERIAL,INBOUND_GROUP_ID, RESULT_LOAD_TIME, MATERIAL_ID,
  209. INBOUND_ABNORMALIS, INBOUND_MATERIAL_NUMBER,
  210. RESULT_STATUS_, RESULT_NUMBER, RESULT_DELETED,
  211. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  212. UPDATE_TIME, INSERT_UPDATE_REMARK)
  213. values (#{resultId,jdbcType=DECIMAL}, #{inboundResultId,jdbcType=DECIMAL}, #{loadId,jdbcType=DECIMAL},
  214. #{resultMaterial,jdbcType=VARCHAR},#{inboundGroupId,jdbcType=VARCHAR},, #{resultLoadTime,jdbcType=TIMESTAMP}, #{materialId,jdbcType=DECIMAL},
  215. #{inboundAbnormalis,jdbcType=DECIMAL}, #{inboundMaterialNumber,jdbcType=DECIMAL},
  216. #{resultStatus,jdbcType=DECIMAL}, #{resultNumber,jdbcType=DECIMAL}, #{resultDeleted,jdbcType=DECIMAL},
  217. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  218. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
  219. </insert>
  220. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.WmspInboundScanResult">
  221. insert into WMSP_INBOUND_SCAN_RESULT
  222. <trim prefix="(" suffix=")" suffixOverrides=",">
  223. <if test="resultId != null">
  224. RESULT_ID,
  225. </if>
  226. <if test="inboundResultId != null">
  227. INBOUND_RESULT_ID,
  228. </if>
  229. <if test="loadId != null">
  230. LOAD_ID,
  231. </if>
  232. <if test="resultMaterial != null">
  233. RESULT_MATERIAL,
  234. </if>
  235. <if test="inboundGroupId != null">
  236. INBOUND_GROUP_ID,
  237. </if>
  238. <if test="resultLoadTime != null">
  239. RESULT_LOAD_TIME,
  240. </if>
  241. <if test="materialId != null">
  242. MATERIAL_ID,
  243. </if>
  244. <if test="inboundAbnormalis != null">
  245. INBOUND_ABNORMALIS,
  246. </if>
  247. <if test="inboundMaterialNumber != null">
  248. INBOUND_MATERIAL_NUMBER,
  249. </if>
  250. <if test="resultStatus != null">
  251. RESULT_STATUS_,
  252. </if>
  253. <if test="resultNumber != null">
  254. RESULT_NUMBER,
  255. </if>
  256. <if test="resultDeleted != null">
  257. RESULT_DELETED,
  258. </if>
  259. <if test="insertUsername != null">
  260. INSERT_USERNAME,
  261. </if>
  262. <if test="insertTime != null">
  263. INSERT_TIME,
  264. </if>
  265. <if test="updateUsername != null">
  266. UPDATE_USERNAME,
  267. </if>
  268. <if test="updateTime != null">
  269. UPDATE_TIME,
  270. </if>
  271. <if test="insertUpdateRemark != null">
  272. INSERT_UPDATE_REMARK,
  273. </if>
  274. </trim>
  275. <trim prefix="values (" suffix=")" suffixOverrides=",">
  276. <if test="resultId != null">
  277. #{resultId,jdbcType=DECIMAL},
  278. </if>
  279. <if test="inboundResultId != null">
  280. #{inboundResultId,jdbcType=DECIMAL},
  281. </if>
  282. <if test="loadId != null">
  283. #{loadId,jdbcType=DECIMAL},
  284. </if>
  285. <if test="resultMaterial != null">
  286. #{resultMaterial,jdbcType=VARCHAR},
  287. </if>
  288. <if test="inboundGroupId != null">
  289. #{inboundGroupId,jdbcType=VARCHAR},
  290. </if>
  291. <if test="resultLoadTime != null">
  292. #{resultLoadTime,jdbcType=TIMESTAMP},
  293. </if>
  294. <if test="materialId != null">
  295. #{materialId,jdbcType=DECIMAL},
  296. </if>
  297. <if test="inboundAbnormalis != null">
  298. #{inboundAbnormalis,jdbcType=DECIMAL},
  299. </if>
  300. <if test="inboundMaterialNumber != null">
  301. #{inboundMaterialNumber,jdbcType=DECIMAL},
  302. </if>
  303. <if test="resultStatus != null">
  304. #{resultStatus,jdbcType=DECIMAL},
  305. </if>
  306. <if test="resultNumber != null">
  307. #{resultNumber,jdbcType=DECIMAL},
  308. </if>
  309. <if test="resultDeleted != null">
  310. #{resultDeleted,jdbcType=DECIMAL},
  311. </if>
  312. <if test="insertUsername != null">
  313. #{insertUsername,jdbcType=VARCHAR},
  314. </if>
  315. <if test="insertTime != null">
  316. #{insertTime,jdbcType=TIMESTAMP},
  317. </if>
  318. <if test="updateUsername != null">
  319. #{updateUsername,jdbcType=VARCHAR},
  320. </if>
  321. <if test="updateTime != null">
  322. #{updateTime,jdbcType=TIMESTAMP},
  323. </if>
  324. <if test="insertUpdateRemark != null">
  325. #{insertUpdateRemark,jdbcType=VARCHAR},
  326. </if>
  327. </trim>
  328. </insert>
  329. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.WmspInboundScanResult">
  330. update WMSP_INBOUND_SCAN_RESULT
  331. set INBOUND_RESULT_ID = #{inboundResultId,jdbcType=DECIMAL},
  332. LOAD_ID = #{loadId,jdbcType=DECIMAL},
  333. RESULT_MATERIAL = #{resultMaterial,jdbcType=VARCHAR},
  334. INBOUND_GROUP_ID = #{inboundGroupId,jdbcType=VARCHAR},
  335. RESULT_LOAD_TIME = #{resultLoadTime,jdbcType=TIMESTAMP},
  336. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  337. INBOUND_ABNORMALIS = #{inboundAbnormalis,jdbcType=DECIMAL},
  338. INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber,jdbcType=DECIMAL},
  339. RESULT_STATUS_ = #{resultStatus,jdbcType=DECIMAL},
  340. RESULT_NUMBER = #{resultNumber,jdbcType=DECIMAL},
  341. RESULT_DELETED = #{resultDeleted,jdbcType=DECIMAL},
  342. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  343. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  344. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  345. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  346. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
  347. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  348. </update>
  349. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.WmspInboundScanResult">
  350. update WMSP_INBOUND_SCAN_RESULT
  351. <set>
  352. <if test="inboundResultId != null">
  353. INBOUND_RESULT_ID = #{inboundResultId,jdbcType=DECIMAL},
  354. </if>
  355. <if test="loadId != null">
  356. LOAD_ID = #{loadId,jdbcType=DECIMAL},
  357. </if>
  358. <if test="resultMaterial != null">
  359. RESULT_MATERIAL = #{resultMaterial,jdbcType=VARCHAR},
  360. </if>
  361. <if test="inboundGroupId != null">
  362. INBOUND_GROUP_ID = #{inboundGroupId,jdbcType=VARCHAR},
  363. </if>
  364. <if test="resultLoadTime != null">
  365. RESULT_LOAD_TIME = #{resultLoadTime,jdbcType=TIMESTAMP},
  366. </if>
  367. <if test="materialId != null">
  368. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  369. </if>
  370. <if test="inboundAbnormalis != null">
  371. INBOUND_ABNORMALIS = #{inboundAbnormalis,jdbcType=DECIMAL},
  372. </if>
  373. <if test="inboundMaterialNumber != null">
  374. INBOUND_MATERIAL_NUMBER = #{inboundMaterialNumber,jdbcType=DECIMAL},
  375. </if>
  376. <if test="resultStatus != null">
  377. RESULT_STATUS_ = #{resultStatus,jdbcType=DECIMAL},
  378. </if>
  379. <if test="resultNumber != null">
  380. RESULT_NUMBER = #{resultNumber,jdbcType=DECIMAL},
  381. </if>
  382. <if test="resultDeleted != null">
  383. RESULT_DELETED = #{resultDeleted,jdbcType=DECIMAL},
  384. </if>
  385. <if test="insertUsername != null">
  386. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  387. </if>
  388. <if test="insertTime != null">
  389. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  390. </if>
  391. <if test="updateUsername != null">
  392. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  393. </if>
  394. <if test="updateTime != null">
  395. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  396. </if>
  397. <if test="insertUpdateRemark != null">
  398. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  399. </if>
  400. </set>
  401. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  402. </update>
  403. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  404. <include refid="select" />
  405. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  406. </select>
  407. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  408. <include refid="select" />
  409. <include refid="where" />
  410. </select>
  411. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  412. <include refid="select" />
  413. <include refid="whereLike" />
  414. </select>
  415. <insert id="batchInsert" parameterType="java.util.List">
  416. insert into WMSP_INBOUND_SCAN_RESULT
  417. (RESULT_ID,
  418. INBOUND_RESULT_ID, LOAD_ID, RESULT_MATERIAL,INBOUND_GROUP_ID,
  419. RESULT_LOAD_TIME, MATERIAL_ID,
  420. INBOUND_ABNORMALIS, INBOUND_MATERIAL_NUMBER,
  421. RESULT_STATUS_, RESULT_NUMBER, RESULT_DELETED,
  422. INSERT_USERNAME, INSERT_TIME,
  423. UPDATE_USERNAME, UPDATE_TIME,
  424. INSERT_UPDATE_REMARK)
  425. ( <foreach collection="list" item="item" separator="union all">
  426. select
  427. #{item.resultId,jdbcType=DECIMAL},
  428. #{item.inboundResultId,jdbcType=DECIMAL}, #{item.loadId,jdbcType=DECIMAL}, #{item.resultMaterial,jdbcType=VARCHAR},#{item.inboundGroupId,jdbcType=VARCHAR},
  429. #{item.resultLoadTime,jdbcType=TIMESTAMP}, #{item.materialId,jdbcType=DECIMAL},
  430. #{item.inboundAbnormalis,jdbcType=DECIMAL}, #{item.inboundMaterialNumber,jdbcType=DECIMAL},
  431. #{item.resultStatus,jdbcType=DECIMAL}, #{item.resultNumber,jdbcType=DECIMAL}, #{item.resultDeleted,jdbcType=DECIMAL},
  432. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  433. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  434. #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
  435. </foreach> )
  436. </insert>
  437. <update id="batchUpdate" parameterType="java.util.List">
  438. update WMSP_INBOUND_SCAN_RESULT
  439. set
  440. RESULT_ID=
  441. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  442. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  443. </foreach>
  444. ,INBOUND_RESULT_ID=
  445. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  446. when #{item.resultId,jdbcType=DECIMAL} then #{item.inboundResultId,jdbcType=DECIMAL}
  447. </foreach>
  448. ,LOAD_ID=
  449. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  450. when #{item.resultId,jdbcType=DECIMAL} then #{item.loadId,jdbcType=DECIMAL}
  451. </foreach>
  452. ,RESULT_MATERIAL=
  453. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  454. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMaterial,jdbcType=VARCHAR}
  455. </foreach>
  456. ,INBOUND_GROUP_ID=
  457. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  458. when #{item.resultId,jdbcType=DECIMAL} then #{item.inboundGroupId,jdbcType=VARCHAR}
  459. </foreach>
  460. ,RESULT_LOAD_TIME=
  461. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  462. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadTime,jdbcType=TIMESTAMP}
  463. </foreach>
  464. ,MATERIAL_ID=
  465. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  466. when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  467. </foreach>
  468. ,INBOUND_ABNORMALIS=
  469. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  470. when #{item.resultId,jdbcType=DECIMAL} then #{item.inboundAbnormalis,jdbcType=DECIMAL}
  471. </foreach>
  472. ,INBOUND_MATERIAL_NUMBER=
  473. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  474. when #{item.resultId,jdbcType=DECIMAL} then #{item.inboundMaterialNumber,jdbcType=DECIMAL}
  475. </foreach>
  476. ,RESULT_STATUS_=
  477. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  478. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultStatus,jdbcType=DECIMAL}
  479. </foreach>
  480. ,RESULT_NUMBER=
  481. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  482. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=DECIMAL}
  483. </foreach>
  484. ,RESULT_DELETED=
  485. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  486. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDeleted,jdbcType=DECIMAL}
  487. </foreach>
  488. ,INSERT_USERNAME=
  489. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  490. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  491. </foreach>
  492. ,INSERT_TIME=
  493. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  494. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  495. </foreach>
  496. ,UPDATE_USERNAME=
  497. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  498. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  499. </foreach>
  500. ,UPDATE_TIME=
  501. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  502. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  503. </foreach>
  504. ,INSERT_UPDATE_REMARK=
  505. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  506. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  507. </foreach>
  508. where RESULT_ID in
  509. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  510. #{item.resultId,jdbcType=DECIMAL}
  511. </foreach>
  512. </update>
  513. <delete id="batchDelete" parameterType="java.util.List">
  514. delete from WMSP_INBOUND_SCAN_RESULT
  515. where RESULT_ID in
  516. <foreach close=")" collection="list" item="id" open="(" separator=",">
  517. #{id}
  518. </foreach>
  519. </delete>
  520. <!-- 友情提示!!!-->
  521. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  522. <!-- <select id="getCount" resultType="java.math.BigDecimal">-->
  523. <!-- select Max(result_id) from wmsp_inbound_scan_result-->
  524. <!-- </select>-->
  525. <select id="getScanNumber" parameterType="java.util.Map" resultType="java.math.BigDecimal">
  526. select max(wisr.result_number)
  527. from wmsp_inbound_scan_result wisr
  528. where wisr.load_id = #{loadId}
  529. </select>
  530. <update id="updateInboundAbnormal">
  531. update wmsp_inbound_scan_result wisr
  532. set (wisr.inbound_abnormalis) =
  533. (select min(wisr.inbound_abnormalis)
  534. from wmsp_inbound_scan_result wisr
  535. join rms_personnel rp
  536. on rp.personnel_id = wisr.load_id
  537. where (wisr.load_id = #{loadId}
  538. or
  539. wisr.load_id = #{otherLoadId})
  540. and wisr.result_number = #{resultNumber})
  541. where wisr.result_number = #{resultNumber}
  542. </update>
  543. <update id="updateInboundScanResult">
  544. update wmsp_inbound_scan_result wisr
  545. set wisr.inbound_result_id=#{InbounId},
  546. wisr.result_number=0,
  547. wisr.result_status_=1
  548. where wisr.result_id = #{resultId}
  549. </update>
  550. <update id="updateReboundScanResult">
  551. update wmsp_inbound_scan_result wisr
  552. set wisr.result_number=0,
  553. wisr.result_status_=1
  554. where wisr.result_id = #{RESULTID}
  555. </update>
  556. <update id="updataStatus">
  557. update wmsp_inbound_stack_result wisr
  558. set wisr.stacking_status = 0
  559. where wisr.result_id = #{stackResultId}
  560. </update>
  561. <update id="updataStatusByResultId">
  562. update wmsp_inbound_scan_result wisr
  563. set wisr.result_number=0,
  564. wisr.result_status_=1,
  565. wisr.INBOUND_RESULT_ID =#{inboundId}
  566. where wisr.result_id = #{resultId}
  567. </update>
  568. <select id="selectScanTagResult" resultType="java.util.Map">
  569. select wmsp1.result_id "RESULTAID",
  570. wmsp2.result_id "RESULTBID",
  571. rp1.personnel_name "LOADA",
  572. rp2.personnel_name "LOADB",
  573. wmsp1.inbound_material_number "MATERIAL_NUMBER",
  574. wmsp1.result_load_time "scan_time",
  575. rm.material_name "material_name",
  576. rm.material_specification || '(' || rm.material_model || ')' "specification",
  577. ruom.unit_of_measure_name "measure_name",
  578. wmsp1.inbound_abnormalis "abnormalis"
  579. from wmsp_inbound_scan_result wmsp1
  580. join
  581. rms_material_steel rms
  582. on
  583. rms.material_steel_id = wmsp1.material_id
  584. join
  585. rms_material rm
  586. on
  587. rm.material_id = rms.material_id
  588. join
  589. rms_unit_of_measure ruom
  590. on
  591. ruom.unit_of_measure_id = rm.unit_of_measure_id
  592. join
  593. wmsp_inbound_scan_result wmsp2
  594. on
  595. wmsp1.result_number = wmsp2.result_number
  596. join
  597. rms_personnel rp1
  598. on
  599. rp1.personnel_id = wmsp1.load_id
  600. join
  601. rms_personnel rp2
  602. on
  603. rp2.personnel_id = wmsp2.load_id
  604. and
  605. rp1.personnel_department_id = rp2.personnel_department_id
  606. and
  607. rp1.personnel_workshopid = rp2.personnel_workshopid
  608. and
  609. rp1.personnel_shifts = rp2.personnel_shifts
  610. and
  611. rp1.personnel_team = rp2.personnel_team
  612. where rp1.personnel_id = 1
  613. and rp2.personnel_id = 2
  614. and wmsp1.result_status_ = 0
  615. and wmsp2.result_status_ = 0
  616. </select>
  617. <select id="selectRepeat" resultMap="BaseResultMap">
  618. select *
  619. from wmsp_inbound_scan_result wisr
  620. where wisr.load_id = #{loadId}
  621. and wisr.result_material = #{resultMaterial}
  622. </select>
  623. <select id="selectIssuedScanTagResult" resultType="java.util.Map">
  624. select wir.inbound_id "inboundId",
  625. wir.inbound_number "inbound_no",
  626. rp1.personnel_name "LOADA",
  627. rp2.personnel_name "LOADB",
  628. wmsp1.inbound_material_number "MATERIAL_NUMBER",
  629. wmsp1.result_load_time "scan_time",
  630. rm.material_name "material_name",
  631. rm.material_specification || '(' || rm.material_model || ')' "specification",
  632. ruom.unit_of_measure_name "measure_name",
  633. rw.warehouse_name "warehouse_name",
  634. rs.stacking_no "stacking_no",
  635. rpg.grid_gradation_number "gradation_number",
  636. rms.material_furnace_number "furnace_number",
  637. rms.material_theoretical_weight "theoretical_weight",
  638. wmsp1.inbound_abnormalis "abnormalis"
  639. from wmsp_inbound_scan_result wmsp1
  640. join rms_material_steel rms
  641. on rms.material_steel_id = wmsp1.material_id
  642. join rms_material rm
  643. on rm.material_id = rms.material_id
  644. join rms_unit_of_measure ruom
  645. on ruom.unit_of_measure_id = rm.unit_of_measure_id
  646. join wmsp_inbound_scan_result wmsp2
  647. on wmsp1.result_number = wmsp2.result_number
  648. join rms_personnel rp1
  649. on rp1.personnel_id = wmsp1.load_id
  650. join wmsp_inbound_result wir
  651. on wir.inbound_id = wmsp1.inbound_result_id
  652. and wir.inbound_id = wmsp2.inbound_result_id
  653. join rms_pwarehouse_grid rpg
  654. on rpg.grid_id = wir.grid_id
  655. join rms_warehouse rw
  656. on rw.warehouse_id = rpg.warehouse_id
  657. join wmsp_inbound_stack_result wisr
  658. on wisr.inbound_result_id = wir.inbound_id
  659. join rms_stacking rs
  660. on rs.stacking_id = wisr.stacking_id
  661. join rms_personnel rp2
  662. on rp2.personnel_id = wmsp2.load_id
  663. and rp1.personnel_department_id = rp2.personnel_department_id
  664. and rp1.personnel_workshopid = rp2.personnel_workshopid
  665. and rp1.personnel_shifts = rp2.personnel_shifts
  666. and rp1.personnel_team = rp2.personnel_team
  667. where rp1.personnel_id = 1
  668. and rp2.personnel_id = 2
  669. and wmsp1.result_status_ = 1
  670. and wmsp2.result_status_ = 1
  671. and wmsp1.inbound_abnormalis = 1
  672. and wmsp2.inbound_abnormalis = 1
  673. </select>
  674. <select id="checkScanResult" parameterType="java.util.Map" resultType="java.util.Map">
  675. select *
  676. from wmsp_inbound_scan_result wisr
  677. where wisr.result_material = #{resultMaterial}
  678. and wisr.load_id = #{loadId}
  679. </select>
  680. <select id="selectIssuedScanTagNoResult" resultType="java.util.Map">
  681. select wir.inbound_id "inboundId",
  682. wir.inbound_number "inbound_no",
  683. rp1.personnel_name "LOADA",
  684. rp2.personnel_name "LOADB",
  685. wmsp1.inbound_material_number "MATERIAL_NUMBER",
  686. wmsp1.result_load_time "scan_time",
  687. rm.material_name "material_name",
  688. rm.material_specification || '(' || rm.material_model || ')' "specification",
  689. ruom.unit_of_measure_name "measure_name",
  690. rw.warehouse_name "warehouse_name",
  691. rs.stacking_no "stacking_no",
  692. rpg.grid_gradation_number "gradation_number",
  693. wmsp1.inbound_abnormalis "abnormalis"
  694. from wmsp_inbound_scan_result wmsp1
  695. join rms_material_steel rms
  696. on rms.material_steel_id = wmsp1.material_id
  697. join rms_material rm
  698. on rm.material_id = rms.material_id
  699. join rms_unit_of_measure ruom
  700. on ruom.unit_of_measure_id = rm.unit_of_measure_id
  701. join wmsp_inbound_scan_result wmsp2
  702. on wmsp1.result_number = wmsp2.result_number
  703. join rms_personnel rp1
  704. on rp1.personnel_id = wmsp1.load_id
  705. join wmsp_inbound_result wir
  706. on wir.inbound_id = wmsp1.inbound_result_id
  707. and wir.inbound_id = wmsp2.inbound_result_id
  708. join rms_pwarehouse_grid rpg
  709. on rpg.grid_id = wir.grid_id
  710. join rms_warehouse rw
  711. on rw.warehouse_id = rpg.warehouse_id
  712. join wmsp_inbound_stack_result wisr
  713. on wisr.inbound_result_id = wir.inbound_id
  714. join rms_stacking rs
  715. on rs.stacking_id = wisr.stacking_id
  716. join rms_personnel rp2
  717. on rp2.personnel_id = wmsp2.load_id
  718. and rp1.personnel_department_id = rp2.personnel_department_id
  719. and rp1.personnel_workshopid = rp2.personnel_workshopid
  720. and rp1.personnel_shifts = rp2.personnel_shifts
  721. and rp1.personnel_team = rp2.personnel_team
  722. where rp1.personnel_id = 1
  723. and rp2.personnel_id = 2
  724. and wmsp1.result_status_ = 1
  725. and wmsp2.result_status_ = 1
  726. and wmsp1.inbound_abnormalis = 0
  727. and wmsp2.inbound_abnormalis = 0
  728. </select>
  729. <select id="selectReIssuedScanResult" resultType="java.util.Map">
  730. select wir.inbound_id "inboundId",
  731. wir.inbound_number "inbound_no",
  732. rp.personnel_name "LOADA",
  733. wmsp.inbound_material_number "MATERIAL_NUMBER",
  734. wmsp.result_load_time "scan_time",
  735. rm.material_name "material_name",
  736. rm.material_specification || '(' || rm.material_model || ')' "specification",
  737. ruom.unit_of_measure_name "measure_name",
  738. rw.warehouse_name "warehouse_name",
  739. rs.stacking_no "stacking_no",
  740. rpg.grid_gradation_number "gradation_number",
  741. rms.material_furnace_number "furnace_number",
  742. rms.material_theoretical_weight "theoretical_weight"
  743. from wmsp_inbound_scan_result wmsp
  744. join rms_material_steel rms
  745. on rms.material_steel_id = wmsp.material_id
  746. join rms_material rm
  747. on rm.material_id = rms.material_id
  748. join rms_unit_of_measure ruom
  749. on ruom.unit_of_measure_id = rm.unit_of_measure_id
  750. join rms_personnel rp
  751. on rp.personnel_id = wmsp.load_id
  752. join wmsp_inbound_result wir
  753. on wir.inbound_id = wmsp.inbound_result_id
  754. join rms_pwarehouse_grid rpg
  755. on rpg.grid_id = wir.grid_id
  756. join rms_warehouse rw
  757. on rw.warehouse_id = rpg.warehouse_id
  758. join wmsp_inbound_stack_result wisr
  759. on wisr.inbound_result_id = wir.inbound_id
  760. join rms_stacking rs
  761. on rs.stacking_id = wisr.stacking_id
  762. where rp.personnel_id = 4
  763. and wmsp.result_status_ = 1
  764. and wir.inbound_type = 1
  765. </select>
  766. <select id="selectReScanTagResult" resultType="java.util.Map">
  767. select wir.inbound_id "inboundId",
  768. wmsp.result_id "RESULTID",
  769. rp.personnel_name "LOADA",
  770. wmsp.inbound_material_number "MATERIAL_NUMBER",
  771. wmsp.result_load_time "scan_time",
  772. rm.material_name "material_name",
  773. rm.material_specification || '(' || rm.material_model || ')' "specification",
  774. ruom.unit_of_measure_name "measure_name"
  775. from wmsp_inbound_scan_result wmsp
  776. join wmsp_inbound_result wir
  777. on wir.inbound_id = wmsp.inbound_result_id
  778. join rms_material_steel rms
  779. on rms.material_steel_id = wmsp.material_id
  780. join rms_material rm
  781. on rm.material_id = rms.material_id
  782. join rms_unit_of_measure ruom
  783. on ruom.unit_of_measure_id = rm.unit_of_measure_id
  784. join rms_personnel rp
  785. on rp.personnel_id = wmsp.load_id
  786. where rp.personnel_id = 4
  787. and wmsp.result_status_ = 0
  788. and wir.inbound_type = 1
  789. </select>
  790. <select id="selectIvIssuedScanResult" resultType="java.util.Map">
  791. select wir.inbound_id "inboundId",
  792. wimr.result_no "result_no",
  793. rp.personnel_name "LOADA",
  794. wmsp.inbound_material_number "MATERIAL_NUMBER",
  795. wmsp.result_load_time "scan_time",
  796. rm.material_name "material_name",
  797. rm.material_specification || '(' || rm.material_model || ')' "specification",
  798. ruom.unit_of_measure_name "measure_name",
  799. rw.warehouse_name "warehouse_name",
  800. rs.stacking_no "stacking_no",
  801. rpg.grid_gradation_number "gradation_number",
  802. rms.material_furnace_number "furnace_number",
  803. rms.material_theoretical_weight "theoretical_weight"
  804. from wmsp_inbound_scan_result wmsp
  805. join rms_material_steel rms
  806. on rms.material_steel_id = wmsp.material_id
  807. join wmsp_ivbound_make_material wimm
  808. on wmsp.material_id = wimm.material_steel_id
  809. join wmsp_ivbound_make_result wimr
  810. on wimr.result_id = wimm.result_id
  811. join rms_material rm
  812. on rm.material_id = rms.material_id
  813. join rms_unit_of_measure ruom
  814. on ruom.unit_of_measure_id = rm.unit_of_measure_id
  815. join rms_personnel rp
  816. on rp.personnel_id = wmsp.load_id
  817. join wmsp_inbound_result wir
  818. on wir.inbound_id = wmsp.inbound_result_id
  819. join rms_pwarehouse_grid rpg
  820. on rpg.grid_id = wir.grid_id
  821. join rms_warehouse rw
  822. on rw.warehouse_id = rpg.warehouse_id
  823. join wmsp_inbound_stack_result wisr
  824. on wisr.inbound_result_id = wir.inbound_id
  825. join rms_stacking rs
  826. on rs.stacking_id = wisr.stacking_id
  827. where rp.personnel_id = 6
  828. and wmsp.result_status_ = 1
  829. and wir.inbound_type = 2
  830. </select>
  831. <select id="selectIvScanTagResult" resultType="java.util.Map">
  832. select wimr.result_no "resultno",
  833. wir.inbound_id "inboundId",
  834. wmsp.result_id "RESULTID",
  835. rp.personnel_name "LOADA",
  836. wmsp.inbound_material_number "MATERIAL_NUMBER",
  837. wmsp.result_load_time "scan_time",
  838. rm.material_name "material_name",
  839. rm.material_specification || '(' || rm.material_model || ')' "specification",
  840. ruom.unit_of_measure_name "measure_name"
  841. from wmsp_inbound_scan_result wmsp
  842. join wmsp_inbound_result wir
  843. on wir.inbound_id = wmsp.inbound_result_id
  844. join rms_material_steel rms
  845. on rms.material_steel_id = wmsp.material_id
  846. join wmsp_ivbound_make_material wimm
  847. on wmsp.material_id = wimm.material_steel_id
  848. join wmsp_ivbound_make_result wimr
  849. on wimr.result_id = wimm.result_id
  850. join rms_material rm
  851. on rm.material_id = rms.material_id
  852. join rms_unit_of_measure ruom
  853. on ruom.unit_of_measure_id = rm.unit_of_measure_id
  854. join rms_personnel rp
  855. on rp.personnel_id = wmsp.load_id
  856. where rp.personnel_id = 6
  857. and wmsp.result_status_ = 0
  858. and wir.inbound_type = 2
  859. </select>
  860. <select id="getLoadId" parameterType="java.util.Map" resultType="java.math.BigDecimal">
  861. select rp.PERSONNEL_ID
  862. from RMS_PERSONNEL rp
  863. where rp.PERSONNEL_JOB_NUMBER = #{userName}
  864. </select>
  865. <select id="getScanResult" resultType="java.util.Map">
  866. select rp.PERSONNEL_WORKSHOPID "personnelWorkshopid",
  867. rp.PERSONNEL_SHIFTS "personnelShifts",
  868. rp.PERSONNEL_TEAM "personnelTeam",
  869. wir.inbound_number "inboundNo",
  870. rw.warehouse_name "warehouseName",
  871. rm.material_name "materialName",
  872. rm.material_specification "materialSpecification",
  873. rm.material_model "materialMode",
  874. rms.material_furnace_number "materialFurnaceNo",
  875. rms.material_production_date "materialProDate",
  876. wisr.RESULT_ID as "resultId",
  877. wisr.INBOUND_ABNORMALIS "abnormalis",
  878. wisr.material_id as "materialId"
  879. from wmsp_inbound_scan_result wisr
  880. left join rms_material_steel rms
  881. on rms.material_steel_id = wisr.material_id
  882. left join rms_material rm
  883. on rm.material_id = rms.material_id
  884. left join wmsp_inbound_result wir
  885. on wir.inbound_id = wisr.inbound_result_id
  886. left join rms_warehouse rw
  887. on rw.warehouse_id = wir.personnel_workshopid
  888. left join RMS_PERSONNEL rp
  889. on rp.PERSONNEL_ID = wisr.LOAD_ID
  890. where wisr.LOAD_ID = #{loadId}
  891. and wisr.RESULT_STATUS_ = 0
  892. </select>
  893. <!--返回结果-->
  894. <select id="getReScanresult" resultType="java.util.Map" parameterType="java.math.BigDecimal">
  895. select rp.PERSONNEL_DEPARTMENT_ID "personnelWorkshopid",
  896. rp.PERSONNEL_SHIFTS "personnelShifts",
  897. rp.PERSONNEL_TEAM "personnelTeam",
  898. wir.inbound_number "inboundNo",
  899. rw.warehouse_name "warehouseName",
  900. rm.material_name "materialName",
  901. rm.MATERIAL_SPECIFICATION || '(' || RM.MATERIAL_MODEL || ')' "specification",
  902. rms.material_furnace_number "materialFurnaceNo",
  903. rms.material_production_date "materialProDate",
  904. wisr.INBOUND_MATERIAL_NUMBER "materialNumber",
  905. wisr.RESULT_ID "resultId",
  906. rm.MATERIAL_CODE "materialCode",
  907. wisr.INBOUND_ABNORMALIS "abnormalis",
  908. wisr.INSERT_TIME "scanTime",
  909. RPG.GRID_GRADATION_NUMBER "grandationNumber",
  910. RS.STACKING_NO "stackingNo",
  911. rms.MATERIAL_PRODUCTION_DATE "productionDate",
  912. rms.MATERIAL_SINGLE_BUNDLE_WEIGHT "bondleWeight"
  913. from wmsp_inbound_scan_result wisr
  914. left join rms_material_steel rms
  915. on rms.material_steel_id = wisr.material_id
  916. left join rms_material rm
  917. on rm.material_id = rms.material_id
  918. left join wmsp_inbound_result wir
  919. on wir.inbound_id = wisr.inbound_result_id
  920. left join rms_warehouse rw
  921. on rw.warehouse_id = wir.personnel_workshopid
  922. left join RMS_PERSONNEL rp
  923. on rp.PERSONNEL_ID = wisr.LOAD_ID
  924. left join WMSP_GRID_MATERIAL WGM
  925. on WGM.MATERIAL_ID=wisr.MATERIAL_ID
  926. left join RMS_PWAREHOUSE_GRID RPG
  927. ON RPG.GRID_ID=WGM.GRID_ID
  928. LEFT JOIN RMS_STACKING RS
  929. ON RS.STACKING_ID=RPG.STACKING_ID
  930. where wisr.LOAD_ID = #{loadId}
  931. and wisr.RESULT_STATUS_ = 0
  932. </select>
  933. <select id="getOtherScanResultId" parameterType="java.util.Map" resultType="java.util.Map">
  934. SELECT WISR.RESULT_ID AS "resultId"
  935. FROM WMSP_INBOUND_SCAN_RESULT WISR
  936. LEFT JOIN RMS_PERSONNEL RP
  937. ON RP.PERSONNEL_ID = WISR.LOAD_ID
  938. WHERE RP.PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
  939. AND RP.PERSONNEL_SHIFTS = #{personnelShifts}
  940. AND RP.PERSONNEL_TEAM = #{personnelTeam}
  941. AND WISR.RESULT_NUMBER != (SELECT WISRA.RESULT_NUMBER FROM WMSP_INBOUND_SCAN_RESULT WISRA WHERE WISRA.RESULT_ID = #{resultId})
  942. </select>
  943. <select id="getOtherLoadId" resultType="java.math.BigDecimal" parameterType="java.util.Map">
  944. select rp.personnel_id
  945. from rms_personnel rp
  946. where rp.PERSONNEL_DEPARTMENT_ID = #{personnelWorkshopid}
  947. and rp.personnel_shifts = #{personnelShifts}
  948. and rp.personnel_team = #{personnelTeam}
  949. and rp.personnel_post = '装卸工'
  950. and rp.personnel_id != #{loadId}
  951. </select>
  952. <select id="getOtherMaterialSteelId" resultType="java.lang.Integer" parameterType="java.util.Map">
  953. select wisr.material_id
  954. from wmsp_inbound_scan_result wisr
  955. where wisr.load_id = #{otherLoadId}
  956. and wisr.result_number = #{resultNumber}
  957. </select>
  958. <select id="selectStackNo" resultType="java.util.Map" parameterType="java.util.Map">
  959. select distinct
  960. wisr.result_id "stackResultId",
  961. widr.driving_id "drivingResultId",
  962. rs.stacking_no "stackingNo",
  963. rpg.warehouse_id "warehouseId",
  964. rs.stacking_id "stackingId",
  965. rs.stacking_arrival "stackingArrival"
  966. from wmsp_inbound_stack_result wisr
  967. left join rms_stacking rs
  968. on wisr.stacking_id = rs.stacking_id
  969. left join wmsp_inbound_driving_result widr
  970. on widr.inbound_result_id = wisr.inbound_result_id
  971. left join
  972. wmsp_inbound_result wir
  973. on
  974. wir.inbound_id = wisr.inbound_result_id
  975. left join
  976. rms_pwarehouse_grid rpg
  977. on
  978. rpg.grid_id = wir.grid_id
  979. where rpg.warehouse_id = #{warehouseId}
  980. and wisr.stacking_status = 0
  981. </select>
  982. <!-- 判断物资是否为线材 -->
  983. <select id="selectMaterialTypeByMaterialId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  984. select RMS.MATERIAL_COUNT "materialCode"
  985. from RMS_MATERIAL_STEEL RMS
  986. where RMS.MATERIAL_STEEL_ID=#{materialId}
  987. </select>
  988. <!-- 查询是否已经扫描-->
  989. <select id="isExist" resultType="java.lang.Integer">
  990. select count(*) from WMSP_INBOUND_SCAN_RESULT wisr
  991. left join WMSP_INBOUND_GROUP wig
  992. on wisr.inbound_Group_Id=wig.inbound_Group_Id
  993. where (wig.USER_NAME_ONE ='${userName}' or wig.USER_NAME_TWO ='${userName}') and wig.state=1 and wisr.INSERT_USERNAME=#{userName}
  994. and wisr.result_material=#{resultMaterial}
  995. </select>
  996. <!--查询已经扫描但是没有下发的-->
  997. <select id="noIssueScanResult" resultMap="BaseResultMap">
  998. select * from WMSP_INBOUND_SCAN_RESULT wisr
  999. left join WMSP_INBOUND_GROUP wig
  1000. on wisr.inbound_Group_Id=wig.inbound_Group_Id
  1001. where wig.USER_NAME_ONE=#{userId} or wig.USER_NAME_TWO=#{userId} and wig.state=1
  1002. and wisr.INBOUND_RESULT_ID is null
  1003. </select>
  1004. <!--查询已经扫描但是没有下发的物质数量-->
  1005. <select id="getScanedNumber" resultType="java.math.BigDecimal">
  1006. select count(*) from WMSP_INBOUND_SCAN_RESULT wisr
  1007. left join WMSP_INBOUND_GROUP wig
  1008. on wisr.inbound_Group_Id=wig.inbound_Group_Id
  1009. where wig.USER_NAME_ONE=#{userId} or wig.USER_NAME_TWO=#{userId} and wig.state=1
  1010. and wisr.INBOUND_RESULT_ID is null
  1011. </select>
  1012. <select id="noIssueScanResultList" resultType="java.util.Map">
  1013. select
  1014. rm.material_name "materialName",
  1015. rm.material_specification "materialSpecification",
  1016. rm.material_model "materialMode",
  1017. rms.material_furnace_number "materialFurnaceNo",
  1018. rms.material_production_date "materialProDate",
  1019. wisr.RESULT_ID as "resultId",
  1020. wisr.INBOUND_ABNORMALIS "abnormalis",
  1021. wisr.material_id as "materialId"
  1022. from wmsp_inbound_scan_result wisr
  1023. left join rms_material_steel rms
  1024. on rms.material_steel_id = wisr.material_id
  1025. left join rms_material rm
  1026. on rm.material_id = rms.material_id
  1027. where wisr.INSERT_USERNAME = #{userName}
  1028. and wisr.RESULT_STATUS_ = 0
  1029. </select>
  1030. <select id="getResultStatusByResultId" resultType="java.lang.Integer">
  1031. SELECT RESULT_STATUS_ FROM WMSP_INBOUND_SCAN_RESULT WHERE RESULT_ID=#{resultId}
  1032. </select>
  1033. </mapper>