WmspInboundResultMapper.xml 70 KB

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