TmsshipLoadShipResultMapper.xml 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  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.TmsshipLoadShipResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmsshipLoadShipResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId"/>
  6. <result column="TOTAL_RESULT_ID" jdbcType="DECIMAL" property="totalResultId"/>
  7. <result column="LOCATION_START_PORT_ID" jdbcType="DECIMAL" property="locationStartPortId"/>
  8. <result column="ARRIVAL_PORT_ID" jdbcType="DECIMAL" property="arrivalPortId"/>
  9. <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId"/>
  10. <result column="RESULT_DELIVERY_DATE" jdbcType="TIMESTAMP" property="resultDeliveryDate"/>
  11. <result column="RESULT_ACTUAL_INSTALLATIONS" jdbcType="DECIMAL" property="resultActualInstallations"/>
  12. <result column="RESULT_NUMBER" jdbcType="VARCHAR" property="resultNumber"/>
  13. <result column="RWAREHOUSE_MATERIAL_ID" jdbcType="DECIMAL" property="rwarehouseMaterialId"/>
  14. <result column="RESULT_ARRIVAL_PORT_TIME" jdbcType="TIMESTAMP" property="resultArrivalPortTime"/>
  15. <result column="RESULT_OUT_PORT_TIME" jdbcType="TIMESTAMP" property="resultOutPortTime"/>
  16. <result column="RESULT_LOAD_SHIP_DATE" jdbcType="TIMESTAMP" property="resultLoadShipDate"/>
  17. <result column="RESULT_ISCLEAR" jdbcType="VARCHAR" property="resultIsclear"/>
  18. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName"/>
  19. <result column="DELETE_TIME" jdbcType="VARCHAR" property="deleteTime"/>
  20. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
  21. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
  22. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
  23. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
  24. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
  25. <result column="DELETED" jdbcType="DECIMAL" property="deleted"/>
  26. </resultMap>
  27. <sql id="columns">
  28. RESULT_ID, TOTAL_RESULT_ID, LOCATION_START_PORT_ID, ARRIVAL_PORT_ID, BATCH_ID, RESULT_DELIVERY_DATE,
  29. RESULT_ACTUAL_INSTALLATIONS, RESULT_NUMBER, RWAREHOUSE_MATERIAL_ID, RESULT_ARRIVAL_PORT_TIME,
  30. RESULT_OUT_PORT_TIME, RESULT_LOAD_SHIP_DATE, RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME,
  31. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  32. DELETED
  33. </sql>
  34. <sql id="columns_alias">
  35. t.RESULT_ID, t.TOTAL_RESULT_ID, t.LOCATION_START_PORT_ID, t.ARRIVAL_PORT_ID, t.BATCH_ID,
  36. t.RESULT_DELIVERY_DATE, t.RESULT_ACTUAL_INSTALLATIONS, t.RESULT_NUMBER, t.RWAREHOUSE_MATERIAL_ID,
  37. t.RESULT_ARRIVAL_PORT_TIME, t.RESULT_OUT_PORT_TIME, t.RESULT_LOAD_SHIP_DATE, t.RESULT_ISCLEAR,
  38. t.DELETE_NAME, t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
  39. t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED
  40. </sql>
  41. <sql id="select">
  42. SELECT
  43. <include refid="columns"/>
  44. FROM TMSSHIP_LOAD_SHIP_RESULT
  45. </sql>
  46. <sql id="select_alias">
  47. SELECT
  48. <include refid="columns_alias"/>
  49. FROM TMSSHIP_LOAD_SHIP_RESULT t
  50. </sql>
  51. <sql id="where">
  52. <where>
  53. <if test="resultId != null">
  54. and RESULT_ID = #{resultId}
  55. </if>
  56. <if test="totalResultId != null">
  57. and TOTAL_RESULT_ID = #{totalResultId}
  58. </if>
  59. <if test="locationStartPortId != null">
  60. and LOCATION_START_PORT_ID = #{locationStartPortId}
  61. </if>
  62. <if test="arrivalPortId != null">
  63. and ARRIVAL_PORT_ID = #{arrivalPortId}
  64. </if>
  65. <if test="batchId != null">
  66. and BATCH_ID = #{batchId}
  67. </if>
  68. <if test="resultDeliveryDate != null">
  69. and TO_CHAR(RESULT_DELIVERY_DATE,'yyyy-MM-dd') = #{resultDeliveryDate}
  70. </if>
  71. <if test="resultActualInstallations != null">
  72. and RESULT_ACTUAL_INSTALLATIONS = #{resultActualInstallations}
  73. </if>
  74. <if test="resultNumber != null and resultNumber != ''">
  75. and RESULT_NUMBER = #{resultNumber}
  76. </if>
  77. <if test="rwarehouseMaterialId != null">
  78. and RWAREHOUSE_MATERIAL_ID = #{rwarehouseMaterialId}
  79. </if>
  80. <if test="resultArrivalPortTime != null">
  81. and TO_CHAR(RESULT_ARRIVAL_PORT_TIME,'yyyy-MM-dd') = #{resultArrivalPortTime}
  82. </if>
  83. <if test="resultOutPortTime != null">
  84. and TO_CHAR(RESULT_OUT_PORT_TIME,'yyyy-MM-dd') = #{resultOutPortTime}
  85. </if>
  86. <if test="resultLoadShipDate != null">
  87. and TO_CHAR(RESULT_LOAD_SHIP_DATE,'yyyy-MM-dd') = #{resultLoadShipDate}
  88. </if>
  89. <if test="resultIsclear != null and resultIsclear != ''">
  90. and RESULT_ISCLEAR = #{resultIsclear}
  91. </if>
  92. <if test="deleteName != null and deleteName != ''">
  93. and DELETE_NAME = #{deleteName}
  94. </if>
  95. <if test="deleteTime != null and deleteTime != ''">
  96. and DELETE_TIME = #{deleteTime}
  97. </if>
  98. <if test="insertUsername != null and insertUsername != ''">
  99. and INSERT_USERNAME = #{insertUsername}
  100. </if>
  101. <if test="insertTime != null">
  102. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  103. </if>
  104. <if test="updateUsername != null and updateUsername != ''">
  105. and UPDATE_USERNAME = #{updateUsername}
  106. </if>
  107. <if test="updateTime != null">
  108. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  109. </if>
  110. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  111. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  112. </if>
  113. <if test="deleted != null">
  114. and DELETED = #{deleted}
  115. </if>
  116. </where>
  117. </sql>
  118. <sql id="whereLike">
  119. <where>
  120. <if test="resultId != null">
  121. and RESULT_ID = #{resultId}
  122. </if>
  123. <if test="totalResultId != null">
  124. and TOTAL_RESULT_ID = #{totalResultId}
  125. </if>
  126. <if test="locationStartPortId != null">
  127. and LOCATION_START_PORT_ID = #{locationStartPortId}
  128. </if>
  129. <if test="arrivalPortId != null">
  130. and ARRIVAL_PORT_ID = #{arrivalPortId}
  131. </if>
  132. <if test="batchId != null">
  133. and BATCH_ID = #{batchId}
  134. </if>
  135. <if test="resultDeliveryDate != null">
  136. and TO_CHAR(RESULT_DELIVERY_DATE,'yyyy-MM-dd') = #{resultDeliveryDate}
  137. </if>
  138. <if test="resultActualInstallations != null">
  139. and RESULT_ACTUAL_INSTALLATIONS = #{resultActualInstallations}
  140. </if>
  141. <if test="resultNumber != null and resultNumber != ''">
  142. and RESULT_NUMBER LIKE '%${resultNumber}%'
  143. </if>
  144. <if test="rwarehouseMaterialId != null">
  145. and RWAREHOUSE_MATERIAL_ID = #{rwarehouseMaterialId}
  146. </if>
  147. <if test="resultArrivalPortTime != null">
  148. and TO_CHAR(RESULT_ARRIVAL_PORT_TIME,'yyyy-MM-dd') = #{resultArrivalPortTime}
  149. </if>
  150. <if test="resultOutPortTime != null">
  151. and TO_CHAR(RESULT_OUT_PORT_TIME,'yyyy-MM-dd') = #{resultOutPortTime}
  152. </if>
  153. <if test="resultLoadShipDate != null">
  154. and TO_CHAR(RESULT_LOAD_SHIP_DATE,'yyyy-MM-dd') = #{resultLoadShipDate}
  155. </if>
  156. <if test="resultIsclear != null and resultIsclear != ''">
  157. and RESULT_ISCLEAR LIKE '%${resultIsclear}%'
  158. </if>
  159. <if test="deleteName != null and deleteName != ''">
  160. and DELETE_NAME LIKE '%${deleteName}%'
  161. </if>
  162. <if test="deleteTime != null and deleteTime != ''">
  163. and DELETE_TIME LIKE '%${deleteTime}%'
  164. </if>
  165. <if test="insertUsername != null and insertUsername != ''">
  166. and INSERT_USERNAME LIKE '%${insertUsername}%'
  167. </if>
  168. <if test="insertTime != null">
  169. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  170. </if>
  171. <if test="updateUsername != null and updateUsername != ''">
  172. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  173. </if>
  174. <if test="updateTime != null">
  175. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  176. </if>
  177. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  178. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  179. </if>
  180. <if test="deleted != null">
  181. and DELETED = #{deleted}
  182. </if>
  183. </where>
  184. </sql>
  185. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  186. delete
  187. from TMSSHIP_LOAD_SHIP_RESULT
  188. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  189. </delete>
  190. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  191. delete from TMSSHIP_LOAD_SHIP_RESULT
  192. where 1!=1
  193. <if test="totalResultId != null">
  194. or TOTAL_RESULT_ID = #{totalResultId}
  195. </if>
  196. <if test="locationStartPortId != null">
  197. or LOCATION_START_PORT_ID = #{locationStartPortId}
  198. </if>
  199. <if test="arrivalPortId != null">
  200. or ARRIVAL_PORT_ID = #{arrivalPortId}
  201. </if>
  202. <if test="batchId != null">
  203. or BATCH_ID = #{batchId}
  204. </if>
  205. <if test="resultDeliveryDate != null">
  206. or TO_CHAR(RESULT_DELIVERY_DATE,'yyyy-MM-dd') = '#{resultDeliveryDate}'
  207. </if>
  208. <if test="resultActualInstallations != null">
  209. or RESULT_ACTUAL_INSTALLATIONS = #{resultActualInstallations}
  210. </if>
  211. <if test="resultNumber != null and resultNumber != ''">
  212. or RESULT_NUMBER = #{resultNumber}
  213. </if>
  214. <if test="rwarehouseMaterialId != null">
  215. or RWAREHOUSE_MATERIAL_ID = #{rwarehouseMaterialId}
  216. </if>
  217. <if test="resultArrivalPortTime != null">
  218. or TO_CHAR(RESULT_ARRIVAL_PORT_TIME,'yyyy-MM-dd') = '#{resultArrivalPortTime}'
  219. </if>
  220. <if test="resultOutPortTime != null">
  221. or TO_CHAR(RESULT_OUT_PORT_TIME,'yyyy-MM-dd') = '#{resultOutPortTime}'
  222. </if>
  223. <if test="resultLoadShipDate != null">
  224. or TO_CHAR(RESULT_LOAD_SHIP_DATE,'yyyy-MM-dd') = '#{resultLoadShipDate}'
  225. </if>
  226. <if test="resultIsclear != null and resultIsclear != ''">
  227. or RESULT_ISCLEAR = #{resultIsclear}
  228. </if>
  229. <if test="deleteName != null and deleteName != ''">
  230. or DELETE_NAME = #{deleteName}
  231. </if>
  232. <if test="deleteTime != null and deleteTime != ''">
  233. or DELETE_TIME = #{deleteTime}
  234. </if>
  235. <if test="insertUsername != null and insertUsername != ''">
  236. or INSERT_USERNAME = #{insertUsername}
  237. </if>
  238. <if test="insertTime != null">
  239. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  240. </if>
  241. <if test="updateUsername != null and updateUsername != ''">
  242. or UPDATE_USERNAME = #{updateUsername}
  243. </if>
  244. <if test="updateTime != null">
  245. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  246. </if>
  247. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  248. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  249. </if>
  250. <if test="deleted != null">
  251. or DELETED = #{deleted}
  252. </if>
  253. </delete>
  254. <insert id="insert" parameterType="com.steerinfo.dil.model.TmsshipLoadShipResult">
  255. insert into TMSSHIP_LOAD_SHIP_RESULT (RESULT_ID, TOTAL_RESULT_ID, LOCATION_START_PORT_ID,
  256. ARRIVAL_PORT_ID, BATCH_ID, RESULT_DELIVERY_DATE,
  257. RESULT_ACTUAL_INSTALLATIONS, RESULT_NUMBER,
  258. RWAREHOUSE_MATERIAL_ID, RESULT_ARRIVAL_PORT_TIME,
  259. RESULT_OUT_PORT_TIME, RESULT_LOAD_SHIP_DATE,
  260. RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME,
  261. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  262. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED)
  263. values (#{resultId,jdbcType=DECIMAL}, #{totalResultId,jdbcType=DECIMAL},
  264. #{locationStartPortId,jdbcType=DECIMAL},
  265. #{arrivalPortId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL},
  266. #{resultDeliveryDate,jdbcType=TIMESTAMP},
  267. #{resultActualInstallations,jdbcType=DECIMAL}, #{resultNumber,jdbcType=VARCHAR},
  268. #{rwarehouseMaterialId,jdbcType=DECIMAL}, #{resultArrivalPortTime,jdbcType=TIMESTAMP},
  269. #{resultOutPortTime,jdbcType=TIMESTAMP}, #{resultLoadShipDate,jdbcType=TIMESTAMP},
  270. #{resultIsclear,jdbcType=VARCHAR}, #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR},
  271. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  272. #{updateUsername,jdbcType=VARCHAR},
  273. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL})
  274. </insert>
  275. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmsshipLoadShipResult">
  276. insert into TMSSHIP_LOAD_SHIP_RESULT
  277. <trim prefix="(" suffix=")" suffixOverrides=",">
  278. <if test="resultId != null">
  279. RESULT_ID,
  280. </if>
  281. <if test="totalResultId != null">
  282. TOTAL_RESULT_ID,
  283. </if>
  284. <if test="locationStartPortId != null">
  285. LOCATION_START_PORT_ID,
  286. </if>
  287. <if test="arrivalPortId != null">
  288. ARRIVAL_PORT_ID,
  289. </if>
  290. <if test="batchId != null">
  291. BATCH_ID,
  292. </if>
  293. <if test="resultDeliveryDate != null">
  294. RESULT_DELIVERY_DATE,
  295. </if>
  296. <if test="resultActualInstallations != null">
  297. RESULT_ACTUAL_INSTALLATIONS,
  298. </if>
  299. <if test="resultNumber != null">
  300. RESULT_NUMBER,
  301. </if>
  302. <if test="rwarehouseMaterialId != null">
  303. RWAREHOUSE_MATERIAL_ID,
  304. </if>
  305. <if test="resultArrivalPortTime != null">
  306. RESULT_ARRIVAL_PORT_TIME,
  307. </if>
  308. <if test="resultOutPortTime != null">
  309. RESULT_OUT_PORT_TIME,
  310. </if>
  311. <if test="resultLoadShipDate != null">
  312. RESULT_LOAD_SHIP_DATE,
  313. </if>
  314. <if test="resultIsclear != null">
  315. RESULT_ISCLEAR,
  316. </if>
  317. <if test="deleteName != null">
  318. DELETE_NAME,
  319. </if>
  320. <if test="deleteTime != null">
  321. DELETE_TIME,
  322. </if>
  323. <if test="insertUsername != null">
  324. INSERT_USERNAME,
  325. </if>
  326. <if test="insertTime != null">
  327. INSERT_TIME,
  328. </if>
  329. <if test="updateUsername != null">
  330. UPDATE_USERNAME,
  331. </if>
  332. <if test="updateTime != null">
  333. UPDATE_TIME,
  334. </if>
  335. <if test="insertUpdateRemark != null">
  336. INSERT_UPDATE_REMARK,
  337. </if>
  338. <if test="deleted != null">
  339. DELETED,
  340. </if>
  341. </trim>
  342. <trim prefix="values (" suffix=")" suffixOverrides=",">
  343. <if test="resultId != null">
  344. #{resultId,jdbcType=DECIMAL},
  345. </if>
  346. <if test="totalResultId != null">
  347. #{totalResultId,jdbcType=DECIMAL},
  348. </if>
  349. <if test="locationStartPortId != null">
  350. #{locationStartPortId,jdbcType=DECIMAL},
  351. </if>
  352. <if test="arrivalPortId != null">
  353. #{arrivalPortId,jdbcType=DECIMAL},
  354. </if>
  355. <if test="batchId != null">
  356. #{batchId,jdbcType=DECIMAL},
  357. </if>
  358. <if test="resultDeliveryDate != null">
  359. #{resultDeliveryDate,jdbcType=TIMESTAMP},
  360. </if>
  361. <if test="resultActualInstallations != null">
  362. #{resultActualInstallations,jdbcType=DECIMAL},
  363. </if>
  364. <if test="resultNumber != null">
  365. #{resultNumber,jdbcType=VARCHAR},
  366. </if>
  367. <if test="rwarehouseMaterialId != null">
  368. #{rwarehouseMaterialId,jdbcType=DECIMAL},
  369. </if>
  370. <if test="resultArrivalPortTime != null">
  371. #{resultArrivalPortTime,jdbcType=TIMESTAMP},
  372. </if>
  373. <if test="resultOutPortTime != null">
  374. #{resultOutPortTime,jdbcType=TIMESTAMP},
  375. </if>
  376. <if test="resultLoadShipDate != null">
  377. #{resultLoadShipDate,jdbcType=TIMESTAMP},
  378. </if>
  379. <if test="resultIsclear != null">
  380. #{resultIsclear,jdbcType=VARCHAR},
  381. </if>
  382. <if test="deleteName != null">
  383. #{deleteName,jdbcType=VARCHAR},
  384. </if>
  385. <if test="deleteTime != null">
  386. #{deleteTime,jdbcType=VARCHAR},
  387. </if>
  388. <if test="insertUsername != null">
  389. #{insertUsername,jdbcType=VARCHAR},
  390. </if>
  391. <if test="insertTime != null">
  392. #{insertTime,jdbcType=TIMESTAMP},
  393. </if>
  394. <if test="updateUsername != null">
  395. #{updateUsername,jdbcType=VARCHAR},
  396. </if>
  397. <if test="updateTime != null">
  398. #{updateTime,jdbcType=TIMESTAMP},
  399. </if>
  400. <if test="insertUpdateRemark != null">
  401. #{insertUpdateRemark,jdbcType=VARCHAR},
  402. </if>
  403. <if test="deleted != null">
  404. #{deleted,jdbcType=DECIMAL},
  405. </if>
  406. </trim>
  407. </insert>
  408. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmsshipLoadShipResult">
  409. update TMSSHIP_LOAD_SHIP_RESULT
  410. set TOTAL_RESULT_ID = #{totalResultId,jdbcType=DECIMAL},
  411. LOCATION_START_PORT_ID = #{locationStartPortId,jdbcType=DECIMAL},
  412. ARRIVAL_PORT_ID = #{arrivalPortId,jdbcType=DECIMAL},
  413. BATCH_ID = #{batchId,jdbcType=DECIMAL},
  414. RESULT_DELIVERY_DATE = #{resultDeliveryDate,jdbcType=TIMESTAMP},
  415. RESULT_ACTUAL_INSTALLATIONS = #{resultActualInstallations,jdbcType=DECIMAL},
  416. RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
  417. RWAREHOUSE_MATERIAL_ID = #{rwarehouseMaterialId,jdbcType=DECIMAL},
  418. RESULT_ARRIVAL_PORT_TIME = #{resultArrivalPortTime,jdbcType=TIMESTAMP},
  419. RESULT_OUT_PORT_TIME = #{resultOutPortTime,jdbcType=TIMESTAMP},
  420. RESULT_LOAD_SHIP_DATE = #{resultLoadShipDate,jdbcType=TIMESTAMP},
  421. RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
  422. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  423. DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
  424. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  425. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  426. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  427. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  428. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  429. DELETED = #{deleted,jdbcType=DECIMAL}
  430. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  431. </update>
  432. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmsshipLoadShipResult">
  433. update TMSSHIP_LOAD_SHIP_RESULT
  434. <set>
  435. <if test="totalResultId != null">
  436. TOTAL_RESULT_ID = #{totalResultId,jdbcType=DECIMAL},
  437. </if>
  438. <if test="locationStartPortId != null">
  439. LOCATION_START_PORT_ID = #{locationStartPortId,jdbcType=DECIMAL},
  440. </if>
  441. <if test="arrivalPortId != null">
  442. ARRIVAL_PORT_ID = #{arrivalPortId,jdbcType=DECIMAL},
  443. </if>
  444. <if test="batchId != null">
  445. BATCH_ID = #{batchId,jdbcType=DECIMAL},
  446. </if>
  447. <if test="resultDeliveryDate != null">
  448. RESULT_DELIVERY_DATE = #{resultDeliveryDate,jdbcType=TIMESTAMP},
  449. </if>
  450. <if test="resultActualInstallations != null">
  451. RESULT_ACTUAL_INSTALLATIONS = #{resultActualInstallations,jdbcType=DECIMAL},
  452. </if>
  453. <if test="resultNumber != null">
  454. RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
  455. </if>
  456. <if test="rwarehouseMaterialId != null">
  457. RWAREHOUSE_MATERIAL_ID = #{rwarehouseMaterialId,jdbcType=DECIMAL},
  458. </if>
  459. <if test="resultArrivalPortTime != null">
  460. RESULT_ARRIVAL_PORT_TIME = #{resultArrivalPortTime,jdbcType=TIMESTAMP},
  461. </if>
  462. <if test="resultOutPortTime != null">
  463. RESULT_OUT_PORT_TIME = #{resultOutPortTime,jdbcType=TIMESTAMP},
  464. </if>
  465. <if test="resultLoadShipDate != null">
  466. RESULT_LOAD_SHIP_DATE = #{resultLoadShipDate,jdbcType=TIMESTAMP},
  467. </if>
  468. <if test="resultIsclear != null">
  469. RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
  470. </if>
  471. <if test="deleteName != null">
  472. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  473. </if>
  474. <if test="deleteTime != null">
  475. DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
  476. </if>
  477. <if test="insertUsername != null">
  478. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  479. </if>
  480. <if test="insertTime != null">
  481. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  482. </if>
  483. <if test="updateUsername != null">
  484. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  485. </if>
  486. <if test="updateTime != null">
  487. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  488. </if>
  489. <if test="insertUpdateRemark != null">
  490. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  491. </if>
  492. <if test="deleted != null">
  493. DELETED = #{deleted,jdbcType=DECIMAL},
  494. </if>
  495. </set>
  496. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  497. </update>
  498. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  499. <include refid="select"/>
  500. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  501. </select>
  502. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  503. <include refid="select"/>
  504. <include refid="where"/>
  505. </select>
  506. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  507. <include refid="select"/>
  508. <include refid="whereLike"/>
  509. </select>
  510. <insert id="batchInsert" parameterType="java.util.List">
  511. insert into TMSSHIP_LOAD_SHIP_RESULT
  512. (RESULT_ID,
  513. TOTAL_RESULT_ID, LOCATION_START_PORT_ID,
  514. ARRIVAL_PORT_ID, BATCH_ID, RESULT_DELIVERY_DATE,
  515. RESULT_ACTUAL_INSTALLATIONS, RESULT_NUMBER,
  516. RWAREHOUSE_MATERIAL_ID, RESULT_ARRIVAL_PORT_TIME,
  517. RESULT_OUT_PORT_TIME, RESULT_LOAD_SHIP_DATE,
  518. RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME,
  519. INSERT_USERNAME, INSERT_TIME,
  520. UPDATE_USERNAME, UPDATE_TIME,
  521. INSERT_UPDATE_REMARK, DELETED)
  522. ( <foreach collection="list" item="item" separator="union all">
  523. select
  524. #{item.resultId,jdbcType=DECIMAL},
  525. #{item.totalResultId,jdbcType=DECIMAL}, #{item.locationStartPortId,jdbcType=DECIMAL},
  526. #{item.arrivalPortId,jdbcType=DECIMAL}, #{item.batchId,jdbcType=DECIMAL},
  527. #{item.resultDeliveryDate,jdbcType=TIMESTAMP},
  528. #{item.resultActualInstallations,jdbcType=DECIMAL}, #{item.resultNumber,jdbcType=VARCHAR},
  529. #{item.rwarehouseMaterialId,jdbcType=DECIMAL}, #{item.resultArrivalPortTime,jdbcType=TIMESTAMP},
  530. #{item.resultOutPortTime,jdbcType=TIMESTAMP}, #{item.resultLoadShipDate,jdbcType=TIMESTAMP},
  531. #{item.resultIsclear,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
  532. #{item.deleteTime,jdbcType=VARCHAR},
  533. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  534. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  535. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL} from dual
  536. </foreach> )
  537. </insert>
  538. <update id="batchUpdate" parameterType="java.util.List">
  539. update TMSSHIP_LOAD_SHIP_RESULT
  540. set
  541. RESULT_ID=
  542. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  543. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  544. </foreach>
  545. ,TOTAL_RESULT_ID=
  546. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  547. when #{item.resultId,jdbcType=DECIMAL} then #{item.totalResultId,jdbcType=DECIMAL}
  548. </foreach>
  549. ,LOCATION_START_PORT_ID=
  550. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  551. when #{item.resultId,jdbcType=DECIMAL} then #{item.locationStartPortId,jdbcType=DECIMAL}
  552. </foreach>
  553. ,ARRIVAL_PORT_ID=
  554. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  555. when #{item.resultId,jdbcType=DECIMAL} then #{item.arrivalPortId,jdbcType=DECIMAL}
  556. </foreach>
  557. ,BATCH_ID=
  558. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  559. when #{item.resultId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
  560. </foreach>
  561. ,RESULT_DELIVERY_DATE=
  562. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  563. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDeliveryDate,jdbcType=TIMESTAMP}
  564. </foreach>
  565. ,RESULT_ACTUAL_INSTALLATIONS=
  566. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  567. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultActualInstallations,jdbcType=DECIMAL}
  568. </foreach>
  569. ,RESULT_NUMBER=
  570. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  571. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=VARCHAR}
  572. </foreach>
  573. ,RWAREHOUSE_MATERIAL_ID=
  574. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  575. when #{item.resultId,jdbcType=DECIMAL} then #{item.rwarehouseMaterialId,jdbcType=DECIMAL}
  576. </foreach>
  577. ,RESULT_ARRIVAL_PORT_TIME=
  578. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  579. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultArrivalPortTime,jdbcType=TIMESTAMP}
  580. </foreach>
  581. ,RESULT_OUT_PORT_TIME=
  582. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  583. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultOutPortTime,jdbcType=TIMESTAMP}
  584. </foreach>
  585. ,RESULT_LOAD_SHIP_DATE=
  586. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  587. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadShipDate,jdbcType=TIMESTAMP}
  588. </foreach>
  589. ,RESULT_ISCLEAR=
  590. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  591. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultIsclear,jdbcType=VARCHAR}
  592. </foreach>
  593. ,DELETE_NAME=
  594. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  595. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  596. </foreach>
  597. ,DELETE_TIME=
  598. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  599. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
  600. </foreach>
  601. ,INSERT_USERNAME=
  602. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  603. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  604. </foreach>
  605. ,INSERT_TIME=
  606. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  607. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  608. </foreach>
  609. ,UPDATE_USERNAME=
  610. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  611. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  612. </foreach>
  613. ,UPDATE_TIME=
  614. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  615. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  616. </foreach>
  617. ,INSERT_UPDATE_REMARK=
  618. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  619. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  620. </foreach>
  621. ,DELETED=
  622. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  623. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  624. </foreach>
  625. where RESULT_ID in
  626. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  627. #{item.resultId,jdbcType=DECIMAL}
  628. </foreach>
  629. </update>
  630. <delete id="batchDelete" parameterType="java.util.List">
  631. delete from TMSSHIP_LOAD_SHIP_RESULT
  632. where RESULT_ID in
  633. <foreach collection="list" item="id" open="(" close=")" separator=",">
  634. #{id}
  635. </foreach>
  636. </delete>
  637. <!-- 友情提示!!!-->
  638. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  639. <select id="selectMaxId" resultType="DECIMAL">
  640. SELECT MAX(RESULT_ID) + 1
  641. FROM TMSSHIP_LOAD_SHIP_RESULT
  642. </select>
  643. <!--查询所有装船信息-->
  644. <sql id="orderByInsertTime">
  645. <if test="orderField != null and orderField != ''">
  646. order by "${orderField}"
  647. <if test="orderType != null and orderType != ''">
  648. ${orderType}
  649. </if>
  650. </if>
  651. <if test="orderField == null ">
  652. order by "insertTime" desc
  653. </if>
  654. </sql>
  655. <select id="selectLoadShipList" resultType="java.util.Map">
  656. SELECT * FROM (
  657. SELECT DISTINCT ttr.ORDER_ID as "orderId",
  658. tlsr.INSERT_TIME as "insertTime",
  659. tlsr.RESULT_ID as "resultId",
  660. rp.PORT_NAME as "noticePort",
  661. adn.NOTICE_DELIVERY_TIME as "noticeTime",
  662. rm.MATERIAL_NAME as "materialName",
  663. db.RESULT_FOREIGN_SHIP_NAME as "foreignShipName",
  664. actr.RESULT_NUMBER_OF_LOANS as "amount",
  665. rrmr.GM_TONNAGE as "portAmount",
  666. rc.CAPACITY_NUMBER as "capacityName",
  667. oic.INSTRUCTION_PLANNED_LOADING as "planWeight",
  668. tsl.LOCATION_VALUE as "nowLocation",
  669. tlsr.RESULT_ACTUAL_INSTALLATIONS as "realWeight",
  670. tlsr.RESULT_ARRIVAL_PORT_TIME as "arriveTime",
  671. tlsr.RESULT_OUT_PORT_TIME as "liveTime",
  672. rps.PORT_NAME as "startPortName",
  673. rpe.PORT_NAME as "arrivePortName",
  674. tlsr.RESULT_LOAD_SHIP_DATE as "loadTime",
  675. tlsr.RESULT_ISCLEAR as "isClear",
  676. tlsr.INSERT_UPDATE_REMARK as "memo"
  677. FROM TMSSHIP_LOAD_SHIP_RESULT tlsr
  678. LEFT JOIN TMSSHIP_TOTAL_RESULT ttr
  679. ON tlsr.TOTAL_RESULT_ID = ttr.RESULT_ID
  680. LEFT JOIN OMSSHIP_INSTRUCTIONS_CAPACITY oic
  681. ON oic.INSTRUCTIONS_CAPACITY_ID = ttr.ORDER_ID
  682. LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
  683. ON osi.SHIPMENT_INSTRUCTIONS_ID = oic.INSTRUCTIONS_ID
  684. LEFT JOIN RMS_CAPACITY rc
  685. ON rc.CAPACITY_ID = oic.CAPACITY_ID
  686. LEFT JOIN DIL_BATCH db
  687. ON tlsr.BATCH_ID = db.BATCH_ID
  688. LEFT JOIN RMS_MATERIAL rm
  689. ON db.MATERIAL_ID = rm.MATERIAL_ID
  690. LEFT JOIN AMSSHIP_DELIVERY_ATTORNEY ada
  691. ON ada.BATCH_ID = osi.BATCH_ID
  692. LEFT JOIN AMSSHIP_DELIVERY_NOTICE adn
  693. ON ada.BATCH_ID = adn.BATCH_ID
  694. LEFT JOIN RMS_PORT rp
  695. ON rp.PORT_ID = adn.PORT_ID
  696. LEFT JOIN AMSSHIP_CARGO_TRANSFER_RESULT actr
  697. ON adn.BATCH_ID = actr.BATCH_ID
  698. LEFT JOIN WMSH_GRID_MATERIAL rrmr
  699. ON tlsr.RWAREHOUSE_MATERIAL_ID = rrmr.GM_ID
  700. LEFT JOIN TMSSHIP_SHIP_LOCATION tsl
  701. ON ttr.RESULT_ID = tsl.TOTAL_RESULT_ID
  702. LEFT JOIN RMS_PORT rps
  703. ON tlsr.LOCATION_START_PORT_ID = rps.PORT_ID
  704. LEFT JOIN RMS_PORT rpe
  705. ON tlsr.ARRIVAL_PORT_ID = rpe.PORT_ID
  706. WHERE tlsr.DELETED = 0)
  707. <where>
  708. <if test="noticePort != null">
  709. and
  710. <foreach collection="noticePort" item="item" open="(" separator="," close=")">
  711. "noticePort" in #{item}
  712. </foreach>
  713. </if>
  714. <if test="noticeTime != null">
  715. and
  716. <foreach collection="noticeTime" item="item" open="(" separator="," close=")">
  717. "noticeTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  718. </foreach>
  719. </if>
  720. <if test="materialName != null">
  721. and
  722. <foreach collection="materialName" item="item" open="(" separator="," close=")">
  723. "materialName" in #{item}
  724. </foreach>
  725. </if>
  726. <if test="foreignShipName != null">
  727. and
  728. <foreach collection="foreignShipName" item="item" open="(" separator="," close=")">
  729. "foreignShipName" in #{item}
  730. </foreach>
  731. </if>
  732. <if test="amount != null">
  733. and
  734. <foreach collection="amount" item="item" open="(" separator="," close=")">
  735. "amount" in #{item}
  736. </foreach>
  737. </if>
  738. <if test="portAmount != null">
  739. and
  740. <foreach collection="portAmount" item="item" open="(" separator="," close=")">
  741. "portAmount" in #{item}
  742. </foreach>
  743. </if>
  744. <if test="capacityName != null">
  745. and
  746. <foreach collection="capacityName" item="item" open="(" separator="," close=")">
  747. "capacityName" in #{item}
  748. </foreach>
  749. </if>
  750. <if test="planWeight != null">
  751. and
  752. <foreach collection="planWeight" item="item" open="(" separator="," close=")">
  753. "planWeight" in #{item}
  754. </foreach>
  755. </if>
  756. <if test="nowLocation != null">
  757. and
  758. <foreach collection="nowLocation" item="item" open="(" separator="," close=")">
  759. "nowLocation" in #{item}
  760. </foreach>
  761. </if>
  762. <if test="realWeight != null">
  763. and
  764. <foreach collection="realWeight" item="item" open="(" separator="," close=")">
  765. "realWeight" in #{item}
  766. </foreach>
  767. </if>
  768. <if test="arriveTime != null">
  769. and
  770. <foreach collection="arriveTime" item="item" open="(" separator="," close=")">
  771. "arriveTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  772. </foreach>
  773. </if>
  774. <if test="liveTime != null">
  775. and
  776. <foreach collection="liveTime" item="item" open="(" separator="," close=")">
  777. "liveTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  778. </foreach>
  779. </if>
  780. <if test="startPortName != null">
  781. and
  782. <foreach collection="startPortName" item="item" open="(" separator="," close=")">
  783. "startPortName" in #{item}
  784. </foreach>
  785. </if>
  786. <if test="arrivePortName != null">
  787. and
  788. <foreach collection="arrivePortName" item="item" open="(" separator="," close=")">
  789. "arrivePortName" in #{item}
  790. </foreach>
  791. </if>
  792. <if test="loadTime != null">
  793. and
  794. <foreach collection="loadTime" item="item" open="(" separator="," close=")">
  795. "loadTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  796. </foreach>
  797. </if>
  798. <if test="isClear != null">
  799. and
  800. <foreach collection="isClear" item="item" open="(" separator="," close=")">
  801. "isClear" in #{item}
  802. </foreach>
  803. </if>
  804. <if test="memo != null">
  805. and
  806. <foreach collection="memo" item="item" open="(" separator="," close=")">
  807. "memo" in #{item}
  808. </foreach>
  809. </if>
  810. </where>
  811. <include refid="orderByInsertTime"></include>
  812. </select>
  813. <select id="selectAllWeight" resultType="DECIMAL" parameterType="DECIMAL">
  814. select SUM(t_loadShip.RESULT_ACTUAL_INSTALLATIONS) "sumWeight"
  815. from OMSSHIP_INSTRUCTIONS_CAPACITY oi_capacity
  816. left join TMSSHIP_TOTAL_RESULT t_total
  817. on oi_capacity.INSTRUCTIONS_CAPACITY_ID = t_total.ORDER_ID
  818. left join TMSSHIP_LOAD_SHIP_RESULT t_loadShip
  819. on t_total.RESULT_ID = t_loadShip.TOTAL_RESULT_ID
  820. where oi_capacity.INSTRUCTIONS_ID = #{instructionsId}
  821. </select>
  822. <select id="selectLoadShip" parameterType="DECIMAL" resultType="java.util.Map">
  823. SELECT LOCATION_START_PORT_ID "locationStartPortId",
  824. ARRIVAL_PORT_ID "arrivalPortId",
  825. BATCH_ID "batchId",
  826. RESULT_DELIVERY_DATE "resultDeliveryDate",
  827. RESULT_ACTUAL_INSTALLATIONS "resultActualInstallations",
  828. RWAREHOUSE_MATERIAL_ID "rwarehouseMaterialId",
  829. RESULT_ARRIVAL_PORT_TIME "resultArrivalPortTime",
  830. RESULT_OUT_PORT_TIME "resultOutPortTime",
  831. RESULT_LOAD_SHIP_DATE "resultLoadShipDate",
  832. RESULT_ISCLEAR "resultIsClear"
  833. FROM TMSSHIP_LOAD_SHIP_RESULT
  834. WHERE RESULT_ID = #{resultId}
  835. </select>
  836. <!-- 通过外轮船名和物资名称得到批次id -->
  837. <select id="getBatchId" parameterType="java.util.Map" resultType="DECIMAL">
  838. SELECT BATCH_ID
  839. FROM DIL_BATCH db
  840. LEFT JOIN RMS_MATERIAL rm
  841. ON rm.MATERIAL_ID = db.MATERIAL_ID
  842. WHERE rm.MATERIAL_NAME = #{materialName}
  843. AND db.RESULT_FOREIGN_SHIP_NAME = #{resultForeignShipName}
  844. </select>
  845. <!-- 得到码头和港口 -->
  846. <select id="getPortAndPier" parameterType="DECIMAL" resultType="java.util.Map">
  847. SELECT ADN.PORT_ID AS "startPortId",
  848. ADA.DOWN_SWIM_PORT_ID AS "arrivePortId",
  849. ACTR.GROUP_ID AS "pierId",
  850. ADN.NOTICE_DELIVERY_TIME AS "noticeDeliveryTime"
  851. FROM AMSSHIP_DELIVERY_NOTICE ADN
  852. LEFT JOIN AMSSHIP_DELIVERY_ATTORNEY ADA
  853. ON ADA.BATCH_ID = ADN.BATCH_ID
  854. LEFT JOIN AMSSHIP_CARGO_TRANSFER_RESULT ACTR
  855. ON ACTR.BATCH_ID = ADN.BATCH_ID
  856. WHERE ADA.BATCH_ID = #{batchId}
  857. </select>
  858. </mapper>