TmstrainLoadingResultMapper.xml 41 KB

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