AmstruckInwardPlanMapper.xml 38 KB

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