WmspInboundResultMapper.xml 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380
  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.WmspInboundResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.WmspInboundResult">
  5. <id column="INBOUND_ID" jdbcType="DECIMAL" property="inboundId" />
  6. <result column="INBOUND_TYPE" jdbcType="DECIMAL" property="inboundType" />
  7. <result column="INBOUND_NUMBER" jdbcType="VARCHAR" property="inboundNumber" />
  8. <result column="INBOUND_DISTRIBUTE_ID" jdbcType="DECIMAL" property="inboundDistributeId" />
  9. <result column="GRID_ID" jdbcType="DECIMAL" property="gridId" />
  10. <result column="INBOUND_GROUP_ID" jdbcType="DECIMAL" property="inboundGroupId" />
  11. <result column="PERSONNEL_WORKSHOPID" jdbcType="DECIMAL" property="personnelWorkshopid" />
  12. <result column="RESULT_NUMBER" jdbcType="DECIMAL" property="resultNumber" />
  13. <result column="RESULT_STATUS" jdbcType="DECIMAL" property="resultStatus" />
  14. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  15. <result column="INBOUND_ISCOMPLETE" jdbcType="DECIMAL" property="inboundIscomplete" />
  16. <result column="RESULT_DELETED" jdbcType="DECIMAL" property="resultDeleted" />
  17. <result column="INBOUND_TIME" jdbcType="TIMESTAMP" property="inboundTime" />
  18. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  19. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  20. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  21. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  22. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  23. <result column="PERSONNEL_TEAM" jdbcType="VARCHAR" property="personnelTeam" />
  24. <result column="PERSONNEL_SHIFTS" jdbcType="VARCHAR" property="personnelShifts" />
  25. </resultMap>
  26. <sql id="columns">
  27. INBOUND_ID, INBOUND_TYPE, INBOUND_NUMBER,INBOUND_DISTRIBUTE_ID, GRID_ID,INBOUND_GROUP_ID,PERSONNEL_WORKSHOPID,RESULT_NUMBER, RESULT_STATUS, MATERIAL_ID, INBOUND_ISCOMPLETE,
  28. RESULT_DELETED, INBOUND_TIME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  29. INSERT_UPDATE_REMARK, PERSONNEL_TEAM,, PERSONNEL_SHIFTS
  30. </sql>
  31. <sql id="columns_alias">
  32. t.INBOUND_ID, t.INBOUND_TYPE, t.INBOUND_NUMBER,t.INBOUND_DISTRIBUTE_ID, t.GRID_ID,INBOUND_GROUP_ID,t.PERSONNEL_WORKSHOPID,t.RESULT_NUMBER, t.RESULT_STATUS, t.MATERIAL_ID,
  33. t.INBOUND_ISCOMPLETE, t.RESULT_DELETED, t.INBOUND_TIME, t.INSERT_USERNAME, t.INSERT_TIME,
  34. t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.PERSONNEL_TEAM, ,
  35. t.PERSONNEL_SHIFTS
  36. </sql>
  37. <sql id="select">
  38. SELECT <include refid="columns" /> FROM WMSP_INBOUND_RESULT
  39. </sql>
  40. <sql id="select_alias">
  41. SELECT <include refid="columns_alias" /> FROM WMSP_INBOUND_RESULT t
  42. </sql>
  43. <sql id="where">
  44. <where>
  45. <if test="inboundId != null">
  46. and INBOUND_ID = #{inboundId}
  47. </if>
  48. <if test="inboundType != null">
  49. and INBOUND_TYPE = #{inboundType}
  50. </if>
  51. <if test="inboundNumber != null and inboundNumber != ''">
  52. and INBOUND_NUMBER = #{inboundNumber}
  53. </if>
  54. <if test="inboundDistributeId != null and inboundDistributeId != ''">
  55. and INBOUND_DISTRIBUTE_ID = #{inboundDistributeId}
  56. </if>
  57. <if test="gridId != null">
  58. and GRID_ID = #{gridId}
  59. </if>
  60. <if test="inboundGroupId != null">
  61. and INBOUND_GROUP_ID = #{inboundGroupId}
  62. </if>
  63. <if test="personnelWorkshopid != null">
  64. and PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
  65. </if>
  66. <if test="resultNumber != null">
  67. and RESULT_NUMBER = #{resultNumber}
  68. </if>
  69. <if test="resultStatus != null">
  70. and RESULT_STATUS = #{resultStatus}
  71. </if>
  72. <if test="materialId != null">
  73. and MATERIAL_ID = #{materialId}
  74. </if>
  75. <if test="inboundIscomplete != null">
  76. and INBOUND_ISCOMPLETE = #{inboundIscomplete}
  77. </if>
  78. <if test="resultDeleted != null">
  79. and RESULT_DELETED = #{resultDeleted}
  80. </if>
  81. <if test="inboundTime != null">
  82. and TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = #{inboundTime}
  83. </if>
  84. <if test="insertUsername != null and insertUsername != ''">
  85. and INSERT_USERNAME = #{insertUsername}
  86. </if>
  87. <if test="insertTime != null">
  88. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  89. </if>
  90. <if test="updateUsername != null and updateUsername != ''">
  91. and UPDATE_USERNAME = #{updateUsername}
  92. </if>
  93. <if test="updateTime != null">
  94. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  95. </if>
  96. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  97. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  98. </if>
  99. <if test="personnelTeam != null and personnelTeam != ''">
  100. and PERSONNEL_TEAM = #{personnelTeam}
  101. </if>
  102. <if test="personnelShifts != null and personnelShifts != ''">
  103. and PERSONNEL_SHIFTS = #{personnelShifts}
  104. </if>
  105. </where>
  106. </sql>
  107. <sql id="whereLike">
  108. <where>
  109. <if test="inboundId != null">
  110. and INBOUND_ID = #{inboundId}
  111. </if>
  112. <if test="inboundType != null">
  113. and INBOUND_TYPE = #{inboundType}
  114. </if>
  115. <if test="inboundNumber != null and inboundNumber != ''">
  116. and INBOUND_NUMBER LIKE '%${inboundNumber}%'
  117. </if>
  118. <if test="inboundDistributeId != null and inboundDistributeId != ''">
  119. and INBOUND_DISTRIBUTE_ID LIKE '%${inboundDistributeId}%'
  120. </if>
  121. <if test="gridId != null">
  122. and GRID_ID = #{gridId}
  123. </if>
  124. <if test="inboundGroupId != null">
  125. and INBOUND_GROUP_ID = #{inboundGroupId}
  126. </if>
  127. <if test="personnelWorkshopid != null">
  128. and PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
  129. </if>
  130. <if test="resultNumber != null">
  131. and RESULT_NUMBER = #{resultNumber}
  132. </if>
  133. <if test="resultStatus != null">
  134. and RESULT_STATUS = #{resultStatus}
  135. </if>
  136. <if test="materialId != null">
  137. and MATERIAL_ID = #{materialId}
  138. </if>
  139. <if test="inboundIscomplete != null">
  140. and INBOUND_ISCOMPLETE = #{inboundIscomplete}
  141. </if>
  142. <if test="resultDeleted != null">
  143. and RESULT_DELETED = #{resultDeleted}
  144. </if>
  145. <if test="inboundTime != null">
  146. and TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = #{inboundTime}
  147. </if>
  148. <if test="insertUsername != null and insertUsername != ''">
  149. and INSERT_USERNAME LIKE '%${insertUsername}%'
  150. </if>
  151. <if test="insertTime != null">
  152. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  153. </if>
  154. <if test="updateUsername != null and updateUsername != ''">
  155. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  156. </if>
  157. <if test="updateTime != null">
  158. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  159. </if>
  160. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  161. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  162. </if>
  163. <if test="personnelTeam != null and personnelTeam != ''">
  164. and PERSONNEL_TEAM LIKE '%${personnelTeam}%'
  165. </if>
  166. <if test="personnelShifts != null and personnelShifts != ''">
  167. and PERSONNEL_SHIFTS LIKE '%${personnelShifts}%'
  168. </if>
  169. </where>
  170. </sql>
  171. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  172. delete from WMSP_INBOUND_RESULT
  173. where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
  174. </delete>
  175. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  176. delete from WMSP_INBOUND_RESULT
  177. where 1!=1
  178. <if test="inboundType != null">
  179. or INBOUND_TYPE = #{inboundType}
  180. </if>
  181. <if test="inboundNumber != null and inboundNumber != ''">
  182. or INBOUND_NUMBER = #{inboundNumber}
  183. </if>
  184. <if test="inboundDistributeId != null and inboundDistributeId != ''">
  185. or INBOUND_DISTRIBUTE_ID = #{inboundDistributeId}
  186. </if>
  187. <if test="gridId != null">
  188. or GRID_ID = #{gridId}
  189. </if>
  190. <if test="inboundGroupId != null">
  191. or INBOUND_GROUP_ID = #{inboundGroupId}
  192. </if>
  193. <if test="personnelWorkshopid != null">
  194. or PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
  195. </if>
  196. <if test="resultNumber != null">
  197. or RESULT_NUMBER = #{resultNumber}
  198. </if>
  199. <if test="resultStatus != null">
  200. or RESULT_STATUS = #{resultStatus}
  201. </if>
  202. <if test="materialId != null">
  203. or MATERIAL_ID = #{materialId}
  204. </if>
  205. <if test="inboundIscomplete != null">
  206. or INBOUND_ISCOMPLETE = #{inboundIscomplete}
  207. </if>
  208. <if test="resultDeleted != null">
  209. or RESULT_DELETED = #{resultDeleted}
  210. </if>
  211. <if test="inboundTime != null">
  212. or TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = '#{inboundTime}'
  213. </if>
  214. <if test="insertUsername != null and insertUsername != ''">
  215. or INSERT_USERNAME = #{insertUsername}
  216. </if>
  217. <if test="insertTime != null">
  218. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  219. </if>
  220. <if test="updateUsername != null and updateUsername != ''">
  221. or UPDATE_USERNAME = #{updateUsername}
  222. </if>
  223. <if test="updateTime != null">
  224. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  225. </if>
  226. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  227. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  228. </if>
  229. <if test="personnelTeam != null and personnelTeam != ''">
  230. or PERSONNEL_TEAM = #{personnelTeam}
  231. </if>
  232. <if test="personnelShifts != null and personnelShifts != ''">
  233. or PERSONNEL_SHIFTS = #{personnelShifts}
  234. </if>
  235. </delete>
  236. <insert id="insert" parameterType="com.steerinfo.dil.model.WmspInboundResult">
  237. insert into WMSP_INBOUND_RESULT (INBOUND_ID, INBOUND_TYPE, INBOUND_NUMBER, INBOUND_DISTRIBUTE_ID,
  238. GRID_ID,INBOUND_GROUP_ID, PERSONNEL_WORKSHOPID,RESULT_NUMBER,RESULT_STATUS, MATERIAL_ID,
  239. INBOUND_ISCOMPLETE, RESULT_DELETED, INBOUND_TIME,
  240. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  241. UPDATE_TIME, INSERT_UPDATE_REMARK, PERSONNEL_TEAM,
  242. PERSONNEL_SHIFTS)
  243. values (#{inboundId,jdbcType=DECIMAL}, #{inboundType,jdbcType=DECIMAL}, #{inboundNumber,jdbcType=VARCHAR},#{inboundDistributeId,jdbcType=DECIMAL},
  244. #{gridId,jdbcType=DECIMAL},#{inboundGroupId,jdbcType=DECIMAL},#{personnelWorkshopid,jdbcType=DECIMAL},#{resultNumber,jdbcType=DECIMAL}, #{resultStatus,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL},
  245. #{inboundIscomplete,jdbcType=DECIMAL}, #{resultDeleted,jdbcType=DECIMAL}, #{inboundTime,jdbcType=TIMESTAMP},
  246. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  247. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{personnelTeam,jdbcType=VARCHAR},
  248. #{personnelShifts,jdbcType=VARCHAR})
  249. </insert>
  250. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.WmspInboundResult">
  251. insert into WMSP_INBOUND_RESULT
  252. <trim prefix="(" suffix=")" suffixOverrides=",">
  253. <if test="inboundId != null">
  254. INBOUND_ID,
  255. </if>
  256. <if test="inboundType != null">
  257. INBOUND_TYPE,
  258. </if>
  259. <if test="inboundNumber != null">
  260. INBOUND_NUMBER,
  261. </if>
  262. <if test="inboundDistributeId != null">
  263. INBOUND_DISTRIBUTE_ID,
  264. </if>
  265. <if test="gridId != null">
  266. GRID_ID,
  267. </if>
  268. <if test="inboundGroupId != null">
  269. INBOUND_GROUP_ID,
  270. </if>
  271. <if test="personnelWorkshopid != null">
  272. PERSONNEL_WORKSHOPID,
  273. </if>
  274. <if test="resultNumber != null">
  275. RESULT_NUMBER,
  276. </if>
  277. <if test="resultStatus != null">
  278. RESULT_STATUS,
  279. </if>
  280. <if test="materialId != null">
  281. MATERIAL_ID,
  282. </if>
  283. <if test="inboundIscomplete != null">
  284. INBOUND_ISCOMPLETE,
  285. </if>
  286. <if test="resultDeleted != null">
  287. RESULT_DELETED,
  288. </if>
  289. <if test="inboundTime != null">
  290. INBOUND_TIME,
  291. </if>
  292. <if test="insertUsername != null">
  293. INSERT_USERNAME,
  294. </if>
  295. <if test="insertTime != null">
  296. INSERT_TIME,
  297. </if>
  298. <if test="updateUsername != null">
  299. UPDATE_USERNAME,
  300. </if>
  301. <if test="updateTime != null">
  302. UPDATE_TIME,
  303. </if>
  304. <if test="insertUpdateRemark != null">
  305. INSERT_UPDATE_REMARK,
  306. </if>
  307. <if test="personnelTeam != null">
  308. PERSONNEL_TEAM,
  309. </if>
  310. <if test="personnelShifts != null">
  311. PERSONNEL_SHIFTS,
  312. </if>
  313. </trim>
  314. <trim prefix="values (" suffix=")" suffixOverrides=",">
  315. <if test="inboundId != null">
  316. #{inboundId,jdbcType=DECIMAL},
  317. </if>
  318. <if test="inboundType != null">
  319. #{inboundType,jdbcType=DECIMAL},
  320. </if>
  321. <if test="inboundNumber != null">
  322. #{inboundNumber,jdbcType=VARCHAR},
  323. </if>
  324. <if test="inboundDistributeId != null">
  325. #{inboundDistributeId,jdbcType=VARCHAR},
  326. </if>
  327. <if test="gridId != null">
  328. #{gridId,jdbcType=DECIMAL},
  329. </if>
  330. <if test="inboundGroupId != null">
  331. #{inboundGroupId,jdbcType=DECIMAL},
  332. </if>
  333. <if test="personnelWorkshopid != null">
  334. #{personnelWorkshopid,jdbcType=DECIMAL},
  335. </if>
  336. <if test="resultNumber != null">
  337. #{resultNumber,jdbcType=DECIMAL},
  338. </if>
  339. <if test="resultStatus != null">
  340. #{resultStatus,jdbcType=DECIMAL},
  341. </if>
  342. <if test="materialId != null">
  343. #{materialId,jdbcType=DECIMAL},
  344. </if>
  345. <if test="inboundIscomplete != null">
  346. #{inboundIscomplete,jdbcType=DECIMAL},
  347. </if>
  348. <if test="resultDeleted != null">
  349. #{resultDeleted,jdbcType=DECIMAL},
  350. </if>
  351. <if test="inboundTime != null">
  352. #{inboundTime,jdbcType=TIMESTAMP},
  353. </if>
  354. <if test="insertUsername != null">
  355. #{insertUsername,jdbcType=VARCHAR},
  356. </if>
  357. <if test="insertTime != null">
  358. #{insertTime,jdbcType=TIMESTAMP},
  359. </if>
  360. <if test="updateUsername != null">
  361. #{updateUsername,jdbcType=VARCHAR},
  362. </if>
  363. <if test="updateTime != null">
  364. #{updateTime,jdbcType=TIMESTAMP},
  365. </if>
  366. <if test="insertUpdateRemark != null">
  367. #{insertUpdateRemark,jdbcType=VARCHAR},
  368. </if>
  369. <if test="personnelTeam != null">
  370. #{personnelTeam,jdbcType=VARCHAR},
  371. </if>
  372. <if test="personnelShifts != null">
  373. #{personnelShifts,jdbcType=VARCHAR},
  374. </if>
  375. </trim>
  376. </insert>
  377. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.WmspInboundResult">
  378. update WMSP_INBOUND_RESULT
  379. set INBOUND_TYPE = #{inboundType,jdbcType=DECIMAL},
  380. INBOUND_NUMBER = #{inboundNumber,jdbcType=VARCHAR},
  381. INBOUND_DISTRIBUTE_ID = #{inboundDistributeId,jdbcType=DECIMAL},
  382. GRID_ID = #{gridId,jdbcType=DECIMAL},
  383. PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=DECIMAL},
  384. RESULT_NUMBER = #{resultNumber,jdbcType=DECIMAL},
  385. INBOUND_GROUP_ID = #{inboundGroupId,jdbcType=DECIMAL},
  386. RESULT_STATUS = #{resultStatus,jdbcType=DECIMAL},
  387. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  388. INBOUND_ISCOMPLETE = #{inboundIscomplete,jdbcType=DECIMAL},
  389. RESULT_DELETED = #{resultDeleted,jdbcType=DECIMAL},
  390. INBOUND_TIME = #{inboundTime,jdbcType=TIMESTAMP},
  391. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  392. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  393. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  394. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  395. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  396. PERSONNEL_TEAM = #{personnelTeam,jdbcType=VARCHAR},
  397. PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR}
  398. where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
  399. </update>
  400. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.WmspInboundResult">
  401. update WMSP_INBOUND_RESULT
  402. <set>
  403. <if test="inboundType != null">
  404. INBOUND_TYPE = #{inboundType,jdbcType=DECIMAL},
  405. </if>
  406. <if test="inboundNumber != null">
  407. INBOUND_NUMBER = #{inboundNumber,jdbcType=VARCHAR},
  408. </if>
  409. <if test="inboundDistributeId != null">
  410. INBOUND_DISTRIBUTE_ID = #{inboundDistributeId,jdbcType=DECIMAL},
  411. </if>
  412. <if test="gridId != null">
  413. GRID_ID = #{gridId,jdbcType=DECIMAL},
  414. </if>
  415. <if test="inboundGroupId != null">
  416. INBOUND_GROUP_ID = #{inboundGroupId,jdbcType=DECIMAL},
  417. </if>
  418. <if test="personnelWorkshopid != null">
  419. PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=DECIMAL},
  420. </if>
  421. <if test="resultNumber != null">
  422. RESULT_NUMBER = #{resultNumber,jdbcType=DECIMAL},
  423. </if>
  424. <if test="resultStatus != null">
  425. RESULT_STATUS = #{resultStatus,jdbcType=DECIMAL},
  426. </if>
  427. <if test="materialId != null">
  428. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  429. </if>
  430. <if test="inboundIscomplete != null">
  431. INBOUND_ISCOMPLETE = #{inboundIscomplete,jdbcType=DECIMAL},
  432. </if>
  433. <if test="resultDeleted != null">
  434. RESULT_DELETED = #{resultDeleted,jdbcType=DECIMAL},
  435. </if>
  436. <if test="inboundTime != null">
  437. INBOUND_TIME = #{inboundTime,jdbcType=TIMESTAMP},
  438. </if>
  439. <if test="insertUsername != null">
  440. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  441. </if>
  442. <if test="insertTime != null">
  443. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  444. </if>
  445. <if test="updateUsername != null">
  446. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  447. </if>
  448. <if test="updateTime != null">
  449. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  450. </if>
  451. <if test="insertUpdateRemark != null">
  452. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  453. </if>
  454. <if test="personnelTeam != null">
  455. PERSONNEL_TEAM = #{personnelTeam,jdbcType=VARCHAR},
  456. </if>
  457. <if test="personnelShifts != null">
  458. PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR},
  459. </if>
  460. </set>
  461. where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
  462. </update>
  463. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  464. <include refid="select" />
  465. where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
  466. </select>
  467. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  468. <include refid="select" />
  469. <include refid="where" />
  470. </select>
  471. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  472. <include refid="select" />
  473. <include refid="whereLike" />
  474. </select>
  475. <insert id="batchInsert" parameterType="java.util.List">
  476. insert into WMSP_INBOUND_RESULT
  477. (INBOUND_ID,
  478. INBOUND_TYPE, INBOUND_NUMBER, GRID_ID,INBOUND_GROUP_ID,PERSONNEL_WORKSHOPID,RESULT_NUMBER,INBOUND_DISTRIBUTE_ID,
  479. RESULT_STATUS, MATERIAL_ID, INBOUND_ISCOMPLETE,
  480. RESULT_DELETED, INBOUND_TIME,
  481. INSERT_USERNAME, INSERT_TIME,
  482. UPDATE_USERNAME, UPDATE_TIME,
  483. INSERT_UPDATE_REMARK, PERSONNEL_TEAM,
  484. PERSONNEL_SHIFTS
  485. )
  486. ( <foreach collection="list" item="item" separator="union all">
  487. select
  488. #{item.inboundId,jdbcType=DECIMAL},
  489. #{item.inboundType,jdbcType=DECIMAL}, #{item.inboundNumber,jdbcType=VARCHAR}, #{item.inboundGroupId,jdbcType=DECIMAL}, #{item.gridId,jdbcType=DECIMAL}, #{item.personnelWorkshopid,jdbcType=DECIMAL}, #{item.resultNumber,jdbcType=DECIMAL}, #{item.inboundDistributeId,jdbcType=DECIMAL},
  490. #{item.resultStatus,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.inboundIscomplete,jdbcType=DECIMAL},
  491. #{item.resultDeleted,jdbcType=DECIMAL}, #{item.inboundTime,jdbcType=TIMESTAMP},
  492. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  493. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  494. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.personnelTeam,jdbcType=VARCHAR},
  495. #{item.personnelShifts,jdbcType=VARCHAR}
  496. from dual
  497. </foreach> )
  498. </insert>
  499. <update id="batchUpdate" parameterType="java.util.List">
  500. update WMSP_INBOUND_RESULT
  501. set
  502. INBOUND_ID=
  503. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  504. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundId,jdbcType=DECIMAL}
  505. </foreach>
  506. ,INBOUND_TYPE=
  507. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  508. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundType,jdbcType=DECIMAL}
  509. </foreach>
  510. ,INBOUND_NUMBER=
  511. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  512. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundNumber,jdbcType=VARCHAR}
  513. </foreach>
  514. ,INBOUND_DISTRIBUTE_ID=
  515. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  516. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundDistributeId,jdbcType=VARCHAR}
  517. </foreach>
  518. ,GRID_ID=
  519. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  520. when #{item.inboundId,jdbcType=DECIMAL} then #{item.gridId,jdbcType=DECIMAL}
  521. </foreach>
  522. ,INBOUND_GROUP_ID=
  523. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  524. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundGroupId,jdbcType=DECIMAL}
  525. </foreach>
  526. ,PERSONNEL_WORKSHOPID=
  527. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  528. when #{item.inboundId,jdbcType=DECIMAL} then #{item.personnelWorkshopid,jdbcType=DECIMAL}
  529. </foreach>
  530. ,RESULT_NUMBER=
  531. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  532. when #{item.inboundId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=DECIMAL}
  533. </foreach>
  534. ,RESULT_STATUS=
  535. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  536. when #{item.inboundId,jdbcType=DECIMAL} then #{item.resultStatus,jdbcType=DECIMAL}
  537. </foreach>
  538. ,MATERIAL_ID=
  539. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  540. when #{item.inboundId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  541. </foreach>
  542. ,INBOUND_ISCOMPLETE=
  543. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  544. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundIscomplete,jdbcType=DECIMAL}
  545. </foreach>
  546. ,RESULT_DELETED=
  547. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  548. when #{item.inboundId,jdbcType=DECIMAL} then #{item.resultDeleted,jdbcType=DECIMAL}
  549. </foreach>
  550. ,INBOUND_TIME=
  551. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  552. when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundTime,jdbcType=TIMESTAMP}
  553. </foreach>
  554. ,INSERT_USERNAME=
  555. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  556. when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  557. </foreach>
  558. ,INSERT_TIME=
  559. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  560. when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  561. </foreach>
  562. ,UPDATE_USERNAME=
  563. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  564. when #{item.inboundId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  565. </foreach>
  566. ,UPDATE_TIME=
  567. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  568. when #{item.inboundId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  569. </foreach>
  570. ,INSERT_UPDATE_REMARK=
  571. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  572. when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  573. </foreach>
  574. ,PERSONNEL_TEAM=
  575. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  576. when #{item.inboundId,jdbcType=DECIMAL} then #{item.personnelTeam,jdbcType=VARCHAR}
  577. </foreach>
  578. ,PERSONNEL_SHIFTS=
  579. <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
  580. when #{item.inboundId,jdbcType=DECIMAL} then #{item.personnelShifts,jdbcType=VARCHAR}
  581. </foreach>
  582. where INBOUND_ID in
  583. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  584. #{item.inboundId,jdbcType=DECIMAL}
  585. </foreach>
  586. </update>
  587. <delete id="batchDelete" parameterType="java.util.List">
  588. delete from WMSP_INBOUND_RESULT
  589. where INBOUND_ID in
  590. <foreach close=")" collection="list" item="id" open="(" separator=",">
  591. #{id}
  592. </foreach>
  593. </delete>
  594. <!-- 友情提示!!!-->
  595. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  596. <select id="selectWmsInboundResult" resultType="java.util.LinkedHashMap">
  597. select
  598. wir.INBOUND_ID "inboundId",
  599. RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
  600. RM.MATERIAL_MODEL || ')' "materialName",
  601. wir.inbound_number "inboundNo",
  602. wir.inbound_time "inboundTime",
  603. wir.inbound_iscomplete "isComplete",
  604. RW.WAREHOUSE_NAME "warehouseName",
  605. RS.STACKING_NO "stackingNo",
  606. RPG.GRID_GRADATION_NUMBER "gridGradationNumber"
  607. from wmsp_inbound_result wir
  608. LEFT JOIN WMSP_GRID_MATERIAL wgm
  609. ON wgm.MATERIAL_ID = wir.MATERIAL_ID
  610. LEFT JOIN RMS_MATERIAL_STEEL rms
  611. ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
  612. LEFT JOIN RMS_MATERIAL rm
  613. ON rm.MATERIAL_ID = rms.MATERIAL_ID
  614. LEFT JOIN RMS_PWAREHOUSE_GRID rpg
  615. ON RPG.GRID_ID = wir.GRID_ID
  616. LEFT JOIN RMS_WAREHOUSE RW
  617. ON RW.WAREHOUSE_ID = rpg.WAREHOUSE_ID
  618. LEFT JOIN RMS_STACKING RS
  619. ON RS.STACKING_ID = RPG.STACKING_ID
  620. where wir.inbound_type = 0
  621. and wir.result_deleted = 0
  622. and wir.INBOUND_ISCOMPLETE != 2
  623. and wgm.UPDATE_TIME is null
  624. order by wir.inbound_time desc
  625. <where>
  626. <if test="INBOUND_NUMBER != null">
  627. and "INBOUND_NUMBER" in
  628. <foreach collection="INBOUND_NUMBER" item="item" open="(" separator="," close=")">
  629. #{item}
  630. </foreach>
  631. </if>
  632. <if test="WAREHOUSE_NAME != null">
  633. and "WAREHOUSE_NAME" in
  634. <foreach collection="WAREHOUSE_NAME" item="item" open="(" separator="," close=")">
  635. #{item}
  636. </foreach>
  637. </if>
  638. <if test="STACKING_NO != null">
  639. and "STACKING_NO" in
  640. <foreach collection="STACKING_NO" item="item" open="(" separator="," close=")">
  641. #{item}
  642. </foreach>
  643. </if>
  644. <if test="GRID_GRADATION_NUMBER != null">
  645. and "GRID_GRADATION_NUMBER" in
  646. <foreach collection="GRID_GRADATION_NUMBER" item="item" open="(" separator="," close=")">
  647. #{item}
  648. </foreach>
  649. </if>
  650. <if test="FURNACE_NUMBER != null">
  651. and "FURNACE_NUMBER" in
  652. <foreach collection="FURNACE_NUMBER" item="item" open="(" separator="," close=")">
  653. #{item}
  654. </foreach>
  655. </if>
  656. <if test="MATERIAL_CODE != null">
  657. and "MATERIAL_CODE" in
  658. <foreach collection="MATERIAL_CODE" item="item" open="(" separator="," close=")">
  659. #{item}
  660. </foreach>
  661. </if>
  662. <if test="MATERIAL_NAME != null">
  663. and "MATERIAL_NAME" in
  664. <foreach collection="MATERIAL_NAME" item="item" open="(" separator="," close=")">
  665. #{item}
  666. </foreach>
  667. </if>
  668. <if test="THEORETICAL_WEIGHT != null">
  669. and "THEORETICAL_WEIGHT" in
  670. <foreach collection="THEORETICAL_WEIGHT" item="item" open="(" separator="," close=")">
  671. #{item}
  672. </foreach>
  673. </if>
  674. <if test="BUNDLE_WEIGHT != null">
  675. and "BUNDLE_WEIGHT" in
  676. <foreach collection="BUNDLE_WEIGHT" item="item" open="(" separator="," close=")">
  677. #{item}
  678. </foreach>
  679. </if>
  680. <if test="MEASURE_NAME != null">
  681. and "MEASURE_NAME" in
  682. <foreach collection="MEASURE_NAME" item="item" open="(" separator="," close=")">
  683. #{item}
  684. </foreach>
  685. </if>
  686. <if test="PRODUCTION_DATE != null">
  687. and "PRODUCTION_DATE" in
  688. <foreach collection="PRODUCTION_DATE" item="item" open="(" separator="," close=")">
  689. to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  690. </foreach>
  691. </if>
  692. <if test="APERSONNEL_NAME != null">
  693. and "APERSONNEL_NAME" in
  694. <foreach collection="APERSONNEL_NAME" item="item" open="(" separator="," close=")">
  695. #{item}
  696. </foreach>
  697. </if>
  698. <if test="BPERSONNEL_NAME != null">
  699. and "BPERSONNEL_NAME" in
  700. <foreach collection="BPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  701. #{item}
  702. </foreach>
  703. </if>
  704. <if test="DPERSONNEL_NAME != null">
  705. and "DPERSONNEL_NAME" in
  706. <foreach collection="DPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  707. #{item}
  708. </foreach>
  709. </if>
  710. <if test="SHIPPER_BRANCH_FACTORY != null">
  711. and "SHIPPER_BRANCH_FACTORY" in
  712. <foreach collection="SHIPPER_BRANCH_FACTORY" item="item" open="(" separator="," close=")">
  713. #{item}
  714. </foreach>
  715. </if>
  716. <if test="PERSONNEL_WORKSHOP != null">
  717. and "PERSONNEL_WORKSHOP" in
  718. <foreach collection="PERSONNEL_WORKSHOP" item="item" open="(" separator="," close=")">
  719. #{item}
  720. </foreach>
  721. </if>
  722. <if test="INBOUND_TIME != null">
  723. and "INBOUND_TIME" in
  724. <foreach collection="INBOUND_TIME" item="item" open="(" separator="," close=")">
  725. #{item}
  726. </foreach>
  727. </if>
  728. </where>
  729. <include refid="orderBy"></include>
  730. </select>
  731. <select id="selectWmsReservedResult" resultType="java.util.LinkedHashMap">
  732. select
  733. wir.INBOUND_ID "inboundId",
  734. RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
  735. RM.MATERIAL_MODEL || ')' "materialName",
  736. wir.inbound_number "inboundNo",
  737. wir.inbound_time "inboundTime",
  738. wir.inbound_iscomplete "isComplete",
  739. RW.WAREHOUSE_NAME "warehouseName",
  740. RS.STACKING_NO "stackingNo",
  741. RPG.GRID_GRADATION_NUMBER "gridGradationNumber"
  742. from wmsp_inbound_result wir
  743. LEFT JOIN RMS_MATERIAL_STEEL rms
  744. ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
  745. LEFT JOIN RMS_MATERIAL rm
  746. ON rm.MATERIAL_ID = rms.MATERIAL_ID
  747. LEFT JOIN RMS_PWAREHOUSE_GRID rpg
  748. ON RPG.GRID_ID = wir.GRID_ID
  749. LEFT JOIN RMS_WAREHOUSE RW
  750. ON RW.WAREHOUSE_ID = rpg.WAREHOUSE_ID
  751. LEFT JOIN RMS_STACKING RS
  752. ON RS.STACKING_ID = RPG.STACKING_ID
  753. where wir.inbound_type = 0
  754. and wir.result_deleted = 0
  755. and wir.INBOUND_ISCOMPLETE = 2
  756. order by wir.inbound_time desc
  757. <where>
  758. <if test="INBOUND_NUMBER != null">
  759. and "INBOUND_NUMBER" in
  760. <foreach collection="INBOUND_NUMBER" item="item" open="(" separator="," close=")">
  761. #{item}
  762. </foreach>
  763. </if>
  764. <if test="WAREHOUSE_NAME != null">
  765. and "WAREHOUSE_NAME" in
  766. <foreach collection="WAREHOUSE_NAME" item="item" open="(" separator="," close=")">
  767. #{item}
  768. </foreach>
  769. </if>
  770. <if test="STACKING_NO != null">
  771. and "STACKING_NO" in
  772. <foreach collection="STACKING_NO" item="item" open="(" separator="," close=")">
  773. #{item}
  774. </foreach>
  775. </if>
  776. <if test="GRID_GRADATION_NUMBER != null">
  777. and "GRID_GRADATION_NUMBER" in
  778. <foreach collection="GRID_GRADATION_NUMBER" item="item" open="(" separator="," close=")">
  779. #{item}
  780. </foreach>
  781. </if>
  782. <if test="FURNACE_NUMBER != null">
  783. and "FURNACE_NUMBER" in
  784. <foreach collection="FURNACE_NUMBER" item="item" open="(" separator="," close=")">
  785. #{item}
  786. </foreach>
  787. </if>
  788. <if test="MATERIAL_CODE != null">
  789. and "MATERIAL_CODE" in
  790. <foreach collection="MATERIAL_CODE" item="item" open="(" separator="," close=")">
  791. #{item}
  792. </foreach>
  793. </if>
  794. <if test="MATERIAL_NAME != null">
  795. and "MATERIAL_NAME" in
  796. <foreach collection="MATERIAL_NAME" item="item" open="(" separator="," close=")">
  797. #{item}
  798. </foreach>
  799. </if>
  800. <if test="THEORETICAL_WEIGHT != null">
  801. and "THEORETICAL_WEIGHT" in
  802. <foreach collection="THEORETICAL_WEIGHT" item="item" open="(" separator="," close=")">
  803. #{item}
  804. </foreach>
  805. </if>
  806. <if test="BUNDLE_WEIGHT != null">
  807. and "BUNDLE_WEIGHT" in
  808. <foreach collection="BUNDLE_WEIGHT" item="item" open="(" separator="," close=")">
  809. #{item}
  810. </foreach>
  811. </if>
  812. <if test="MEASURE_NAME != null">
  813. and "MEASURE_NAME" in
  814. <foreach collection="MEASURE_NAME" item="item" open="(" separator="," close=")">
  815. #{item}
  816. </foreach>
  817. </if>
  818. <if test="PRODUCTION_DATE != null">
  819. and "PRODUCTION_DATE" in
  820. <foreach collection="PRODUCTION_DATE" item="item" open="(" separator="," close=")">
  821. to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  822. </foreach>
  823. </if>
  824. <if test="APERSONNEL_NAME != null">
  825. and "APERSONNEL_NAME" in
  826. <foreach collection="APERSONNEL_NAME" item="item" open="(" separator="," close=")">
  827. #{item}
  828. </foreach>
  829. </if>
  830. <if test="BPERSONNEL_NAME != null">
  831. and "BPERSONNEL_NAME" in
  832. <foreach collection="BPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  833. #{item}
  834. </foreach>
  835. </if>
  836. <if test="DPERSONNEL_NAME != null">
  837. and "DPERSONNEL_NAME" in
  838. <foreach collection="DPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  839. #{item}
  840. </foreach>
  841. </if>
  842. <if test="SHIPPER_BRANCH_FACTORY != null">
  843. and "SHIPPER_BRANCH_FACTORY" in
  844. <foreach collection="SHIPPER_BRANCH_FACTORY" item="item" open="(" separator="," close=")">
  845. #{item}
  846. </foreach>
  847. </if>
  848. <if test="PERSONNEL_WORKSHOP != null">
  849. and "PERSONNEL_WORKSHOP" in
  850. <foreach collection="PERSONNEL_WORKSHOP" item="item" open="(" separator="," close=")">
  851. #{item}
  852. </foreach>
  853. </if>
  854. <if test="INBOUND_TIME != null">
  855. and "INBOUND_TIME" in
  856. <foreach collection="INBOUND_TIME" item="item" open="(" separator="," close=")">
  857. #{item}
  858. </foreach>
  859. </if>
  860. </where>
  861. <include refid="orderBy"></include>
  862. </select>
  863. <sql id="orderBy">
  864. <if test="orderField != null and orderField != ''">
  865. order by "${orderField}"
  866. <if test="orderType != null and orderType != ''">
  867. ${orderType}
  868. </if>
  869. </if>
  870. </sql>
  871. <!-- <select id="getCount" resultType="java.math.BigDecimal">-->
  872. <!-- select MAX(INBOUND_ID) from wmsp_inbound_result-->
  873. <!-- </select>-->
  874. <select id="selectWmsReboundResult" resultType="java.util.LinkedHashMap">
  875. select wimr.result_no "result_no",
  876. rw.warehouse_name "warehouse_name",
  877. rs.stacking_no "stacking_no",
  878. rpg.grid_gradation_number "gradation_number",
  879. rms.material_furnace_number "furnace_number",
  880. rm.material_name "material_name",
  881. rm.material_specification || '(' || rm.material_model || ')' "specification",
  882. rms.material_theoretical_weight "theoretical_weight",
  883. wmsp.inbound_material_number "MATERIAL_NUMBER",
  884. rms.material_production_date "production_date",
  885. rp1.personnel_name "LOADA",
  886. rp2.personnel_name "LOADD",
  887. wir.inbound_time "inbound_time"
  888. from wmsp_inbound_scan_result wmsp
  889. join rms_material_steel rms
  890. on rms.material_steel_id = wmsp.material_id
  891. join wmsp_ivbound_make_material wimm
  892. on wmsp.material_id = wimm.material_steel_id
  893. join wmsp_ivbound_make_result wimr
  894. on wimr.result_id = wimm.result_id
  895. join rms_material rm
  896. on rm.material_id = rms.material_id
  897. join rms_unit_of_measure ruom
  898. on ruom.unit_of_measure_id = rm.unit_of_measure_id
  899. join rms_personnel rp1
  900. on rp1.personnel_id = wmsp.load_id
  901. join wmsp_inbound_result wir
  902. on wir.inbound_id = wmsp.inbound_result_id
  903. join wmsp_inbound_driving_result widr
  904. on widr.inbound_result_id = wir.inbound_id
  905. join rms_personnel rp2
  906. on rp2.personnel_id = widr.driver_id
  907. join rms_pwarehouse_grid rpg
  908. on rpg.grid_id = wir.grid_id
  909. join rms_warehouse rw
  910. on rw.warehouse_id = rpg.warehouse_id
  911. join wmsp_inbound_stack_result wisr
  912. on wisr.inbound_result_id = wir.inbound_id
  913. join rms_stacking rs
  914. on rs.stacking_id = wisr.stacking_id
  915. where rp1.personnel_id = 6
  916. and wmsp.result_status_ = 1
  917. and wir.inbound_type = 2
  918. <where>
  919. <if test="result_no != null">
  920. and "result_no" in
  921. <foreach collection="result_no" item="item" open="(" separator="," close=")">
  922. #{item}
  923. </foreach>
  924. </if>
  925. <if test="warehouse_name != null">
  926. and "warehouse_name" in
  927. <foreach collection="warehouse_name" item="item" open="(" separator="," close=")">
  928. #{item}
  929. </foreach>
  930. </if>
  931. <if test="stacking_no != null">
  932. and "stacking_no" in
  933. <foreach collection="stacking_no" item="item" open="(" separator="," close=")">
  934. #{item}
  935. </foreach>
  936. </if>
  937. <if test="gradation_number != null">
  938. and "gradation_number" in
  939. <foreach collection="gradation_number" item="item" open="(" separator="," close=")">
  940. #{item}
  941. </foreach>
  942. </if>
  943. <if test="furnace_number != null">
  944. and "furnace_number" in
  945. <foreach collection="furnace_number" item="item" open="(" separator="," close=")">
  946. #{item}
  947. </foreach>
  948. </if>
  949. <if test="material_name != null">
  950. and "material_name" in
  951. <foreach collection="material_name" item="item" open="(" separator="," close=")">
  952. #{item}
  953. </foreach>
  954. </if>
  955. <if test="specification != null">
  956. and "specification" in
  957. <foreach collection="specification" item="item" open="(" separator="," close=")">
  958. #{item}
  959. </foreach>
  960. </if>
  961. <if test="theoretical_weight != null">
  962. and "theoretical_weight" in
  963. <foreach collection="theoretical_weight" item="item" open="(" separator="," close=")">
  964. #{item}
  965. </foreach>
  966. </if>
  967. <if test="MATERIAL_NUMBER != null">
  968. and "MATERIAL_NUMBER" in
  969. <foreach collection="MATERIAL_NUMBER" item="item" open="(" separator="," close=")">
  970. #{item}
  971. </foreach>
  972. </if>
  973. <if test="production_date != null">
  974. and "production_date" in
  975. <foreach collection="production_date" item="item" open="(" separator="," close=")">
  976. to_date('${item}','yyyy-mm-dd')
  977. </foreach>
  978. </if>
  979. <if test="LOADA != null">
  980. and "LOADA" in
  981. <foreach collection="LOADA" item="item" open="(" separator="," close=")">
  982. #{item}
  983. </foreach>
  984. </if>
  985. <if test="LOADD != null">
  986. and "LOADD" in
  987. <foreach collection="LOADD" item="item" open="(" separator="," close=")">
  988. #{item}
  989. </foreach>
  990. </if>
  991. <if test="inbound_time != null">
  992. and "inbound_time" in
  993. <foreach collection="inbound_time" item="item" open="(" separator="," close=")">
  994. to_date('${item}','yyyy-mm-dd')
  995. </foreach>
  996. </if>
  997. </where>
  998. <include refid="orderBy"></include>
  999. </select>
  1000. <select id="selectWmsIvboundResult" resultType="java.util.Map">
  1001. select wimr.result_id "resultId",
  1002. wimr.result_no "result_no",
  1003. rw1.warehouse_name "before_warehouse",
  1004. rw2.warehouse_name "after_warehouse",
  1005. wimr.insert_time "insert_time",
  1006. (select count(*)
  1007. from wmsp_ivbound_make_result wimr
  1008. join rms_warehouse rw1
  1009. on rw1.warehouse_id = wimr.result_before_warehouse_id
  1010. join rms_warehouse rw2
  1011. on rw2.warehouse_id = wimr.result_after_warehouse_id
  1012. join wmsp_ivbound_make_material wimm
  1013. on wimm.result_id = wimr.result_id) "material_number"
  1014. from wmsp_ivbound_make_result wimr
  1015. join rms_warehouse rw1
  1016. on rw1.warehouse_id = wimr.result_before_warehouse_id
  1017. join rms_warehouse rw2
  1018. on rw2.warehouse_id = wimr.result_after_warehouse_id
  1019. join wmsp_ivbound_make_material wimm
  1020. on wimm.result_id = wimr.result_id
  1021. order by wimr.insert_time desc
  1022. <where>
  1023. <if test="result_no != null">
  1024. and "result_no" in
  1025. <foreach collection="result_no" item="item" open="(" separator="," close=")">
  1026. #{item}
  1027. </foreach>
  1028. </if>
  1029. <if test="before_warehouse != null">
  1030. and "before_warehouse" in
  1031. <foreach collection="before_warehouse" item="item" open="(" separator="," close=")">
  1032. #{item}
  1033. </foreach>
  1034. </if>
  1035. <if test="after_warehouse != null">
  1036. and "after_warehouse" in
  1037. <foreach collection="after_warehouse" item="item" open="(" separator="," close=")">
  1038. #{item}
  1039. </foreach>
  1040. </if>
  1041. <if test="insert_time != null">
  1042. and "insert_time" in
  1043. <foreach collection="insert_time" item="item" open="(" separator="," close=")">
  1044. to_date('${item}','yyyy-mm-dd')
  1045. </foreach>
  1046. </if>
  1047. <if test="material_number != null">
  1048. and "material_number" in
  1049. <foreach collection="material_number" item="item" open="(" separator="," close=")">
  1050. #{item}
  1051. </foreach>
  1052. </if>
  1053. </where>
  1054. <include refid="orderBy"></include>
  1055. </select>
  1056. <select id="selectWmsIvboundMaterialResult" resultType="java.util.LinkedHashMap">
  1057. select
  1058. wimr.result_no "result_no",
  1059. rw1.warehouse_name "before_warehouse",
  1060. rw2.warehouse_name "after_warehouse",
  1061. rs1.stacking_no "before_stack",
  1062. wimm.before_gradution_number "before_gradution_number",
  1063. rm.material_code "material_code",
  1064. rm.material_name "material_name",
  1065. rm.material_specification || '(' || rm.material_model || ')' "specification",
  1066. rms.material_furnace_number "furnace_number",
  1067. rms.material_theoretical_weight "theoretical_weight",
  1068. (select count(*) from wmsp_ivbound_make_material wimm
  1069. join
  1070. wmsp_ivbound_make_result wimr
  1071. on
  1072. wimr.result_id=wimm.result_id
  1073. join
  1074. rms_warehouse rw1
  1075. on
  1076. rw1.warehouse_id=wimr.result_before_warehouse_id
  1077. join
  1078. rms_warehouse rw2
  1079. on
  1080. rw2.warehouse_id=wimr.result_after_warehouse_id
  1081. join rms_stacking rs1
  1082. on
  1083. rs1.stacking_id=wimm.before_stacking_id
  1084. join
  1085. rms_material_steel rms
  1086. on
  1087. rms.material_steel_id=wimm.material_steel_id
  1088. join
  1089. rms_material rm
  1090. on
  1091. rm.material_id=rms.material_id
  1092. join
  1093. wmsp_inbound_scan_result wisr
  1094. on
  1095. wisr.material_id=wimm.material_steel_id
  1096. join
  1097. rms_personnel rp2
  1098. on
  1099. rp2.personnel_id=wisr.load_id
  1100. join
  1101. wmsp_inbound_result wir
  1102. on
  1103. wir.inbound_id=wisr.inbound_result_id
  1104. join
  1105. wmsp_inbound_driving_result widr
  1106. on
  1107. widr.inbound_result_id=wir.inbound_id
  1108. join
  1109. rms_personnel rp3
  1110. on
  1111. rp3.personnel_id=widr.driver_id
  1112. join
  1113. rms_pwarehouse_grid rpg
  1114. on
  1115. rpg.grid_id=wir.inbound_id
  1116. where wimm.result_id = #{resultId}) "material_number",
  1117. rms.material_production_date "production_date",
  1118. rp2.personnel_name "LOADA",
  1119. rp3.personnel_name "LOADD",
  1120. wir.inbound_time "inbound_time"
  1121. from wmsp_ivbound_make_material wimm
  1122. join
  1123. wmsp_ivbound_make_result wimr
  1124. on
  1125. wimr.result_id=wimm.result_id
  1126. join
  1127. rms_warehouse rw1
  1128. on
  1129. rw1.warehouse_id=wimr.result_before_warehouse_id
  1130. join
  1131. rms_warehouse rw2
  1132. on
  1133. rw2.warehouse_id=wimr.result_after_warehouse_id
  1134. join rms_stacking rs1
  1135. on
  1136. rs1.stacking_id=wimm.before_stacking_id
  1137. join
  1138. rms_material_steel rms
  1139. on
  1140. rms.material_steel_id=wimm.material_steel_id
  1141. join
  1142. rms_material rm
  1143. on
  1144. rm.material_id=rms.material_id
  1145. join
  1146. wmsp_inbound_scan_result wisr
  1147. on
  1148. wisr.material_id=wimm.material_steel_id
  1149. join
  1150. rms_personnel rp2
  1151. on
  1152. rp2.personnel_id=wisr.load_id
  1153. join
  1154. wmsp_inbound_result wir
  1155. on
  1156. wir.inbound_id=wisr.inbound_result_id
  1157. join
  1158. wmsp_inbound_driving_result widr
  1159. on
  1160. widr.inbound_result_id=wir.inbound_id
  1161. join
  1162. rms_personnel rp3
  1163. on
  1164. rp3.personnel_id=widr.driver_id
  1165. join
  1166. rms_pwarehouse_grid rpg
  1167. on
  1168. rpg.grid_id=wir.inbound_id
  1169. where wimm.result_id = #{resultId}
  1170. order by
  1171. wir.inbound_time desc
  1172. <where>
  1173. <if test="result_no != null">
  1174. and "result_no" in
  1175. <foreach collection="result_no" item="item" open="(" separator="," close=")">
  1176. #{item}
  1177. </foreach>
  1178. </if>
  1179. <if test="before_warehouse != null">
  1180. and "before_warehouse" in
  1181. <foreach collection="before_warehouse" item="item" open="(" separator="," close=")">
  1182. #{item}
  1183. </foreach>
  1184. </if>
  1185. <if test="after_warehouse != null">
  1186. and "after_warehouse" in
  1187. <foreach collection="after_warehouse" item="item" open="(" separator="," close=")">
  1188. #{item}
  1189. </foreach>
  1190. </if>
  1191. <if test="before_stack != null">
  1192. and "before_stack" in
  1193. <foreach collection="before_stack" item="item" open="(" separator="," close=")">
  1194. #{item}
  1195. </foreach>
  1196. </if>
  1197. <if test="before_gradution_number != null">
  1198. and "before_gradution_number" in
  1199. <foreach collection="before_gradution_number" item="item" open="(" separator="," close=")">
  1200. #{item}
  1201. </foreach>
  1202. </if>
  1203. <if test="material_code != null">
  1204. and "material_code" in
  1205. <foreach collection="material_code" item="item" open="(" separator="," close=")">
  1206. #{item}
  1207. </foreach>
  1208. </if>
  1209. <if test="material_name != null">
  1210. and "material_name" in
  1211. <foreach collection="material_name" item="item" open="(" separator="," close=")">
  1212. #{item}
  1213. </foreach>
  1214. </if>
  1215. <if test="furnace_number != null">
  1216. and "furnace_number" in
  1217. <foreach collection="furnace_number" item="item" open="(" separator="," close=")">
  1218. #{item}
  1219. </foreach>
  1220. </if>
  1221. <if test="theoretical_weight != null">
  1222. and "theoretical_weight" in
  1223. <foreach collection="theoretical_weight" item="item" open="(" separator="," close=")">
  1224. #{item}
  1225. </foreach>
  1226. </if>
  1227. <if test="material_number != null">
  1228. and "material_number" in
  1229. <foreach collection="material_number" item="item" open="(" separator="," close=")">
  1230. #{item}
  1231. </foreach>
  1232. </if>
  1233. <if test="production_date != null">
  1234. and "production_date" in
  1235. <foreach collection="production_date" item="item" open="(" separator="," close=")">
  1236. to_date('${item}','yyyy-mm-dd')
  1237. </foreach>
  1238. </if>
  1239. <if test="LOADA != null">
  1240. and "LOADA" in
  1241. <foreach collection="LOADA" item="item" open="(" separator="," close=")">
  1242. #{item}
  1243. </foreach>
  1244. </if>
  1245. <if test="LOADD != null">
  1246. and "LOADD" in
  1247. <foreach collection="LOADD" item="item" open="(" separator="," close=")">
  1248. #{item}
  1249. </foreach>
  1250. </if>
  1251. <if test="inbound_time != null">
  1252. and "inbound_time" in
  1253. <foreach collection="inbound_time" item="item" open="(" separator="," close=")">
  1254. to_date('${item}','yyyy-mm-dd')
  1255. </foreach>
  1256. </if>
  1257. </where>
  1258. <include refid="orderBy"></include>
  1259. </select>
  1260. <select id="selectScanResultByIboundResultId" resultType="java.util.LinkedHashMap"
  1261. parameterType="java.util.Map">
  1262. SELECT DISTINCT RP.PERSONNEL_NAME "load",
  1263. WISR.MATERIAL_ID "materialId",
  1264. WISR.RESULT_LOAD_TIME "loadTime",
  1265. RM.material_code "material_code",
  1266. RM.material_name "material_name",
  1267. RM.material_specification || '(' || rm.material_model || ')' "specification",
  1268. RMS.material_furnace_number "furnace_number",
  1269. RMS.material_theoretical_weight "theoretical_weight"
  1270. FROM WMSP_INBOUND_RESULT WIR
  1271. LEFT JOIN WMSP_INBOUND_SCAN_RESULT WISR ON WISR.INBOUND_RESULT_ID = WIR.INBOUND_ID
  1272. LEFT JOIN RMS_MATERIAL_STEEL RMS ON RMS.MATERIAL_STEEL_ID = WISR.MATERIAL_ID
  1273. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = RMS.MATERIAL_ID
  1274. LEFT JOIN RMS_PERSONNEL RP ON RP.PERSONNEL_ID = WISR.LOAD_ID
  1275. WHERE WIR.INBOUND_ID = #{inboundId,jdbcType=INTEGER}
  1276. AND WIR.RESULT_DELETED = 0
  1277. </select>
  1278. <select id="selectWarehouseName" resultType="java.lang.String">
  1279. select rw.warehouse_name
  1280. from rms_warehouse rw
  1281. where rw.warehouse_id =#{houseId}
  1282. </select>
  1283. <select id="selectInboundResultByGroupId" resultType="Map">
  1284. SELECT * FROM
  1285. (SELECT wid.DISTRIBUTE_ID "distributeId", wid.batch "batch",wir.INSERT_USERNAME "userName", wir.RESULT_STATUS "resultStatus" FROM WMSP_INBOUND_RESULT wir
  1286. LEFT JOIN WMSP_INBOUND_DISTRIBUTE wid
  1287. ON wir.inbound_distribute_id=wid.distribute_id
  1288. WHERE wir.inbound_Group_Id=#{groupId} ORDER BY INBOUND_TIME DESC)
  1289. where rownum=1
  1290. </select>
  1291. <select id="getGrid" resultType="java.math.BigDecimal">
  1292. select "gridId",rownum rm from (select t.grid_Id "gridId" from WMSP_INBOUND_RESULT t where t.inbound_distribute_id=#{distributeId} and t.RESULT_NUMBER=#{resultNumber} ORDER BY inbound_time DESC )
  1293. </select>
  1294. <!-- 根据resultId查询出对应的物资Id-->
  1295. <select id="getResultMaterialByResultId" resultType="java.util.LinkedHashMap">
  1296. SELECT wosr.RESULT_MATERIAL "resultMaterial"
  1297. FROM WMSP_OUTBOUND_SCAN_RESULT wosr
  1298. WHERE wosr.RESULT_CHECK = 0
  1299. AND wosr.OUTBOUND_RESULT_ID = #{resultId}
  1300. </select>
  1301. <select id="getInboundResult" resultType="java.util.LinkedHashMap"
  1302. parameterType="java.util.Map">
  1303. SELECT
  1304. wir.INBOUND_ID "inboundId",
  1305. wgm.GM_ID "gmId"
  1306. FROM WMSP_INBOUND_RESULT wir
  1307. JOIN WMSP_INBOUND_SCAN_RESULT wisr
  1308. ON wisr.INBOUND_RESULT_ID = wir.INBOUND_ID
  1309. JOIN WMSP_GRID_MATERIAL wgm
  1310. ON wgm.GRID_ID = wir.GRID_ID
  1311. WHERE wisr.RESULT_MATERIAL = #{resultMaterial}
  1312. </select>
  1313. <update id="updateInboundStatus">
  1314. update WMSP_INBOUND_RESULT set RESULT_STATUS= 2 where INBOUND_DISTRIBUTE_ID = #{distributeId}
  1315. </update>
  1316. <update id="updateStatusByMaterilaId">
  1317. update WMSP_INBOUND_RESULT set INBOUND_ISCOMPLETE = 1 where MATERIAL_ID=#{materialId}
  1318. </update>
  1319. <!-- and wir.insert_time between sysdate and trunc(sysdate + 1, 'dd')-->
  1320. <update id="updateStatusByMaterialId">
  1321. update wmsp_inbound_result set INBOUND_ISCOMPLETE=2 where inbound_id in
  1322. (
  1323. select * from(
  1324. select inbound_id from WMSP_INBOUND_RESULT wir
  1325. left join rms_material_steel rms
  1326. on wir.material_id = rms.material_steel_id
  1327. left join WMSP_GRID_MATERIAL wgm
  1328. on wgm.MATERIAL_ID = rms.material_steel_id
  1329. where rms.material_id=(
  1330. select distinct rms2.material_id from rms_material_steel rms2
  1331. where material_steel_id =#{materialId}
  1332. ) and INBOUND_ISCOMPLETE='1' and wgm.deleted ='0'
  1333. order by wir.insert_time desc
  1334. ) where Rownum='1'
  1335. )
  1336. </update>
  1337. <select id="getInbountNumber" resultType="java.math.BigDecimal">
  1338. select count(*) from WMSP_INBOUND_RESULT wir
  1339. </select>
  1340. <select id="getTypeMaterilaId" resultType="java.lang.Integer">
  1341. select count(*) from WMSP_INBOUND_RESULT
  1342. where MATERIAL_ID=#{materialId} and INBOUND_ISCOMPLETE='2'
  1343. </select>
  1344. </mapper>