WmspInboundResultMapper.xml 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659
  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 * from (
  598. SELECT
  599. wir.INBOUND_ID "inboundId",
  600. RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
  601. RM.MATERIAL_MODEL || ')' "materialName",
  602. wir.INBOUND_NUMBER "inboundNo",
  603. wir.INBOUND_TIME "inboundTime",
  604. wir.INBOUND_ISCOMPLETE "isComplete",
  605. RW.WAREHOUSE_NAME "warehouseName",
  606. RS.STACKING_NO "stackingNo",
  607. RPG.GRID_GRADATION_NUMBER "gridGradationNumber",
  608. -- 关联炉号
  609. rms.MATERIAL_FURNACE_NUMBER "furnaceNumber",
  610. -- 关联物资实际重量
  611. rms.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight"
  612. FROM wmsp_inbound_result wir
  613. LEFT JOIN WMSP_GRID_MATERIAL wgm
  614. ON wgm.MATERIAL_ID = wir.MATERIAL_ID
  615. LEFT JOIN RMS_MATERIAL_STEEL rms
  616. ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
  617. LEFT JOIN RMS_MATERIAL rm
  618. ON rm.MATERIAL_ID = rms.MATERIAL_ID
  619. LEFT JOIN RMS_PWAREHOUSE_GRID rpg
  620. ON RPG.GRID_ID = wir.GRID_ID
  621. LEFT JOIN RMS_WAREHOUSE RW
  622. ON RW.WAREHOUSE_ID = rpg.WAREHOUSE_ID
  623. LEFT JOIN RMS_STACKING RS
  624. ON RS.STACKING_ID = RPG.STACKING_ID
  625. WHERE
  626. wir.inbound_type = 0
  627. AND wir.result_deleted = 0
  628. AND wir.INBOUND_ISCOMPLETE != 2
  629. AND rpg.WAREHOUSE_ID = #{warehouseId}
  630. AND wgm.UPDATE_TIME IS NULL
  631. <if test="oneDate != null">
  632. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= wir.inbound_time
  633. </if>
  634. <if test="startDate != null">
  635. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= wir.inbound_time
  636. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= wir.inbound_time
  637. </if>
  638. ORDER BY wir.inbound_time DESC
  639. )
  640. <where>
  641. <if test="INBOUND_NUMBER != null">
  642. and "INBOUND_NUMBER" in
  643. <foreach collection="INBOUND_NUMBER" item="item" open="(" separator="," close=")">
  644. #{item}
  645. </foreach>
  646. </if>
  647. <if test="WAREHOUSE_NAME != null">
  648. and "WAREHOUSE_NAME" in
  649. <foreach collection="WAREHOUSE_NAME" item="item" open="(" separator="," close=")">
  650. #{item}
  651. </foreach>
  652. </if>
  653. <if test="STACKING_NO != null">
  654. and "STACKING_NO" in
  655. <foreach collection="STACKING_NO" item="item" open="(" separator="," close=")">
  656. #{item}
  657. </foreach>
  658. </if>
  659. <if test="GRID_GRADATION_NUMBER != null">
  660. and "GRID_GRADATION_NUMBER" in
  661. <foreach collection="GRID_GRADATION_NUMBER" item="item" open="(" separator="," close=")">
  662. #{item}
  663. </foreach>
  664. </if>
  665. <if test="FURNACE_NUMBER != null">
  666. and "FURNACE_NUMBER" in
  667. <foreach collection="FURNACE_NUMBER" item="item" open="(" separator="," close=")">
  668. #{item}
  669. </foreach>
  670. </if>
  671. <if test="MATERIAL_CODE != null">
  672. and "MATERIAL_CODE" in
  673. <foreach collection="MATERIAL_CODE" item="item" open="(" separator="," close=")">
  674. #{item}
  675. </foreach>
  676. </if>
  677. <if test="MATERIAL_NAME != null">
  678. and "MATERIAL_NAME" in
  679. <foreach collection="MATERIAL_NAME" item="item" open="(" separator="," close=")">
  680. #{item}
  681. </foreach>
  682. </if>
  683. <if test="THEORETICAL_WEIGHT != null">
  684. and "THEORETICAL_WEIGHT" in
  685. <foreach collection="THEORETICAL_WEIGHT" item="item" open="(" separator="," close=")">
  686. #{item}
  687. </foreach>
  688. </if>
  689. <if test="BUNDLE_WEIGHT != null">
  690. and "BUNDLE_WEIGHT" in
  691. <foreach collection="BUNDLE_WEIGHT" item="item" open="(" separator="," close=")">
  692. #{item}
  693. </foreach>
  694. </if>
  695. <if test="MEASURE_NAME != null">
  696. and "MEASURE_NAME" in
  697. <foreach collection="MEASURE_NAME" item="item" open="(" separator="," close=")">
  698. #{item}
  699. </foreach>
  700. </if>
  701. <if test="PRODUCTION_DATE != null">
  702. and "PRODUCTION_DATE" in
  703. <foreach collection="PRODUCTION_DATE" item="item" open="(" separator="," close=")">
  704. to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  705. </foreach>
  706. </if>
  707. <if test="APERSONNEL_NAME != null">
  708. and "APERSONNEL_NAME" in
  709. <foreach collection="APERSONNEL_NAME" item="item" open="(" separator="," close=")">
  710. #{item}
  711. </foreach>
  712. </if>
  713. <if test="BPERSONNEL_NAME != null">
  714. and "BPERSONNEL_NAME" in
  715. <foreach collection="BPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  716. #{item}
  717. </foreach>
  718. </if>
  719. <if test="DPERSONNEL_NAME != null">
  720. and "DPERSONNEL_NAME" in
  721. <foreach collection="DPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  722. #{item}
  723. </foreach>
  724. </if>
  725. <if test="SHIPPER_BRANCH_FACTORY != null">
  726. and "SHIPPER_BRANCH_FACTORY" in
  727. <foreach collection="SHIPPER_BRANCH_FACTORY" item="item" open="(" separator="," close=")">
  728. #{item}
  729. </foreach>
  730. </if>
  731. <if test="PERSONNEL_WORKSHOP != null">
  732. and "PERSONNEL_WORKSHOP" in
  733. <foreach collection="PERSONNEL_WORKSHOP" item="item" open="(" separator="," close=")">
  734. #{item}
  735. </foreach>
  736. </if>
  737. <if test="INBOUND_TIME != null">
  738. and "INBOUND_TIME" in
  739. <foreach collection="INBOUND_TIME" item="item" open="(" separator="," close=")">
  740. #{item}
  741. </foreach>
  742. </if>
  743. </where>
  744. <include refid="orderBy"></include>
  745. </select>
  746. <select id="selectWmsInboundResults" resultType="java.util.LinkedHashMap">
  747. select * from(
  748. SELECT
  749. wir.INBOUND_ID "inboundId",
  750. RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
  751. RM.MATERIAL_MODEL || ')' "materialName",
  752. wir.INBOUND_NUMBER "inboundNo",
  753. wir.INBOUND_TIME "inboundTime",
  754. wir.INBOUND_ISCOMPLETE "isComplete",
  755. RW.WAREHOUSE_NAME "warehouseName",
  756. RS.STACKING_NO "stackingNo",
  757. RPG.GRID_GRADATION_NUMBER "gridGradationNumber",
  758. -- 关联炉号
  759. rms.MATERIAL_FURNACE_NUMBER "furnaceNumber",
  760. -- 关联物资实际重量
  761. rms.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight"
  762. FROM wmsp_inbound_result wir
  763. LEFT JOIN WMSP_GRID_MATERIAL wgm
  764. ON wgm.MATERIAL_ID = wir.MATERIAL_ID
  765. LEFT JOIN RMS_MATERIAL_STEEL rms
  766. ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
  767. LEFT JOIN RMS_MATERIAL rm
  768. ON rm.MATERIAL_ID = rms.MATERIAL_ID
  769. LEFT JOIN RMS_PWAREHOUSE_GRID rpg
  770. ON RPG.GRID_ID = wir.GRID_ID
  771. LEFT JOIN RMS_WAREHOUSE RW
  772. ON RW.WAREHOUSE_ID = rpg.WAREHOUSE_ID
  773. LEFT JOIN RMS_STACKING RS
  774. ON RS.STACKING_ID = RPG.STACKING_ID
  775. WHERE
  776. wir.inbound_type = 0
  777. AND wir.result_deleted = 0
  778. AND wir.INBOUND_ISCOMPLETE != 2
  779. AND rpg.WAREHOUSE_ID = #{warehouseId}
  780. <if test="oneDate != null">
  781. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= wir.inbound_time
  782. </if>
  783. <if test="startDate != null">
  784. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= wir.inbound_time
  785. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= wir.inbound_time
  786. </if>
  787. ORDER BY wir.inbound_time DESC
  788. )
  789. <where>
  790. <if test="INBOUND_NUMBER != null">
  791. and "INBOUND_NUMBER" in
  792. <foreach collection="INBOUND_NUMBER" item="item" open="(" separator="," close=")">
  793. #{item}
  794. </foreach>
  795. </if>
  796. <if test="WAREHOUSE_NAME != null">
  797. and "WAREHOUSE_NAME" in
  798. <foreach collection="WAREHOUSE_NAME" item="item" open="(" separator="," close=")">
  799. #{item}
  800. </foreach>
  801. </if>
  802. <if test="STACKING_NO != null">
  803. and "STACKING_NO" in
  804. <foreach collection="STACKING_NO" item="item" open="(" separator="," close=")">
  805. #{item}
  806. </foreach>
  807. </if>
  808. <if test="GRID_GRADATION_NUMBER != null">
  809. and "GRID_GRADATION_NUMBER" in
  810. <foreach collection="GRID_GRADATION_NUMBER" item="item" open="(" separator="," close=")">
  811. #{item}
  812. </foreach>
  813. </if>
  814. <if test="FURNACE_NUMBER != null">
  815. and "FURNACE_NUMBER" in
  816. <foreach collection="FURNACE_NUMBER" item="item" open="(" separator="," close=")">
  817. #{item}
  818. </foreach>
  819. </if>
  820. <if test="MATERIAL_CODE != null">
  821. and "MATERIAL_CODE" in
  822. <foreach collection="MATERIAL_CODE" item="item" open="(" separator="," close=")">
  823. #{item}
  824. </foreach>
  825. </if>
  826. <if test="MATERIAL_NAME != null">
  827. and "MATERIAL_NAME" in
  828. <foreach collection="MATERIAL_NAME" item="item" open="(" separator="," close=")">
  829. #{item}
  830. </foreach>
  831. </if>
  832. <if test="THEORETICAL_WEIGHT != null">
  833. and "THEORETICAL_WEIGHT" in
  834. <foreach collection="THEORETICAL_WEIGHT" item="item" open="(" separator="," close=")">
  835. #{item}
  836. </foreach>
  837. </if>
  838. <if test="BUNDLE_WEIGHT != null">
  839. and "BUNDLE_WEIGHT" in
  840. <foreach collection="BUNDLE_WEIGHT" item="item" open="(" separator="," close=")">
  841. #{item}
  842. </foreach>
  843. </if>
  844. <if test="MEASURE_NAME != null">
  845. and "MEASURE_NAME" in
  846. <foreach collection="MEASURE_NAME" item="item" open="(" separator="," close=")">
  847. #{item}
  848. </foreach>
  849. </if>
  850. <if test="PRODUCTION_DATE != null">
  851. and "PRODUCTION_DATE" in
  852. <foreach collection="PRODUCTION_DATE" item="item" open="(" separator="," close=")">
  853. to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  854. </foreach>
  855. </if>
  856. <if test="APERSONNEL_NAME != null">
  857. and "APERSONNEL_NAME" in
  858. <foreach collection="APERSONNEL_NAME" item="item" open="(" separator="," close=")">
  859. #{item}
  860. </foreach>
  861. </if>
  862. <if test="BPERSONNEL_NAME != null">
  863. and "BPERSONNEL_NAME" in
  864. <foreach collection="BPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  865. #{item}
  866. </foreach>
  867. </if>
  868. <if test="DPERSONNEL_NAME != null">
  869. and "DPERSONNEL_NAME" in
  870. <foreach collection="DPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  871. #{item}
  872. </foreach>
  873. </if>
  874. <if test="SHIPPER_BRANCH_FACTORY != null">
  875. and "SHIPPER_BRANCH_FACTORY" in
  876. <foreach collection="SHIPPER_BRANCH_FACTORY" item="item" open="(" separator="," close=")">
  877. #{item}
  878. </foreach>
  879. </if>
  880. <if test="PERSONNEL_WORKSHOP != null">
  881. and "PERSONNEL_WORKSHOP" in
  882. <foreach collection="PERSONNEL_WORKSHOP" item="item" open="(" separator="," close=")">
  883. #{item}
  884. </foreach>
  885. </if>
  886. <if test="INBOUND_TIME != null">
  887. and "INBOUND_TIME" in
  888. <foreach collection="INBOUND_TIME" item="item" open="(" separator="," close=")">
  889. #{item}
  890. </foreach>
  891. </if>
  892. </where>
  893. <include refid="orderBy"></include>
  894. </select>
  895. <select id="selectWmsReservedResult" resultType="java.util.LinkedHashMap">
  896. select * from (
  897. select
  898. wir.INBOUND_ID "inboundId",
  899. RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
  900. RM.MATERIAL_MODEL || ')' "materialName",
  901. wir.inbound_number "inboundNo",
  902. wir.inbound_time "inboundTime",
  903. wir.inbound_iscomplete "isComplete",
  904. RW.WAREHOUSE_NAME "warehouseName",
  905. RS.STACKING_NO "stackingNo",
  906. RPG.GRID_GRADATION_NUMBER "gridGradationNumber",
  907. -- 关联炉号
  908. rms.MATERIAL_FURNACE_NUMBER "furnaceNumber",
  909. -- 关联物资实际重量
  910. rms.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight"
  911. from wmsp_inbound_result wir
  912. LEFT JOIN RMS_MATERIAL_STEEL rms
  913. ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
  914. -- 关联实时库存
  915. LEFT JOIN WMSP_GRID_MATERIAL wgm
  916. ON wgm.MATERIAL_ID = wir.MATERIAL_ID
  917. LEFT JOIN RMS_MATERIAL rm
  918. ON rm.MATERIAL_ID = rms.MATERIAL_ID
  919. LEFT JOIN RMS_PWAREHOUSE_GRID rpg
  920. ON RPG.GRID_ID = wir.GRID_ID
  921. LEFT JOIN RMS_WAREHOUSE RW
  922. ON RW.WAREHOUSE_ID = rpg.WAREHOUSE_ID
  923. LEFT JOIN RMS_STACKING RS
  924. ON RS.STACKING_ID = RPG.STACKING_ID
  925. where wir.inbound_type = 0
  926. and wir.result_deleted = 0
  927. and wir.INBOUND_ISCOMPLETE = 2
  928. and wgm.UPDATE_TIME is null
  929. and rpg.WAREHOUSE_ID = #{warehouseId}
  930. order by wir.inbound_time desc
  931. )
  932. <where>
  933. <if test="INBOUND_NUMBER != null">
  934. and "INBOUND_NUMBER" in
  935. <foreach collection="INBOUND_NUMBER" item="item" open="(" separator="," close=")">
  936. #{item}
  937. </foreach>
  938. </if>
  939. <if test="WAREHOUSE_NAME != null">
  940. and "WAREHOUSE_NAME" in
  941. <foreach collection="WAREHOUSE_NAME" item="item" open="(" separator="," close=")">
  942. #{item}
  943. </foreach>
  944. </if>
  945. <if test="STACKING_NO != null">
  946. and "STACKING_NO" in
  947. <foreach collection="STACKING_NO" item="item" open="(" separator="," close=")">
  948. #{item}
  949. </foreach>
  950. </if>
  951. <if test="GRID_GRADATION_NUMBER != null">
  952. and "GRID_GRADATION_NUMBER" in
  953. <foreach collection="GRID_GRADATION_NUMBER" item="item" open="(" separator="," close=")">
  954. #{item}
  955. </foreach>
  956. </if>
  957. <if test="FURNACE_NUMBER != null">
  958. and "FURNACE_NUMBER" in
  959. <foreach collection="FURNACE_NUMBER" item="item" open="(" separator="," close=")">
  960. #{item}
  961. </foreach>
  962. </if>
  963. <if test="MATERIAL_CODE != null">
  964. and "MATERIAL_CODE" in
  965. <foreach collection="MATERIAL_CODE" item="item" open="(" separator="," close=")">
  966. #{item}
  967. </foreach>
  968. </if>
  969. <if test="MATERIAL_NAME != null">
  970. and "MATERIAL_NAME" in
  971. <foreach collection="MATERIAL_NAME" item="item" open="(" separator="," close=")">
  972. #{item}
  973. </foreach>
  974. </if>
  975. <if test="THEORETICAL_WEIGHT != null">
  976. and "THEORETICAL_WEIGHT" in
  977. <foreach collection="THEORETICAL_WEIGHT" item="item" open="(" separator="," close=")">
  978. #{item}
  979. </foreach>
  980. </if>
  981. <if test="BUNDLE_WEIGHT != null">
  982. and "BUNDLE_WEIGHT" in
  983. <foreach collection="BUNDLE_WEIGHT" item="item" open="(" separator="," close=")">
  984. #{item}
  985. </foreach>
  986. </if>
  987. <if test="MEASURE_NAME != null">
  988. and "MEASURE_NAME" in
  989. <foreach collection="MEASURE_NAME" item="item" open="(" separator="," close=")">
  990. #{item}
  991. </foreach>
  992. </if>
  993. <if test="PRODUCTION_DATE != null">
  994. and "PRODUCTION_DATE" in
  995. <foreach collection="PRODUCTION_DATE" item="item" open="(" separator="," close=")">
  996. to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  997. </foreach>
  998. </if>
  999. <if test="APERSONNEL_NAME != null">
  1000. and "APERSONNEL_NAME" in
  1001. <foreach collection="APERSONNEL_NAME" item="item" open="(" separator="," close=")">
  1002. #{item}
  1003. </foreach>
  1004. </if>
  1005. <if test="BPERSONNEL_NAME != null">
  1006. and "BPERSONNEL_NAME" in
  1007. <foreach collection="BPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  1008. #{item}
  1009. </foreach>
  1010. </if>
  1011. <if test="DPERSONNEL_NAME != null">
  1012. and "DPERSONNEL_NAME" in
  1013. <foreach collection="DPERSONNEL_NAME" item="item" open="(" separator="," close=")">
  1014. #{item}
  1015. </foreach>
  1016. </if>
  1017. <if test="SHIPPER_BRANCH_FACTORY != null">
  1018. and "SHIPPER_BRANCH_FACTORY" in
  1019. <foreach collection="SHIPPER_BRANCH_FACTORY" item="item" open="(" separator="," close=")">
  1020. #{item}
  1021. </foreach>
  1022. </if>
  1023. <if test="PERSONNEL_WORKSHOP != null">
  1024. and "PERSONNEL_WORKSHOP" in
  1025. <foreach collection="PERSONNEL_WORKSHOP" item="item" open="(" separator="," close=")">
  1026. #{item}
  1027. </foreach>
  1028. </if>
  1029. <if test="INBOUND_TIME != null">
  1030. and "INBOUND_TIME" in
  1031. <foreach collection="INBOUND_TIME" item="item" open="(" separator="," close=")">
  1032. #{item}
  1033. </foreach>
  1034. </if>
  1035. </where>
  1036. <include refid="orderBy"></include>
  1037. </select>
  1038. <sql id="orderBy">
  1039. <if test="orderField != null and orderField != ''">
  1040. order by "${orderField}"
  1041. <if test="orderType != null and orderType != ''">
  1042. ${orderType}
  1043. </if>
  1044. </if>
  1045. </sql>
  1046. <!-- <select id="getCount" resultType="java.math.BigDecimal">-->
  1047. <!-- select MAX(INBOUND_ID) from wmsp_inbound_result-->
  1048. <!-- </select>-->
  1049. <select id="selectWmsReboundResult" resultType="java.util.LinkedHashMap">
  1050. select * from (
  1051. select wimr.result_no "result_no",
  1052. rw.warehouse_name "warehouse_name",
  1053. rs.stacking_no "stacking_no",
  1054. rpg.grid_gradation_number "gradation_number",
  1055. rms.material_furnace_number "furnace_number",
  1056. rm.material_name "material_name",
  1057. rm.material_specification || '(' || rm.material_model || ')' "specification",
  1058. rms.material_theoretical_weight "theoretical_weight",
  1059. wmsp.inbound_material_number "MATERIAL_NUMBER",
  1060. rms.material_production_date "production_date",
  1061. rp1.personnel_name "LOADA",
  1062. rp2.personnel_name "LOADD",
  1063. wir.inbound_time "inbound_time"
  1064. from wmsp_inbound_scan_result wmsp
  1065. join rms_material_steel rms
  1066. on rms.material_steel_id = wmsp.material_id
  1067. join wmsp_ivbound_make_material wimm
  1068. on wmsp.material_id = wimm.material_steel_id
  1069. join wmsp_ivbound_make_result wimr
  1070. on wimr.result_id = wimm.result_id
  1071. join rms_material rm
  1072. on rm.material_id = rms.material_id
  1073. join rms_unit_of_measure ruom
  1074. on ruom.unit_of_measure_id = rm.unit_of_measure_id
  1075. join rms_personnel rp1
  1076. on rp1.personnel_id = wmsp.load_id
  1077. join wmsp_inbound_result wir
  1078. on wir.inbound_id = wmsp.inbound_result_id
  1079. join wmsp_inbound_driving_result widr
  1080. on widr.inbound_result_id = wir.inbound_id
  1081. join rms_personnel rp2
  1082. on rp2.personnel_id = widr.driver_id
  1083. join rms_pwarehouse_grid rpg
  1084. on rpg.grid_id = wir.grid_id
  1085. join rms_warehouse rw
  1086. on rw.warehouse_id = rpg.warehouse_id
  1087. join wmsp_inbound_stack_result wisr
  1088. on wisr.inbound_result_id = wir.inbound_id
  1089. join rms_stacking rs
  1090. on rs.stacking_id = wisr.stacking_id
  1091. where rp1.personnel_id = 6
  1092. and wmsp.result_status_ = 1
  1093. and wir.inbound_type = 2
  1094. )
  1095. <where>
  1096. <if test="result_no != null">
  1097. and "result_no" in
  1098. <foreach collection="result_no" item="item" open="(" separator="," close=")">
  1099. #{item}
  1100. </foreach>
  1101. </if>
  1102. <if test="warehouse_name != null">
  1103. and "warehouse_name" in
  1104. <foreach collection="warehouse_name" item="item" open="(" separator="," close=")">
  1105. #{item}
  1106. </foreach>
  1107. </if>
  1108. <if test="stacking_no != null">
  1109. and "stacking_no" in
  1110. <foreach collection="stacking_no" item="item" open="(" separator="," close=")">
  1111. #{item}
  1112. </foreach>
  1113. </if>
  1114. <if test="gradation_number != null">
  1115. and "gradation_number" in
  1116. <foreach collection="gradation_number" item="item" open="(" separator="," close=")">
  1117. #{item}
  1118. </foreach>
  1119. </if>
  1120. <if test="furnace_number != null">
  1121. and "furnace_number" in
  1122. <foreach collection="furnace_number" item="item" open="(" separator="," close=")">
  1123. #{item}
  1124. </foreach>
  1125. </if>
  1126. <if test="material_name != null">
  1127. and "material_name" in
  1128. <foreach collection="material_name" item="item" open="(" separator="," close=")">
  1129. #{item}
  1130. </foreach>
  1131. </if>
  1132. <if test="specification != null">
  1133. and "specification" in
  1134. <foreach collection="specification" item="item" open="(" separator="," close=")">
  1135. #{item}
  1136. </foreach>
  1137. </if>
  1138. <if test="theoretical_weight != null">
  1139. and "theoretical_weight" in
  1140. <foreach collection="theoretical_weight" item="item" open="(" separator="," close=")">
  1141. #{item}
  1142. </foreach>
  1143. </if>
  1144. <if test="MATERIAL_NUMBER != null">
  1145. and "MATERIAL_NUMBER" in
  1146. <foreach collection="MATERIAL_NUMBER" item="item" open="(" separator="," close=")">
  1147. #{item}
  1148. </foreach>
  1149. </if>
  1150. <if test="production_date != null">
  1151. and "production_date" in
  1152. <foreach collection="production_date" item="item" open="(" separator="," close=")">
  1153. to_date('${item}','yyyy-mm-dd')
  1154. </foreach>
  1155. </if>
  1156. <if test="LOADA != null">
  1157. and "LOADA" in
  1158. <foreach collection="LOADA" item="item" open="(" separator="," close=")">
  1159. #{item}
  1160. </foreach>
  1161. </if>
  1162. <if test="LOADD != null">
  1163. and "LOADD" in
  1164. <foreach collection="LOADD" item="item" open="(" separator="," close=")">
  1165. #{item}
  1166. </foreach>
  1167. </if>
  1168. <if test="inbound_time != null">
  1169. and "inbound_time" in
  1170. <foreach collection="inbound_time" item="item" open="(" separator="," close=")">
  1171. to_date('${item}','yyyy-mm-dd')
  1172. </foreach>
  1173. </if>
  1174. </where>
  1175. <include refid="orderBy"></include>
  1176. </select>
  1177. <select id="selectWmsIvboundResult" resultType="java.util.Map">
  1178. select * from(
  1179. select wimr.result_id "resultId",
  1180. wimr.result_no "result_no",
  1181. rw1.warehouse_name "before_warehouse",
  1182. rw2.warehouse_name "after_warehouse",
  1183. wimr.insert_time "insert_time",
  1184. (select count(*)
  1185. from wmsp_ivbound_make_result wimr
  1186. join rms_warehouse rw1
  1187. on rw1.warehouse_id = wimr.result_before_warehouse_id
  1188. join rms_warehouse rw2
  1189. on rw2.warehouse_id = wimr.result_after_warehouse_id
  1190. join wmsp_ivbound_make_material wimm
  1191. on wimm.result_id = wimr.result_id) "material_number"
  1192. from wmsp_ivbound_make_result wimr
  1193. join rms_warehouse rw1
  1194. on rw1.warehouse_id = wimr.result_before_warehouse_id
  1195. join rms_warehouse rw2
  1196. on rw2.warehouse_id = wimr.result_after_warehouse_id
  1197. join wmsp_ivbound_make_material wimm
  1198. on wimm.result_id = wimr.result_id
  1199. order by wimr.insert_time desc
  1200. )
  1201. <where>
  1202. <if test="result_no != null">
  1203. and "result_no" in
  1204. <foreach collection="result_no" item="item" open="(" separator="," close=")">
  1205. #{item}
  1206. </foreach>
  1207. </if>
  1208. <if test="before_warehouse != null">
  1209. and "before_warehouse" in
  1210. <foreach collection="before_warehouse" item="item" open="(" separator="," close=")">
  1211. #{item}
  1212. </foreach>
  1213. </if>
  1214. <if test="after_warehouse != null">
  1215. and "after_warehouse" in
  1216. <foreach collection="after_warehouse" item="item" open="(" separator="," close=")">
  1217. #{item}
  1218. </foreach>
  1219. </if>
  1220. <if test="insert_time != null">
  1221. and "insert_time" in
  1222. <foreach collection="insert_time" item="item" open="(" separator="," close=")">
  1223. to_date('${item}','yyyy-mm-dd')
  1224. </foreach>
  1225. </if>
  1226. <if test="material_number != null">
  1227. and "material_number" in
  1228. <foreach collection="material_number" item="item" open="(" separator="," close=")">
  1229. #{item}
  1230. </foreach>
  1231. </if>
  1232. </where>
  1233. <include refid="orderBy"></include>
  1234. </select>
  1235. <select id="selectWmsIvboundMaterialResult" resultType="java.util.LinkedHashMap">
  1236. select * from(
  1237. select
  1238. wimr.result_no "result_no",
  1239. rw1.warehouse_name "before_warehouse",
  1240. rw2.warehouse_name "after_warehouse",
  1241. rs1.stacking_no "before_stack",
  1242. wimm.before_gradution_number "before_gradution_number",
  1243. rm.material_code "material_code",
  1244. rm.material_name "material_name",
  1245. rm.material_specification || '(' || rm.material_model || ')' "specification",
  1246. rms.material_furnace_number "furnace_number",
  1247. rms.material_theoretical_weight "theoretical_weight",
  1248. (select count(*) from wmsp_ivbound_make_material wimm
  1249. join
  1250. wmsp_ivbound_make_result wimr
  1251. on
  1252. wimr.result_id=wimm.result_id
  1253. join
  1254. rms_warehouse rw1
  1255. on
  1256. rw1.warehouse_id=wimr.result_before_warehouse_id
  1257. join
  1258. rms_warehouse rw2
  1259. on
  1260. rw2.warehouse_id=wimr.result_after_warehouse_id
  1261. join rms_stacking rs1
  1262. on
  1263. rs1.stacking_id=wimm.before_stacking_id
  1264. join
  1265. rms_material_steel rms
  1266. on
  1267. rms.material_steel_id=wimm.material_steel_id
  1268. join
  1269. rms_material rm
  1270. on
  1271. rm.material_id=rms.material_id
  1272. join
  1273. wmsp_inbound_scan_result wisr
  1274. on
  1275. wisr.material_id=wimm.material_steel_id
  1276. join
  1277. rms_personnel rp2
  1278. on
  1279. rp2.personnel_id=wisr.load_id
  1280. join
  1281. wmsp_inbound_result wir
  1282. on
  1283. wir.inbound_id=wisr.inbound_result_id
  1284. join
  1285. wmsp_inbound_driving_result widr
  1286. on
  1287. widr.inbound_result_id=wir.inbound_id
  1288. join
  1289. rms_personnel rp3
  1290. on
  1291. rp3.personnel_id=widr.driver_id
  1292. join
  1293. rms_pwarehouse_grid rpg
  1294. on
  1295. rpg.grid_id=wir.inbound_id
  1296. where wimm.result_id = #{resultId}) "material_number",
  1297. rms.material_production_date "production_date",
  1298. rp2.personnel_name "LOADA",
  1299. rp3.personnel_name "LOADD",
  1300. wir.inbound_time "inbound_time"
  1301. from wmsp_ivbound_make_material wimm
  1302. join
  1303. wmsp_ivbound_make_result wimr
  1304. on
  1305. wimr.result_id=wimm.result_id
  1306. join
  1307. rms_warehouse rw1
  1308. on
  1309. rw1.warehouse_id=wimr.result_before_warehouse_id
  1310. join
  1311. rms_warehouse rw2
  1312. on
  1313. rw2.warehouse_id=wimr.result_after_warehouse_id
  1314. join rms_stacking rs1
  1315. on
  1316. rs1.stacking_id=wimm.before_stacking_id
  1317. join
  1318. rms_material_steel rms
  1319. on
  1320. rms.material_steel_id=wimm.material_steel_id
  1321. join
  1322. rms_material rm
  1323. on
  1324. rm.material_id=rms.material_id
  1325. join
  1326. wmsp_inbound_scan_result wisr
  1327. on
  1328. wisr.material_id=wimm.material_steel_id
  1329. join
  1330. rms_personnel rp2
  1331. on
  1332. rp2.personnel_id=wisr.load_id
  1333. join
  1334. wmsp_inbound_result wir
  1335. on
  1336. wir.inbound_id=wisr.inbound_result_id
  1337. join
  1338. wmsp_inbound_driving_result widr
  1339. on
  1340. widr.inbound_result_id=wir.inbound_id
  1341. join
  1342. rms_personnel rp3
  1343. on
  1344. rp3.personnel_id=widr.driver_id
  1345. join
  1346. rms_pwarehouse_grid rpg
  1347. on
  1348. rpg.grid_id=wir.inbound_id
  1349. where wimm.result_id = #{resultId}
  1350. order by
  1351. wir.inbound_time desc
  1352. )
  1353. <where>
  1354. <if test="result_no != null">
  1355. and "result_no" in
  1356. <foreach collection="result_no" item="item" open="(" separator="," close=")">
  1357. #{item}
  1358. </foreach>
  1359. </if>
  1360. <if test="before_warehouse != null">
  1361. and "before_warehouse" in
  1362. <foreach collection="before_warehouse" item="item" open="(" separator="," close=")">
  1363. #{item}
  1364. </foreach>
  1365. </if>
  1366. <if test="after_warehouse != null">
  1367. and "after_warehouse" in
  1368. <foreach collection="after_warehouse" item="item" open="(" separator="," close=")">
  1369. #{item}
  1370. </foreach>
  1371. </if>
  1372. <if test="before_stack != null">
  1373. and "before_stack" in
  1374. <foreach collection="before_stack" item="item" open="(" separator="," close=")">
  1375. #{item}
  1376. </foreach>
  1377. </if>
  1378. <if test="before_gradution_number != null">
  1379. and "before_gradution_number" in
  1380. <foreach collection="before_gradution_number" item="item" open="(" separator="," close=")">
  1381. #{item}
  1382. </foreach>
  1383. </if>
  1384. <if test="material_code != null">
  1385. and "material_code" in
  1386. <foreach collection="material_code" item="item" open="(" separator="," close=")">
  1387. #{item}
  1388. </foreach>
  1389. </if>
  1390. <if test="material_name != null">
  1391. and "material_name" in
  1392. <foreach collection="material_name" item="item" open="(" separator="," close=")">
  1393. #{item}
  1394. </foreach>
  1395. </if>
  1396. <if test="furnace_number != null">
  1397. and "furnace_number" in
  1398. <foreach collection="furnace_number" item="item" open="(" separator="," close=")">
  1399. #{item}
  1400. </foreach>
  1401. </if>
  1402. <if test="theoretical_weight != null">
  1403. and "theoretical_weight" in
  1404. <foreach collection="theoretical_weight" item="item" open="(" separator="," close=")">
  1405. #{item}
  1406. </foreach>
  1407. </if>
  1408. <if test="material_number != null">
  1409. and "material_number" in
  1410. <foreach collection="material_number" item="item" open="(" separator="," close=")">
  1411. #{item}
  1412. </foreach>
  1413. </if>
  1414. <if test="production_date != null">
  1415. and "production_date" in
  1416. <foreach collection="production_date" item="item" open="(" separator="," close=")">
  1417. to_date('${item}','yyyy-mm-dd')
  1418. </foreach>
  1419. </if>
  1420. <if test="LOADA != null">
  1421. and "LOADA" in
  1422. <foreach collection="LOADA" item="item" open="(" separator="," close=")">
  1423. #{item}
  1424. </foreach>
  1425. </if>
  1426. <if test="LOADD != null">
  1427. and "LOADD" in
  1428. <foreach collection="LOADD" item="item" open="(" separator="," close=")">
  1429. #{item}
  1430. </foreach>
  1431. </if>
  1432. <if test="inbound_time != null">
  1433. and "inbound_time" in
  1434. <foreach collection="inbound_time" item="item" open="(" separator="," close=")">
  1435. to_date('${item}','yyyy-mm-dd')
  1436. </foreach>
  1437. </if>
  1438. </where>
  1439. <include refid="orderBy"></include>
  1440. </select>
  1441. <select id="selectScanResultByIboundResultId" resultType="java.util.LinkedHashMap"
  1442. parameterType="java.util.Map">
  1443. SELECT DISTINCT RP.PERSONNEL_NAME "load",
  1444. WISR.MATERIAL_ID "materialId",
  1445. WISR.RESULT_LOAD_TIME "loadTime",
  1446. RM.material_code "material_code",
  1447. RM.material_name "material_name",
  1448. RM.material_specification || '(' || rm.material_model || ')' "specification",
  1449. RMS.material_furnace_number "furnace_number",
  1450. RMS.material_theoretical_weight "theoretical_weight"
  1451. FROM WMSP_INBOUND_RESULT WIR
  1452. LEFT JOIN WMSP_INBOUND_SCAN_RESULT WISR ON WISR.INBOUND_RESULT_ID = WIR.INBOUND_ID
  1453. LEFT JOIN RMS_MATERIAL_STEEL RMS ON RMS.MATERIAL_STEEL_ID = WISR.MATERIAL_ID
  1454. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = RMS.MATERIAL_ID
  1455. LEFT JOIN RMS_PERSONNEL RP ON RP.PERSONNEL_ID = WISR.LOAD_ID
  1456. WHERE WIR.INBOUND_ID = #{inboundId,jdbcType=INTEGER}
  1457. AND WIR.RESULT_DELETED = 0
  1458. </select>
  1459. <select id="selectWarehouseName" resultType="java.lang.String">
  1460. select rw.warehouse_name
  1461. from rms_warehouse rw
  1462. where rw.warehouse_id =#{houseId}
  1463. </select>
  1464. <select id="selectInboundResultByGroupId" resultType="Map">
  1465. SELECT * FROM
  1466. (SELECT wid.DISTRIBUTE_ID "distributeId", wid.batch "batch",wir.INSERT_USERNAME "userName", wir.RESULT_STATUS "resultStatus" FROM WMSP_INBOUND_RESULT wir
  1467. LEFT JOIN WMSP_INBOUND_DISTRIBUTE wid
  1468. ON wir.inbound_distribute_id=wid.distribute_id
  1469. WHERE wir.inbound_Group_Id=#{groupId} ORDER BY INBOUND_TIME DESC)
  1470. where rownum=1
  1471. </select>
  1472. <select id="getGrid" resultType="java.math.BigDecimal">
  1473. 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 )
  1474. </select>
  1475. <!-- 根据resultId查询出对应的物资Id-->
  1476. <select id="getResultMaterialByResultId" resultType="java.util.LinkedHashMap">
  1477. SELECT wosr.RESULT_MATERIAL "resultMaterial"
  1478. FROM WMSP_OUTBOUND_SCAN_RESULT wosr
  1479. WHERE wosr.RESULT_CHECK = 0
  1480. AND wosr.OUTBOUND_RESULT_ID = #{resultId}
  1481. </select>
  1482. <select id="getInboundResult" resultType="java.util.LinkedHashMap"
  1483. parameterType="java.util.Map">
  1484. SELECT
  1485. wir.INBOUND_ID "inboundId",
  1486. wgm.GM_ID "gmId"
  1487. FROM WMSP_INBOUND_RESULT wir
  1488. JOIN WMSP_INBOUND_SCAN_RESULT wisr
  1489. ON wisr.INBOUND_RESULT_ID = wir.INBOUND_ID
  1490. JOIN WMSP_GRID_MATERIAL wgm
  1491. ON wgm.GRID_ID = wir.GRID_ID
  1492. WHERE wisr.RESULT_MATERIAL = #{resultMaterial}
  1493. </select>
  1494. <update id="updateInboundStatus">
  1495. update WMSP_INBOUND_RESULT set RESULT_STATUS= 2 where INBOUND_DISTRIBUTE_ID = #{distributeId}
  1496. </update>
  1497. <update id="updateStatusByMaterilaId">
  1498. update WMSP_INBOUND_RESULT set INBOUND_ISCOMPLETE = 1 where MATERIAL_ID=#{materialId}
  1499. </update>
  1500. <!-- and wir.insert_time between sysdate and trunc(sysdate + 1, 'dd')-->
  1501. <update id="updateStatusByMaterialId">
  1502. update wmsp_inbound_result set INBOUND_ISCOMPLETE=2 where inbound_id in
  1503. (
  1504. select * from(
  1505. select inbound_id from WMSP_INBOUND_RESULT wir
  1506. left join rms_material_steel rms
  1507. on wir.material_id = rms.material_steel_id
  1508. left join WMSP_GRID_MATERIAL wgm
  1509. on wgm.MATERIAL_ID = rms.material_steel_id
  1510. where rms.material_id=(
  1511. select distinct rms2.material_id from rms_material_steel rms2
  1512. where material_steel_id =#{materialId}
  1513. ) and INBOUND_ISCOMPLETE='1' and wgm.deleted ='0' and to_char(wir.insert_time,'YYYY-MM-DD')=TO_CHAR(SYSDATE,'YYYY-MM-DD')
  1514. order by wir.insert_time desc
  1515. ) where Rownum='1'
  1516. )
  1517. </update>
  1518. <select id="getInbountNumber" resultType="java.math.BigDecimal">
  1519. select count(*) from WMSP_INBOUND_RESULT wir
  1520. </select>
  1521. <select id="getTypeMaterilaId" resultType="java.lang.Integer">
  1522. select count(*) from WMSP_INBOUND_RESULT
  1523. where MATERIAL_ID=#{materialId} and INBOUND_ISCOMPLETE='2'
  1524. </select>
  1525. <select id="getWmsInboundResultStatistics" parameterType="java.util.Map" resultType="java.util.Map">
  1526. SELECT DISTINCT
  1527. -- 炉号生产总数量
  1528. table1.count "count",
  1529. -- 炉号生产总重量
  1530. table2.weight "weight",
  1531. -- 炉号生产的第一件钢材时间
  1532. table3.onetime "onetime",
  1533. -- 生产物资型号
  1534. RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
  1535. RM.MATERIAL_MODEL || ')' "materialName",
  1536. -- 炉号
  1537. MATERIAL_FURNACE_NUMBER "furnaceNumber1"
  1538. FROM
  1539. WMSP_INBOUND_RESULT WIR
  1540. LEFT JOIN RMS_MATERIAL_STEEL RMS
  1541. ON RMS.MATERIAL_STEEL_ID = WIR.MATERIAL_ID
  1542. LEFT JOIN RMS_MATERIAL RM
  1543. ON RM.MATERIAL_ID = RMS.MATERIAL_ID
  1544. LEFT JOIN WMSP_GRID_MATERIAL WGM
  1545. ON WGM.MATERIAL_ID = WIR.MATERIAL_ID
  1546. LEFT JOIN RMS_PWAREHOUSE_GRID RPG
  1547. ON RPG.GRID_ID = WGM.GRID_ID
  1548. LEFT JOIN (
  1549. SELECT
  1550. count(MATERIAL_FURNACE_NUMBER) count,
  1551. MATERIAL_FURNACE_NUMBER "furnaceNumber1"
  1552. FROM
  1553. WMSP_INBOUND_RESULT WIR2
  1554. LEFT JOIN RMS_MATERIAL_STEEL RMS2
  1555. ON RMS2.MATERIAL_STEEL_ID = WIR2.MATERIAL_ID
  1556. WHERE RMS2.DELETED IS NULL OR RMS2.DELETED = 0
  1557. <if test="oneDate != null">
  1558. AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= WIR2.INBOUND_TIME
  1559. </if>
  1560. <if test="startDate != null">
  1561. AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= WIR2.INBOUND_TIME
  1562. AND to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= WIR2.INBOUND_TIME
  1563. </if>
  1564. GROUP BY
  1565. MATERIAL_FURNACE_NUMBER
  1566. ) table1
  1567. ON RMS.MATERIAL_FURNACE_NUMBER = table1."furnaceNumber1"
  1568. LEFT JOIN (
  1569. SELECT
  1570. sum(MATERIAL_THEORETICAL_WEIGHT) weight,
  1571. MATERIAL_FURNACE_NUMBER "furnaceNumber2"
  1572. FROM
  1573. WMSP_INBOUND_RESULT WIR3
  1574. LEFT JOIN RMS_MATERIAL_STEEL RMS3
  1575. ON RMS3.MATERIAL_STEEL_ID = WIR3.MATERIAL_ID
  1576. WHERE RMS3.DELETED IS NULL OR RMS3.DELETED = 0
  1577. <if test="oneDate != null">
  1578. AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= WIR3.INBOUND_TIME
  1579. </if>
  1580. <if test="startDate != null">
  1581. AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= WIR3.INBOUND_TIME
  1582. AND to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= WIR3.INBOUND_TIME
  1583. </if>
  1584. GROUP BY
  1585. MATERIAL_FURNACE_NUMBER
  1586. ) table2
  1587. ON table1."furnaceNumber1" = table2."furnaceNumber2"
  1588. LEFT JOIN(
  1589. SELECT
  1590. MIN(WIR4.INSERT_TIME) onetime,
  1591. MATERIAL_FURNACE_NUMBER "furnaceNumber3"
  1592. FROM
  1593. WMSP_INBOUND_RESULT WIR4
  1594. LEFT JOIN RMS_MATERIAL_STEEL RMS4
  1595. ON RMS4.MATERIAL_STEEL_ID = WIR4.MATERIAL_ID
  1596. WHERE RMS4.DELETED IS NULL OR RMS4.DELETED = 0
  1597. <if test="oneDate != null">
  1598. AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= WIR4.INBOUND_TIME
  1599. </if>
  1600. <if test="startDate != null">
  1601. AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= WIR4.INBOUND_TIME
  1602. AND to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= WIR4.INBOUND_TIME
  1603. </if>
  1604. GROUP BY
  1605. MATERIAL_FURNACE_NUMBER
  1606. )table3
  1607. ON table3."furnaceNumber3" = table2."furnaceNumber2"
  1608. WHERE RPG.WAREHOUSE_ID = #{warehouseId}
  1609. <if test="oneDate != null">
  1610. AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= WIR.INBOUND_TIME
  1611. </if>
  1612. <if test="startDate != null">
  1613. AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= WIR.INBOUND_TIME
  1614. AND to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= WIR.INBOUND_TIME
  1615. </if>
  1616. AND WIR.RESULT_DELETED = 0 ORDER BY table3.onetime ASC
  1617. <include refid="orderBy"></include>
  1618. </select>
  1619. </mapper>