OmstrainOrderMapper.xml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  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. <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
  19. <result column="STRAWMATS" jdbcType="DECIMAL" property="strawmats" />
  20. </resultMap>
  21. <sql id="columns">
  22. ORDER_ID, ORDER_NO, ORDER_WAGON_NO, ORDER_WAGON_WEIGHT, INSERT_USERNAME, INSERT_TIME,
  23. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, ENSTATION_TIME, OUTSTATION_TIME,
  24. BILLING_WEIGHT, "IS_ACCEPT", WAREHOUSE_ID, STRAWMATS
  25. </sql>
  26. <sql id="columns_alias">
  27. t.ORDER_ID, t.ORDER_NO, t.ORDER_WAGON_NO, t.ORDER_WAGON_WEIGHT, t.INSERT_USERNAME,
  28. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.ENSTATION_TIME,
  29. t.OUTSTATION_TIME, t.BILLING_WEIGHT, t."IS_ACCEPT", t.WAREHOUSE_ID, t.STRAWMATS
  30. </sql>
  31. <sql id="select">
  32. SELECT <include refid="columns" /> FROM OMSTRAIN_ORDER
  33. </sql>
  34. <sql id="select_alias">
  35. SELECT <include refid="columns_alias" /> FROM OMSTRAIN_ORDER t
  36. </sql>
  37. <sql id="where">
  38. <where>
  39. <if test="orderId != null">
  40. and ORDER_ID = #{orderId}
  41. </if>
  42. <if test="orderNo != null and orderNo != ''">
  43. and ORDER_NO = #{orderNo}
  44. </if>
  45. <if test="orderWagonNo != null and orderWagonNo != ''">
  46. and ORDER_WAGON_NO = #{orderWagonNo}
  47. </if>
  48. <if test="orderWagonWeight != null">
  49. and ORDER_WAGON_WEIGHT = #{orderWagonWeight}
  50. </if>
  51. <if test="insertUsername != null and insertUsername != ''">
  52. and INSERT_USERNAME = #{insertUsername}
  53. </if>
  54. <if test="insertTime != null">
  55. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  56. </if>
  57. <if test="updateUsername != null and updateUsername != ''">
  58. and UPDATE_USERNAME = #{updateUsername}
  59. </if>
  60. <if test="updateTime != null">
  61. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  62. </if>
  63. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  64. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  65. </if>
  66. <if test="enstationTime != null">
  67. and TO_CHAR(ENSTATION_TIME,'yyyy-MM-dd') = #{enstationTime}
  68. </if>
  69. <if test="outstationTime != null">
  70. and TO_CHAR(OUTSTATION_TIME,'yyyy-MM-dd') = #{outstationTime}
  71. </if>
  72. <if test="billingWeight != null">
  73. and BILLING_WEIGHT = #{billingWeight}
  74. </if>
  75. <if test="isAccept != null">
  76. and IS_ACCEPT = #{isAccept}
  77. </if>
  78. <if test="warehouseId != null">
  79. and WAREHOUSE_ID = #{warehouseId}
  80. </if>
  81. <if test="strawmats != null">
  82. and STRAWMATS = #{strawmats}
  83. </if>
  84. </where>
  85. </sql>
  86. <sql id="whereLike">
  87. <where>
  88. <if test="orderId != null">
  89. and ORDER_ID = #{orderId}
  90. </if>
  91. <if test="orderNo != null and orderNo != ''">
  92. and ORDER_NO LIKE '%${orderNo}%'
  93. </if>
  94. <if test="orderWagonNo != null and orderWagonNo != ''">
  95. and ORDER_WAGON_NO LIKE '%${orderWagonNo}%'
  96. </if>
  97. <if test="orderWagonWeight != null">
  98. and ORDER_WAGON_WEIGHT = #{orderWagonWeight}
  99. </if>
  100. <if test="insertUsername != null and insertUsername != ''">
  101. and INSERT_USERNAME LIKE '%${insertUsername}%'
  102. </if>
  103. <if test="insertTime != null">
  104. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  105. </if>
  106. <if test="updateUsername != null and updateUsername != ''">
  107. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  108. </if>
  109. <if test="updateTime != null">
  110. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  111. </if>
  112. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  113. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  114. </if>
  115. <if test="enstationTime != null">
  116. and TO_CHAR(ENSTATION_TIME,'yyyy-MM-dd') = #{enstationTime}
  117. </if>
  118. <if test="outstationTime != null">
  119. and TO_CHAR(OUTSTATION_TIME,'yyyy-MM-dd') = #{outstationTime}
  120. </if>
  121. <if test="billingWeight != null">
  122. and BILLING_WEIGHT = #{billingWeight}
  123. </if>
  124. <if test="isAccept != null">
  125. and IS_ACCEPT = #{isAccept}
  126. </if>
  127. <if test="warehouseId != null">
  128. and WAREHOUSE_ID = #{warehouseId}
  129. </if>
  130. <if test="strawmats != null">
  131. and STRAWMATS = #{strawmats}
  132. </if>
  133. </where>
  134. </sql>
  135. <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
  136. delete from OMSTRAIN_ORDER
  137. where ORDER_ID = #{orderId,jdbcType=DECIMAL}
  138. </delete>
  139. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  140. delete from OMSTRAIN_ORDER
  141. where 1!=1
  142. <if test="orderNo != null and orderNo != ''">
  143. or ORDER_NO = #{orderNo}
  144. </if>
  145. <if test="orderWagonNo != null and orderWagonNo != ''">
  146. or ORDER_WAGON_NO = #{orderWagonNo}
  147. </if>
  148. <if test="orderWagonWeight != null">
  149. or ORDER_WAGON_WEIGHT = #{orderWagonWeight}
  150. </if>
  151. <if test="insertUsername != null and insertUsername != ''">
  152. or INSERT_USERNAME = #{insertUsername}
  153. </if>
  154. <if test="insertTime != null">
  155. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  156. </if>
  157. <if test="updateUsername != null and updateUsername != ''">
  158. or UPDATE_USERNAME = #{updateUsername}
  159. </if>
  160. <if test="updateTime != null">
  161. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  162. </if>
  163. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  164. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  165. </if>
  166. <if test="enstationTime != null">
  167. or TO_CHAR(ENSTATION_TIME,'yyyy-MM-dd') = '#{enstationTime}'
  168. </if>
  169. <if test="outstationTime != null">
  170. or TO_CHAR(OUTSTATION_TIME,'yyyy-MM-dd') = '#{outstationTime}'
  171. </if>
  172. <if test="billingWeight != null">
  173. or BILLING_WEIGHT = #{billingWeight}
  174. </if>
  175. <if test="isAccept != null">
  176. or IS_ACCEPT = #{isAccept}
  177. </if>
  178. <if test="warehouseId != null">
  179. or WAREHOUSE_ID = #{warehouseId}
  180. </if>
  181. <if test="strawmats != null">
  182. or STRAWMATS = #{strawmats}
  183. </if>
  184. </delete>
  185. <insert id="insert" parameterType="com.steerinfo.dil.model.OmstrainOrder">
  186. insert into OMSTRAIN_ORDER (ORDER_ID, ORDER_NO, ORDER_WAGON_NO,
  187. ORDER_WAGON_WEIGHT, INSERT_USERNAME, INSERT_TIME,
  188. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  189. ENSTATION_TIME, OUTSTATION_TIME, BILLING_WEIGHT,
  190. "IS_ACCEPT", WAREHOUSE_ID, STRAWMATS
  191. )
  192. values (#{orderId,jdbcType=DECIMAL}, #{orderNo,jdbcType=VARCHAR}, #{orderWagonNo,jdbcType=VARCHAR},
  193. #{orderWagonWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  194. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  195. #{enstationTime,jdbcType=TIMESTAMP}, #{outstationTime,jdbcType=TIMESTAMP}, #{billingWeight,jdbcType=DECIMAL},
  196. #{isAccept,jdbcType=DECIMAL}, #{warehouseId,jdbcType=DECIMAL}, #{strawmats,jdbcType=DECIMAL}
  197. )
  198. </insert>
  199. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmstrainOrder">
  200. insert into OMSTRAIN_ORDER
  201. <trim prefix="(" suffix=")" suffixOverrides=",">
  202. <if test="orderId != null">
  203. ORDER_ID,
  204. </if>
  205. <if test="orderNo != null">
  206. ORDER_NO,
  207. </if>
  208. <if test="orderWagonNo != null">
  209. ORDER_WAGON_NO,
  210. </if>
  211. <if test="orderWagonWeight != null">
  212. ORDER_WAGON_WEIGHT,
  213. </if>
  214. <if test="insertUsername != null">
  215. INSERT_USERNAME,
  216. </if>
  217. <if test="insertTime != null">
  218. INSERT_TIME,
  219. </if>
  220. <if test="updateUsername != null">
  221. UPDATE_USERNAME,
  222. </if>
  223. <if test="updateTime != null">
  224. UPDATE_TIME,
  225. </if>
  226. <if test="insertUpdateRemark != null">
  227. INSERT_UPDATE_REMARK,
  228. </if>
  229. <if test="enstationTime != null">
  230. ENSTATION_TIME,
  231. </if>
  232. <if test="outstationTime != null">
  233. OUTSTATION_TIME,
  234. </if>
  235. <if test="billingWeight != null">
  236. BILLING_WEIGHT,
  237. </if>
  238. <if test="isAccept != null">
  239. "IS_ACCEPT",
  240. </if>
  241. <if test="warehouseId != null">
  242. WAREHOUSE_ID,
  243. </if>
  244. <if test="strawmats != null">
  245. STRAWMATS,
  246. </if>
  247. </trim>
  248. <trim prefix="values (" suffix=")" suffixOverrides=",">
  249. <if test="orderId != null">
  250. #{orderId,jdbcType=DECIMAL},
  251. </if>
  252. <if test="orderNo != null">
  253. #{orderNo,jdbcType=VARCHAR},
  254. </if>
  255. <if test="orderWagonNo != null">
  256. #{orderWagonNo,jdbcType=VARCHAR},
  257. </if>
  258. <if test="orderWagonWeight != null">
  259. #{orderWagonWeight,jdbcType=DECIMAL},
  260. </if>
  261. <if test="insertUsername != null">
  262. #{insertUsername,jdbcType=VARCHAR},
  263. </if>
  264. <if test="insertTime != null">
  265. #{insertTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="updateUsername != null">
  268. #{updateUsername,jdbcType=VARCHAR},
  269. </if>
  270. <if test="updateTime != null">
  271. #{updateTime,jdbcType=TIMESTAMP},
  272. </if>
  273. <if test="insertUpdateRemark != null">
  274. #{insertUpdateRemark,jdbcType=VARCHAR},
  275. </if>
  276. <if test="enstationTime != null">
  277. #{enstationTime,jdbcType=TIMESTAMP},
  278. </if>
  279. <if test="outstationTime != null">
  280. #{outstationTime,jdbcType=TIMESTAMP},
  281. </if>
  282. <if test="billingWeight != null">
  283. #{billingWeight,jdbcType=DECIMAL},
  284. </if>
  285. <if test="isAccept != null">
  286. #{isAccept,jdbcType=DECIMAL},
  287. </if>
  288. <if test="warehouseId != null">
  289. #{warehouseId,jdbcType=DECIMAL},
  290. </if>
  291. <if test="strawmats != null">
  292. #{strawmats,jdbcType=DECIMAL},
  293. </if>
  294. </trim>
  295. </insert>
  296. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmstrainOrder">
  297. update OMSTRAIN_ORDER
  298. set ORDER_NO = #{orderNo,jdbcType=VARCHAR},
  299. ORDER_WAGON_NO = #{orderWagonNo,jdbcType=VARCHAR},
  300. ORDER_WAGON_WEIGHT = #{orderWagonWeight,jdbcType=DECIMAL},
  301. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  302. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  303. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  304. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  305. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  306. ENSTATION_TIME = #{enstationTime,jdbcType=TIMESTAMP},
  307. OUTSTATION_TIME = #{outstationTime,jdbcType=TIMESTAMP},
  308. BILLING_WEIGHT = #{billingWeight,jdbcType=DECIMAL},
  309. "IS_ACCEPT" = #{isAccept,jdbcType=DECIMAL},
  310. WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  311. STRAWMATS = #{strawmats,jdbcType=DECIMAL}
  312. where ORDER_ID = #{orderId,jdbcType=DECIMAL}
  313. </update>
  314. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmstrainOrder">
  315. update OMSTRAIN_ORDER
  316. <set>
  317. <if test="orderNo != null">
  318. ORDER_NO = #{orderNo,jdbcType=VARCHAR},
  319. </if>
  320. <if test="orderWagonNo != null">
  321. ORDER_WAGON_NO = #{orderWagonNo,jdbcType=VARCHAR},
  322. </if>
  323. <if test="orderWagonWeight != null">
  324. ORDER_WAGON_WEIGHT = #{orderWagonWeight,jdbcType=DECIMAL},
  325. </if>
  326. <if test="insertUsername != null">
  327. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  328. </if>
  329. <if test="insertTime != null">
  330. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  331. </if>
  332. <if test="updateUsername != null">
  333. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  334. </if>
  335. <if test="updateTime != null">
  336. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  337. </if>
  338. <if test="insertUpdateRemark != null">
  339. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  340. </if>
  341. <if test="enstationTime != null">
  342. ENSTATION_TIME = #{enstationTime,jdbcType=TIMESTAMP},
  343. </if>
  344. <if test="outstationTime != null">
  345. OUTSTATION_TIME = #{outstationTime,jdbcType=TIMESTAMP},
  346. </if>
  347. <if test="billingWeight != null">
  348. BILLING_WEIGHT = #{billingWeight,jdbcType=DECIMAL},
  349. </if>
  350. <if test="isAccept != null">
  351. "IS_ACCEPT" = #{isAccept,jdbcType=DECIMAL},
  352. </if>
  353. <if test="warehouseId != null">
  354. WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  355. </if>
  356. <if test="strawmats != null">
  357. STRAWMATS = #{strawmats,jdbcType=DECIMAL},
  358. </if>
  359. </set>
  360. where ORDER_ID = #{orderId,jdbcType=DECIMAL}
  361. </update>
  362. <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
  363. <include refid="select" />
  364. where ORDER_ID = #{orderId,jdbcType=DECIMAL}
  365. </select>
  366. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  367. <include refid="select" />
  368. <include refid="where" />
  369. </select>
  370. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  371. <include refid="select" />
  372. <include refid="whereLike" />
  373. </select>
  374. <insert id="batchInsert" parameterType="java.util.List">
  375. insert into OMSTRAIN_ORDER
  376. (ORDER_ID,
  377. ORDER_NO, ORDER_WAGON_NO, ORDER_WAGON_WEIGHT,
  378. INSERT_USERNAME, INSERT_TIME,
  379. UPDATE_USERNAME, UPDATE_TIME,
  380. INSERT_UPDATE_REMARK, ENSTATION_TIME,
  381. OUTSTATION_TIME, BILLING_WEIGHT,
  382. "IS_ACCEPT", WAREHOUSE_ID, STRAWMATS
  383. )
  384. ( <foreach collection="list" item="item" separator="union all">
  385. select
  386. #{item.orderId,jdbcType=DECIMAL},
  387. #{item.orderNo,jdbcType=VARCHAR}, #{item.orderWagonNo,jdbcType=VARCHAR}, #{item.orderWagonWeight,jdbcType=DECIMAL},
  388. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  389. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  390. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.enstationTime,jdbcType=TIMESTAMP},
  391. #{item.outstationTime,jdbcType=TIMESTAMP}, #{item.billingWeight,jdbcType=DECIMAL},
  392. #{item.isAccept,jdbcType=DECIMAL}, #{item.warehouseId,jdbcType=DECIMAL}, #{item.strawmats,jdbcType=DECIMAL}
  393. from dual
  394. </foreach> )
  395. </insert>
  396. <update id="batchUpdate" parameterType="java.util.List">
  397. update OMSTRAIN_ORDER
  398. set
  399. ORDER_ID=
  400. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  401. when #{item.orderId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
  402. </foreach>
  403. ,ORDER_NO=
  404. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  405. when #{item.orderId,jdbcType=DECIMAL} then #{item.orderNo,jdbcType=VARCHAR}
  406. </foreach>
  407. ,ORDER_WAGON_NO=
  408. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  409. when #{item.orderId,jdbcType=DECIMAL} then #{item.orderWagonNo,jdbcType=VARCHAR}
  410. </foreach>
  411. ,ORDER_WAGON_WEIGHT=
  412. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  413. when #{item.orderId,jdbcType=DECIMAL} then #{item.orderWagonWeight,jdbcType=DECIMAL}
  414. </foreach>
  415. ,INSERT_USERNAME=
  416. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  417. when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  418. </foreach>
  419. ,INSERT_TIME=
  420. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  421. when #{item.orderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  422. </foreach>
  423. ,UPDATE_USERNAME=
  424. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  425. when #{item.orderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  426. </foreach>
  427. ,UPDATE_TIME=
  428. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  429. when #{item.orderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  430. </foreach>
  431. ,INSERT_UPDATE_REMARK=
  432. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  433. when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  434. </foreach>
  435. ,ENSTATION_TIME=
  436. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  437. when #{item.orderId,jdbcType=DECIMAL} then #{item.enstationTime,jdbcType=TIMESTAMP}
  438. </foreach>
  439. ,OUTSTATION_TIME=
  440. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  441. when #{item.orderId,jdbcType=DECIMAL} then #{item.outstationTime,jdbcType=TIMESTAMP}
  442. </foreach>
  443. ,BILLING_WEIGHT=
  444. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  445. when #{item.orderId,jdbcType=DECIMAL} then #{item.billingWeight,jdbcType=DECIMAL}
  446. </foreach>
  447. ,"IS_ACCEPT"=
  448. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  449. when #{item.orderId,jdbcType=DECIMAL} then #{item.isAccept,jdbcType=DECIMAL}
  450. </foreach>
  451. ,WAREHOUSE_ID=
  452. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  453. when #{item.orderId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
  454. </foreach>
  455. ,STRAWMATS=
  456. <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
  457. when #{item.orderId,jdbcType=DECIMAL} then #{item.strawmats,jdbcType=DECIMAL}
  458. </foreach>
  459. where ORDER_ID in
  460. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  461. #{item.orderId,jdbcType=DECIMAL}
  462. </foreach>
  463. </update>
  464. <delete id="batchDelete" parameterType="java.util.List">
  465. delete from OMSTRAIN_ORDER
  466. where ORDER_ID in
  467. <foreach close=")" collection="list" item="id" open="(" separator=",">
  468. #{id}
  469. </foreach>
  470. </delete>
  471. <!-- 友情提示!!!-->
  472. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  473. <!-- 友情提示!!!-->
  474. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  475. <select id="getOrderTrainMes" resultType="java.util.Map" parameterType="java.lang.Integer">
  476. SELECT
  477. OO.ORDER_ID "orderId",
  478. OO.ORDER_TYPE "orderType",
  479. OO.ORDER_LINE_SEQUENCE "orderLineSequence",
  480. OO.ORDER_NUMBER "orderNumber",
  481. RC.CAPACITY_NUMBER "capacityNumber",
  482. RS.SHIPPER_NAME "shipperName",
  483. ASOM.SALE_ORDER_CONSIGNEE_TEL "consigneeTel",
  484. ASOM.SALE_DATE_OF_RECEIPT "saleDateOfReceipt",
  485. RC2.CONSIGNEE_COMPANY_NAME "consigneeCompanyNames",
  486. CONCAT(CONCAT( CONCAT( CONCAT( RDA.ADDRESS_PROVINCE, RDA.ADDRESS_DISTRICT ), RDA.ADDRESS_TOWN ),RDA.ADDRESS_DELIVERY_ADDRESS ),RRP.ADDRESS_DELIVERY_ADDRESS) "receiveAddressName",
  487. TTR.RESULT_TOTAL_ID "resultTotalId",
  488. OO.CAN_WORK "canWork",
  489. OO.ORDER_STATUS "orderStatus",
  490. OTO.ORDER_ID "trainOrderId",
  491. OTO.ORDER_WAGON_NO "wagonNo",
  492. rpg.INSERT_UPDATE_REMARK "stackName",
  493. to_char(OTO.ENSTATION_TIME,'yyyy-mm-dd') "enStationTime",
  494. to_char(OTO.OUTSTATION_TIME,'yyyy-mm-dd') "outStationTime",
  495. RW.WAREHOUSE_NAME "sendStation",
  496. RW.WAREHOUSE_ID "sendStationId"
  497. FROM
  498. OMSTRUCK_ORDER OO
  499. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  500. LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  501. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
  502. LEFT JOIN RMS_CONSIGNEE RC2 ON ASO.RECEIVE_ID = RC2.CONSIGNEE_ID
  503. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  504. LEFT JOIN RMS_RECEIVE_PLACE RRP ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
  505. LEFT JOIN RMS_RECEIVE_ADDRESS RDA ON RDA.ADDRESS_ID = RRP.ADDRESS_ID
  506. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON OO.ORDER_ID = TTR.ORDER_ID
  507. LEFT JOIN TMSTT_ORDER TTO ON TTO.TRUCK_ORDER_ID = OO.ORDER_ID
  508. LEFT JOIN OMSTRAIN_ORDER OTO ON OTO.ORDER_ID = TTO.TRAIN_ORDER_ID
  509. LEFT JOIN RMS_PWAREHOUSE_GRID RPG ON RPG.STACKING_ID = OO.ORDER_ID
  510. LEFT JOIN RMS_WAREHOUSE RW ON RW.WAREHOUSE_ID = RPG.WAREHOUSE_ID
  511. WHERE
  512. OO.ORDER_ID = #{orderId}
  513. </select>
  514. <!-- 根据运输订单id查找调入仓库 -->
  515. <select id="getInwardWarehouse" resultType="java.lang.String" parameterType="java.math.BigDecimal">
  516. SELECT
  517. distinct RISW.INWARD_WAREHOUSE_NAME "inwardWarehouseName"
  518. FROM
  519. OMSTRUCK_ORDER OO
  520. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  521. LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  522. left join AMS_SALE_MATERIAL ASM ON ASO.SALE_ORDER_ID = ASM.SALE_ORDER_ID
  523. LEFT JOIN RMS_INWARD_STEEL_WAREHOUSE RISW ON ASM.TRANSFER_IN_OF_WAREHOUSE = RISW.INWARD_WAREHOUSE_CODE
  524. WHERE
  525. OO.ORDER_ID = #{orderId}
  526. </select>
  527. <!-- 根据运输订单id查找调出仓库 -->
  528. <select id="getOutOfWarehouse" resultType="java.lang.String" parameterType="java.math.BigDecimal">
  529. SELECT
  530. distinct ASM.TRANSFER_OUT_OF_WAREHOUSE "outOfWarehouse"
  531. FROM
  532. OMSTRUCK_ORDER OO
  533. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  534. LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  535. left join AMS_SALE_MATERIAL ASM ON ASO.SALE_ORDER_ID = ASM.SALE_ORDER_ID
  536. WHERE
  537. OO.ORDER_ID = #{orderId}
  538. FETCH NEXT 1 ROWS ONLY
  539. </select>
  540. <select id="getMaterialList" resultType="java.util.Map" parameterType="java.util.Map">
  541. SELECT RM.MATERIAL_ID "materialId",
  542. RM.MATERIAL_NAME||'-'||RM.MATERIAL_SPECIFICATION||'('||RM.MATERIAL_SPECIFICATION||')'||'-'||OOM.ORDER_MATERIAL_NUMBER||'件' "materialName"
  543. FROM OMSTRUCK_ORDER_MATERIAL OOM
  544. LEFT JOIN RMS_MATERIAL RM
  545. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  546. WHERE OOM.ORDER_ID = #{orderId}
  547. </select>
  548. <select id="getLuhaoNum" resultType="java.util.Map" parameterType="decimal">
  549. SELECT
  550. RMS.MATERIAL_FURNACE_NUMBER "materialFurnaceNumber",
  551. COUNT( WOSR.RESULT_ID ) "materialNum"
  552. FROM
  553. WMSP_OUTBOUND_RESULT WOR
  554. LEFT JOIN WMSP_OUTBOUND_RESULT_MATERIAL WORM ON WORM.OUTBOUND_RESULT_ID = WOR.RESULT_ID
  555. LEFT JOIN WMSP_OUTBOUND_SCAN_RESULT WOSR ON WORM.RESULT_MATERIAL_ID = WOSR.RESULT_MATERIAL_ID
  556. LEFT JOIN WMSP_INBOUND_RESULT WIR ON WOSR.INBOUND_RESULT_ID = WIR.INBOUND_ID
  557. LEFT JOIN RMS_MATERIAL_STEEL RMS ON WIR.MATERIAL_ID = RMS.MATERIAL_STEEL_ID
  558. WHERE WOR.BILL_LADING_ID = #{orderId}
  559. AND WORM.MATERIAL_ID = #{materialId}
  560. GROUP BY
  561. RMS.MATERIAL_FURNACE_NUMBER
  562. </select>
  563. <select id="getWagonShippingDetails" resultType="java.util.Map" parameterType="java.util.Map">
  564. SELECT * FROM (SELECT DISTINCT OO.ORDER_ID "orderId",
  565. ASO.SALE_ORDER_ID "saleOrderId",
  566. ASO.SALE_NUMBER "saleOrderNo",
  567. ASM.SALE_MATERIAL_ID "saleMaterialId",
  568. ASM.MATERIAL_NUMBER "materialNum",
  569. ASM.MATERIAL_WEIGHT "theoryWeight",
  570. ASM.EAS_PRIMARY_ID "closeEntryId",
  571. RC.CONSIGNEE_COMPANY_NAME "consigneeName",
  572. RC.CONSIGNEE_ID "consigneeId",
  573. RS.SHIPPER_NAME "shipperName",
  574. RM.MATERIAL_ID "materialId",
  575. RM.MATERIAL_NAME "materialName",
  576. RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "materialSpa",
  577. OTO.ORDER_NO "orderNum",
  578. TWR.RESULT_NET_WEIGHT "materialWeight",
  579. to_char(OTO.OUTSTATION_TIME,'yyyy-mm-dd') "OutStation",
  580. to_char(TUR.RESULT_END_TIME,'yyyy-mm-dd') "EnStation",
  581. to_char(ASO.INSERT_TIME,'yyyy-mm-dd') "orderTime",
  582. OTO.ORDER_WAGON_NO "wagonNo",
  583. OTO.ORDER_WAGON_WEIGHT "wagonWeight",
  584. OTO.BILLING_WEIGHT "wagonBillWeight",
  585. RAR1.ARRIVAL_NAME "arrivalStation",
  586. RAR.ARRIVAL_NAME "sendStation",
  587. ASO.SALE_REMARK "orderType",
  588. OTO.ORDER_ID "trainOrderId",
  589. RPG.GRID_ID "gridId",
  590. RPG.INSERT_UPDATE_REMARK "stackName",
  591. decode(wgm.DELETED,0,'入库',1,'出库','未入库') "wgmDelete",
  592. R_CAPACITY.CAPACITY_NUMBER "capacityNum",
  593. (CASE WHEN
  594. RW.WAREHOUSE_NAME IS NOT NULL
  595. THEN RW.WAREHOUSE_NAME
  596. WHEN RC.CONSIGNEE_COMPANY_NAME != '成都积微物联电子商务有限公司'
  597. THEN RAR1.DAYPLAN_DEDICATED_LINE
  598. ELSE RAR1.UPDATE_USERNAME
  599. END)
  600. "unloadPoint",
  601. RAR1.RAILWAY_BUREAU "railwayBureau",
  602. OTO.STRAWMATS "strawMats",
  603. OO.ORDER_NUMBER "number",
  604. OTO.WAREHOUSE_ID "unloadPointId",
  605. decode(OTO."IS_ACCEPT",0,'未收货',1,'已收货') "isAccept",
  606. OTO.is_accept_time "isAcceptTime",
  607. RP.PERSONNEL_NAME "inboundPersonnelName",
  608. RPG.INSERT_TIME "inboundTime",
  609. RPG.UPDATE_TIME "outboundTime",
  610. RP2.PERSONNEL_NAME "outboundPersonnelName",
  611. TWR.INSERT_UPDATE_REMARK "weightNo",
  612. TLFR.RESULT_OUT_GATE_TIME "outGateTime"
  613. FROM AMS_SALE_ORDER ASO
  614. LEFT JOIN RMS_CONSIGNEE RC ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
  615. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
  616. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
  617. LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
  618. ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
  619. LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
  620. ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
  621. LEFT JOIN AMS_SALE_MATERIAL ASM ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
  622. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASM.MATERIAL_ID
  623. LEFT JOIN TMSTRAIN_PLEASE_APPROVE_RESULT TPAR ON TPAR.RAIL_PLAN_ID = ASM.SALE_MATERIAL_ID
  624. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAR ON RAR.ARRIVAL_ID = TPAR.SEND_STATION_ID
  625. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAR1 ON RAR1.ARRIVAL_ID = TPAR.TO_THE_STATION_ID
  626. LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID AND OO.ORDER_STATUS=2
  627. LEFT JOIN RMS_CAPACITY R_CAPACITY ON R_CAPACITY.CAPACITY_ID = OO.CAPACITY_ID
  628. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  629. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  630. AND TWR.MATERIAL_ID = RM.MATERIAL_ID
  631. AND TWR.SALE_MATERIAL_ID = ASM.SALE_MATERIAL_ID
  632. LEFT JOIN TMSTRUCK_UNLOAD_RESULT TUR ON TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  633. AND TUR.MATERIAL_ID = RM.MATERIAL_ID
  634. LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT TLFR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  635. LEFT JOIN TMSTT_ORDER TTO ON TTO.TRUCK_ORDER_ID = OO.ORDER_ID
  636. LEFT JOIN OMSTRAIN_ORDER OTO ON OTO.ORDER_ID = TTO.TRAIN_ORDER_ID
  637. LEFT JOIN RMS_PWAREHOUSE_GRID RPG ON RPG.STACKING_ID = OO.ORDER_ID
  638. LEFT JOIN RMS_PERSONNEL RP ON RP.PERSONNEL_SSO_ID = RPG.INSERT_USERNAME
  639. LEFT JOIN RMS_PERSONNEL RP2 ON RP2.PERSONNEL_SSO_ID = RPG.UPDATE_USERNAME
  640. LEFT JOIN WMSP_GRID_MATERIAL WGM ON WGM.GRID_ID = RPG.GRID_ID
  641. and wgm.MATERIAL_ID = rm.MATERIAL_ID
  642. LEFT JOIN RMS_WAREHOUSE RW ON RW.WAREHOUSE_ID = OTO.WAREHOUSE_ID
  643. WHERE ASO.SALE_TYPE = 4
  644. AND OO.ORDER_STATUS IN (2,5)
  645. <if test="oneDate != null">
  646. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = ASO.INSERT_TIME
  647. </if>
  648. <if test="startDate != null">
  649. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= ASO.INSERT_TIME
  650. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ASO.INSERT_TIME
  651. </if>
  652. <if test="wagonNo != null">
  653. and OTO.ORDER_WAGON_NO like #{wagonNo}
  654. </if>
  655. <if test="consigneeName != null">
  656. and RC.CONSIGNEE_COMPANY_NAME like #{consigneeName}
  657. </if>
  658. <if test="toTheStation != null">
  659. and RAR1.ARRIVAL_NAME like #{toTheStation}
  660. </if>
  661. <if test="sendStation != null">
  662. and RAR.ARRIVAL_NAME like #{sendStation}
  663. </if>
  664. <if test="materialSpa != null">
  665. and RAR.ARRIVAL_NAME like '%${materialSpa}'
  666. </if>
  667. <if test="materialName != null">
  668. and RAR.ARRIVAL_NAME like '%${materialName}'
  669. </if>
  670. Order By "OutStation" desc,OTO.ORDER_WAGON_NO
  671. )
  672. </select>
  673. <select id="getTrainOrderIds" resultType="java.math.BigDecimal" parameterType="decimal">
  674. SELECT OO.ORDER_ID FROM TMSTT_ORDER TTO
  675. LEFT JOIN OMSTRAIN_ORDER OO
  676. ON OO.ORDER_ID = TTO.TRAIN_ORDER_ID
  677. WHERE TTO.TRUCK_ORDER_ID = #{orderId}
  678. </select>
  679. </mapper>