WmspInboundResultMapper.xml 71 KB

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