WmshInboundResultMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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.WmshInboundResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.WmshInboundResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="RESULT_NUMBER" jdbcType="VARCHAR" property="resultNumber" />
  7. <result column="PORT_ID" jdbcType="DECIMAL" property="portId" />
  8. <result column="RESULT_MATERIAL_NUMBER" jdbcType="DECIMAL" property="resultMaterialNumber" />
  9. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  10. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  11. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  12. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  13. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  14. <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
  15. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  16. <result column="WORK_TIME" jdbcType="TIMESTAMP" property="workTime" />
  17. </resultMap>
  18. <sql id="columns">
  19. RESULT_ID, RESULT_NUMBER, PORT_ID, RESULT_MATERIAL_NUMBER, INSERT_USERNAME, INSERT_TIME,
  20. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, BATCH_ID, DELETED, WORK_TIME
  21. </sql>
  22. <sql id="columns_alias">
  23. t.RESULT_ID, t.RESULT_NUMBER, t.PORT_ID, t.RESULT_MATERIAL_NUMBER, t.INSERT_USERNAME,
  24. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.BATCH_ID,
  25. t.DELETED, t.WORK_TIME
  26. </sql>
  27. <sql id="select">
  28. SELECT <include refid="columns" /> FROM WMSH_INBOUND_RESULT
  29. </sql>
  30. <sql id="select_alias">
  31. SELECT <include refid="columns_alias" /> FROM WMSH_INBOUND_RESULT t
  32. </sql>
  33. <sql id="where">
  34. <where>
  35. <if test="resultId != null">
  36. and RESULT_ID = #{resultId}
  37. </if>
  38. <if test="resultNumber != null and resultNumber != ''">
  39. and RESULT_NUMBER = #{resultNumber}
  40. </if>
  41. <if test="portId != null">
  42. and PORT_ID = #{portId}
  43. </if>
  44. <if test="resultMaterialNumber != null">
  45. and RESULT_MATERIAL_NUMBER = #{resultMaterialNumber}
  46. </if>
  47. <if test="insertUsername != null and insertUsername != ''">
  48. and INSERT_USERNAME = #{insertUsername}
  49. </if>
  50. <if test="insertTime != null">
  51. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  52. </if>
  53. <if test="updateUsername != null and updateUsername != ''">
  54. and UPDATE_USERNAME = #{updateUsername}
  55. </if>
  56. <if test="updateTime != null">
  57. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  58. </if>
  59. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  60. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  61. </if>
  62. <if test="batchId != null">
  63. and BATCH_ID = #{batchId}
  64. </if>
  65. <if test="deleted != null">
  66. and DELETED = #{deleted}
  67. </if>
  68. <if test="workTime != null">
  69. and TO_CHAR(WORK_TIME,'yyyy-MM-dd') = #{workTime}
  70. </if>
  71. </where>
  72. </sql>
  73. <sql id="whereLike">
  74. <where>
  75. <if test="resultId != null">
  76. and RESULT_ID = #{resultId}
  77. </if>
  78. <if test="resultNumber != null and resultNumber != ''">
  79. and RESULT_NUMBER LIKE '%${resultNumber}%'
  80. </if>
  81. <if test="portId != null">
  82. and PORT_ID = #{portId}
  83. </if>
  84. <if test="resultMaterialNumber != null">
  85. and RESULT_MATERIAL_NUMBER = #{resultMaterialNumber}
  86. </if>
  87. <if test="insertUsername != null and insertUsername != ''">
  88. and INSERT_USERNAME LIKE '%${insertUsername}%'
  89. </if>
  90. <if test="insertTime != null">
  91. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  92. </if>
  93. <if test="updateUsername != null and updateUsername != ''">
  94. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  95. </if>
  96. <if test="updateTime != null">
  97. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  98. </if>
  99. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  100. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  101. </if>
  102. <if test="batchId != null">
  103. and BATCH_ID = #{batchId}
  104. </if>
  105. <if test="deleted != null">
  106. and DELETED = #{deleted}
  107. </if>
  108. <if test="workTime != null">
  109. and TO_CHAR(WORK_TIME,'yyyy-MM-dd') = #{workTime}
  110. </if>
  111. </where>
  112. </sql>
  113. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  114. delete from WMSH_INBOUND_RESULT
  115. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  116. </delete>
  117. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  118. delete from WMSH_INBOUND_RESULT
  119. where 1!=1
  120. <if test="resultNumber != null and resultNumber != ''">
  121. or RESULT_NUMBER = #{resultNumber}
  122. </if>
  123. <if test="portId != null">
  124. or PORT_ID = #{portId}
  125. </if>
  126. <if test="resultMaterialNumber != null">
  127. or RESULT_MATERIAL_NUMBER = #{resultMaterialNumber}
  128. </if>
  129. <if test="insertUsername != null and insertUsername != ''">
  130. or INSERT_USERNAME = #{insertUsername}
  131. </if>
  132. <if test="insertTime != null">
  133. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  134. </if>
  135. <if test="updateUsername != null and updateUsername != ''">
  136. or UPDATE_USERNAME = #{updateUsername}
  137. </if>
  138. <if test="updateTime != null">
  139. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  140. </if>
  141. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  142. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  143. </if>
  144. <if test="batchId != null">
  145. or BATCH_ID = #{batchId}
  146. </if>
  147. <if test="deleted != null">
  148. or DELETED = #{deleted}
  149. </if>
  150. <if test="workTime != null">
  151. or TO_CHAR(WORK_TIME,'yyyy-MM-dd') = '#{workTime}'
  152. </if>
  153. </delete>
  154. <insert id="insert" parameterType="com.steerinfo.dil.model.WmshInboundResult">
  155. insert into WMSH_INBOUND_RESULT (RESULT_ID, RESULT_NUMBER, PORT_ID,
  156. RESULT_MATERIAL_NUMBER, INSERT_USERNAME, INSERT_TIME,
  157. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  158. BATCH_ID, DELETED, WORK_TIME
  159. )
  160. values (#{resultId,jdbcType=DECIMAL}, #{resultNumber,jdbcType=VARCHAR}, #{portId,jdbcType=DECIMAL},
  161. #{resultMaterialNumber,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  162. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  163. #{batchId,jdbcType=DECIMAL}, #{deleted,jdbcType=DECIMAL}, #{workTime,jdbcType=TIMESTAMP}
  164. )
  165. </insert>
  166. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.WmshInboundResult">
  167. insert into WMSH_INBOUND_RESULT
  168. <trim prefix="(" suffix=")" suffixOverrides=",">
  169. <if test="resultId != null">
  170. RESULT_ID,
  171. </if>
  172. <if test="resultNumber != null">
  173. RESULT_NUMBER,
  174. </if>
  175. <if test="portId != null">
  176. PORT_ID,
  177. </if>
  178. <if test="resultMaterialNumber != null">
  179. RESULT_MATERIAL_NUMBER,
  180. </if>
  181. <if test="insertUsername != null">
  182. INSERT_USERNAME,
  183. </if>
  184. <if test="insertTime != null">
  185. INSERT_TIME,
  186. </if>
  187. <if test="updateUsername != null">
  188. UPDATE_USERNAME,
  189. </if>
  190. <if test="updateTime != null">
  191. UPDATE_TIME,
  192. </if>
  193. <if test="insertUpdateRemark != null">
  194. INSERT_UPDATE_REMARK,
  195. </if>
  196. <if test="batchId != null">
  197. BATCH_ID,
  198. </if>
  199. <if test="deleted != null">
  200. DELETED,
  201. </if>
  202. <if test="workTime != null">
  203. WORK_TIME,
  204. </if>
  205. </trim>
  206. <trim prefix="values (" suffix=")" suffixOverrides=",">
  207. <if test="resultId != null">
  208. #{resultId,jdbcType=DECIMAL},
  209. </if>
  210. <if test="resultNumber != null">
  211. #{resultNumber,jdbcType=VARCHAR},
  212. </if>
  213. <if test="portId != null">
  214. #{portId,jdbcType=DECIMAL},
  215. </if>
  216. <if test="resultMaterialNumber != null">
  217. #{resultMaterialNumber,jdbcType=DECIMAL},
  218. </if>
  219. <if test="insertUsername != null">
  220. #{insertUsername,jdbcType=VARCHAR},
  221. </if>
  222. <if test="insertTime != null">
  223. #{insertTime,jdbcType=TIMESTAMP},
  224. </if>
  225. <if test="updateUsername != null">
  226. #{updateUsername,jdbcType=VARCHAR},
  227. </if>
  228. <if test="updateTime != null">
  229. #{updateTime,jdbcType=TIMESTAMP},
  230. </if>
  231. <if test="insertUpdateRemark != null">
  232. #{insertUpdateRemark,jdbcType=VARCHAR},
  233. </if>
  234. <if test="batchId != null">
  235. #{batchId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="deleted != null">
  238. #{deleted,jdbcType=DECIMAL},
  239. </if>
  240. <if test="workTime != null">
  241. #{workTime,jdbcType=TIMESTAMP},
  242. </if>
  243. </trim>
  244. </insert>
  245. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.WmshInboundResult">
  246. update WMSH_INBOUND_RESULT
  247. set RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
  248. PORT_ID = #{portId,jdbcType=DECIMAL},
  249. RESULT_MATERIAL_NUMBER = #{resultMaterialNumber,jdbcType=DECIMAL},
  250. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  251. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  252. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  253. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  254. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  255. BATCH_ID = #{batchId,jdbcType=DECIMAL},
  256. DELETED = #{deleted,jdbcType=DECIMAL},
  257. WORK_TIME = #{workTime,jdbcType=TIMESTAMP}
  258. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  259. </update>
  260. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.WmshInboundResult">
  261. update WMSH_INBOUND_RESULT
  262. <set>
  263. <if test="resultNumber != null">
  264. RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
  265. </if>
  266. <if test="portId != null">
  267. PORT_ID = #{portId,jdbcType=DECIMAL},
  268. </if>
  269. <if test="resultMaterialNumber != null">
  270. RESULT_MATERIAL_NUMBER = #{resultMaterialNumber,jdbcType=DECIMAL},
  271. </if>
  272. <if test="insertUsername != null">
  273. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  274. </if>
  275. <if test="insertTime != null">
  276. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  277. </if>
  278. <if test="updateUsername != null">
  279. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  280. </if>
  281. <if test="updateTime != null">
  282. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  283. </if>
  284. <if test="insertUpdateRemark != null">
  285. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  286. </if>
  287. <if test="batchId != null">
  288. BATCH_ID = #{batchId,jdbcType=DECIMAL},
  289. </if>
  290. <if test="deleted != null">
  291. DELETED = #{deleted,jdbcType=DECIMAL},
  292. </if>
  293. <if test="workTime != null">
  294. WORK_TIME = #{workTime,jdbcType=TIMESTAMP},
  295. </if>
  296. </set>
  297. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  298. </update>
  299. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  300. <include refid="select" />
  301. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  302. </select>
  303. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  304. <include refid="select" />
  305. <include refid="where" />
  306. </select>
  307. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  308. <include refid="select" />
  309. <include refid="whereLike" />
  310. </select>
  311. <insert id="batchInsert" parameterType="java.util.List">
  312. insert into WMSH_INBOUND_RESULT
  313. (RESULT_ID,
  314. RESULT_NUMBER, PORT_ID, RESULT_MATERIAL_NUMBER,
  315. INSERT_USERNAME, INSERT_TIME,
  316. UPDATE_USERNAME, UPDATE_TIME,
  317. INSERT_UPDATE_REMARK, BATCH_ID,
  318. DELETED, WORK_TIME)
  319. ( <foreach collection="list" item="item" separator="union all">
  320. select
  321. #{item.resultId,jdbcType=DECIMAL},
  322. #{item.resultNumber,jdbcType=VARCHAR}, #{item.portId,jdbcType=DECIMAL}, #{item.resultMaterialNumber,jdbcType=DECIMAL},
  323. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  324. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  325. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.batchId,jdbcType=DECIMAL},
  326. #{item.deleted,jdbcType=DECIMAL}, #{item.workTime,jdbcType=TIMESTAMP} from dual
  327. </foreach> )
  328. </insert>
  329. <update id="batchUpdate" parameterType="java.util.List">
  330. update WMSH_INBOUND_RESULT
  331. set
  332. RESULT_ID=
  333. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  334. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  335. </foreach>
  336. ,RESULT_NUMBER=
  337. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  338. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=VARCHAR}
  339. </foreach>
  340. ,PORT_ID=
  341. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  342. when #{item.resultId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
  343. </foreach>
  344. ,RESULT_MATERIAL_NUMBER=
  345. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  346. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMaterialNumber,jdbcType=DECIMAL}
  347. </foreach>
  348. ,INSERT_USERNAME=
  349. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  350. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  351. </foreach>
  352. ,INSERT_TIME=
  353. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  354. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  355. </foreach>
  356. ,UPDATE_USERNAME=
  357. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  358. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  359. </foreach>
  360. ,UPDATE_TIME=
  361. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  362. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  363. </foreach>
  364. ,INSERT_UPDATE_REMARK=
  365. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  366. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  367. </foreach>
  368. ,BATCH_ID=
  369. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  370. when #{item.resultId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
  371. </foreach>
  372. ,DELETED=
  373. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  374. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  375. </foreach>
  376. ,WORK_TIME=
  377. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  378. when #{item.resultId,jdbcType=DECIMAL} then #{item.workTime,jdbcType=TIMESTAMP}
  379. </foreach>
  380. where RESULT_ID in
  381. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  382. #{item.resultId,jdbcType=DECIMAL}
  383. </foreach>
  384. </update>
  385. <delete id="batchDelete" parameterType="java.util.List">
  386. delete from WMSH_INBOUND_RESULT
  387. where RESULT_ID in
  388. <foreach close=")" collection="list" item="id" open="(" separator=",">
  389. #{id}
  390. </foreach>
  391. </delete>
  392. <!-- 友情提示!!!-->
  393. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  394. <!-- 友情提示!!!-->
  395. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  396. <!-- 排序 -->
  397. <sql id="orderBy">
  398. <if test="orderField != null and orderField != ''">
  399. order by "${orderField}"
  400. <if test="orderType != null and orderType != ''">
  401. ${orderType}
  402. </if>
  403. </if>
  404. </sql>
  405. <!-- 查询所有港存库实绩 -->
  406. <select id="getAllResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  407. select *
  408. from (
  409. select WIR.RESULT_ID "resultId",
  410. WIR.RESULT_NUMBER "resultNumber",
  411. RP.PORT_NAME "portName",
  412. RM.MATERIAL_NAME "materialName",
  413. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  414. WIR.RESULT_MATERIAL_NUMBER "resultMaterialNumber",
  415. WIR.INSERT_USERNAME "insertUsername",
  416. WIR.INSERT_TIME "insertTime"
  417. from WMSH_INBOUND_RESULT WIR
  418. left join DIL_BATCH DB
  419. on WIR.BATCH_ID = DB.BATCH_ID
  420. left join RMS_MATERIAL RM
  421. on RM.MATERIAL_ID = DB.MATERIAL_ID
  422. Left join RMS_PORT RP
  423. on RP.PORT_ID = WIR.PORT_ID
  424. where WIR.DELETED = 0
  425. )
  426. <where>
  427. <if test="resultNumber != null">
  428. <foreach collection="resultNumber" item="item" open="(" separator="or" close=")">
  429. "resultNumber" like '%${item}%'
  430. </foreach>
  431. </if>
  432. <if test="portName != null">
  433. and
  434. <foreach collection="portName" item="item" open="(" separator="or" close=")">
  435. "portName" like '%${item}%'
  436. </foreach>
  437. </if>
  438. <if test="materialName != null">
  439. and
  440. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  441. "materialName" like '%${item}%'
  442. </foreach>
  443. </if>
  444. <if test="resultForeignShipName != null">
  445. and
  446. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  447. "resultForeignShipName" like '%${item}%'
  448. </foreach>
  449. </if>
  450. <if test="resultMaterialNumber != null">
  451. and
  452. <foreach collection="resultMaterialNumber" item="item" open="(" separator="or" close=")">
  453. "resultMaterialNumber" like '%${item}%'
  454. </foreach>
  455. </if>
  456. <if test="insertUsername != null">
  457. and
  458. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  459. "insertUsername" like '%${item}%'
  460. </foreach>
  461. </if>
  462. <if test="insertTime != null">
  463. and
  464. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  465. "insertTime" like '%${item}%'
  466. </foreach>
  467. </if>
  468. </where>
  469. <include refid="orderBy"></include>
  470. <if test="orderField == null ">
  471. order by "insertTime" desc
  472. </if>
  473. </select>
  474. <!-- 通过ID查询实绩-->
  475. <select id="getResultById" parameterType="int" resultType="java.util.Map">
  476. select
  477. WIR.BATCH_ID "batchId",
  478. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  479. WIR.PORT_ID "portId",
  480. WIR.RESULT_MATERIAL_NUMBER "resultMaterialNumber"
  481. from WMSH_INBOUND_RESULT WIR
  482. left join DIL_BATCH DB
  483. on DB.BATCH_ID = WIR.BATCH_ID
  484. where WIR.RESULT_ID = #{resultId}
  485. </select>
  486. <update id="updateForBind">
  487. update WMSH_INBOUND_RESULT
  488. set BATCH_ID = #{batchId}
  489. where BATCH_ID = #{batchIdOld}
  490. </update>
  491. <select id="findInboundDetail" resultType="java.util.Map">
  492. select
  493. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  494. WIR.RESULT_ID "resultId",
  495. WIR.RESULT_NUMBER "resultNumber",
  496. RP.PORT_NAME "portName",
  497. RM.MATERIAL_NAME "materialName",
  498. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  499. WIR.RESULT_MATERIAL_NUMBER "resultMaterialNumber",
  500. WIR.INSERT_USERNAME "insertUsername",
  501. WIR.INSERT_TIME "insertTime"
  502. from WMSH_INBOUND_RESULT WIR
  503. left join DIL_BATCH DB
  504. on WIR.BATCH_ID = DB.BATCH_ID
  505. left join RMS_MATERIAL RM
  506. on RM.MATERIAL_ID = DB.MATERIAL_ID
  507. Left join RMS_PORT RP
  508. on RP.PORT_ID = WIR.PORT_ID
  509. left join AMS_PURCHASE_ORDER APO
  510. on APO.BATCH_ID=DB.BATCH_ID
  511. where WIR.DELETED = 0
  512. and DB.BATCH_ID = #{batchId}
  513. and WIR.INSERT_TIME >= #{time}
  514. and RP.PORT_NAME = '万州港'
  515. </select>
  516. </mapper>