AmstruckInwardPlanMapper.xml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  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. and
  479. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  480. "purchaseOrderNo" like '%${item}%'
  481. </foreach>
  482. </if>
  483. <if test="materialName != null">
  484. and
  485. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  486. "materialName" like '%${item}%'
  487. </foreach>
  488. </if>
  489. <if test="materialNumber != null">
  490. and
  491. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  492. "materialNumber" like '%${item}%'
  493. </foreach>
  494. </if>
  495. <if test="resultForeignShipName != null">
  496. and
  497. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  498. "resultForeignShipName" like '%${item}%'
  499. </foreach>
  500. </if>
  501. <if test="requirementNumber != null">
  502. and
  503. <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
  504. "requirementNumber" like '%${item}%'
  505. </foreach>
  506. </if>
  507. <if test="requirementType != null">
  508. and
  509. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  510. "requirementType" like '%${item}%'
  511. </foreach>
  512. </if>
  513. <if test="capacityTypeName != null">
  514. and
  515. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  516. "capacityTypeName" like '%${item}%'
  517. </foreach>
  518. </if>
  519. <if test="requirementTruckTime != null">
  520. and
  521. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  522. "requirementTruckTime" like '%${item}%'
  523. </foreach>
  524. </if>
  525. <if test="requirementWorkType != null">
  526. and
  527. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  528. "requirementWorkType" like '%${item}%'
  529. </foreach>
  530. </if>
  531. <if test="requirementWorkContent != null">
  532. and
  533. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  534. "requirementWorkContent" like '%${item}%'
  535. </foreach>
  536. </if>
  537. <if test="requirementWorkEnvironment != null">
  538. and
  539. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  540. "requirementWorkEnvironment" like '%${item}%'
  541. </foreach>
  542. </if>
  543. <if test="requirementEstimatedDuration != null">
  544. and
  545. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  546. "requirementEstimatedDuration" like '%${item}%'
  547. </foreach>
  548. </if>
  549. <if test="planNumber != null">
  550. and
  551. <foreach collection="planNumber" item="item" open="(" separator="or" close=")">
  552. "planNumber" like '%${item}%'
  553. </foreach>
  554. </if>
  555. <if test="carrierName != null">
  556. and
  557. <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
  558. "carrierName" like '%${item}%'
  559. </foreach>
  560. </if>
  561. <if test="planTruckNumber != null">
  562. and
  563. <foreach collection="planTruckNumber" item="item" open="(" separator="or" close=")">
  564. "planTruckNumber" like '%${item}%'
  565. </foreach>
  566. </if>
  567. <if test="wareHouseName != null">
  568. and
  569. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  570. "wareHouseName" like '%${item}%'
  571. </foreach>
  572. </if>
  573. </where>
  574. <include refid="orderBy"></include>
  575. </select>
  576. <!-- 展示运输计划 -->
  577. <select id="getIssuedPlanList" resultType="java.util.Map" parameterType="java.util.Map">
  578. SELECT *
  579. FROM (SELECT 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. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  587. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  588. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  589. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  590. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  591. AIR.REQUIREMENT_ID AS "requirementId",
  592. AIP.PLAN_ID AS "planId",
  593. AIP.CARRIER_ID AS "carrierId",
  594. AIP.INSERT_TIME AS "insertTime",
  595. RS.SHIPPER_NAME AS "shipperName"
  596. FROM AMSTRUCK_INWARD_PLAN AIP
  597. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  598. ON ARP.PLAN_ID = AIP.PLAN_ID
  599. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  600. ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  601. LEFT JOIN RMS_SHIPPER RS
  602. ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  603. LEFT JOIN RMS_CARRIER RCA
  604. ON RCA.CARRIER_ID = AIP.CARRIER_ID
  605. WHERE AIP.DELETED = 0
  606. AND AIR.PURCHASE_ORDER_ID IS NULL
  607. <if test="planId != null">
  608. and AIP.PLAN_ID = #{planId}
  609. </if>
  610. <if test="carrierId != null">
  611. and (select
  612. rc.carrier_sso_id from rms_carrier rc
  613. where rc.carrier_id = AIP.CARRIER_ID) = #{carrierId}
  614. </if>
  615. <if test="planStatus == 0">
  616. and AIP.PLAN_STATUS = 0
  617. </if>
  618. <if test="planStatus == 1">
  619. and AIP.PLAN_STATUS in (1,2)
  620. </if>
  621. <if test="planStatus == 4">
  622. and AIP.PLAN_STATUS = 4
  623. </if>
  624. <if test="planStatus == 2">
  625. and AIP.PLAN_STATUS = 2
  626. </if>
  627. <if test="planStatus == 3">
  628. and AIP.PLAN_STATUS = 3
  629. </if>
  630. )
  631. <where>
  632. <if test="purchaseOrderNo != null">
  633. and
  634. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  635. "purchaseOrderNo" like '%${item}%'
  636. </foreach>
  637. </if>
  638. <if test="materialName != null">
  639. and
  640. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  641. "materialName" like '%${item}%'
  642. </foreach>
  643. </if>
  644. <if test="materialNumber != null">
  645. and
  646. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  647. "materialNumber" like '%${item}%'
  648. </foreach>
  649. </if>
  650. <if test="materialWeight != null">
  651. and
  652. <foreach collection="materialWeight" item="item" open="(" separator="or" close=")">
  653. "materialWeight" like '%${item}%'
  654. </foreach>
  655. </if>
  656. <if test="resultForeignShipName != null">
  657. and
  658. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  659. "resultForeignShipName" like '%${item}%'
  660. </foreach>
  661. </if>
  662. <if test="requirementNumber != null">
  663. and
  664. <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
  665. "requirementNumber" like '%${item}%'
  666. </foreach>
  667. </if>
  668. <if test="requirementType != null">
  669. and
  670. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  671. "requirementType" like '%${item}%'
  672. </foreach>
  673. </if>
  674. <if test="planIssueTime != null">
  675. and
  676. <foreach collection="planIssueTime" item="item" open="(" separator="or" close=")">
  677. "planIssueTime" like '%${item}%'
  678. </foreach>
  679. </if>
  680. <if test="planIssueName != null">
  681. and
  682. <foreach collection="planIssueName" item="item" open="(" separator="or" close=")">
  683. "planIssueName" like '%${item}%'
  684. </foreach>
  685. </if>
  686. <if test="capacityTypeName != null">
  687. and
  688. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  689. "capacityTypeName" like '%${item}%'
  690. </foreach>
  691. </if>
  692. <if test="requirementTruckTime != null">
  693. and
  694. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  695. "requirementTruckTime" like '%${item}%'
  696. </foreach>
  697. </if>
  698. <if test="requirementWorkType != null">
  699. and
  700. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  701. "requirementWorkType" like '%${item}%'
  702. </foreach>
  703. </if>
  704. <if test="requirementWorkContent != null">
  705. and
  706. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  707. "requirementWorkContent" like '%${item}%'
  708. </foreach>
  709. </if>
  710. <if test="requirementWorkEnvironment != null">
  711. and
  712. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  713. "requirementWorkEnvironment" like '%${item}%'
  714. </foreach>
  715. </if>
  716. <if test="requirementEstimatedDuration != null">
  717. and
  718. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  719. "requirementEstimatedDuration" like '%${item}%'
  720. </foreach>
  721. </if>
  722. <if test="planNumber != null">
  723. and
  724. <foreach collection="planNumber" item="item" open="(" separator="or" close=")">
  725. "planNumber" like '%${item}%'
  726. </foreach>
  727. </if>
  728. <if test="carrierName != null">
  729. and
  730. <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
  731. "carrierName" like '%${item}%'
  732. </foreach>
  733. </if>
  734. <if test="planTruckNumber != null">
  735. and
  736. <foreach collection="planTruckNumber" item="item" open="(" separator="or" close=")">
  737. "planTruckNumber" like '%${item}%'
  738. </foreach>
  739. </if>
  740. <if test="wareHouseName != null">
  741. and
  742. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  743. "wareHouseName" like '%${item}%'
  744. </foreach>
  745. </if>
  746. </where>
  747. <include refid="orderBy"></include>
  748. </select>
  749. <sql id="orderBy">
  750. <if test="orderField != null and orderField != ''">
  751. order by "${orderField}"
  752. <if test="orderType != null and orderType != ''">
  753. ${orderType}
  754. </if>
  755. </if>
  756. <if test="orderField == null ">
  757. order by "insertTime" desc
  758. </if>
  759. </sql>
  760. <select id="selectInwardPlanToUpdate" parameterType="DECIMAL" resultType="java.util.Map">
  761. SELECT AIP.CARRIER_ID AS "carrierId",
  762. AIP.PLAN_TRUCK_NUMBER AS "planTruckNumber",
  763. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  764. AIP.PLAN_NUMBER AS "planNumber"
  765. FROM AMSTRUCK_INWARD_PLAN AIP
  766. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  767. ON AIP.PLAN_ID = ARP.PLAN_ID
  768. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  769. ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  770. WHERE AIP.PLAN_ID = #{planId}
  771. </select>
  772. <select id="getCarrierList" resultType="java.util.Map">
  773. SELECT RC.CARRIER_ID AS "id",
  774. RC.CARRIER_ID AS "value",
  775. RC.CARRIER_NAME AS "label"
  776. FROM RMS_CARRIER RC
  777. </select>
  778. <select id="getPlanOrder" resultType="java.util.Map" parameterType="java.util.Map">
  779. select RC.CAPACITY_ID "capacityId",
  780. rc.capacity_number "capacityNumber",
  781. oo.order_number "orderNumber",
  782. oo.order_id "orderId"
  783. from OMSTRUCK_ORDER OO
  784. left join RMS_CAPACITY RC
  785. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  786. left join amstruck_inward_plan aip
  787. on aip.plan_id = oo.order_plan_id
  788. left join amstruck_requirement_plan arp
  789. on arp.plan_id = aip.plan_id
  790. left join amstruck_inward_requirement air
  791. on air.requirement_id = arp.requirement_id
  792. where oo.order_status = #{orderStatus}
  793. <if test="planId != null ">
  794. and aip.plan_id = #{planId}
  795. </if>
  796. <if test="requirementId != null ">
  797. and air.requirement_id = #{requirementId}
  798. </if>
  799. </select>
  800. </mapper>