OmstrainOrderMapper.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  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.OmstrainOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.OmstrainOrder">
  5. <id column="ORDER_ID" jdbcType="DECIMAL" property="orderId" />
  6. <result column="ORDER_NO" jdbcType="VARCHAR" property="orderNo" />
  7. <result column="ORDER_WAGON_NO" jdbcType="VARCHAR" property="orderWagonNo" />
  8. <result column="ORDER_WAGON_WEIGHT" jdbcType="DECIMAL" property="orderWagonWeight" />
  9. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  10. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  11. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  12. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  13. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  14. <result column="ENSTATION_TIME" jdbcType="TIMESTAMP" property="enstationTime" />
  15. <result column="OUTSTATION_TIME" jdbcType="TIMESTAMP" property="outstationTime" />
  16. <result column="BILLING_WEIGHT" jdbcType="DECIMAL" property="billingWeight" />
  17. <result column="IS_ACCEPT " jdbcType="DECIMAL" property="isAccept" />
  18. </resultMap>
  19. <sql id="columns">
  20. ORDER_ID, ORDER_NO, ORDER_WAGON_NO, ORDER_WAGON_WEIGHT, INSERT_USERNAME, INSERT_TIME,
  21. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, ENSTATION_TIME, OUTSTATION_TIME,
  22. BILLING_WEIGHT, "IS_ACCEPT "
  23. </sql>
  24. <sql id="columns_alias">
  25. t.ORDER_ID, t.ORDER_NO, t.ORDER_WAGON_NO, t.ORDER_WAGON_WEIGHT, t.INSERT_USERNAME,
  26. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.ENSTATION_TIME,
  27. t.OUTSTATION_TIME, t.BILLING_WEIGHT, t."IS_ACCEPT "
  28. </sql>
  29. <sql id="select">
  30. SELECT <include refid="columns" /> FROM OMSTRAIN_ORDER
  31. </sql>
  32. <sql id="select_alias">
  33. SELECT <include refid="columns_alias" /> FROM OMSTRAIN_ORDER t
  34. </sql>
  35. <sql id="where">
  36. <where>
  37. <if test="orderId != null">
  38. and ORDER_ID = #{orderId}
  39. </if>
  40. <if test="orderNo != null and orderNo != ''">
  41. and ORDER_NO = #{orderNo}
  42. </if>
  43. <if test="orderWagonNo != null and orderWagonNo != ''">
  44. and ORDER_WAGON_NO = #{orderWagonNo}
  45. </if>
  46. <if test="orderWagonWeight != null">
  47. and ORDER_WAGON_WEIGHT = #{orderWagonWeight}
  48. </if>
  49. <if test="insertUsername != null and insertUsername != ''">
  50. and INSERT_USERNAME = #{insertUsername}
  51. </if>
  52. <if test="insertTime != null">
  53. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  54. </if>
  55. <if test="updateUsername != null and updateUsername != ''">
  56. and UPDATE_USERNAME = #{updateUsername}
  57. </if>
  58. <if test="updateTime != null">
  59. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  60. </if>
  61. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  62. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  63. </if>
  64. <if test="enstationTime != null">
  65. and TO_CHAR(ENSTATION_TIME,'yyyy-MM-dd') = #{enstationTime}
  66. </if>
  67. <if test="outstationTime != null">
  68. and TO_CHAR(OUTSTATION_TIME,'yyyy-MM-dd') = #{outstationTime}
  69. </if>
  70. <if test="billingWeight != null">
  71. and BILLING_WEIGHT = #{billingWeight}
  72. </if>
  73. <if test="isAccept != null">
  74. and IS_ACCEPT = #{isAccept}
  75. </if>
  76. </where>
  77. </sql>
  78. <sql id="whereLike">
  79. <where>
  80. <if test="orderId != null">
  81. and ORDER_ID = #{orderId}
  82. </if>
  83. <if test="orderNo != null and orderNo != ''">
  84. and ORDER_NO LIKE '%${orderNo}%'
  85. </if>
  86. <if test="orderWagonNo != null and orderWagonNo != ''">
  87. and ORDER_WAGON_NO LIKE '%${orderWagonNo}%'
  88. </if>
  89. <if test="orderWagonWeight != null">
  90. and ORDER_WAGON_WEIGHT = #{orderWagonWeight}
  91. </if>
  92. <if test="insertUsername != null and insertUsername != ''">
  93. and INSERT_USERNAME LIKE '%${insertUsername}%'
  94. </if>
  95. <if test="insertTime != null">
  96. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  97. </if>
  98. <if test="updateUsername != null and updateUsername != ''">
  99. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  100. </if>
  101. <if test="updateTime != null">
  102. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  103. </if>
  104. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  105. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  106. </if>
  107. <if test="enstationTime != null">
  108. and TO_CHAR(ENSTATION_TIME,'yyyy-MM-dd') = #{enstationTime}
  109. </if>
  110. <if test="outstationTime != null">
  111. and TO_CHAR(OUTSTATION_TIME,'yyyy-MM-dd') = #{outstationTime}
  112. </if>
  113. <if test="billingWeight != null">
  114. and BILLING_WEIGHT = #{billingWeight}
  115. </if>
  116. <if test="isAccept != null">
  117. and IS_ACCEPT = #{isAccept}
  118. </if>
  119. </where>
  120. </sql>
  121. <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
  122. delete from OMSTRAIN_ORDER
  123. where ORDER_ID = #{orderId,jdbcType=DECIMAL}
  124. </delete>
  125. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  126. delete from OMSTRAIN_ORDER
  127. where 1!=1
  128. <if test="orderNo != null and orderNo != ''">
  129. or ORDER_NO = #{orderNo}
  130. </if>
  131. <if test="orderWagonNo != null and orderWagonNo != ''">
  132. or ORDER_WAGON_NO = #{orderWagonNo}
  133. </if>
  134. <if test="orderWagonWeight != null">
  135. or ORDER_WAGON_WEIGHT = #{orderWagonWeight}
  136. </if>
  137. <if test="insertUsername != null and insertUsername != ''">
  138. or INSERT_USERNAME = #{insertUsername}
  139. </if>
  140. <if test="insertTime != null">
  141. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  142. </if>
  143. <if test="updateUsername != null and updateUsername != ''">
  144. or UPDATE_USERNAME = #{updateUsername}
  145. </if>
  146. <if test="updateTime != null">
  147. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  148. </if>
  149. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  150. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  151. </if>
  152. <if test="enstationTime != null">
  153. or TO_CHAR(ENSTATION_TIME,'yyyy-MM-dd') = '#{enstationTime}'
  154. </if>
  155. <if test="outstationTime != null">
  156. or TO_CHAR(OUTSTATION_TIME,'yyyy-MM-dd') = '#{outstationTime}'
  157. </if>
  158. <if test="billingWeight != null">
  159. or BILLING_WEIGHT = #{billingWeight}
  160. </if>
  161. <if test="isAccept != null">
  162. or IS_ACCEPT = #{isAccept}
  163. </if>
  164. </delete>
  165. <insert id="insert" parameterType="com.steerinfo.dil.model.OmstrainOrder">
  166. insert into OMSTRAIN_ORDER (ORDER_ID, ORDER_NO, ORDER_WAGON_NO,
  167. ORDER_WAGON_WEIGHT, INSERT_USERNAME, INSERT_TIME,
  168. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  169. ENSTATION_TIME, OUTSTATION_TIME, BILLING_WEIGHT,
  170. "IS_ACCEPT ")
  171. values (#{orderId,jdbcType=DECIMAL}, #{orderNo,jdbcType=VARCHAR}, #{orderWagonNo,jdbcType=VARCHAR},
  172. #{orderWagonWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  173. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  174. #{enstationTime,jdbcType=TIMESTAMP}, #{outstationTime,jdbcType=TIMESTAMP}, #{billingWeight,jdbcType=DECIMAL},
  175. #{isAccept,jdbcType=DECIMAL})
  176. </insert>
  177. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmstrainOrder">
  178. insert into OMSTRAIN_ORDER
  179. <trim prefix="(" suffix=")" suffixOverrides=",">
  180. <if test="orderId != null">
  181. ORDER_ID,
  182. </if>
  183. <if test="orderNo != null">
  184. ORDER_NO,
  185. </if>
  186. <if test="orderWagonNo != null">
  187. ORDER_WAGON_NO,
  188. </if>
  189. <if test="orderWagonWeight != null">
  190. ORDER_WAGON_WEIGHT,
  191. </if>
  192. <if test="insertUsername != null">
  193. INSERT_USERNAME,
  194. </if>
  195. <if test="insertTime != null">
  196. INSERT_TIME,
  197. </if>
  198. <if test="updateUsername != null">
  199. UPDATE_USERNAME,
  200. </if>
  201. <if test="updateTime != null">
  202. UPDATE_TIME,
  203. </if>
  204. <if test="insertUpdateRemark != null">
  205. INSERT_UPDATE_REMARK,
  206. </if>
  207. <if test="enstationTime != null">
  208. ENSTATION_TIME,
  209. </if>
  210. <if test="outstationTime != null">
  211. OUTSTATION_TIME,
  212. </if>
  213. <if test="billingWeight != null">
  214. BILLING_WEIGHT,
  215. </if>
  216. <if test="isAccept != null">
  217. "IS_ACCEPT ",
  218. </if>
  219. </trim>
  220. <trim prefix="values (" suffix=")" suffixOverrides=",">
  221. <if test="orderId != null">
  222. #{orderId,jdbcType=DECIMAL},
  223. </if>
  224. <if test="orderNo != null">
  225. #{orderNo,jdbcType=VARCHAR},
  226. </if>
  227. <if test="orderWagonNo != null">
  228. #{orderWagonNo,jdbcType=VARCHAR},
  229. </if>
  230. <if test="orderWagonWeight != null">
  231. #{orderWagonWeight,jdbcType=DECIMAL},
  232. </if>
  233. <if test="insertUsername != null">
  234. #{insertUsername,jdbcType=VARCHAR},
  235. </if>
  236. <if test="insertTime != null">
  237. #{insertTime,jdbcType=TIMESTAMP},
  238. </if>
  239. <if test="updateUsername != null">
  240. #{updateUsername,jdbcType=VARCHAR},
  241. </if>
  242. <if test="updateTime != null">
  243. #{updateTime,jdbcType=TIMESTAMP},
  244. </if>
  245. <if test="insertUpdateRemark != null">
  246. #{insertUpdateRemark,jdbcType=VARCHAR},
  247. </if>
  248. <if test="enstationTime != null">
  249. #{enstationTime,jdbcType=TIMESTAMP},
  250. </if>
  251. <if test="outstationTime != null">
  252. #{outstationTime,jdbcType=TIMESTAMP},
  253. </if>
  254. <if test="billingWeight != null">
  255. #{billingWeight,jdbcType=DECIMAL},
  256. </if>
  257. <if test="isAccept != null">
  258. #{isAccept,jdbcType=DECIMAL},
  259. </if>
  260. </trim>
  261. </insert>
  262. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmstrainOrder">
  263. update OMSTRAIN_ORDER
  264. set ORDER_NO = #{orderNo,jdbcType=VARCHAR},
  265. ORDER_WAGON_NO = #{orderWagonNo,jdbcType=VARCHAR},
  266. ORDER_WAGON_WEIGHT = #{orderWagonWeight,jdbcType=DECIMAL},
  267. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  268. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  269. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  270. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  271. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  272. ENSTATION_TIME = #{enstationTime,jdbcType=TIMESTAMP},
  273. OUTSTATION_TIME = #{outstationTime,jdbcType=TIMESTAMP},
  274. BILLING_WEIGHT = #{billingWeight,jdbcType=DECIMAL},
  275. "IS_ACCEPT " = #{isAccept,jdbcType=DECIMAL}
  276. where ORDER_ID = #{orderId,jdbcType=DECIMAL}
  277. </update>
  278. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmstrainOrder">
  279. update OMSTRAIN_ORDER
  280. <set>
  281. <if test="orderNo != null">
  282. ORDER_NO = #{orderNo,jdbcType=VARCHAR},
  283. </if>
  284. <if test="orderWagonNo != null">
  285. ORDER_WAGON_NO = #{orderWagonNo,jdbcType=VARCHAR},
  286. </if>
  287. <if test="orderWagonWeight != null">
  288. ORDER_WAGON_WEIGHT = #{orderWagonWeight,jdbcType=DECIMAL},
  289. </if>
  290. <if test="insertUsername != null">
  291. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  292. </if>
  293. <if test="insertTime != null">
  294. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  295. </if>
  296. <if test="updateUsername != null">
  297. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  298. </if>
  299. <if test="updateTime != null">
  300. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  301. </if>
  302. <if test="insertUpdateRemark != null">
  303. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  304. </if>
  305. <if test="enstationTime != null">
  306. ENSTATION_TIME = #{enstationTime,jdbcType=TIMESTAMP},
  307. </if>
  308. <if test="outstationTime != null">
  309. OUTSTATION_TIME = #{outstationTime,jdbcType=TIMESTAMP},
  310. </if>
  311. <if test="billingWeight != null">
  312. BILLING_WEIGHT = #{billingWeight,jdbcType=DECIMAL},
  313. </if>
  314. <if test="isAccept != null">
  315. "IS_ACCEPT " = #{isAccept,jdbcType=DECIMAL},
  316. </if>
  317. </set>
  318. where ORDER_ID = #{orderId,jdbcType=DECIMAL}
  319. </update>
  320. <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
  321. <include refid="select" />
  322. where ORDER_ID = #{orderId,jdbcType=DECIMAL}
  323. </select>
  324. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  325. <include refid="select" />
  326. <include refid="where" />
  327. </select>
  328. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  329. <include refid="select" />
  330. <include refid="whereLike" />
  331. </select>
  332. <insert id="batchInsert" parameterType="java.util.List">
  333. insert into OMSTRAIN_ORDER
  334. (ORDER_ID,
  335. ORDER_NO, ORDER_WAGON_NO, ORDER_WAGON_WEIGHT,
  336. INSERT_USERNAME, INSERT_TIME,
  337. UPDATE_USERNAME, UPDATE_TIME,
  338. INSERT_UPDATE_REMARK, ENSTATION_TIME,
  339. OUTSTATION_TIME, BILLING_WEIGHT,
  340. "IS_ACCEPT ")
  341. ( <foreach collection="list" item="item" separator="union all">
  342. select
  343. #{item.orderId,jdbcType=DECIMAL},
  344. #{item.orderNo,jdbcType=VARCHAR}, #{item.orderWagonNo,jdbcType=VARCHAR}, #{item.orderWagonWeight,jdbcType=DECIMAL},
  345. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  346. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  347. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.enstationTime,jdbcType=TIMESTAMP},
  348. #{item.outstationTime,jdbcType=TIMESTAMP}, #{item.billingWeight,jdbcType=DECIMAL},
  349. #{item.isAccept,jdbcType=DECIMAL} from dual
  350. </foreach> )
  351. </insert>
  352. <update id="batchUpdate" parameterType="java.util.List">
  353. update OMSTRAIN_ORDER
  354. set
  355. ORDER_ID=
  356. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  357. when #{item.orderId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
  358. </foreach>
  359. ,ORDER_NO=
  360. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  361. when #{item.orderId,jdbcType=DECIMAL} then #{item.orderNo,jdbcType=VARCHAR}
  362. </foreach>
  363. ,ORDER_WAGON_NO=
  364. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  365. when #{item.orderId,jdbcType=DECIMAL} then #{item.orderWagonNo,jdbcType=VARCHAR}
  366. </foreach>
  367. ,ORDER_WAGON_WEIGHT=
  368. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  369. when #{item.orderId,jdbcType=DECIMAL} then #{item.orderWagonWeight,jdbcType=DECIMAL}
  370. </foreach>
  371. ,INSERT_USERNAME=
  372. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  373. when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  374. </foreach>
  375. ,INSERT_TIME=
  376. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  377. when #{item.orderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  378. </foreach>
  379. ,UPDATE_USERNAME=
  380. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  381. when #{item.orderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  382. </foreach>
  383. ,UPDATE_TIME=
  384. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  385. when #{item.orderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  386. </foreach>
  387. ,INSERT_UPDATE_REMARK=
  388. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  389. when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  390. </foreach>
  391. ,ENSTATION_TIME=
  392. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  393. when #{item.orderId,jdbcType=DECIMAL} then #{item.enstationTime,jdbcType=TIMESTAMP}
  394. </foreach>
  395. ,OUTSTATION_TIME=
  396. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  397. when #{item.orderId,jdbcType=DECIMAL} then #{item.outstationTime,jdbcType=TIMESTAMP}
  398. </foreach>
  399. ,BILLING_WEIGHT=
  400. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  401. when #{item.orderId,jdbcType=DECIMAL} then #{item.billingWeight,jdbcType=DECIMAL}
  402. </foreach>
  403. ,"IS_ACCEPT "=
  404. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  405. when #{item.orderId,jdbcType=DECIMAL} then #{item.isAccept,jdbcType=DECIMAL}
  406. </foreach>
  407. where ORDER_ID in
  408. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  409. #{item.orderId,jdbcType=DECIMAL}
  410. </foreach>
  411. </update>
  412. <delete id="batchDelete" parameterType="java.util.List">
  413. delete from OMSTRAIN_ORDER
  414. where ORDER_ID in
  415. <foreach close=")" collection="list" item="id" open="(" separator=",">
  416. #{id}
  417. </foreach>
  418. </delete>
  419. <!-- 友情提示!!!-->
  420. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  421. <!-- 友情提示!!!-->
  422. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  423. <select id="getOrderTrainMes" resultType="java.util.Map" parameterType="java.lang.Integer">
  424. SELECT
  425. OO.ORDER_ID "orderId",
  426. OO.ORDER_TYPE "orderType",
  427. OO.ORDER_LINE_SEQUENCE "orderLineSequence",
  428. OO.ORDER_NUMBER "orderNumber",
  429. RC.CAPACITY_NUMBER "capacityNumber",
  430. RS.SHIPPER_NAME "shipperName",
  431. ASOM.SALE_ORDER_CONSIGNEE_TEL "consigneeTel",
  432. ASOM.SALE_DATE_OF_RECEIPT "saleDateOfReceipt",
  433. RC2.CONSIGNEE_COMPANY_NAME "consigneeCompanyNames",
  434. CONCAT(CONCAT( CONCAT( CONCAT( RDA.ADDRESS_PROVINCE, RDA.ADDRESS_DISTRICT ), RDA.ADDRESS_TOWN ),RDA.ADDRESS_DELIVERY_ADDRESS ),RRP.ADDRESS_DELIVERY_ADDRESS) "receiveAddressName",
  435. TTR.RESULT_TOTAL_ID "resultTotalId",
  436. OO.CAN_WORK "canWork",
  437. OO.ORDER_STATUS "orderStatus",
  438. OTO.ORDER_ID "trainOrderId",
  439. OTO.ORDER_WAGON_NO "wagonNo",
  440. to_char(OTO.ENSTATION_TIME,'yyyy-mm-dd') "enStationTime",
  441. to_char(OTO.OUTSTATION_TIME,'yyyy-mm-dd') "outStationTime",
  442. RW.WAREHOUSE_NAME "sendStation",
  443. RW.WAREHOUSE_ID "sendStationId"
  444. FROM
  445. OMSTRUCK_ORDER OO
  446. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  447. LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  448. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
  449. LEFT JOIN RMS_CONSIGNEE RC2 ON ASO.RECEIVE_ID = RC2.CONSIGNEE_ID
  450. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  451. LEFT JOIN RMS_RECEIVE_PLACE RRP ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
  452. LEFT JOIN RMS_RECEIVE_ADDRESS RDA ON RDA.ADDRESS_ID = RRP.ADDRESS_ID
  453. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON OO.ORDER_ID = TTR.ORDER_ID
  454. LEFT JOIN TMSTT_ORDER TTO ON TTO.TRUCK_ORDER_ID = OO.ORDER_ID
  455. LEFT JOIN OMSTRAIN_ORDER OTO ON OTO.ORDER_ID = TTO.TRAIN_ORDER_ID
  456. LEFT JOIN RMS_PWAREHOUSE_GRID RPG ON RPG.STACKING_ID = OO.ORDER_ID
  457. LEFT JOIN RMS_WAREHOUSE RW ON RW.WAREHOUSE_ID = RPG.WAREHOUSE_ID
  458. WHERE
  459. OO.ORDER_ID = #{orderId}
  460. </select>
  461. <select id="getMaterialList" resultType="java.util.Map" parameterType="java.util.Map">
  462. SELECT RM.MATERIAL_ID "materialId",
  463. RM.MATERIAL_NAME||'-'||RM.MATERIAL_SPECIFICATION||'('||RM.MATERIAL_SPECIFICATION||')'||'-'||OOM.ORDER_MATERIAL_NUMBER||'件' "materialName"
  464. FROM OMSTRUCK_ORDER_MATERIAL OOM
  465. LEFT JOIN RMS_MATERIAL RM
  466. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  467. WHERE OOM.ORDER_ID = #{orderId}
  468. </select>
  469. <select id="getLuhaoNum" resultType="java.util.Map" parameterType="decimal">
  470. SELECT
  471. RMS.MATERIAL_FURNACE_NUMBER "materialFurnaceNumber",
  472. COUNT( WOSR.RESULT_ID ) "materialNum"
  473. FROM
  474. WMSP_OUTBOUND_RESULT WOR
  475. LEFT JOIN WMSP_OUTBOUND_RESULT_MATERIAL WORM ON WORM.OUTBOUND_RESULT_ID = WOR.RESULT_ID
  476. LEFT JOIN WMSP_OUTBOUND_SCAN_RESULT WOSR ON WORM.RESULT_MATERIAL_ID = WOSR.RESULT_MATERIAL_ID
  477. LEFT JOIN WMSP_INBOUND_RESULT WIR ON WOSR.INBOUND_RESULT_ID = WIR.INBOUND_ID
  478. LEFT JOIN RMS_MATERIAL_STEEL RMS ON WIR.MATERIAL_ID = RMS.MATERIAL_STEEL_ID
  479. WHERE WOR.BILL_LADING_ID = #{orderId}
  480. AND WORM.MATERIAL_ID = #{materialId}
  481. GROUP BY
  482. RMS.MATERIAL_FURNACE_NUMBER
  483. </select>
  484. <select id="getWagonShippingDetails" resultType="java.util.Map" parameterType="java.util.Map">
  485. SELECT * FROM (SELECT DISTINCT OO.ORDER_ID "orderId",
  486. ASO.SALE_ORDER_ID "saleOrderId",
  487. ASO.SALE_NUMBER "saleOrderNo",
  488. ASM.SALE_MATERIAL_ID "saleMaterialId",
  489. ASM.MATERIAL_NUMBER "materialNum",
  490. ASM.METER_WEIGHT "theoryWeight",
  491. ASM.EAS_PRIMARY_ID "closeEntryId",
  492. RC.CONSIGNEE_COMPANY_NAME "consigneeName",
  493. RS.SHIPPER_NAME "shipperName",
  494. RM.MATERIAL_ID "materialId",
  495. RM.MATERIAL_NAME "materialName",
  496. RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "materialSpa",
  497. OTO.ORDER_NO "orderNum",
  498. TWR.RESULT_NET_WEIGHT "materialWeight",
  499. to_char(OTO.OUTSTATION_TIME,'yyyy-mm-dd') "OutStation",
  500. to_char(OTO.ENSTATION_TIME,'yyyy-mm-dd') "EnStation",
  501. OTO.ORDER_WAGON_NO "wagonNo",
  502. OTO.ORDER_WAGON_WEIGHT "wagonWeight",
  503. OTO.BILLING_WEIGHT "wagonBillWeight",
  504. RAR1.ARRIVAL_NAME "arrivalStation",
  505. RAR.ARRIVAL_NAME "sendStation",
  506. ASO.SALE_REMARK "orderType",
  507. OTO.ORDER_ID "trainOrderId",
  508. RPG.GRID_ID "gridId",
  509. decode(wgm.DELETED,0,'入库',1,'出库','未入库') "wgmDelete",
  510. R_CAPACITY.CAPACITY_NUMBER "capacityNum"
  511. FROM AMS_SALE_ORDER ASO
  512. LEFT JOIN TMSTRAIN_PLEASE_APPROVE_RESULT TPAR ON TPAR.RAIL_PLAN_ID = ASO.SALE_ORDER_ID
  513. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAR ON RAR.ARRIVAL_ID = TPAR.SEND_STATION_ID
  514. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAR1 ON RAR1.ARRIVAL_ID = TPAR.TO_THE_STATION_ID
  515. LEFT JOIN RMS_CONSIGNEE RC ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
  516. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
  517. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
  518. LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
  519. ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
  520. LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
  521. ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
  522. LEFT JOIN AMS_SALE_MATERIAL ASM ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
  523. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASM.MATERIAL_ID
  524. LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
  525. LEFT JOIN RMS_CAPACITY R_CAPACITY ON R_CAPACITY.CAPACITY_ID = OO.CAPACITY_ID
  526. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  527. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  528. AND TWR.MATERIAL_ID = RM.MATERIAL_ID
  529. LEFT JOIN TMSTT_ORDER TTO ON TTO.TRUCK_ORDER_ID = OO.ORDER_ID
  530. LEFT JOIN OMSTRAIN_ORDER OTO ON OTO.ORDER_ID = TTO.TRAIN_ORDER_ID
  531. LEFT JOIN RMS_PWAREHOUSE_GRID RPG ON RPG.STACKING_ID = OO.ORDER_ID
  532. LEFT JOIN WMSP_GRID_MATERIAL WGM ON WGM.GRID_ID = RPG.GRID_ID
  533. and wgm.MATERIAL_ID = rm.MATERIAL_ID
  534. WHERE ASO.SALE_TYPE = 4
  535. <!-- <if test="oneDate != null">-->
  536. <!-- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = RPG.INSERT_TIME-->
  537. <!-- </if>-->
  538. <!-- <if test="startDate != null">-->
  539. <!-- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= RPG.INSERT_TIME-->
  540. <!-- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= RPG.INSERT_TIME-->
  541. <!-- </if>-->
  542. )
  543. </select>
  544. </mapper>