TmstrainWagonUnloadResultMapper.xml 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  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.TmstrainWagonUnloadResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
  5. <id column="UNLOADING_ID" jdbcType="DECIMAL" property="unloadingId" />
  6. <result column="PURCHASE_ORDER_RAIL_PLAN_ID" jdbcType="DECIMAL" property="purchaseOrderRailPlanId" />
  7. <result column="RESULT_WAGON_NO" jdbcType="VARCHAR" property="resultWagonNo" />
  8. <result column="RESULT_ARRIVAL_DATE" jdbcType="TIMESTAMP" property="resultArrivalDate" />
  9. <result column="RESULT_UNLOAD_TIME" jdbcType="TIMESTAMP" property="resultUnloadTime" />
  10. <result column="UNLOADING_POINT_ID" jdbcType="DECIMAL" property="unloadingPointId" />
  11. <result column="RESULT_BIG_TICKET_WEIGHT" jdbcType="DECIMAL" property="resultBigTicketWeight" />
  12. <result column="RESULT_RAIL_HORIZONTAL_WEIGHT" jdbcType="DECIMAL" property="resultRailHorizontalWeight" />
  13. <result column="RESULT_REMARK" jdbcType="VARCHAR" property="resultRemark" />
  14. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  15. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  16. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  17. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  18. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  19. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  20. <result column="RESULT_TYPE" jdbcType="DECIMAL" property="resultType" />
  21. </resultMap>
  22. <sql id="columns">
  23. UNLOADING_ID, PURCHASE_ORDER_RAIL_PLAN_ID, RESULT_WAGON_NO, RESULT_ARRIVAL_DATE,
  24. RESULT_UNLOAD_TIME, UNLOADING_POINT_ID, RESULT_BIG_TICKET_WEIGHT, RESULT_RAIL_HORIZONTAL_WEIGHT,
  25. RESULT_REMARK, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  26. DELETED, RESULT_TYPE
  27. </sql>
  28. <sql id="columns_alias">
  29. t.UNLOADING_ID, t.PURCHASE_ORDER_RAIL_PLAN_ID, t.RESULT_WAGON_NO, t.RESULT_ARRIVAL_DATE,
  30. t.RESULT_UNLOAD_TIME, t.UNLOADING_POINT_ID, t.RESULT_BIG_TICKET_WEIGHT, t.RESULT_RAIL_HORIZONTAL_WEIGHT,
  31. t.RESULT_REMARK, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
  32. t.INSERT_UPDATE_REMARK, t.DELETED, t.RESULT_TYPE
  33. </sql>
  34. <sql id="select">
  35. SELECT <include refid="columns"/> FROM TMSTRAIN_WAGON_UNLOAD_RESULT
  36. </sql>
  37. <sql id="select_alias">
  38. SELECT <include refid="columns_alias"/> FROM TMSTRAIN_WAGON_UNLOAD_RESULT t
  39. </sql>
  40. <sql id="where">
  41. <where>
  42. <if test="unloadingId != null">
  43. and UNLOADING_ID = #{unloadingId}
  44. </if>
  45. <if test="purchaseOrderRailPlanId != null">
  46. and PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId}
  47. </if>
  48. <if test="resultWagonNo != null and resultWagonNo != ''">
  49. and RESULT_WAGON_NO = #{resultWagonNo}
  50. </if>
  51. <if test="resultArrivalDate != null">
  52. and TO_CHAR(RESULT_ARRIVAL_DATE,'yyyy-MM-dd') = #{resultArrivalDate}
  53. </if>
  54. <if test="resultUnloadTime != null">
  55. and TO_CHAR(RESULT_UNLOAD_TIME,'yyyy-MM-dd') = #{resultUnloadTime}
  56. </if>
  57. <if test="unloadingPointId != null">
  58. and UNLOADING_POINT_ID = #{unloadingPointId}
  59. </if>
  60. <if test="resultBigTicketWeight != null">
  61. and RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight}
  62. </if>
  63. <if test="resultRailHorizontalWeight != null">
  64. and RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight}
  65. </if>
  66. <if test="resultRemark != null and resultRemark != ''">
  67. and RESULT_REMARK = #{resultRemark}
  68. </if>
  69. <if test="insertUsername != null and insertUsername != ''">
  70. and INSERT_USERNAME = #{insertUsername}
  71. </if>
  72. <if test="insertTime != null">
  73. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  74. </if>
  75. <if test="updateUsername != null and updateUsername != ''">
  76. and UPDATE_USERNAME = #{updateUsername}
  77. </if>
  78. <if test="updateTime != null">
  79. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  80. </if>
  81. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  82. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  83. </if>
  84. <if test="deleted != null">
  85. and DELETED = #{deleted}
  86. </if>
  87. <if test="resultType != null">
  88. and RESULT_TYPE = #{resultType}
  89. </if>
  90. </where>
  91. </sql>
  92. <sql id="whereLike">
  93. <where>
  94. <if test="unloadingId != null">
  95. and UNLOADING_ID = #{unloadingId}
  96. </if>
  97. <if test="purchaseOrderRailPlanId != null">
  98. and PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId}
  99. </if>
  100. <if test="resultWagonNo != null and resultWagonNo != ''">
  101. and RESULT_WAGON_NO LIKE '%${resultWagonNo}%'
  102. </if>
  103. <if test="resultArrivalDate != null">
  104. and TO_CHAR(RESULT_ARRIVAL_DATE,'yyyy-MM-dd') = #{resultArrivalDate}
  105. </if>
  106. <if test="resultUnloadTime != null">
  107. and TO_CHAR(RESULT_UNLOAD_TIME,'yyyy-MM-dd') = #{resultUnloadTime}
  108. </if>
  109. <if test="unloadingPointId != null">
  110. and UNLOADING_POINT_ID = #{unloadingPointId}
  111. </if>
  112. <if test="resultBigTicketWeight != null">
  113. and RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight}
  114. </if>
  115. <if test="resultRailHorizontalWeight != null">
  116. and RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight}
  117. </if>
  118. <if test="resultRemark != null and resultRemark != ''">
  119. and RESULT_REMARK LIKE '%${resultRemark}%'
  120. </if>
  121. <if test="insertUsername != null and insertUsername != ''">
  122. and INSERT_USERNAME LIKE '%${insertUsername}%'
  123. </if>
  124. <if test="insertTime != null">
  125. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  126. </if>
  127. <if test="updateUsername != null and updateUsername != ''">
  128. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  129. </if>
  130. <if test="updateTime != null">
  131. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  132. </if>
  133. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  134. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  135. </if>
  136. <if test="deleted != null">
  137. and DELETED = #{deleted}
  138. </if>
  139. <if test="resultType != null">
  140. and RESULT_TYPE = #{resultType}
  141. </if>
  142. </where>
  143. </sql>
  144. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  145. delete from TMSTRAIN_WAGON_UNLOAD_RESULT
  146. where UNLOADING_ID = #{unloadingId,jdbcType=DECIMAL}
  147. </delete>
  148. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  149. delete from TMSTRAIN_WAGON_UNLOAD_RESULT
  150. where 1!=1
  151. <if test="purchaseOrderRailPlanId != null">
  152. or PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId}
  153. </if>
  154. <if test="resultWagonNo != null and resultWagonNo != ''">
  155. or RESULT_WAGON_NO = #{resultWagonNo}
  156. </if>
  157. <if test="resultArrivalDate != null">
  158. or TO_CHAR(RESULT_ARRIVAL_DATE,'yyyy-MM-dd') = '#{resultArrivalDate}'
  159. </if>
  160. <if test="resultUnloadTime != null">
  161. or TO_CHAR(RESULT_UNLOAD_TIME,'yyyy-MM-dd') = '#{resultUnloadTime}'
  162. </if>
  163. <if test="unloadingPointId != null">
  164. or UNLOADING_POINT_ID = #{unloadingPointId}
  165. </if>
  166. <if test="resultBigTicketWeight != null">
  167. or RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight}
  168. </if>
  169. <if test="resultRailHorizontalWeight != null">
  170. or RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight}
  171. </if>
  172. <if test="resultRemark != null and resultRemark != ''">
  173. or RESULT_REMARK = #{resultRemark}
  174. </if>
  175. <if test="insertUsername != null and insertUsername != ''">
  176. or INSERT_USERNAME = #{insertUsername}
  177. </if>
  178. <if test="insertTime != null">
  179. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  180. </if>
  181. <if test="updateUsername != null and updateUsername != ''">
  182. or UPDATE_USERNAME = #{updateUsername}
  183. </if>
  184. <if test="updateTime != null">
  185. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  186. </if>
  187. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  188. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  189. </if>
  190. <if test="deleted != null">
  191. or DELETED = #{deleted}
  192. </if>
  193. <if test="resultType != null">
  194. or RESULT_TYPE = #{resultType}
  195. </if>
  196. </delete>
  197. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
  198. insert into TMSTRAIN_WAGON_UNLOAD_RESULT (UNLOADING_ID, PURCHASE_ORDER_RAIL_PLAN_ID,
  199. RESULT_WAGON_NO, RESULT_ARRIVAL_DATE, RESULT_UNLOAD_TIME,
  200. UNLOADING_POINT_ID, RESULT_BIG_TICKET_WEIGHT,
  201. RESULT_RAIL_HORIZONTAL_WEIGHT, RESULT_REMARK,
  202. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  203. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
  204. RESULT_TYPE)
  205. values (#{unloadingId,jdbcType=DECIMAL}, #{purchaseOrderRailPlanId,jdbcType=DECIMAL},
  206. #{resultWagonNo,jdbcType=VARCHAR}, #{resultArrivalDate,jdbcType=TIMESTAMP}, #{resultUnloadTime,jdbcType=TIMESTAMP},
  207. #{unloadingPointId,jdbcType=DECIMAL}, #{resultBigTicketWeight,jdbcType=DECIMAL},
  208. #{resultRailHorizontalWeight,jdbcType=DECIMAL}, #{resultRemark,jdbcType=VARCHAR},
  209. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  210. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  211. #{resultType,jdbcType=DECIMAL})
  212. </insert>
  213. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
  214. insert into TMSTRAIN_WAGON_UNLOAD_RESULT
  215. <trim prefix="(" suffix=")" suffixOverrides=",">
  216. <if test="unloadingId != null">
  217. UNLOADING_ID,
  218. </if>
  219. <if test="purchaseOrderRailPlanId != null">
  220. PURCHASE_ORDER_RAIL_PLAN_ID,
  221. </if>
  222. <if test="resultWagonNo != null">
  223. RESULT_WAGON_NO,
  224. </if>
  225. <if test="resultArrivalDate != null">
  226. RESULT_ARRIVAL_DATE,
  227. </if>
  228. <if test="resultUnloadTime != null">
  229. RESULT_UNLOAD_TIME,
  230. </if>
  231. <if test="unloadingPointId != null">
  232. UNLOADING_POINT_ID,
  233. </if>
  234. <if test="resultBigTicketWeight != null">
  235. RESULT_BIG_TICKET_WEIGHT,
  236. </if>
  237. <if test="resultRailHorizontalWeight != null">
  238. RESULT_RAIL_HORIZONTAL_WEIGHT,
  239. </if>
  240. <if test="resultRemark != null">
  241. RESULT_REMARK,
  242. </if>
  243. <if test="insertUsername != null">
  244. INSERT_USERNAME,
  245. </if>
  246. <if test="insertTime != null">
  247. INSERT_TIME,
  248. </if>
  249. <if test="updateUsername != null">
  250. UPDATE_USERNAME,
  251. </if>
  252. <if test="updateTime != null">
  253. UPDATE_TIME,
  254. </if>
  255. <if test="insertUpdateRemark != null">
  256. INSERT_UPDATE_REMARK,
  257. </if>
  258. <if test="deleted != null">
  259. DELETED,
  260. </if>
  261. <if test="resultType != null">
  262. RESULT_TYPE,
  263. </if>
  264. </trim>
  265. <trim prefix="values (" suffix=")" suffixOverrides=",">
  266. <if test="unloadingId != null">
  267. #{unloadingId,jdbcType=DECIMAL},
  268. </if>
  269. <if test="purchaseOrderRailPlanId != null">
  270. #{purchaseOrderRailPlanId,jdbcType=DECIMAL},
  271. </if>
  272. <if test="resultWagonNo != null">
  273. #{resultWagonNo,jdbcType=VARCHAR},
  274. </if>
  275. <if test="resultArrivalDate != null">
  276. #{resultArrivalDate,jdbcType=TIMESTAMP},
  277. </if>
  278. <if test="resultUnloadTime != null">
  279. #{resultUnloadTime,jdbcType=TIMESTAMP},
  280. </if>
  281. <if test="unloadingPointId != null">
  282. #{unloadingPointId,jdbcType=DECIMAL},
  283. </if>
  284. <if test="resultBigTicketWeight != null">
  285. #{resultBigTicketWeight,jdbcType=DECIMAL},
  286. </if>
  287. <if test="resultRailHorizontalWeight != null">
  288. #{resultRailHorizontalWeight,jdbcType=DECIMAL},
  289. </if>
  290. <if test="resultRemark != null">
  291. #{resultRemark,jdbcType=VARCHAR},
  292. </if>
  293. <if test="insertUsername != null">
  294. #{insertUsername,jdbcType=VARCHAR},
  295. </if>
  296. <if test="insertTime != null">
  297. #{insertTime,jdbcType=TIMESTAMP},
  298. </if>
  299. <if test="updateUsername != null">
  300. #{updateUsername,jdbcType=VARCHAR},
  301. </if>
  302. <if test="updateTime != null">
  303. #{updateTime,jdbcType=TIMESTAMP},
  304. </if>
  305. <if test="insertUpdateRemark != null">
  306. #{insertUpdateRemark,jdbcType=VARCHAR},
  307. </if>
  308. <if test="deleted != null">
  309. #{deleted,jdbcType=DECIMAL},
  310. </if>
  311. <if test="resultType != null">
  312. #{resultType,jdbcType=DECIMAL},
  313. </if>
  314. </trim>
  315. </insert>
  316. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
  317. update TMSTRAIN_WAGON_UNLOAD_RESULT
  318. set PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId,jdbcType=DECIMAL},
  319. RESULT_WAGON_NO = #{resultWagonNo,jdbcType=VARCHAR},
  320. RESULT_ARRIVAL_DATE = #{resultArrivalDate,jdbcType=TIMESTAMP},
  321. RESULT_UNLOAD_TIME = #{resultUnloadTime,jdbcType=TIMESTAMP},
  322. UNLOADING_POINT_ID = #{unloadingPointId,jdbcType=DECIMAL},
  323. RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight,jdbcType=DECIMAL},
  324. RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight,jdbcType=DECIMAL},
  325. RESULT_REMARK = #{resultRemark,jdbcType=VARCHAR},
  326. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  327. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  328. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  329. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  330. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  331. DELETED = #{deleted,jdbcType=DECIMAL},
  332. RESULT_TYPE = #{resultType,jdbcType=DECIMAL}
  333. where UNLOADING_ID = #{unloadingId,jdbcType=DECIMAL}
  334. </update>
  335. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
  336. update TMSTRAIN_WAGON_UNLOAD_RESULT
  337. <set>
  338. <if test="purchaseOrderRailPlanId != null">
  339. PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId,jdbcType=DECIMAL},
  340. </if>
  341. <if test="resultWagonNo != null">
  342. RESULT_WAGON_NO = #{resultWagonNo,jdbcType=VARCHAR},
  343. </if>
  344. <if test="resultArrivalDate != null">
  345. RESULT_ARRIVAL_DATE = #{resultArrivalDate,jdbcType=TIMESTAMP},
  346. </if>
  347. <if test="resultUnloadTime != null">
  348. RESULT_UNLOAD_TIME = #{resultUnloadTime,jdbcType=TIMESTAMP},
  349. </if>
  350. <if test="unloadingPointId != null">
  351. UNLOADING_POINT_ID = #{unloadingPointId,jdbcType=DECIMAL},
  352. </if>
  353. <if test="resultBigTicketWeight != null">
  354. RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight,jdbcType=DECIMAL},
  355. </if>
  356. <if test="resultRailHorizontalWeight != null">
  357. RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight,jdbcType=DECIMAL},
  358. </if>
  359. <if test="resultRemark != null">
  360. RESULT_REMARK = #{resultRemark,jdbcType=VARCHAR},
  361. </if>
  362. <if test="insertUsername != null">
  363. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  364. </if>
  365. <if test="insertTime != null">
  366. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  367. </if>
  368. <if test="updateUsername != null">
  369. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  370. </if>
  371. <if test="updateTime != null">
  372. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  373. </if>
  374. <if test="insertUpdateRemark != null">
  375. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  376. </if>
  377. <if test="deleted != null">
  378. DELETED = #{deleted,jdbcType=DECIMAL},
  379. </if>
  380. <if test="resultType != null">
  381. RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
  382. </if>
  383. </set>
  384. where UNLOADING_ID = #{unloadingId,jdbcType=DECIMAL}
  385. </update>
  386. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  387. <include refid="select"/>
  388. where UNLOADING_ID = #{unloadingId,jdbcType=DECIMAL}
  389. </select>
  390. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  391. <include refid="select"/>
  392. <include refid="where"/>
  393. </select>
  394. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  395. <include refid="select"/>
  396. <include refid="whereLike"/>
  397. </select>
  398. <insert id="batchInsert" parameterType="java.util.List">
  399. insert into TMSTRAIN_WAGON_UNLOAD_RESULT
  400. (UNLOADING_ID,
  401. PURCHASE_ORDER_RAIL_PLAN_ID, RESULT_WAGON_NO,
  402. RESULT_ARRIVAL_DATE, RESULT_UNLOAD_TIME,
  403. UNLOADING_POINT_ID, RESULT_BIG_TICKET_WEIGHT,
  404. RESULT_RAIL_HORIZONTAL_WEIGHT, RESULT_REMARK,
  405. INSERT_USERNAME, INSERT_TIME,
  406. UPDATE_USERNAME, UPDATE_TIME,
  407. INSERT_UPDATE_REMARK, DELETED,
  408. RESULT_TYPE)
  409. ( <foreach collection="list" item="item" separator="union all">
  410. select
  411. #{item.unloadingId,jdbcType=DECIMAL},
  412. #{item.purchaseOrderRailPlanId,jdbcType=DECIMAL}, #{item.resultWagonNo,jdbcType=VARCHAR},
  413. #{item.resultArrivalDate,jdbcType=TIMESTAMP}, #{item.resultUnloadTime,jdbcType=TIMESTAMP},
  414. #{item.unloadingPointId,jdbcType=DECIMAL}, #{item.resultBigTicketWeight,jdbcType=DECIMAL},
  415. #{item.resultRailHorizontalWeight,jdbcType=DECIMAL}, #{item.resultRemark,jdbcType=VARCHAR},
  416. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  417. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  418. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
  419. #{item.resultType,jdbcType=DECIMAL} from dual
  420. </foreach> )
  421. </insert>
  422. <update id="batchUpdate" parameterType="java.util.List">
  423. update TMSTRAIN_WAGON_UNLOAD_RESULT
  424. set
  425. UNLOADING_ID=
  426. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  427. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.unloadingId,jdbcType=DECIMAL}
  428. </foreach>
  429. ,PURCHASE_ORDER_RAIL_PLAN_ID=
  430. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  431. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.purchaseOrderRailPlanId,jdbcType=DECIMAL}
  432. </foreach>
  433. ,RESULT_WAGON_NO=
  434. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  435. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultWagonNo,jdbcType=VARCHAR}
  436. </foreach>
  437. ,RESULT_ARRIVAL_DATE=
  438. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  439. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultArrivalDate,jdbcType=TIMESTAMP}
  440. </foreach>
  441. ,RESULT_UNLOAD_TIME=
  442. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  443. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultUnloadTime,jdbcType=TIMESTAMP}
  444. </foreach>
  445. ,UNLOADING_POINT_ID=
  446. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  447. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.unloadingPointId,jdbcType=DECIMAL}
  448. </foreach>
  449. ,RESULT_BIG_TICKET_WEIGHT=
  450. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  451. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultBigTicketWeight,jdbcType=DECIMAL}
  452. </foreach>
  453. ,RESULT_RAIL_HORIZONTAL_WEIGHT=
  454. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  455. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultRailHorizontalWeight,jdbcType=DECIMAL}
  456. </foreach>
  457. ,RESULT_REMARK=
  458. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  459. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultRemark,jdbcType=VARCHAR}
  460. </foreach>
  461. ,INSERT_USERNAME=
  462. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  463. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  464. </foreach>
  465. ,INSERT_TIME=
  466. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  467. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  468. </foreach>
  469. ,UPDATE_USERNAME=
  470. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  471. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  472. </foreach>
  473. ,UPDATE_TIME=
  474. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  475. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  476. </foreach>
  477. ,INSERT_UPDATE_REMARK=
  478. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  479. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  480. </foreach>
  481. ,DELETED=
  482. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  483. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  484. </foreach>
  485. ,RESULT_TYPE=
  486. <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
  487. when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultType,jdbcType=DECIMAL}
  488. </foreach>
  489. where UNLOADING_ID in
  490. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  491. #{item.unloadingId,jdbcType=DECIMAL}
  492. </foreach>
  493. </update>
  494. <delete id="batchDelete" parameterType="java.util.List">
  495. delete from TMSTRAIN_WAGON_UNLOAD_RESULT
  496. where UNLOADING_ID in
  497. <foreach collection="list" item="id" open="(" close=")" separator=",">
  498. #{id}
  499. </foreach>
  500. </delete>
  501. <!-- 友情提示!!!-->
  502. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  503. <select id="getTmsWagonUnLoadInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  504. select * from(
  505. select t_unload.UNLOADING_ID "unloadingId",
  506. a_order.PURCHASE_ORDER_NO "purchaseOrderNo",
  507. t_unload.RESULT_WAGON_NO "resultWagonNo",
  508. to_char(t_load.RESULT_LOADING_DATE, 'yyyy-mm-dd') "resultLoadingDate",
  509. to_char(t_unload.RESULT_ARRIVAL_DATE, 'yyyy-mm-dd') "resultArrivalDate",
  510. to_char(t_unload.RESULT_UNLOAD_TIME, 'yyyy-mm-dd') "resultUnloadTime",
  511. t_load.RESULT_CLASS "resultClass",
  512. d_batch.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  513. r_material.MATERIAL_NAME "materialName",
  514. r_s_arrival.ARRIVAL_NAME "sendStationName",
  515. r_a_arrival.ARRIVAL_NAME "arrivalStationName",
  516. RW.WAREHOUSE_NAME "unloadPointName",
  517. t_unload.RESULT_BIG_TICKET_WEIGHT "resultBigTicketWeight",
  518. t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT "resultRailHorizontalWeight",
  519. t_unload.RESULT_REMARK "resultRemark"
  520. from TMSTRAIN_LOADING_RESULT t_load
  521. left join TMSTRAIN_WAGON_UNLOAD_RESULT t_unload
  522. on t_load.RESULT_WAGON_NO=t_unload.RESULT_WAGON_NO
  523. left join AMS_PURCHASE_ORDER a_order
  524. on t_unload.PURCHASE_ORDER_RAIL_PLAN_ID=a_order.PURCHASE_ORDER_ID
  525. left join DIL_BATCH d_batch
  526. on t_load.BATCH_ID=d_batch.BATCH_ID
  527. left join RMS_MATERIAL r_material
  528. on d_batch.MATERIAL_ID=r_material.MATERIAL_ID
  529. left join RMSTRAIN_ARRIVAL_SEND r_s_arrival
  530. on r_s_arrival.ARRIVAL_ID=t_load.SEND_STATION_ID
  531. left join RMSTRAIN_ARRIVAL_SEND r_a_arrival
  532. on r_a_arrival.ARRIVAL_ID=t_load.ARRIVAL_STATION_ID
  533. left join RMS_WAREHOUSE RW
  534. on RW.WAREHOUSE_ID = t_unload.UNLOADING_POINT_ID
  535. where t_unload.DELETED = 0 and t_load.DELETED = 2 and t_unload.RESULT_TYPE = #{resultType}
  536. )
  537. <where>
  538. <if test="purchaseOrderNo != null">
  539. and
  540. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  541. "purchaseOrderNo" like '%${item}%'
  542. </foreach>
  543. </if>
  544. <if test="resultWagonNo != null">
  545. and
  546. <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
  547. "resultWagonNo" like '%${item}%'
  548. </foreach>
  549. </if>
  550. <if test="resultLoadingDate != null">
  551. and
  552. <foreach collection="resultLoadingDate" item="item" open="(" separator="or" close=")">
  553. "resultLoadingDate" like '%${item}%'
  554. </foreach>
  555. </if>
  556. <if test="resultArrivalDate != null">
  557. and
  558. <foreach collection="resultArrivalDate" item="item" open="(" separator="or" close=")">
  559. "resultArrivalDate" like '%${item}%'
  560. </foreach>
  561. </if>
  562. <if test="resultUnloadTime != null">
  563. and
  564. <foreach collection="resultUnloadTime" item="item" open="(" separator="or" close=")">
  565. "resultUnloadTime" like '%${item}%'
  566. </foreach>
  567. </if>
  568. <if test="resultClass != null">
  569. and
  570. <foreach collection="resultClass" item="item" open="(" separator="or" close=")">
  571. "resultClass" like '%${item}%'
  572. </foreach>
  573. </if>
  574. <if test="resultForeignShipName != null">
  575. and
  576. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  577. "resultForeignShipName" like '%${item}%'
  578. </foreach>
  579. </if>
  580. <if test="materialName != null">
  581. and
  582. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  583. "materialName" like '%${item}%'
  584. </foreach>
  585. </if>
  586. <if test="sendStationName != null">
  587. and
  588. <foreach collection="sendStationName" item="item" open="(" separator="or" close=")">
  589. "sendStationName" like '%${item}%'
  590. </foreach>
  591. </if>
  592. <if test="arrivalStationName != null">
  593. and
  594. <foreach collection="arrivalStationName" item="item" open="(" separator="or" close=")">
  595. arrivalStationName like '%${item}%'
  596. </foreach>
  597. </if>
  598. <if test="unloadPointName != null">
  599. and
  600. <foreach collection="unloadPointName" item="item" open="(" separator="or" close=")">
  601. "unloadPointName" like '%${item}%'
  602. </foreach>
  603. </if>
  604. <if test="resultBigTicketWeight != null">
  605. and
  606. <foreach collection="resultBigTicketWeight" item="item" open="(" separator="or" close=")">
  607. "resultBigTicketWeight" like '%${item}%'
  608. </foreach>
  609. </if>
  610. <if test="resultRailHorizontalWeight != null">
  611. and
  612. <foreach collection="resultRailHorizontalWeight" item="item" open="(" separator="or" close=")">
  613. "resultRailHorizontalWeight" like '%${item}%'
  614. </foreach>
  615. </if>
  616. <if test="resultRemark != null">
  617. and
  618. <foreach collection="resultRemark" item="item" open="(" separator="or" close=")">
  619. "resultRemark" like '%${item}%'
  620. </foreach>
  621. </if>
  622. </where>
  623. <include refid="orderBy"></include>
  624. <if test="orderField == null ">
  625. order by "resultUnloadTime" desc
  626. </if>
  627. </select>
  628. <sql id="orderBy">
  629. <if test="orderField != null and orderField != ''">
  630. order by "${orderField}"
  631. <if test="orderType != null and orderType != ''">
  632. ${orderType}
  633. </if>
  634. </if>
  635. </sql>
  636. <select id="getTmstrainResult" resultType="java.util.LinkedHashMap">
  637. select * from(
  638. select a_order.PURCHASE_ORDER_NO "purchaseOrderNo",
  639. t_load.RESULT_WAGON_NO "resultWagonNo",
  640. d_batch.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  641. r_material.MATERIAL_NAME "materialName",
  642. t_load.RESULT_LOADING_DATE "resultLoadingDate",
  643. r_s_arrival.ARRIVAL_NAME "sendStationName",
  644. r_a_arrival.ARRIVAL_NAME "arrivalStationName",
  645. t_unload.RESULT_UNLOAD_TIME "resultUnloadTime",
  646. t_load.RESULT_BILLABLE_TONNAGE "resultBillableTonnage",
  647. t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT "resultRailHorizontalWeight",
  648. (t_load.RESULT_BILLABLE_TONNAGE-t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT) "differentialWeight"
  649. from TMSTRAIN_LOADING_RESULT t_load
  650. left join AMS_PURCHASE_ORDER a_order
  651. on t_load.PURCHASE_ORDER_RAIL_PLAN_ID=a_order.PURCHASE_ORDER_ID
  652. left join DIL_BATCH d_batch
  653. on t_load.BATCH_ID=d_batch.BATCH_ID
  654. left join RMS_MATERIAL r_material
  655. on t_load.MATERIAL_ID=r_material.MATERIAL_ID
  656. left join RMSTRAIN_ARRIVAL_SEND r_s_arrival
  657. on r_s_arrival.ARRIVAL_ID=t_load.SEND_STATION_ID
  658. left join RMSTRAIN_ARRIVAL_SEND r_a_arrival
  659. on r_a_arrival.ARRIVAL_ID=t_load.ARRIVAL_STATION_ID
  660. left join TMSTRAIN_WAGON_UNLOAD_RESULT t_unload
  661. on t_unload.RESULT_WAGON_NO=t_load.RESULT_WAGON_NO
  662. where t_load.DELETED = 0
  663. )
  664. <where>
  665. <if test="purchaseOrderNo != null">
  666. and
  667. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  668. "purchaseOrderNo" like '%${item}%'
  669. </foreach>
  670. </if>
  671. <if test="resultWagonNo != null">
  672. and
  673. <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
  674. "resultWagonNo" like '%${item}%'
  675. </foreach>
  676. </if>
  677. <if test="resultForeignShipName != null">
  678. and
  679. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  680. "resultForeignShipName" like '%${item}%'
  681. </foreach>
  682. </if>
  683. <if test="materialName != null">
  684. and
  685. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  686. "materialName" like '%${item}%'
  687. </foreach>
  688. </if>
  689. <if test="resultLoadingDate != null">
  690. and
  691. <foreach collection="resultLoadingDate" item="item" open="(" separator="or" close=")">
  692. "resultLoadingDate" like '%${item}%'
  693. </foreach>
  694. </if>
  695. <if test="sendStationName != null">
  696. and
  697. <foreach collection="sendStationName" item="item" open="(" separator="or" close=")">
  698. "sendStationName" like '%${item}%'
  699. </foreach>
  700. </if>
  701. <if test="arrivalStationName != null">
  702. and
  703. <foreach collection="arrivalStationName" item="item" open="(" separator="or" close=")">
  704. arrivalStationName like '%${item}%'
  705. </foreach>
  706. </if>
  707. <if test="resultUnloadTime != null">
  708. and
  709. <foreach collection="resultUnloadTime" item="item" open="(" separator="or" close=")">
  710. "resultUnloadTime" like '%${item}%'
  711. </foreach>
  712. </if>
  713. <if test="resultBillableTonnage != null">
  714. and
  715. <foreach collection="resultBillableTonnage" item="item" open="(" separator="or" close=")">
  716. "resultBillableTonnage" like '%${item}%'
  717. </foreach>
  718. </if>
  719. <if test="resultRailHorizontalWeight != null">
  720. and
  721. <foreach collection="resultRailHorizontalWeight" item="item" open="(" separator="or" close=")">
  722. "resultRailHorizontalWeight" like '%${item}%'
  723. </foreach>
  724. </if>
  725. <if test="differentialWeight != null">
  726. and
  727. <foreach collection="differentialWeight" item="item" open="(" separator="or" close=")">
  728. "differentialWeight" like '%${item}%'
  729. </foreach>
  730. </if>
  731. </where>
  732. <include refid="orderBy"></include>
  733. <if test="orderField == null ">
  734. order by "resultUnloadTime" desc
  735. </if>
  736. </select>
  737. <select id="getUnloadingPointName" resultType="java.util.LinkedHashMap">
  738. select
  739. UNLOAD_POINT_ID "id",
  740. UNLOAD_POINT_ID "value",
  741. UNLOAD_POINT_NAME "label"
  742. from TMSTRAIN_UNLOAD_POINT
  743. </select>
  744. <!-- <select id="getUnloadingRouteName" resultType="java.util.LinkedHashMap">-->
  745. <!-- select-->
  746. <!-- UNLOAD_ROUTE_ID "id",-->
  747. <!-- UNLOAD_ROUTE_ID "value",-->
  748. <!-- UNLOAD_ROUTE_NAME "label"-->
  749. <!-- from TMSTRAIN_UNLOAD_ROUTE-->
  750. <!-- </select>-->
  751. <select id="selectByUnLoadingId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
  752. select
  753. t_unload.RESULT_WAGON_NO "resultWagonNo",
  754. t_unload.RESULT_ARRIVAL_DATE "resultArrivalDate",
  755. t_unload.RESULT_UNLOAD_TIME "resultUnloadTime",
  756. t_unload.UNLOADING_POINT_ID "unloadingPointId",
  757. t_unload.RESULT_BIG_TICKET_WEIGHT "resultBigTicketWeight",
  758. t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT "resultRailHorizontalWeight",
  759. t_unload.RESULT_REMARK "resultRemark"
  760. from TMSTRAIN_WAGON_UNLOAD_RESULT t_unload
  761. where t_unload.UNLOADING_ID = #{unloadingId}
  762. </select>
  763. <select id="selectWagonUnLoadResultForNZ" parameterType="java.util.Map" resultType="java.util.Map">
  764. select
  765. *
  766. from
  767. (
  768. SELECT TWUR.UNLOADING_ID "unloadingId",
  769. AROD.DAYPLAN_NO "dayPlanNo",
  770. TWUR.RESULT_WAGON_NO "resultWagonNo",
  771. TO_CHAR(TWUR.RESULT_UNLOAD_TIME, 'yyyy-mm-dd') "resultUnloadTime",
  772. RS.SHIPPER_NAME "shipperName",
  773. RC.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
  774. RAS.ARRIVAL_NAME "dayplanSendStationName",
  775. RAS2.ARRIVAL_NAME "dayplanToTheStationName",
  776. AROD.DAYPLAN_CONSIGNEE_TEL "dayplanConsigneeTel",
  777. AROD.DAYPLAN_CONSIGNEE_NAME "dayplanConsigneeName",
  778. AROD.DAYPLAN_DELIVERY_DATE "dayplanDeliveryDate",
  779. RAS2.DAYPLAN_DEDICATED_LINE "dayplanDedicatedLine",
  780. TWUR.RESULT_ARRIVAL_DATE "resultArrivalDate",
  781. TWUR.INSERT_TIME "insertTime",
  782. RW.WAREHOUSE_NAME "warehouseName",
  783. TWUR.INSERT_UPDATE_REMARK "insertUpdateRemark"
  784. FROM TMSTRAIN_WAGON_UNLOAD_RESULT TWUR
  785. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  786. ON AROD.DAYPLAN_ID = TWUR.PURCHASE_ORDER_RAIL_PLAN_ID
  787. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
  788. ON RAS.ARRIVAL_ID = AROD.DAYPLAN_SEND_STATION_ID
  789. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS2
  790. ON RAS2.ARRIVAL_ID = AROD.DAYPLAN_TO_THE_STATION_ID
  791. LEFT JOIN RMS_SHIPPER RS
  792. ON RS.SHIPPER_ID = AROD.SHIPPER_ID
  793. LEFT JOIN RMS_CONSIGNEE RC
  794. ON RC.CONSIGNEE_ID = AROD.RECEIVING_UNIT_ID
  795. LEFT JOIN RMS_WAREHOUSE RW
  796. ON TWUR.UNLOADING_POINT_ID = RW.WAREHOUSE_ID
  797. WHERE TWUR.DELETED = 0 AND TWUR.RESULT_TYPE = 4
  798. )
  799. <where>
  800. <if test="dayPlanNo!= null">
  801. <foreach collection="dayPlanNo" item="item" open="(" separator="or" close=")">
  802. "dayPlanNo" like '%${item}%'
  803. </foreach>
  804. </if>
  805. <if test="resultWagonNo!= null">
  806. and
  807. <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
  808. "resultWagonNo" like '%${item}%'
  809. </foreach>
  810. </if>
  811. <if test="resultUnloadTime!= null">
  812. and
  813. <foreach collection="resultUnloadTime" item="item" open="(" separator="or" close=")">
  814. "resultUnloadTime" like '%${item}%'
  815. </foreach>
  816. </if>
  817. <if test="shipperName!= null">
  818. and
  819. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  820. "shipperName" like '%${item}%'
  821. </foreach>
  822. </if>
  823. <if test="consigneeCompanyName!= null">
  824. and
  825. <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
  826. "consigneeCompanyName" like '%${item}%'
  827. </foreach>
  828. </if>
  829. <if test="dayplanSendStationName!= null">
  830. and
  831. <foreach collection="dayplanSendStationName" item="item" open="(" separator="or" close=")">
  832. "dayplanSendStationName" like '%${item}%'
  833. </foreach>
  834. </if>
  835. <if test="dayplanToTheStationName!= null">
  836. and
  837. <foreach collection="dayplanToTheStationName" item="item" open="(" separator="or" close=")">
  838. "dayplanToTheStationName" like '%${item}%'
  839. </foreach>
  840. </if>
  841. <if test="dayplanConsigneeTel!= null">
  842. and
  843. <foreach collection="dayplanConsigneeTel" item="item" open="(" separator="or" close=")">
  844. "dayplanConsigneeTel" like '%${item}%'
  845. </foreach>
  846. </if>
  847. <if test="dayplanConsigneeName!= null">
  848. and
  849. <foreach collection="dayplanConsigneeName" item="item" open="(" separator="or" close=")">
  850. "dayplanConsigneeName" like '%${item}%'
  851. </foreach>
  852. </if>
  853. <if test="dayplanDedicatedLine!= null">
  854. and
  855. <foreach collection="dayplanDedicatedLine" item="item" open="(" separator="or" close=")">
  856. "dayplanDedicatedLine" like '%${item}%'
  857. </foreach>
  858. </if>
  859. <if test="resultArrivalDate!= null">
  860. and
  861. <foreach collection="resultArrivalDate" item="item" open="(" separator="or" close=")">
  862. "resultArrivalDate" like '%${item}%'
  863. </foreach>
  864. </if>
  865. <if test="warehouseName!= null">
  866. and
  867. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  868. "warehouseName" like '%${item}%'
  869. </foreach>
  870. </if>
  871. <if test="insertUpdateRemark!= null">
  872. and
  873. <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
  874. "insertUpdateRemark" like '%${item}%'
  875. </foreach>
  876. </if>
  877. </where>
  878. <include refid="orderBy"></include>
  879. <if test="orderField == null ">
  880. order by "insertTime" desc
  881. </if>
  882. </select>
  883. <!-- 火车卸货 -->
  884. <select id="getTrainResult" resultType="java.util.LinkedHashMap">
  885. select *
  886. from(
  887. select a_order.PURCHASE_ORDER_NO "purchaseOrderNo",
  888. t_load.RESULT_WAGON_NO "resultWagonNo",
  889. d_batch.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  890. r_material.MATERIAL_NAME "materialName",
  891. t_unload.RESULT_UNLOAD_TIME "resultUnloadTime",
  892. (t_load.RESULT_BILLABLE_TONNAGE-t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT) "differentialWeight",
  893. oo.ORDER_NO "orderNo",
  894. TUP.UNLOAD_POINT_NAME "unloadPointName"
  895. from TMSTRAIN_LOADING_RESULT t_load
  896. left join AMS_PURCHASE_ORDER a_order
  897. on t_load.PURCHASE_ORDER_RAIL_PLAN_ID=a_order.PURCHASE_ORDER_ID
  898. left join DIL_BATCH d_batch
  899. on t_load.BATCH_ID=d_batch.BATCH_ID
  900. left join RMS_MATERIAL r_material
  901. on t_load.MATERIAL_ID=r_material.MATERIAL_ID
  902. left join TMSTRAIN_WAGON_UNLOAD_RESULT t_unload
  903. on t_unload.RESULT_WAGON_NO=t_load.RESULT_WAGON_NO
  904. LEFT JOIN OMSTRAIN_ORDER OO
  905. ON OO.ORDER_WAGON_NO=t_unload.RESULT_WAGON_NO
  906. left join TMSTRAIN_UNLOAD_POINT TUP
  907. on TUP.UNLOAD_POINT_ID=t_unload.UNLOADING_ID
  908. where t_load.DELETED = 0
  909. )
  910. </select>
  911. <!-- 通过运输订单ID查询关联的火运总实绩ID -->
  912. <select id="getTotalIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  913. select DISTINCT
  914. TTTR.TMSTRAIN_TOTAL_RESULT_ID "trainTotalId",
  915. TTTR.TMSTRUCK_TOTAL_RESULT_ID "truckTotalId"
  916. from TMSTRUCK_TOTAL_RESULT TTR
  917. LEFT JOIN TMSTRAIN_TRUCK_TOTAL_RESULT TTTR
  918. ON TTR.RESULT_TOTAL_ID = TTTR.TMSTRUCK_TOTAL_RESULT_ID
  919. WHERE TTR.ORDER_ID = #{orderId}
  920. </select>
  921. <!-- 通过火运总实绩ID查询火运装车实绩ID-->
  922. <select id="getLoadingIdByTrainTotalId" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
  923. SELECT TTR.LOADING_ID
  924. FROM TMSTRAIN_TOTAL_RESULT TTR
  925. WHERE TTR.TOTAL_RESULT_ID = #{trainTotalId}
  926. </select>
  927. <!-- 通过装车实绩ID查询车皮号与发运计划ID -->
  928. <select id="getWagonNoAndRailPlanByLoadingId" parameterType="int" resultType="java.util.Map">
  929. SELECT TLR.RESULT_WAGON_NO "resultWagonNo",
  930. TLR.PURCHASE_ORDER_RAIL_PLAN_ID "railPlanId"
  931. FROM TMSTRAIN_LOADING_RESULT TLR
  932. WHERE TLR.RESULT_ID = #{loadingId}
  933. </select>
  934. <!-- 通过车皮号与发运计划ID匹配卸车实绩 -->
  935. <select id="getUnloadIdByWagonNoAndRailPlanId" resultType="java.lang.Integer">
  936. SELECT TWUR.UNLOADING_ID
  937. FROM TMSTRAIN_WAGON_UNLOAD_RESULT TWUR
  938. WHERE TWUR.RESULT_WAGON_NO = #{resultWagonNo} AND TWUR.PURCHASE_ORDER_RAIL_PLAN_ID = #{railPlanId}
  939. </select>
  940. <!-- 内转达州站到厂内料场 10003 达州站 -->
  941. <select id="getTrainUnloadDaZhouToDaGang" parameterType="java.util.Map" resultType="java.util.Map">
  942. select
  943. apo.purchase_order_no "purchaseOrderNo",
  944. db.result_foreign_ship_name "resultForeignShipName",
  945. rm.material_name "materialName",
  946. twur.result_wagon_no "resultWagonNo",
  947. twur.result_unload_time "resultUnloadTime",
  948. rw.WAREHOUSE_NAME "warehouseName",
  949. (
  950. select TLR.RESULT_BILLABLE_TONNAGE
  951. from TMSTRAIN_LOADING_RESULT TLR
  952. where TLR.RESULT_WAGON_NO = twur.RESULT_WAGON_NO
  953. and rownum = 1
  954. ) "unloadWeight"
  955. from tmstrain_wagon_unload_result twur
  956. left join ams_purchase_order apo
  957. on apo.purchase_order_id = twur.purchase_order_rail_plan_id
  958. left join dil_batch db
  959. on db.batch_id = apo.batch_id
  960. left join rms_material rm
  961. on rm.material_id = db.material_id
  962. left join rms_warehouse rw
  963. on rw.warehouse_id = twur.unloading_id
  964. where twur.RESULT_TYPE = 1 and twur.UNLOADING_POINT_ID = 9
  965. </select>
  966. <!-- 内转老区轨道衡-厂内料场 -->
  967. <select id="getTrainUnloadLaoQuToDaGgang" parameterType="java.util.Map" resultType="java.util.Map">
  968. select
  969. apo.purchase_order_no "purchaseOrderNo",
  970. db.result_foreign_ship_name "resultForeignShipName",
  971. rm.material_name "materialName",
  972. twur.result_wagon_no "resultWagonNo",
  973. twur.result_unload_time "resultUnloadTime",
  974. rw.WAREHOUSE_NAME "warehouseName",
  975. (
  976. select TLR.RESULT_BILLABLE_TONNAGE
  977. from TMSTRAIN_LOADING_RESULT TLR
  978. where TLR.RESULT_WAGON_NO = twur.RESULT_WAGON_NO
  979. and rownum = 1
  980. ) "unloadWeight"
  981. from tmstrain_wagon_unload_result twur
  982. left join ams_purchase_order apo
  983. on apo.purchase_order_id = twur.purchase_order_rail_plan_id
  984. left join dil_batch db
  985. on db.batch_id = apo.batch_id
  986. left join rms_material rm
  987. on rm.material_id = db.material_id
  988. left join rms_warehouse rw
  989. on rw.warehouse_id = twur.unloading_id
  990. where twur.RESULT_TYPE = 1 and twur.UNLOADING_POINT_ID = 13
  991. </select>
  992. <!--查询装车实绩中的卸货点 -->
  993. <select id="getUnloadId" parameterType="java.util.Map" resultType="java.math.BigDecimal">
  994. select TLR.UNLOADING_POINT_ID
  995. from TMSTRAIN_LOADING_RESULT TLR
  996. where TLR.RESULT_ID = #{resultId}
  997. </select>
  998. </mapper>