AmsRailOffsetDayplanMapper.xml 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900
  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.AmsRailOffsetDayplanMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsRailOffsetDayplan">
  5. <id column="DAYPLAN_ID" jdbcType="DECIMAL" property="dayplanId"/>
  6. <result column="DAYPLAN_NO" jdbcType="VARCHAR" property="dayplanNo"/>
  7. <result column="DAYPLAN_DATE" jdbcType="TIMESTAMP" property="dayplanDate"/>
  8. <result column="SHIPPER_ID" jdbcType="DECIMAL" property="shipperId"/>
  9. <result column="DAYPLAN_DELIVERY_DATE" jdbcType="TIMESTAMP" property="dayplanDeliveryDate"/>
  10. <result column="DAYPLAN_OWN_CARS_AMOUT" jdbcType="DECIMAL" property="dayplanOwnCarsAmout"/>
  11. <result column="DAYPLAN_TO_THE_STATION_ID" jdbcType="DECIMAL" property="dayplanToTheStationId"/>
  12. <result column="DAYPLAN_WAGON_NUMBER" jdbcType="DECIMAL" property="dayplanWagonNumber"/>
  13. <result column="RECEIVING_UNIT_ID" jdbcType="DECIMAL" property="receivingUnitId"/>
  14. <result column="DAYPLAN_CONSIGNEE_NAME" jdbcType="VARCHAR" property="dayplanConsigneeName"/>
  15. <result column="DAYPLAN_CONSIGNEE_TEL" jdbcType="VARCHAR" property="dayplanConsigneeTel"/>
  16. <result column="DAYPLAN_RECEIVE_STATUS" jdbcType="DECIMAL" property="dayplanReceiveStatus"/>
  17. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
  18. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
  19. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
  20. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
  21. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
  22. <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId"/>
  23. <result column="DAYPLAN_SEND_STATION_ID" jdbcType="DECIMAL" property="dayplanSendStationId"/>
  24. <result column="DELETED" jdbcType="DECIMAL" property="deleted"/>
  25. </resultMap>
  26. <sql id="columns">
  27. DAYPLAN_ID, DAYPLAN_NO, DAYPLAN_DATE, SHIPPER_ID, DAYPLAN_DELIVERY_DATE, DAYPLAN_OWN_CARS_AMOUT,
  28. DAYPLAN_TO_THE_STATION_ID, DAYPLAN_WAGON_NUMBER, RECEIVING_UNIT_ID, DAYPLAN_CONSIGNEE_NAME,
  29. DAYPLAN_CONSIGNEE_TEL, DAYPLAN_RECEIVE_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  30. UPDATE_TIME, INSERT_UPDATE_REMARK, CARRIER_ID, DAYPLAN_SEND_STATION_ID, DELETED
  31. </sql>
  32. <sql id="columns_alias">
  33. t.DAYPLAN_ID, t.DAYPLAN_NO, t.DAYPLAN_DATE, t.SHIPPER_ID, t.DAYPLAN_DELIVERY_DATE,
  34. t.DAYPLAN_OWN_CARS_AMOUT, t.DAYPLAN_TO_THE_STATION_ID, t.DAYPLAN_WAGON_NUMBER, t.RECEIVING_UNIT_ID,
  35. t.DAYPLAN_CONSIGNEE_NAME, t.DAYPLAN_CONSIGNEE_TEL, t.DAYPLAN_RECEIVE_STATUS, t.INSERT_USERNAME,
  36. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.CARRIER_ID,
  37. t.DAYPLAN_SEND_STATION_ID, t.DELETED
  38. </sql>
  39. <sql id="select">
  40. SELECT
  41. <include refid="columns"/>
  42. FROM AMS_RAIL_OFFSET_DAYPLAN
  43. </sql>
  44. <sql id="select_alias">
  45. SELECT
  46. <include refid="columns_alias"/>
  47. FROM AMS_RAIL_OFFSET_DAYPLAN t
  48. </sql>
  49. <sql id="where">
  50. <where>
  51. <if test="dayplanId != null">
  52. and DAYPLAN_ID = #{dayplanId}
  53. </if>
  54. <if test="dayplanNo != null and dayplanNo != ''">
  55. and DAYPLAN_NO = #{dayplanNo}
  56. </if>
  57. <if test="dayplanDate != null">
  58. and TO_CHAR(DAYPLAN_DATE,'yyyy-MM-dd') = #{dayplanDate}
  59. </if>
  60. <if test="shipperId != null">
  61. and SHIPPER_ID = #{shipperId}
  62. </if>
  63. <if test="dayplanDeliveryDate != null">
  64. and TO_CHAR(DAYPLAN_DELIVERY_DATE,'yyyy-MM-dd') = #{dayplanDeliveryDate}
  65. </if>
  66. <if test="dayplanOwnCarsAmout != null">
  67. and DAYPLAN_OWN_CARS_AMOUT = #{dayplanOwnCarsAmout}
  68. </if>
  69. <if test="dayplanToTheStationId != null">
  70. and DAYPLAN_TO_THE_STATION_ID = #{dayplanToTheStationId}
  71. </if>
  72. <if test="dayplanWagonNumber != null">
  73. and DAYPLAN_WAGON_NUMBER = #{dayplanWagonNumber}
  74. </if>
  75. <if test="receivingUnitId != null">
  76. and RECEIVING_UNIT_ID = #{receivingUnitId}
  77. </if>
  78. <if test="dayplanConsigneeName != null and dayplanConsigneeName != ''">
  79. and DAYPLAN_CONSIGNEE_NAME = #{dayplanConsigneeName}
  80. </if>
  81. <if test="dayplanConsigneeTel != null and dayplanConsigneeTel != ''">
  82. and DAYPLAN_CONSIGNEE_TEL = #{dayplanConsigneeTel}
  83. </if>
  84. <if test="dayplanReceiveStatus != null">
  85. and DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus}
  86. </if>
  87. <if test="insertUsername != null and insertUsername != ''">
  88. and INSERT_USERNAME = #{insertUsername}
  89. </if>
  90. <if test="insertTime != null">
  91. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  92. </if>
  93. <if test="updateUsername != null and updateUsername != ''">
  94. and UPDATE_USERNAME = #{updateUsername}
  95. </if>
  96. <if test="updateTime != null">
  97. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  98. </if>
  99. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  100. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  101. </if>
  102. <if test="carrierId != null">
  103. and CARRIER_ID = #{carrierId}
  104. </if>
  105. <if test="dayplanSendStationId != null">
  106. and DAYPLAN_SEND_STATION_ID = #{dayplanSendStationId}
  107. </if>
  108. <if test="deleted != null">
  109. and DELETED = #{deleted}
  110. </if>
  111. </where>
  112. </sql>
  113. <sql id="whereLike">
  114. <where>
  115. <if test="dayplanId != null">
  116. and DAYPLAN_ID = #{dayplanId}
  117. </if>
  118. <if test="dayplanNo != null and dayplanNo != ''">
  119. and DAYPLAN_NO LIKE '%${dayplanNo}%'
  120. </if>
  121. <if test="dayplanDate != null">
  122. and TO_CHAR(DAYPLAN_DATE,'yyyy-MM-dd') = #{dayplanDate}
  123. </if>
  124. <if test="shipperId != null">
  125. and SHIPPER_ID = #{shipperId}
  126. </if>
  127. <if test="dayplanDeliveryDate != null">
  128. and TO_CHAR(DAYPLAN_DELIVERY_DATE,'yyyy-MM-dd') = #{dayplanDeliveryDate}
  129. </if>
  130. <if test="dayplanOwnCarsAmout != null">
  131. and DAYPLAN_OWN_CARS_AMOUT = #{dayplanOwnCarsAmout}
  132. </if>
  133. <if test="dayplanToTheStationId != null">
  134. and DAYPLAN_TO_THE_STATION_ID = #{dayplanToTheStationId}
  135. </if>
  136. <if test="dayplanWagonNumber != null">
  137. and DAYPLAN_WAGON_NUMBER = #{dayplanWagonNumber}
  138. </if>
  139. <if test="receivingUnitId != null">
  140. and RECEIVING_UNIT_ID = #{receivingUnitId}
  141. </if>
  142. <if test="dayplanConsigneeName != null and dayplanConsigneeName != ''">
  143. and DAYPLAN_CONSIGNEE_NAME LIKE '%${dayplanConsigneeName}%'
  144. </if>
  145. <if test="dayplanConsigneeTel != null and dayplanConsigneeTel != ''">
  146. and DAYPLAN_CONSIGNEE_TEL LIKE '%${dayplanConsigneeTel}%'
  147. </if>
  148. <if test="dayplanReceiveStatus != null">
  149. and DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus}
  150. </if>
  151. <if test="insertUsername != null and insertUsername != ''">
  152. and INSERT_USERNAME LIKE '%${insertUsername}%'
  153. </if>
  154. <if test="insertTime != null">
  155. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  156. </if>
  157. <if test="updateUsername != null and updateUsername != ''">
  158. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  159. </if>
  160. <if test="updateTime != null">
  161. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  162. </if>
  163. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  164. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  165. </if>
  166. <if test="carrierId != null">
  167. and CARRIER_ID = #{carrierId}
  168. </if>
  169. <if test="dayplanSendStationId != null">
  170. and DAYPLAN_SEND_STATION_ID = #{dayplanSendStationId}
  171. </if>
  172. <if test="deleted != null">
  173. and DELETED = #{deleted}
  174. </if>
  175. </where>
  176. </sql>
  177. <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
  178. delete
  179. from AMS_RAIL_OFFSET_DAYPLAN
  180. where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
  181. </delete>
  182. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  183. delete from AMS_RAIL_OFFSET_DAYPLAN
  184. where 1!=1
  185. <if test="dayplanNo != null and dayplanNo != ''">
  186. or DAYPLAN_NO = #{dayplanNo}
  187. </if>
  188. <if test="dayplanDate != null">
  189. or TO_CHAR(DAYPLAN_DATE,'yyyy-MM-dd') = '#{dayplanDate}'
  190. </if>
  191. <if test="shipperId != null">
  192. or SHIPPER_ID = #{shipperId}
  193. </if>
  194. <if test="dayplanDeliveryDate != null">
  195. or TO_CHAR(DAYPLAN_DELIVERY_DATE,'yyyy-MM-dd') = '#{dayplanDeliveryDate}'
  196. </if>
  197. <if test="dayplanOwnCarsAmout != null">
  198. or DAYPLAN_OWN_CARS_AMOUT = #{dayplanOwnCarsAmout}
  199. </if>
  200. <if test="dayplanToTheStationId != null">
  201. or DAYPLAN_TO_THE_STATION_ID = #{dayplanToTheStationId}
  202. </if>
  203. <if test="dayplanWagonNumber != null">
  204. or DAYPLAN_WAGON_NUMBER = #{dayplanWagonNumber}
  205. </if>
  206. <if test="receivingUnitId != null">
  207. or RECEIVING_UNIT_ID = #{receivingUnitId}
  208. </if>
  209. <if test="dayplanConsigneeName != null and dayplanConsigneeName != ''">
  210. or DAYPLAN_CONSIGNEE_NAME = #{dayplanConsigneeName}
  211. </if>
  212. <if test="dayplanConsigneeTel != null and dayplanConsigneeTel != ''">
  213. or DAYPLAN_CONSIGNEE_TEL = #{dayplanConsigneeTel}
  214. </if>
  215. <if test="dayplanReceiveStatus != null">
  216. or DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus}
  217. </if>
  218. <if test="insertUsername != null and insertUsername != ''">
  219. or INSERT_USERNAME = #{insertUsername}
  220. </if>
  221. <if test="insertTime != null">
  222. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  223. </if>
  224. <if test="updateUsername != null and updateUsername != ''">
  225. or UPDATE_USERNAME = #{updateUsername}
  226. </if>
  227. <if test="updateTime != null">
  228. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  229. </if>
  230. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  231. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  232. </if>
  233. <if test="carrierId != null">
  234. or CARRIER_ID = #{carrierId}
  235. </if>
  236. <if test="dayplanSendStationId != null">
  237. or DAYPLAN_SEND_STATION_ID = #{dayplanSendStationId}
  238. </if>
  239. <if test="deleted != null">
  240. or DELETED = #{deleted}
  241. </if>
  242. </delete>
  243. <insert id="insert" parameterType="com.steerinfo.dil.model.AmsRailOffsetDayplan">
  244. insert into AMS_RAIL_OFFSET_DAYPLAN (DAYPLAN_ID, DAYPLAN_NO, DAYPLAN_DATE,
  245. SHIPPER_ID, DAYPLAN_DELIVERY_DATE, DAYPLAN_OWN_CARS_AMOUT,
  246. DAYPLAN_TO_THE_STATION_ID, DAYPLAN_WAGON_NUMBER,
  247. RECEIVING_UNIT_ID, DAYPLAN_CONSIGNEE_NAME,
  248. DAYPLAN_CONSIGNEE_TEL, DAYPLAN_RECEIVE_STATUS,
  249. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  250. UPDATE_TIME, INSERT_UPDATE_REMARK, CARRIER_ID,
  251. DAYPLAN_SEND_STATION_ID, DELETED)
  252. values (#{dayplanId,jdbcType=DECIMAL}, #{dayplanNo,jdbcType=VARCHAR}, #{dayplanDate,jdbcType=TIMESTAMP},
  253. #{shipperId,jdbcType=DECIMAL}, #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
  254. #{dayplanOwnCarsAmout,jdbcType=DECIMAL},
  255. #{dayplanToTheStationId,jdbcType=DECIMAL}, #{dayplanWagonNumber,jdbcType=DECIMAL},
  256. #{receivingUnitId,jdbcType=DECIMAL}, #{dayplanConsigneeName,jdbcType=VARCHAR},
  257. #{dayplanConsigneeTel,jdbcType=VARCHAR}, #{dayplanReceiveStatus,jdbcType=DECIMAL},
  258. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  259. #{updateUsername,jdbcType=VARCHAR},
  260. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{carrierId,jdbcType=DECIMAL},
  261. #{dayplanSendStationId,jdbcType=DECIMAL}, #{deleted,jdbcType=DECIMAL})
  262. </insert>
  263. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsRailOffsetDayplan">
  264. insert into AMS_RAIL_OFFSET_DAYPLAN
  265. <trim prefix="(" suffix=")" suffixOverrides=",">
  266. <if test="dayplanId != null">
  267. DAYPLAN_ID,
  268. </if>
  269. <if test="dayplanNo != null">
  270. DAYPLAN_NO,
  271. </if>
  272. <if test="dayplanDate != null">
  273. DAYPLAN_DATE,
  274. </if>
  275. <if test="shipperId != null">
  276. SHIPPER_ID,
  277. </if>
  278. <if test="dayplanDeliveryDate != null">
  279. DAYPLAN_DELIVERY_DATE,
  280. </if>
  281. <if test="dayplanOwnCarsAmout != null">
  282. DAYPLAN_OWN_CARS_AMOUT,
  283. </if>
  284. <if test="dayplanToTheStationId != null">
  285. DAYPLAN_TO_THE_STATION_ID,
  286. </if>
  287. <if test="dayplanWagonNumber != null">
  288. DAYPLAN_WAGON_NUMBER,
  289. </if>
  290. <if test="receivingUnitId != null">
  291. RECEIVING_UNIT_ID,
  292. </if>
  293. <if test="dayplanConsigneeName != null">
  294. DAYPLAN_CONSIGNEE_NAME,
  295. </if>
  296. <if test="dayplanConsigneeTel != null">
  297. DAYPLAN_CONSIGNEE_TEL,
  298. </if>
  299. <if test="dayplanReceiveStatus != null">
  300. DAYPLAN_RECEIVE_STATUS,
  301. </if>
  302. <if test="insertUsername != null">
  303. INSERT_USERNAME,
  304. </if>
  305. <if test="insertTime != null">
  306. INSERT_TIME,
  307. </if>
  308. <if test="updateUsername != null">
  309. UPDATE_USERNAME,
  310. </if>
  311. <if test="updateTime != null">
  312. UPDATE_TIME,
  313. </if>
  314. <if test="insertUpdateRemark != null">
  315. INSERT_UPDATE_REMARK,
  316. </if>
  317. <if test="carrierId != null">
  318. CARRIER_ID,
  319. </if>
  320. <if test="dayplanSendStationId != null">
  321. DAYPLAN_SEND_STATION_ID,
  322. </if>
  323. <if test="deleted != null">
  324. DELETED,
  325. </if>
  326. </trim>
  327. <trim prefix="values (" suffix=")" suffixOverrides=",">
  328. <if test="dayplanId != null">
  329. #{dayplanId,jdbcType=DECIMAL},
  330. </if>
  331. <if test="dayplanNo != null">
  332. #{dayplanNo,jdbcType=VARCHAR},
  333. </if>
  334. <if test="dayplanDate != null">
  335. #{dayplanDate,jdbcType=TIMESTAMP},
  336. </if>
  337. <if test="shipperId != null">
  338. #{shipperId,jdbcType=DECIMAL},
  339. </if>
  340. <if test="dayplanDeliveryDate != null">
  341. #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
  342. </if>
  343. <if test="dayplanOwnCarsAmout != null">
  344. #{dayplanOwnCarsAmout,jdbcType=DECIMAL},
  345. </if>
  346. <if test="dayplanToTheStationId != null">
  347. #{dayplanToTheStationId,jdbcType=DECIMAL},
  348. </if>
  349. <if test="dayplanWagonNumber != null">
  350. #{dayplanWagonNumber,jdbcType=DECIMAL},
  351. </if>
  352. <if test="receivingUnitId != null">
  353. #{receivingUnitId,jdbcType=DECIMAL},
  354. </if>
  355. <if test="dayplanConsigneeName != null">
  356. #{dayplanConsigneeName,jdbcType=VARCHAR},
  357. </if>
  358. <if test="dayplanConsigneeTel != null">
  359. #{dayplanConsigneeTel,jdbcType=VARCHAR},
  360. </if>
  361. <if test="dayplanReceiveStatus != null">
  362. #{dayplanReceiveStatus,jdbcType=DECIMAL},
  363. </if>
  364. <if test="insertUsername != null">
  365. #{insertUsername,jdbcType=VARCHAR},
  366. </if>
  367. <if test="insertTime != null">
  368. #{insertTime,jdbcType=TIMESTAMP},
  369. </if>
  370. <if test="updateUsername != null">
  371. #{updateUsername,jdbcType=VARCHAR},
  372. </if>
  373. <if test="updateTime != null">
  374. #{updateTime,jdbcType=TIMESTAMP},
  375. </if>
  376. <if test="insertUpdateRemark != null">
  377. #{insertUpdateRemark,jdbcType=VARCHAR},
  378. </if>
  379. <if test="carrierId != null">
  380. #{carrierId,jdbcType=DECIMAL},
  381. </if>
  382. <if test="dayplanSendStationId != null">
  383. #{dayplanSendStationId,jdbcType=DECIMAL},
  384. </if>
  385. <if test="deleted != null">
  386. #{deleted,jdbcType=DECIMAL},
  387. </if>
  388. </trim>
  389. </insert>
  390. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsRailOffsetDayplan">
  391. update AMS_RAIL_OFFSET_DAYPLAN
  392. set DAYPLAN_NO = #{dayplanNo,jdbcType=VARCHAR},
  393. DAYPLAN_DATE = #{dayplanDate,jdbcType=TIMESTAMP},
  394. SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
  395. DAYPLAN_DELIVERY_DATE = #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
  396. DAYPLAN_OWN_CARS_AMOUT = #{dayplanOwnCarsAmout,jdbcType=DECIMAL},
  397. DAYPLAN_TO_THE_STATION_ID = #{dayplanToTheStationId,jdbcType=DECIMAL},
  398. DAYPLAN_WAGON_NUMBER = #{dayplanWagonNumber,jdbcType=DECIMAL},
  399. RECEIVING_UNIT_ID = #{receivingUnitId,jdbcType=DECIMAL},
  400. DAYPLAN_CONSIGNEE_NAME = #{dayplanConsigneeName,jdbcType=VARCHAR},
  401. DAYPLAN_CONSIGNEE_TEL = #{dayplanConsigneeTel,jdbcType=VARCHAR},
  402. DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus,jdbcType=DECIMAL},
  403. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  404. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  405. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  406. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  407. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  408. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  409. DAYPLAN_SEND_STATION_ID = #{dayplanSendStationId,jdbcType=DECIMAL},
  410. DELETED = #{deleted,jdbcType=DECIMAL}
  411. where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
  412. </update>
  413. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsRailOffsetDayplan">
  414. update AMS_RAIL_OFFSET_DAYPLAN
  415. <set>
  416. <if test="dayplanNo != null">
  417. DAYPLAN_NO = #{dayplanNo,jdbcType=VARCHAR},
  418. </if>
  419. <if test="dayplanDate != null">
  420. DAYPLAN_DATE = #{dayplanDate,jdbcType=TIMESTAMP},
  421. </if>
  422. <if test="shipperId != null">
  423. SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
  424. </if>
  425. <if test="dayplanDeliveryDate != null">
  426. DAYPLAN_DELIVERY_DATE = #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
  427. </if>
  428. <if test="dayplanOwnCarsAmout != null">
  429. DAYPLAN_OWN_CARS_AMOUT = #{dayplanOwnCarsAmout,jdbcType=DECIMAL},
  430. </if>
  431. <if test="dayplanToTheStationId != null">
  432. DAYPLAN_TO_THE_STATION_ID = #{dayplanToTheStationId,jdbcType=DECIMAL},
  433. </if>
  434. <if test="dayplanWagonNumber != null">
  435. DAYPLAN_WAGON_NUMBER = #{dayplanWagonNumber,jdbcType=DECIMAL},
  436. </if>
  437. <if test="receivingUnitId != null">
  438. RECEIVING_UNIT_ID = #{receivingUnitId,jdbcType=DECIMAL},
  439. </if>
  440. <if test="dayplanConsigneeName != null">
  441. DAYPLAN_CONSIGNEE_NAME = #{dayplanConsigneeName,jdbcType=VARCHAR},
  442. </if>
  443. <if test="dayplanConsigneeTel != null">
  444. DAYPLAN_CONSIGNEE_TEL = #{dayplanConsigneeTel,jdbcType=VARCHAR},
  445. </if>
  446. <if test="dayplanReceiveStatus != null">
  447. DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus,jdbcType=DECIMAL},
  448. </if>
  449. <if test="insertUsername != null">
  450. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  451. </if>
  452. <if test="insertTime != null">
  453. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  454. </if>
  455. <if test="updateUsername != null">
  456. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  457. </if>
  458. <if test="updateTime != null">
  459. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  460. </if>
  461. <if test="insertUpdateRemark != null">
  462. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  463. </if>
  464. <if test="carrierId != null">
  465. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  466. </if>
  467. <if test="dayplanSendStationId != null">
  468. DAYPLAN_SEND_STATION_ID = #{dayplanSendStationId,jdbcType=DECIMAL},
  469. </if>
  470. <if test="deleted != null">
  471. DELETED = #{deleted,jdbcType=DECIMAL},
  472. </if>
  473. </set>
  474. where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
  475. </update>
  476. <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
  477. <include refid="select"/>
  478. where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
  479. </select>
  480. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  481. <include refid="select"/>
  482. <include refid="where"/>
  483. </select>
  484. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  485. <include refid="select"/>
  486. <include refid="whereLike"/>
  487. </select>
  488. <insert id="batchInsert" parameterType="java.util.List">
  489. insert into AMS_RAIL_OFFSET_DAYPLAN
  490. (DAYPLAN_ID,
  491. DAYPLAN_NO, DAYPLAN_DATE, SHIPPER_ID,
  492. DAYPLAN_DELIVERY_DATE, DAYPLAN_OWN_CARS_AMOUT,
  493. DAYPLAN_TO_THE_STATION_ID, DAYPLAN_WAGON_NUMBER,
  494. RECEIVING_UNIT_ID, DAYPLAN_CONSIGNEE_NAME,
  495. DAYPLAN_CONSIGNEE_TEL, DAYPLAN_RECEIVE_STATUS,
  496. INSERT_USERNAME, INSERT_TIME,
  497. UPDATE_USERNAME, UPDATE_TIME,
  498. INSERT_UPDATE_REMARK, CARRIER_ID,
  499. DAYPLAN_SEND_STATION_ID, DELETED
  500. )
  501. ( <foreach collection="list" item="item" separator="union all">
  502. select
  503. #{item.dayplanId,jdbcType=DECIMAL},
  504. #{item.dayplanNo,jdbcType=VARCHAR}, #{item.dayplanDate,jdbcType=TIMESTAMP}, #{item.shipperId,jdbcType=DECIMAL},
  505. #{item.dayplanDeliveryDate,jdbcType=TIMESTAMP}, #{item.dayplanOwnCarsAmout,jdbcType=DECIMAL},
  506. #{item.dayplanToTheStationId,jdbcType=DECIMAL}, #{item.dayplanWagonNumber,jdbcType=DECIMAL},
  507. #{item.receivingUnitId,jdbcType=DECIMAL}, #{item.dayplanConsigneeName,jdbcType=VARCHAR},
  508. #{item.dayplanConsigneeTel,jdbcType=VARCHAR}, #{item.dayplanReceiveStatus,jdbcType=DECIMAL},
  509. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  510. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  511. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.carrierId,jdbcType=DECIMAL},
  512. #{item.dayplanSendStationId,jdbcType=DECIMAL}, #{item.deleted,jdbcType=DECIMAL}
  513. from dual
  514. </foreach> )
  515. </insert>
  516. <update id="batchUpdate" parameterType="java.util.List">
  517. update AMS_RAIL_OFFSET_DAYPLAN
  518. set
  519. DAYPLAN_ID=
  520. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  521. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanId,jdbcType=DECIMAL}
  522. </foreach>
  523. ,DAYPLAN_NO=
  524. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  525. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanNo,jdbcType=VARCHAR}
  526. </foreach>
  527. ,DAYPLAN_DATE=
  528. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  529. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanDate,jdbcType=TIMESTAMP}
  530. </foreach>
  531. ,SHIPPER_ID=
  532. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  533. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
  534. </foreach>
  535. ,DAYPLAN_DELIVERY_DATE=
  536. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  537. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanDeliveryDate,jdbcType=TIMESTAMP}
  538. </foreach>
  539. ,DAYPLAN_OWN_CARS_AMOUT=
  540. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  541. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanOwnCarsAmout,jdbcType=DECIMAL}
  542. </foreach>
  543. ,DAYPLAN_TO_THE_STATION_ID=
  544. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  545. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanToTheStationId,jdbcType=DECIMAL}
  546. </foreach>
  547. ,DAYPLAN_WAGON_NUMBER=
  548. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  549. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanWagonNumber,jdbcType=DECIMAL}
  550. </foreach>
  551. ,RECEIVING_UNIT_ID=
  552. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  553. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.receivingUnitId,jdbcType=DECIMAL}
  554. </foreach>
  555. ,DAYPLAN_CONSIGNEE_NAME=
  556. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  557. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanConsigneeName,jdbcType=VARCHAR}
  558. </foreach>
  559. ,DAYPLAN_CONSIGNEE_TEL=
  560. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  561. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanConsigneeTel,jdbcType=VARCHAR}
  562. </foreach>
  563. ,DAYPLAN_RECEIVE_STATUS=
  564. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  565. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanReceiveStatus,jdbcType=DECIMAL}
  566. </foreach>
  567. ,INSERT_USERNAME=
  568. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  569. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  570. </foreach>
  571. ,INSERT_TIME=
  572. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  573. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  574. </foreach>
  575. ,UPDATE_USERNAME=
  576. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  577. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  578. </foreach>
  579. ,UPDATE_TIME=
  580. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  581. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  582. </foreach>
  583. ,INSERT_UPDATE_REMARK=
  584. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  585. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  586. </foreach>
  587. ,CARRIER_ID=
  588. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  589. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
  590. </foreach>
  591. ,DAYPLAN_SEND_STATION_ID=
  592. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  593. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanSendStationId,jdbcType=DECIMAL}
  594. </foreach>
  595. ,DELETED=
  596. <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
  597. when #{item.dayplanId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  598. </foreach>
  599. where DAYPLAN_ID in
  600. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  601. #{item.dayplanId,jdbcType=DECIMAL}
  602. </foreach>
  603. </update>
  604. <delete id="batchDelete" parameterType="java.util.List">
  605. delete from AMS_RAIL_OFFSET_DAYPLAN
  606. where DAYPLAN_ID in
  607. <foreach collection="list" item="id" open="(" close=")" separator=",">
  608. #{id}
  609. </foreach>
  610. </delete>
  611. <!-- 友情提示!!!-->
  612. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  613. <!-- 展示钢材发往异地库日计划 -->
  614. <select id="getRailOffsetDayplan" parameterType="java.util.Map" resultType="java.util.Map">
  615. SELECT *
  616. FROM (SELECT AROD.DAYPLAN_ID AS "dayPlanId",
  617. AROD.DAYPLAN_NO AS "dayplanNo",
  618. to_char(AROD.DAYPLAN_DATE, 'yyyy-mm-dd') AS "dayplanDate",
  619. RS.SHIPPER_NAME AS "shipperName",
  620. to_char(AROD.DAYPLAN_DELIVERY_DATE, 'yyyy-mm-dd') AS "dayplanDeliveryDate",
  621. RAS.TRANSFER_UNIT AS "transferUnit",
  622. AROD.DAYPLAN_OWN_CARS_AMOUT AS "dayplanOwnCarsAmout",
  623. AROD.DAYPLAN_WAGON_NUMBER AS "dayplanWagonNumber",
  624. RAS.ARRIVAL_NAME AS "arrivalName",
  625. RAS.DAYPLAN_DEDICATED_LINE AS "dayplanDedicatedLine",
  626. RW.WAREHOUSE_NAME AS "wareHouseName",
  627. AROD.DAYPLAN_CONSIGNEE_NAME AS "dayplanConsigneeName",
  628. AROD.DAYPLAN_CONSIGNEE_TEL AS "dayplanConsigneeTel",
  629. AROD.INSERT_TIME AS "insertTime"
  630. FROM AMS_RAIL_OFFSET_DAYPLAN AROD
  631. LEFT JOIN RMS_SHIPPER RS
  632. ON AROD.SHIPPER_ID = RS.SHIPPER_ID
  633. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
  634. ON AROD.DAYPLAN_TO_THE_STATION_ID = RAS.ARRIVAL_ID
  635. LEFT JOIN RMS_WAREHOUSE RW
  636. ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
  637. WHERE AROD.DELETED = 0
  638. <if test="dayplanReceiveStatus != null">
  639. AND AROD.DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus}
  640. </if>
  641. <if test="carrierId != null">
  642. AND AROD.CARRIER_ID = #{carrierId}
  643. </if>
  644. )
  645. <where>
  646. <if test="dayplanNo != null">
  647. and
  648. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  649. "dayplanNo" like '%${item}%'
  650. </foreach>
  651. </if>
  652. <if test="dayplanDate != null">
  653. and
  654. <foreach collection="dayplanDate" item="item" open="(" separator="or" close=")">
  655. "dayplanDate" like '%${item}%'
  656. </foreach>
  657. </if>
  658. <if test="shipperName != null">
  659. and
  660. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  661. "shipperName" like '%${item}%'
  662. </foreach>
  663. </if>
  664. <if test="dayplanDeliveryDate != null">
  665. and
  666. <foreach collection="dayplanDeliveryDate" item="item" open="(" separator="or" close=")">
  667. "dayplanDeliveryDate" like '%${item}%'
  668. </foreach>
  669. </if>
  670. <if test="transferUnit != null">
  671. and
  672. <foreach collection="transferUnit" item="item" open="(" separator="or" close=")">
  673. "transferUnit" like '%${item}%'
  674. </foreach>
  675. </if>
  676. <if test="dayplanOwnCarsAmout != null">
  677. and
  678. <foreach collection="dayplanOwnCarsAmout" item="item" open="(" separator="or" close=")">
  679. "dayplanOwnCarsAmout" like '%${item}%'
  680. </foreach>
  681. </if>
  682. <if test="dayplanWagonNumber != null">
  683. and
  684. <foreach collection="dayplanWagonNumber" item="item" open="(" separator="or" close=")">
  685. "dayplanWagonNumber" like '%${item}%'
  686. </foreach>
  687. </if>
  688. <if test="arrivalName != null">
  689. and
  690. <foreach collection="arrivalName" item="item" open="(" separator="or" close=")">
  691. "arrivalName" like '%${item}%'
  692. </foreach>
  693. </if>
  694. <if test="dayplanDedicatedLine != null">
  695. and
  696. <foreach collection="dayplanDedicatedLine" item="item" open="(" separator="or" close=")">
  697. "dayplanDedicatedLine" like '%${item}%'
  698. </foreach>
  699. </if>
  700. <if test="wareHouseName != null">
  701. and
  702. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  703. "wareHouseName" like '%${item}%'
  704. </foreach>
  705. </if>
  706. <if test="dayplanConsigneeName != null">
  707. and
  708. <foreach collection="dayplanConsigneeName" item="item" open="(" separator="or" close=")">
  709. "dayplanConsigneeName" like '%${item}%'
  710. </foreach>
  711. </if>
  712. <if test="dayplanConsigneeTel != null">
  713. and
  714. <foreach collection="dayplanConsigneeTel" item="item" open="(" separator="or" close=")">
  715. "dayplanConsigneeTel" like '%${item}%'
  716. </foreach>
  717. </if>
  718. </where>
  719. <include refid="orderBy"></include>
  720. </select>
  721. <sql id="orderBy">
  722. <if test="orderField != null and orderField != ''">
  723. order by "${orderField}"
  724. <if test="orderType != null and orderType != ''">
  725. ${orderType}
  726. </if>
  727. </if>
  728. <if test="orderField == null ">
  729. order by "insertTime" desc
  730. </if>
  731. </sql>
  732. <!-- 通过主键Id查询发运钢材到异地库计划数据用于修改 -->
  733. <select id="getRailOffseDayMes" parameterType="int" resultType="java.util.Map">
  734. select AROD.DAYPLAN_NO "dayplanNo",
  735. AROD.CARRIER_ID "carrierId",
  736. AROD.SHIPPER_ID "shipperId",
  737. AROD.DAYPLAN_DATE "dayplanDate",
  738. AROD.DAYPLAN_DELIVERY_DATE "dayplanDeliveryDate",
  739. AROD.DAYPLAN_OWN_CARS_AMOUT "dayplanOwnCarsAmout",
  740. AROD.DAYPLAN_TO_THE_STATION_ID "dayplanToTheStationId",
  741. AROD.DAYPLAN_WAGON_NUMBER "dayplanWagonNumber",
  742. AROD.RECEIVING_UNIT_ID "receivingUnitId",
  743. AROD.DAYPLAN_CONSIGNEE_NAME "dayplanConsigneeName",
  744. AROD.DAYPLAN_CONSIGNEE_TEL "dayplanConsigneeTel"
  745. from AMS_RAIL_OFFSET_DAYPLAN AROD
  746. where AROD.DAYPLAN_ID = #{dayplanId}
  747. </select>
  748. <!-- 通过发运计划主键查询关联所有物资信息 -->
  749. <select id="getMaterialMesByDayPlanId" parameterType="java.util.Map" resultType="java.util.Map">
  750. SELECT *
  751. FROM (SELECT
  752. rm.material_id as "materialId",
  753. rm.material_code as "materialCode",
  754. rm.material_specification as "materialSpecification",
  755. rm.material_model as "materialMode",
  756. RM.MATERIAL_NAME AS "materailName",
  757. AROM.OFFSET_MATERIAL_NUMBER AS "materialNumber",
  758. AROM.OFFSET_MATERIAL_WEIGHT AS "materialWeight"
  759. FROM AMS_RAIL_OFFSET_MATERIAL AROM
  760. LEFT JOIN RMS_MATERIAL RM
  761. ON AROM.MATERIAL_ID = RM.MATERIAL_ID
  762. WHERE arom.dayplan_id = #{dayplanId})
  763. <where>
  764. <if test="materailName != null">
  765. and
  766. <foreach collection="materailName" item="item" open="(" separator="or" close=")">
  767. "materailName" like '%${item}%'
  768. </foreach>
  769. </if>
  770. <if test="materialNumber != null">
  771. and
  772. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  773. "materialNumber" like '%${item}%'
  774. </foreach>
  775. </if>
  776. <if test="materialWeight != null">
  777. and
  778. <foreach collection="materialWeight" item="item" open="(" separator="or" close=")">
  779. "materialWeight" like '%${item}%'
  780. </foreach>
  781. </if>
  782. </where>
  783. </select>
  784. <!-- 到站下拉 -->
  785. <select id="getdayPlanToTheStationId" resultType="java.util.Map">
  786. SELECT RAS.ARRIVAL_ID AS "id",
  787. RAS.ARRIVAL_ID AS "value",
  788. RAS.ARRIVAL_NAME AS "label"
  789. FROM RMSTRAIN_ARRIVAL_SEND RAS
  790. </select>
  791. <select id="getRailOffsetDayplanId" resultType="java.util.Map">
  792. SELECT *
  793. FROM (SELECT AROD.DAYPLAN_ID AS "dayPlanId",
  794. AROD.DAYPLAN_NO AS "dayplanNo",
  795. AROD.DAYPLAN_DATE AS "dayplanDate",
  796. RS.SHIPPER_NAME AS "shipperName",
  797. AROD.DAYPLAN_DELIVERY_DATE AS "dayplanDeliveryDate",
  798. RAS.TRANSFER_UNIT AS "transferUnit",
  799. AROD.DAYPLAN_OWN_CARS_AMOUT AS "dayplanOwnCarsAmout",
  800. AROD.DAYPLAN_WAGON_NUMBER AS "dayplanWagonNumber",
  801. RAS.ARRIVAL_NAME AS "arrivalName",
  802. RAS.DAYPLAN_DEDICATED_LINE AS "dayplanDedicatedLine",
  803. RW.WAREHOUSE_NAME AS "wareHouseName",
  804. AROD.DAYPLAN_CONSIGNEE_NAME AS "dayplanConsigneeName",
  805. AROD.DAYPLAN_CONSIGNEE_TEL AS "dayplanConsigneeTel",
  806. AROD.INSERT_TIME AS "insertTime"
  807. FROM AMS_RAIL_OFFSET_DAYPLAN AROD
  808. LEFT JOIN RMS_SHIPPER RS
  809. ON AROD.SHIPPER_ID = RS.SHIPPER_ID
  810. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
  811. ON AROD.DAYPLAN_TO_THE_STATION_ID = RAS.ARRIVAL_ID
  812. LEFT JOIN RMS_WAREHOUSE RW
  813. ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
  814. WHERE AROD.DELETED = 0
  815. and
  816. arod.dayplan_id=#{dayPlanId}
  817. )
  818. <where>
  819. <if test="dayplanNo != null">
  820. and
  821. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  822. "dayplanNo" like '%${item}%'
  823. </foreach>
  824. </if>
  825. <if test="dayplanDate != null">
  826. and
  827. <foreach collection="dayplanDate" item="item" open="(" separator="or" close=")">
  828. "dayplanDate" like '%${item}%'
  829. </foreach>
  830. </if>
  831. <if test="shipperName != null">
  832. and
  833. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  834. "shipperName" like '%${item}%'
  835. </foreach>
  836. </if>
  837. <if test="dayplanDeliveryDate != null">
  838. and
  839. <foreach collection="dayplanDeliveryDate" item="item" open="(" separator="or" close=")">
  840. "dayplanDeliveryDate" like '%${item}%'
  841. </foreach>
  842. </if>
  843. <if test="transferUnit != null">
  844. and
  845. <foreach collection="transferUnit" item="item" open="(" separator="or" close=")">
  846. "transferUnit" like '%${item}%'
  847. </foreach>
  848. </if>
  849. <if test="dayplanOwnCarsAmout != null">
  850. and
  851. <foreach collection="dayplanOwnCarsAmout" item="item" open="(" separator="or" close=")">
  852. "dayplanOwnCarsAmout" like '%${item}%'
  853. </foreach>
  854. </if>
  855. <if test="dayplanWagonNumber != null">
  856. and
  857. <foreach collection="dayplanWagonNumber" item="item" open="(" separator="or" close=")">
  858. "dayplanWagonNumber" like '%${item}%'
  859. </foreach>
  860. </if>
  861. <if test="arrivalName != null">
  862. and
  863. <foreach collection="arrivalName" item="item" open="(" separator="or" close=")">
  864. "arrivalName" like '%${item}%'
  865. </foreach>
  866. </if>
  867. <if test="dayplanDedicatedLine != null">
  868. and
  869. <foreach collection="dayplanDedicatedLine" item="item" open="(" separator="or" close=")">
  870. "dayplanDedicatedLine" like '%${item}%'
  871. </foreach>
  872. </if>
  873. <if test="wareHouseName != null">
  874. and
  875. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  876. "wareHouseName" like '%${item}%'
  877. </foreach>
  878. </if>
  879. <if test="dayplanConsigneeName != null">
  880. and
  881. <foreach collection="dayplanConsigneeName" item="item" open="(" separator="or" close=")">
  882. "dayplanConsigneeName" like '%${item}%'
  883. </foreach>
  884. </if>
  885. <if test="dayplanConsigneeTel != null">
  886. and
  887. <foreach collection="dayplanConsigneeTel" item="item" open="(" separator="or" close=")">
  888. "dayplanConsigneeTel" like '%${item}%'
  889. </foreach>
  890. </if>
  891. </where>
  892. <include refid="orderBy"></include>
  893. </select>
  894. </mapper>