WmspInboundScanResultMapper.xml 56 KB

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