AmstruckInwardPlanMapper.xml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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.AmstruckInwardPlanMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmstruckInwardPlan">
  5. <id column="PLAN_ID" jdbcType="DECIMAL" property="planId"/>
  6. <result column="PLAN_NUMBER" jdbcType="VARCHAR" property="planNumber"/>
  7. <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId"/>
  8. <result column="PLAN_TRUCK_NUMBER" jdbcType="DECIMAL" property="planTruckNumber"/>
  9. <result column="PLAN_STATUS" jdbcType="DECIMAL" property="planStatus"/>
  10. <result column="PLAN_ISSUE_TIME" jdbcType="TIMESTAMP" property="planIssueTime"/>
  11. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
  12. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
  13. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
  14. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
  15. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
  16. <result column="DELETED" jdbcType="DECIMAL" property="deleted"/>
  17. <result column="PLAN_ISSUE_NAME" jdbcType="VARCHAR" property="planIssueName"/>
  18. </resultMap>
  19. <sql id="columns">
  20. PLAN_ID, PLAN_NUMBER, CARRIER_ID, PLAN_TRUCK_NUMBER, PLAN_STATUS, PLAN_ISSUE_TIME,
  21. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  22. DELETED, PLAN_ISSUE_NAME
  23. </sql>
  24. <sql id="columns_alias">
  25. t.PLAN_ID, t.PLAN_NUMBER, t.CARRIER_ID, t.PLAN_TRUCK_NUMBER, t.PLAN_STATUS, t.PLAN_ISSUE_TIME,
  26. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  27. t.DELETED, t.PLAN_ISSUE_NAME
  28. </sql>
  29. <sql id="select">
  30. SELECT
  31. <include refid="columns"/>
  32. FROM AMSTRUCK_INWARD_PLAN
  33. </sql>
  34. <sql id="select_alias">
  35. SELECT
  36. <include refid="columns_alias"/>
  37. FROM AMSTRUCK_INWARD_PLAN t
  38. </sql>
  39. <sql id="where">
  40. <where>
  41. <if test="planId != null">
  42. and PLAN_ID = #{planId}
  43. </if>
  44. <if test="planNumber != null and planNumber != ''">
  45. and PLAN_NUMBER = #{planNumber}
  46. </if>
  47. <if test="carrierId != null">
  48. and CARRIER_ID = #{carrierId}
  49. </if>
  50. <if test="planTruckNumber != null">
  51. and PLAN_TRUCK_NUMBER = #{planTruckNumber}
  52. </if>
  53. <if test="planStatus != null">
  54. and PLAN_STATUS = #{planStatus}
  55. </if>
  56. <if test="planIssueTime != null">
  57. and TO_CHAR(PLAN_ISSUE_TIME,'yyyy-MM-dd') = #{planIssueTime}
  58. </if>
  59. <if test="insertUsername != null and insertUsername != ''">
  60. and INSERT_USERNAME = #{insertUsername}
  61. </if>
  62. <if test="insertTime != null">
  63. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  64. </if>
  65. <if test="updateUsername != null and updateUsername != ''">
  66. and UPDATE_USERNAME = #{updateUsername}
  67. </if>
  68. <if test="updateTime != null">
  69. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  70. </if>
  71. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  72. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  73. </if>
  74. <if test="deleted != null">
  75. and DELETED = #{deleted}
  76. </if>
  77. <if test="planIssueName != null and planIssueName != ''">
  78. and PLAN_ISSUE_NAME = #{planIssueName}
  79. </if>
  80. </where>
  81. </sql>
  82. <sql id="whereLike">
  83. <where>
  84. <if test="planId != null">
  85. and PLAN_ID = #{planId}
  86. </if>
  87. <if test="planNumber != null and planNumber != ''">
  88. and PLAN_NUMBER LIKE '%${planNumber}%'
  89. </if>
  90. <if test="carrierId != null">
  91. and CARRIER_ID = #{carrierId}
  92. </if>
  93. <if test="planTruckNumber != null">
  94. and PLAN_TRUCK_NUMBER = #{planTruckNumber}
  95. </if>
  96. <if test="planStatus != null">
  97. and PLAN_STATUS = #{planStatus}
  98. </if>
  99. <if test="planIssueTime != null">
  100. and TO_CHAR(PLAN_ISSUE_TIME,'yyyy-MM-dd') = #{planIssueTime}
  101. </if>
  102. <if test="insertUsername != null and insertUsername != ''">
  103. and INSERT_USERNAME LIKE '%${insertUsername}%'
  104. </if>
  105. <if test="insertTime != null">
  106. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  107. </if>
  108. <if test="updateUsername != null and updateUsername != ''">
  109. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  110. </if>
  111. <if test="updateTime != null">
  112. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  113. </if>
  114. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  115. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  116. </if>
  117. <if test="deleted != null">
  118. and DELETED = #{deleted}
  119. </if>
  120. <if test="planIssueName != null and planIssueName != ''">
  121. and PLAN_ISSUE_NAME LIKE '%${planIssueName}%'
  122. </if>
  123. </where>
  124. </sql>
  125. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  126. delete
  127. from AMSTRUCK_INWARD_PLAN
  128. where PLAN_ID = #{planId,jdbcType=DECIMAL}
  129. </delete>
  130. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  131. delete from AMSTRUCK_INWARD_PLAN
  132. where 1!=1
  133. <if test="planNumber != null and planNumber != ''">
  134. or PLAN_NUMBER = #{planNumber}
  135. </if>
  136. <if test="carrierId != null">
  137. or CARRIER_ID = #{carrierId}
  138. </if>
  139. <if test="planTruckNumber != null">
  140. or PLAN_TRUCK_NUMBER = #{planTruckNumber}
  141. </if>
  142. <if test="planStatus != null">
  143. or PLAN_STATUS = #{planStatus}
  144. </if>
  145. <if test="planIssueTime != null">
  146. or TO_CHAR(PLAN_ISSUE_TIME,'yyyy-MM-dd') = '#{planIssueTime}'
  147. </if>
  148. <if test="insertUsername != null and insertUsername != ''">
  149. or INSERT_USERNAME = #{insertUsername}
  150. </if>
  151. <if test="insertTime != null">
  152. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  153. </if>
  154. <if test="updateUsername != null and updateUsername != ''">
  155. or UPDATE_USERNAME = #{updateUsername}
  156. </if>
  157. <if test="updateTime != null">
  158. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  159. </if>
  160. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  161. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  162. </if>
  163. <if test="deleted != null">
  164. or DELETED = #{deleted}
  165. </if>
  166. <if test="planIssueName != null and planIssueName != ''">
  167. or PLAN_ISSUE_NAME = #{planIssueName}
  168. </if>
  169. </delete>
  170. <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
  171. insert into AMSTRUCK_INWARD_PLAN (PLAN_ID, PLAN_NUMBER, CARRIER_ID,
  172. PLAN_TRUCK_NUMBER, PLAN_STATUS, PLAN_ISSUE_TIME,
  173. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  174. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
  175. PLAN_ISSUE_NAME)
  176. values (#{planId,jdbcType=DECIMAL}, #{planNumber,jdbcType=VARCHAR}, #{carrierId,jdbcType=DECIMAL},
  177. #{planTruckNumber,jdbcType=DECIMAL}, #{planStatus,jdbcType=DECIMAL},
  178. #{planIssueTime,jdbcType=TIMESTAMP},
  179. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  180. #{updateUsername,jdbcType=VARCHAR},
  181. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  182. #{planIssueName,jdbcType=VARCHAR})
  183. </insert>
  184. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
  185. insert into AMSTRUCK_INWARD_PLAN
  186. <trim prefix="(" suffix=")" suffixOverrides=",">
  187. <if test="planId != null">
  188. PLAN_ID,
  189. </if>
  190. <if test="planNumber != null">
  191. PLAN_NUMBER,
  192. </if>
  193. <if test="carrierId != null">
  194. CARRIER_ID,
  195. </if>
  196. <if test="planTruckNumber != null">
  197. PLAN_TRUCK_NUMBER,
  198. </if>
  199. <if test="planStatus != null">
  200. PLAN_STATUS,
  201. </if>
  202. <if test="planIssueTime != null">
  203. PLAN_ISSUE_TIME,
  204. </if>
  205. <if test="insertUsername != null">
  206. INSERT_USERNAME,
  207. </if>
  208. <if test="insertTime != null">
  209. INSERT_TIME,
  210. </if>
  211. <if test="updateUsername != null">
  212. UPDATE_USERNAME,
  213. </if>
  214. <if test="updateTime != null">
  215. UPDATE_TIME,
  216. </if>
  217. <if test="insertUpdateRemark != null">
  218. INSERT_UPDATE_REMARK,
  219. </if>
  220. <if test="deleted != null">
  221. DELETED,
  222. </if>
  223. <if test="planIssueName != null">
  224. PLAN_ISSUE_NAME,
  225. </if>
  226. </trim>
  227. <trim prefix="values (" suffix=")" suffixOverrides=",">
  228. <if test="planId != null">
  229. #{planId,jdbcType=DECIMAL},
  230. </if>
  231. <if test="planNumber != null">
  232. #{planNumber,jdbcType=VARCHAR},
  233. </if>
  234. <if test="carrierId != null">
  235. #{carrierId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="planTruckNumber != null">
  238. #{planTruckNumber,jdbcType=DECIMAL},
  239. </if>
  240. <if test="planStatus != null">
  241. #{planStatus,jdbcType=DECIMAL},
  242. </if>
  243. <if test="planIssueTime != null">
  244. #{planIssueTime,jdbcType=TIMESTAMP},
  245. </if>
  246. <if test="insertUsername != null">
  247. #{insertUsername,jdbcType=VARCHAR},
  248. </if>
  249. <if test="insertTime != null">
  250. #{insertTime,jdbcType=TIMESTAMP},
  251. </if>
  252. <if test="updateUsername != null">
  253. #{updateUsername,jdbcType=VARCHAR},
  254. </if>
  255. <if test="updateTime != null">
  256. #{updateTime,jdbcType=TIMESTAMP},
  257. </if>
  258. <if test="insertUpdateRemark != null">
  259. #{insertUpdateRemark,jdbcType=VARCHAR},
  260. </if>
  261. <if test="deleted != null">
  262. #{deleted,jdbcType=DECIMAL},
  263. </if>
  264. <if test="planIssueName != null">
  265. #{planIssueName,jdbcType=VARCHAR},
  266. </if>
  267. </trim>
  268. </insert>
  269. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
  270. update AMSTRUCK_INWARD_PLAN
  271. set PLAN_NUMBER = #{planNumber,jdbcType=VARCHAR},
  272. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  273. PLAN_TRUCK_NUMBER = #{planTruckNumber,jdbcType=DECIMAL},
  274. PLAN_STATUS = #{planStatus,jdbcType=DECIMAL},
  275. PLAN_ISSUE_TIME = #{planIssueTime,jdbcType=TIMESTAMP},
  276. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  277. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  278. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  279. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  280. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  281. DELETED = #{deleted,jdbcType=DECIMAL},
  282. PLAN_ISSUE_NAME = #{planIssueName,jdbcType=VARCHAR}
  283. where PLAN_ID = #{planId,jdbcType=DECIMAL}
  284. </update>
  285. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
  286. update AMSTRUCK_INWARD_PLAN
  287. <set>
  288. <if test="planNumber != null">
  289. PLAN_NUMBER = #{planNumber,jdbcType=VARCHAR},
  290. </if>
  291. <if test="carrierId != null">
  292. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  293. </if>
  294. <if test="planTruckNumber != null">
  295. PLAN_TRUCK_NUMBER = #{planTruckNumber,jdbcType=DECIMAL},
  296. </if>
  297. <if test="planStatus != null">
  298. PLAN_STATUS = #{planStatus,jdbcType=DECIMAL},
  299. </if>
  300. <if test="planIssueTime != null">
  301. PLAN_ISSUE_TIME = #{planIssueTime,jdbcType=TIMESTAMP},
  302. </if>
  303. <if test="insertUsername != null">
  304. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  305. </if>
  306. <if test="insertTime != null">
  307. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  308. </if>
  309. <if test="updateUsername != null">
  310. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  311. </if>
  312. <if test="updateTime != null">
  313. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  314. </if>
  315. <if test="insertUpdateRemark != null">
  316. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  317. </if>
  318. <if test="deleted != null">
  319. DELETED = #{deleted,jdbcType=DECIMAL},
  320. </if>
  321. <if test="planIssueName != null">
  322. PLAN_ISSUE_NAME = #{planIssueName,jdbcType=VARCHAR},
  323. </if>
  324. </set>
  325. where PLAN_ID = #{planId,jdbcType=DECIMAL}
  326. </update>
  327. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  328. <include refid="select"/>
  329. where PLAN_ID = #{planId,jdbcType=DECIMAL}
  330. </select>
  331. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  332. <include refid="select"/>
  333. <include refid="where"/>
  334. </select>
  335. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  336. <include refid="select"/>
  337. <include refid="whereLike"/>
  338. </select>
  339. <insert id="batchInsert" parameterType="java.util.List">
  340. insert into AMSTRUCK_INWARD_PLAN
  341. (PLAN_ID,
  342. PLAN_NUMBER, CARRIER_ID, PLAN_TRUCK_NUMBER,
  343. PLAN_STATUS, PLAN_ISSUE_TIME,
  344. INSERT_USERNAME, INSERT_TIME,
  345. UPDATE_USERNAME, UPDATE_TIME,
  346. INSERT_UPDATE_REMARK, DELETED,
  347. PLAN_ISSUE_NAME)
  348. ( <foreach collection="list" item="item" separator="union all">
  349. select
  350. #{item.planId,jdbcType=DECIMAL},
  351. #{item.planNumber,jdbcType=VARCHAR}, #{item.carrierId,jdbcType=DECIMAL},
  352. #{item.planTruckNumber,jdbcType=DECIMAL},
  353. #{item.planStatus,jdbcType=DECIMAL}, #{item.planIssueTime,jdbcType=TIMESTAMP},
  354. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  355. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  356. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
  357. #{item.planIssueName,jdbcType=VARCHAR} from dual
  358. </foreach> )
  359. </insert>
  360. <update id="batchUpdate" parameterType="java.util.List">
  361. update AMSTRUCK_INWARD_PLAN
  362. set
  363. PLAN_ID=
  364. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  365. when #{item.planId,jdbcType=DECIMAL} then #{item.planId,jdbcType=DECIMAL}
  366. </foreach>
  367. ,PLAN_NUMBER=
  368. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  369. when #{item.planId,jdbcType=DECIMAL} then #{item.planNumber,jdbcType=VARCHAR}
  370. </foreach>
  371. ,CARRIER_ID=
  372. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  373. when #{item.planId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
  374. </foreach>
  375. ,PLAN_TRUCK_NUMBER=
  376. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  377. when #{item.planId,jdbcType=DECIMAL} then #{item.planTruckNumber,jdbcType=DECIMAL}
  378. </foreach>
  379. ,PLAN_STATUS=
  380. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  381. when #{item.planId,jdbcType=DECIMAL} then #{item.planStatus,jdbcType=DECIMAL}
  382. </foreach>
  383. ,PLAN_ISSUE_TIME=
  384. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  385. when #{item.planId,jdbcType=DECIMAL} then #{item.planIssueTime,jdbcType=TIMESTAMP}
  386. </foreach>
  387. ,INSERT_USERNAME=
  388. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  389. when #{item.planId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  390. </foreach>
  391. ,INSERT_TIME=
  392. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  393. when #{item.planId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  394. </foreach>
  395. ,UPDATE_USERNAME=
  396. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  397. when #{item.planId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  398. </foreach>
  399. ,UPDATE_TIME=
  400. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  401. when #{item.planId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  402. </foreach>
  403. ,INSERT_UPDATE_REMARK=
  404. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  405. when #{item.planId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  406. </foreach>
  407. ,DELETED=
  408. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  409. when #{item.planId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  410. </foreach>
  411. ,PLAN_ISSUE_NAME=
  412. <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
  413. when #{item.planId,jdbcType=DECIMAL} then #{item.planIssueName,jdbcType=VARCHAR}
  414. </foreach>
  415. where PLAN_ID in
  416. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  417. #{item.planId,jdbcType=DECIMAL}
  418. </foreach>
  419. </update>
  420. <delete id="batchDelete" parameterType="java.util.List">
  421. delete from AMSTRUCK_INWARD_PLAN
  422. where PLAN_ID in
  423. <foreach collection="list" item="id" open="(" close=")" separator=",">
  424. #{id}
  425. </foreach>
  426. </delete>
  427. <!-- 友情提示!!!-->
  428. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  429. <!-- 展示运输计划 -->
  430. <select id="getTruckPlanList" resultType="java.util.Map" parameterType="java.util.Map">
  431. SELECT *
  432. FROM (SELECT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  433. RM.MATERIAL_NAME AS "materialName",
  434. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  435. AIP.PLAN_NUMBER AS "planNumber",
  436. RCA.CARRIER_NAME AS "carrierName",
  437. AIP.PLAN_TRUCK_NUMBER AS "planTruckNumber",
  438. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  439. AIR.REQUIREMENT_TYPE AS "requirementType",
  440. RCT.CAPACITY_TYPE_NAME AS "capacityTypeName",
  441. ARM.MATERIAL_COUNT AS "materialNumber",
  442. ARM.MATERIAL_WEIGHT AS "materialWeight",
  443. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  444. RW.WAREHOUSE_NAME AS "wareHouseName",
  445. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  446. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  447. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  448. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  449. AIP.PLAN_ID AS "planId",
  450. AIP.INSERT_TIME AS "insertTime"
  451. FROM AMSTRUCK_INWARD_PLAN AIP
  452. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  453. ON ARP.PLAN_ID = AIP.PLAN_ID
  454. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  455. ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  456. LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
  457. ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  458. LEFT JOIN AMS_PURCHASE_ORDER APO
  459. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  460. LEFT JOIN DIL_BATCH DB
  461. ON APO.BATCH_ID = DB.BATCH_ID
  462. LEFT JOIN RMS_MATERIAL RM
  463. ON RM.MATERIAL_ID = DB.MATERIAL_ID
  464. LEFT JOIN RMS_WAREHOUSE RW
  465. ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
  466. LEFT JOIN RMS_CARRIER RCA
  467. ON RCA.CARRIER_ID = AIP.CARRIER_ID
  468. LEFT JOIN RMS_CAPACITY_TYPE RCT
  469. ON RCT.CAPACITY_TYPE_ID = AIR.CAPACITY_TYPE_ID
  470. WHERE AIP.PLAN_STATUS = #{planStatus}
  471. AND AIP.DELETED = 0
  472. )
  473. <where>
  474. <if test="purchaseOrderNo != null">
  475. and
  476. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  477. "purchaseOrderNo" like '%${item}%'
  478. </foreach>
  479. </if>
  480. <if test="materialName != null">
  481. and
  482. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  483. "materialName" like '%${item}%'
  484. </foreach>
  485. </if>
  486. <if test="materialNumber != null">
  487. and
  488. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  489. "materialNumber" like '%${item}%'
  490. </foreach>
  491. </if>
  492. <if test="resultForeignShipName != null">
  493. and
  494. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  495. "resultForeignShipName" like '%${item}%'
  496. </foreach>
  497. </if>
  498. <if test="requirementNumber != null">
  499. and
  500. <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
  501. "requirementNumber" like '%${item}%'
  502. </foreach>
  503. </if>
  504. <if test="requirementType != null">
  505. and
  506. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  507. "requirementType" like '%${item}%'
  508. </foreach>
  509. </if>
  510. <if test="capacityTypeName != null">
  511. and
  512. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  513. "capacityTypeName" like '%${item}%'
  514. </foreach>
  515. </if>
  516. <if test="requirementTruckTime != null">
  517. and
  518. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  519. "requirementTruckTime" like '%${item}%'
  520. </foreach>
  521. </if>
  522. <if test="requirementWorkType != null">
  523. and
  524. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  525. "requirementWorkType" like '%${item}%'
  526. </foreach>
  527. </if>
  528. <if test="requirementWorkContent != null">
  529. and
  530. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  531. "requirementWorkContent" like '%${item}%'
  532. </foreach>
  533. </if>
  534. <if test="requirementWorkEnvironment != null">
  535. and
  536. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  537. "requirementWorkEnvironment" like '%${item}%'
  538. </foreach>
  539. </if>
  540. <if test="requirementEstimatedDuration != null">
  541. and
  542. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  543. "requirementEstimatedDuration" like '%${item}%'
  544. </foreach>
  545. </if>
  546. <if test="planNumber != null">
  547. and
  548. <foreach collection="planNumber" item="item" open="(" separator="or" close=")">
  549. "planNumber" like '%${item}%'
  550. </foreach>
  551. </if>
  552. <if test="carrierName != null">
  553. and
  554. <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
  555. "carrierName" like '%${item}%'
  556. </foreach>
  557. </if>
  558. <if test="planTruckNumber != null">
  559. and
  560. <foreach collection="planTruckNumber" item="item" open="(" separator="or" close=")">
  561. "planTruckNumber" like '%${item}%'
  562. </foreach>
  563. </if>
  564. <if test="wareHouseName != null">
  565. and
  566. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  567. "wareHouseName" like '%${item}%'
  568. </foreach>
  569. </if>
  570. </where>
  571. <include refid="orderBy"></include>
  572. </select>
  573. <!-- 展示运输计划 -->
  574. <select id="getIssuedPlanList" resultType="java.util.Map" parameterType="java.util.Map">
  575. SELECT *
  576. FROM (SELECT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  577. RM.MATERIAL_NAME AS "materialName",
  578. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  579. AIP.PLAN_NUMBER AS "planNumber",
  580. RCA.CARRIER_NAME AS "carrierName",
  581. AIP.PLAN_TRUCK_NUMBER AS "planTruckNumber",
  582. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  583. AIP.PLAN_ISSUE_TIME AS "planIssueTime",
  584. AIP.PLAN_ISSUE_NAME AS "planIssueName",
  585. AIR.REQUIREMENT_TYPE AS "requirementType",
  586. RCT.CAPACITY_TYPE_NAME AS "capacityTypeName",
  587. ARM.MATERIAL_COUNT AS "materialNumber",
  588. ARM.MATERIAL_WEIGHT AS "materialWeight",
  589. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  590. RW.WAREHOUSE_NAME AS "wareHouseName",
  591. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  592. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  593. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  594. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  595. AIP.PLAN_ID AS "planId",
  596. AIP.INSERT_TIME AS "insertTime",
  597. AIP.CARRIER_ID AS "carrierId"
  598. FROM AMSTRUCK_INWARD_PLAN AIP
  599. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  600. ON ARP.PLAN_ID = AIP.PLAN_ID
  601. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  602. ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  603. LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
  604. ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  605. LEFT JOIN AMS_PURCHASE_ORDER APO
  606. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  607. LEFT JOIN DIL_BATCH DB
  608. ON APO.BATCH_ID = DB.BATCH_ID
  609. LEFT JOIN RMS_MATERIAL RM
  610. ON RM.MATERIAL_ID = DB.MATERIAL_ID
  611. LEFT JOIN RMS_WAREHOUSE RW
  612. ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
  613. LEFT JOIN RMS_CARRIER RCA
  614. ON RCA.CARRIER_ID = AIP.CARRIER_ID
  615. LEFT JOIN RMS_CAPACITY_TYPE RCT
  616. ON RCT.CAPACITY_TYPE_ID = AIR.CAPACITY_TYPE_ID
  617. WHERE AIP.PLAN_STATUS = #{planStatus}
  618. AND AIP.DELETED = 0
  619. <if test="planId != null">
  620. and AIP.PLAN_ID = #{planId}
  621. </if>
  622. <if test="carrierId != null">
  623. and AIP.CARRIER_ID = #{carrierId}
  624. </if>
  625. )
  626. <where>
  627. <if test="purchaseOrderNo != null">
  628. and
  629. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  630. "purchaseOrderNo" like '%${item}%'
  631. </foreach>
  632. </if>
  633. <if test="materialName != null">
  634. and
  635. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  636. "materialName" like '%${item}%'
  637. </foreach>
  638. </if>
  639. <if test="materialNumber != null">
  640. and
  641. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  642. "materialNumber" like '%${item}%'
  643. </foreach>
  644. </if>
  645. <if test="materialWeight != null">
  646. and
  647. <foreach collection="materialWeight" item="item" open="(" separator="or" close=")">
  648. "materialWeight" like '%${item}%'
  649. </foreach>
  650. </if>
  651. <if test="resultForeignShipName != null">
  652. and
  653. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  654. "resultForeignShipName" like '%${item}%'
  655. </foreach>
  656. </if>
  657. <if test="requirementNumber != null">
  658. and
  659. <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
  660. "requirementNumber" like '%${item}%'
  661. </foreach>
  662. </if>
  663. <if test="requirementType != null">
  664. and
  665. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  666. "requirementType" like '%${item}%'
  667. </foreach>
  668. </if>
  669. <if test="planIssueTime != null">
  670. and
  671. <foreach collection="planIssueTime" item="item" open="(" separator="or" close=")">
  672. "planIssueTime" like '%${item}%'
  673. </foreach>
  674. </if>
  675. <if test="planIssueName != null">
  676. and
  677. <foreach collection="planIssueName" item="item" open="(" separator="or" close=")">
  678. "planIssueName" like '%${item}%'
  679. </foreach>
  680. </if>
  681. <if test="capacityTypeName != null">
  682. and
  683. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  684. "capacityTypeName" like '%${item}%'
  685. </foreach>
  686. </if>
  687. <if test="requirementTruckTime != null">
  688. and
  689. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  690. "requirementTruckTime" like '%${item}%'
  691. </foreach>
  692. </if>
  693. <if test="requirementWorkType != null">
  694. and
  695. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  696. "requirementWorkType" like '%${item}%'
  697. </foreach>
  698. </if>
  699. <if test="requirementWorkContent != null">
  700. and
  701. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  702. "requirementWorkContent" like '%${item}%'
  703. </foreach>
  704. </if>
  705. <if test="requirementWorkEnvironment != null">
  706. and
  707. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  708. "requirementWorkEnvironment" like '%${item}%'
  709. </foreach>
  710. </if>
  711. <if test="requirementEstimatedDuration != null">
  712. and
  713. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  714. "requirementEstimatedDuration" like '%${item}%'
  715. </foreach>
  716. </if>
  717. <if test="planNumber != null">
  718. and
  719. <foreach collection="planNumber" item="item" open="(" separator="or" close=")">
  720. "planNumber" like '%${item}%'
  721. </foreach>
  722. </if>
  723. <if test="carrierName != null">
  724. and
  725. <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
  726. "carrierName" like '%${item}%'
  727. </foreach>
  728. </if>
  729. <if test="planTruckNumber != null">
  730. and
  731. <foreach collection="planTruckNumber" item="item" open="(" separator="or" close=")">
  732. "planTruckNumber" like '%${item}%'
  733. </foreach>
  734. </if>
  735. <if test="wareHouseName != null">
  736. and
  737. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  738. "wareHouseName" like '%${item}%'
  739. </foreach>
  740. </if>
  741. </where>
  742. <include refid="orderBy"></include>
  743. </select>
  744. <sql id="orderBy">
  745. <if test="orderField != null and orderField != ''">
  746. order by "${orderField}"
  747. <if test="orderType != null and orderType != ''">
  748. ${orderType}
  749. </if>
  750. </if>
  751. <if test="orderField == null ">
  752. order by "insertTime" desc
  753. </if>
  754. </sql>
  755. <select id="selectInwardPlanToUpdate" parameterType="DECIMAL" resultType="java.util.Map">
  756. SELECT AIP.CARRIER_ID AS "carrierId",
  757. AIP.PLAN_TRUCK_NUMBER AS "planTruckNumber",
  758. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  759. AIP.PLAN_NUMBER AS "planNumber"
  760. FROM AMSTRUCK_INWARD_PLAN AIP
  761. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  762. ON AIP.PLAN_ID = ARP.PLAN_ID
  763. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  764. ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  765. WHERE AIP.PLAN_ID = #{planId}
  766. </select>
  767. <select id="getCarrierList" resultType="java.util.Map">
  768. SELECT RC.CARRIER_ID AS "id",
  769. RC.CARRIER_ID AS "value",
  770. RC.CARRIER_NAME AS "label"
  771. FROM RMS_CARRIER RC
  772. </select>
  773. </mapper>