AmstruckInwardRequirementMapper.xml 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092
  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.AmstruckInwardRequirementMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmstruckInwardRequirement">
  5. <id column="REQUIREMENT_ID" jdbcType="DECIMAL" property="requirementId"/>
  6. <result column="PURCHASE_ORDER_ID" jdbcType="DECIMAL" property="purchaseOrderId"/>
  7. <result column="REQUIREMENT_NUMBER" jdbcType="VARCHAR" property="requirementNumber"/>
  8. <result column="REQUIREMENT_TYPE" jdbcType="VARCHAR" property="requirementType"/>
  9. <result column="CAPACITY_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId"/>
  10. <result column="REQUIREMENT_TRUCK_TIME" jdbcType="TIMESTAMP" property="requirementTruckTime"/>
  11. <result column="REQUIREMENT_SHIPPER_ID" jdbcType="DECIMAL" property="requirementShipperId"/>
  12. <result column="REQUIREMENT_WORK_TYPE" jdbcType="DECIMAL" property="requirementWorkType"/>
  13. <result column="REQUIREMENT_WORK_CONTENT" jdbcType="VARCHAR" property="requirementWorkContent"/>
  14. <result column="LINE_ID" jdbcType="DECIMAL" property="lineId"/>
  15. <result column="REQUIREMENT_WORK_ENVIRONMENT" jdbcType="VARCHAR" property="requirementWorkEnvironment"/>
  16. <result column="REQUIREMENT_ESTIMATED_DURATION" jdbcType="DECIMAL" property="requirementEstimatedDuration"/>
  17. <result column="REQUIREMENT_OVERLIMIT" jdbcType="VARCHAR" property="requirementOverlimit"/>
  18. <result column="REQUIREMNT_UNIT_ID" jdbcType="DECIMAL" property="requiremntUnitId"/>
  19. <result column="REQUIREMENT_STATUS" jdbcType="DECIMAL" property="requirementStatus"/>
  20. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
  21. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
  22. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
  23. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
  24. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
  25. <result column="DELETED" jdbcType="DECIMAL" property="deleted"/>
  26. <result column="REQUIREMENT_UNLOAD_UNIT_ID" jdbcType="DECIMAL" property="requirementUnloadUnitId"/>
  27. </resultMap>
  28. <sql id="columns">
  29. REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER, REQUIREMENT_TYPE, CAPACITY_TYPE_ID,
  30. REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT,
  31. LINE_ID, REQUIREMENT_WORK_ENVIRONMENT, REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
  32. REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  33. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, REQUIREMENT_UNLOAD_UNIT_ID
  34. </sql>
  35. <sql id="columns_alias">
  36. t.REQUIREMENT_ID, t.PURCHASE_ORDER_ID, t.REQUIREMENT_NUMBER, t.REQUIREMENT_TYPE,
  37. t.CAPACITY_TYPE_ID, t.REQUIREMENT_TRUCK_TIME, t.REQUIREMENT_SHIPPER_ID, t.REQUIREMENT_WORK_TYPE,
  38. t.REQUIREMENT_WORK_CONTENT, t.LINE_ID, t.REQUIREMENT_WORK_ENVIRONMENT, t.REQUIREMENT_ESTIMATED_DURATION,
  39. t.REQUIREMENT_OVERLIMIT, t.REQUIREMNT_UNIT_ID, t.REQUIREMENT_STATUS, t.INSERT_USERNAME,
  40. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
  41. t.REQUIREMENT_UNLOAD_UNIT_ID
  42. </sql>
  43. <sql id="select">
  44. SELECT
  45. <include refid="columns"/>
  46. FROM AMSTRUCK_INWARD_REQUIREMENT
  47. </sql>
  48. <sql id="select_alias">
  49. SELECT
  50. <include refid="columns_alias"/>
  51. FROM AMSTRUCK_INWARD_REQUIREMENT t
  52. </sql>
  53. <sql id="where">
  54. <where>
  55. <if test="requirementId != null">
  56. and REQUIREMENT_ID = #{requirementId}
  57. </if>
  58. <if test="purchaseOrderId != null">
  59. and PURCHASE_ORDER_ID = #{purchaseOrderId}
  60. </if>
  61. <if test="requirementNumber != null and requirementNumber != ''">
  62. and REQUIREMENT_NUMBER = #{requirementNumber}
  63. </if>
  64. <if test="requirementType != null and requirementType != ''">
  65. and REQUIREMENT_TYPE = #{requirementType}
  66. </if>
  67. <if test="capacityTypeId != null">
  68. and CAPACITY_TYPE_ID = #{capacityTypeId}
  69. </if>
  70. <if test="requirementTruckTime != null">
  71. and TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = #{requirementTruckTime}
  72. </if>
  73. <if test="requirementShipperId != null">
  74. and REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
  75. </if>
  76. <if test="requirementWorkType != null">
  77. and REQUIREMENT_WORK_TYPE = #{requirementWorkType}
  78. </if>
  79. <if test="requirementWorkContent != null and requirementWorkContent != ''">
  80. and REQUIREMENT_WORK_CONTENT = #{requirementWorkContent}
  81. </if>
  82. <if test="lineId != null">
  83. and LINE_ID = #{lineId}
  84. </if>
  85. <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
  86. and REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment}
  87. </if>
  88. <if test="requirementEstimatedDuration != null">
  89. and REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
  90. </if>
  91. <if test="requirementOverlimit != null and requirementOverlimit != ''">
  92. and REQUIREMENT_OVERLIMIT = #{requirementOverlimit}
  93. </if>
  94. <if test="requiremntUnitId != null">
  95. and REQUIREMNT_UNIT_ID = #{requiremntUnitId}
  96. </if>
  97. <if test="requirementStatus != null">
  98. and REQUIREMENT_STATUS = #{requirementStatus}
  99. </if>
  100. <if test="insertUsername != null and insertUsername != ''">
  101. and INSERT_USERNAME = #{insertUsername}
  102. </if>
  103. <if test="insertTime != null">
  104. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  105. </if>
  106. <if test="updateUsername != null and updateUsername != ''">
  107. and UPDATE_USERNAME = #{updateUsername}
  108. </if>
  109. <if test="updateTime != null">
  110. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  111. </if>
  112. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  113. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  114. </if>
  115. <if test="deleted != null">
  116. and DELETED = #{deleted}
  117. </if>
  118. <if test="requirementUnloadUnitId != null">
  119. and REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId}
  120. </if>
  121. </where>
  122. </sql>
  123. <sql id="whereLike">
  124. <where>
  125. <if test="requirementId != null">
  126. and REQUIREMENT_ID = #{requirementId}
  127. </if>
  128. <if test="purchaseOrderId != null">
  129. and PURCHASE_ORDER_ID = #{purchaseOrderId}
  130. </if>
  131. <if test="requirementNumber != null and requirementNumber != ''">
  132. and REQUIREMENT_NUMBER LIKE '%${requirementNumber}%'
  133. </if>
  134. <if test="requirementType != null and requirementType != ''">
  135. and REQUIREMENT_TYPE LIKE '%${requirementType}%'
  136. </if>
  137. <if test="capacityTypeId != null">
  138. and CAPACITY_TYPE_ID = #{capacityTypeId}
  139. </if>
  140. <if test="requirementTruckTime != null">
  141. and TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = #{requirementTruckTime}
  142. </if>
  143. <if test="requirementShipperId != null">
  144. and REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
  145. </if>
  146. <if test="requirementWorkType != null">
  147. and REQUIREMENT_WORK_TYPE = #{requirementWorkType}
  148. </if>
  149. <if test="requirementWorkContent != null and requirementWorkContent != ''">
  150. and REQUIREMENT_WORK_CONTENT LIKE '%${requirementWorkContent}%'
  151. </if>
  152. <if test="lineId != null">
  153. and LINE_ID = #{lineId}
  154. </if>
  155. <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
  156. and REQUIREMENT_WORK_ENVIRONMENT LIKE '%${requirementWorkEnvironment}%'
  157. </if>
  158. <if test="requirementEstimatedDuration != null">
  159. and REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
  160. </if>
  161. <if test="requirementOverlimit != null and requirementOverlimit != ''">
  162. and REQUIREMENT_OVERLIMIT LIKE '%${requirementOverlimit}%'
  163. </if>
  164. <if test="requiremntUnitId != null">
  165. and REQUIREMNT_UNIT_ID = #{requiremntUnitId}
  166. </if>
  167. <if test="requirementStatus != null">
  168. and REQUIREMENT_STATUS = #{requirementStatus}
  169. </if>
  170. <if test="insertUsername != null and insertUsername != ''">
  171. and INSERT_USERNAME LIKE '%${insertUsername}%'
  172. </if>
  173. <if test="insertTime != null">
  174. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  175. </if>
  176. <if test="updateUsername != null and updateUsername != ''">
  177. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  178. </if>
  179. <if test="updateTime != null">
  180. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  181. </if>
  182. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  183. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  184. </if>
  185. <if test="deleted != null">
  186. and DELETED = #{deleted}
  187. </if>
  188. <if test="requirementUnloadUnitId != null">
  189. and REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId}
  190. </if>
  191. </where>
  192. </sql>
  193. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  194. delete
  195. from AMSTRUCK_INWARD_REQUIREMENT
  196. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  197. </delete>
  198. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  199. delete from AMSTRUCK_INWARD_REQUIREMENT
  200. where 1!=1
  201. <if test="purchaseOrderId != null">
  202. or PURCHASE_ORDER_ID = #{purchaseOrderId}
  203. </if>
  204. <if test="requirementNumber != null and requirementNumber != ''">
  205. or REQUIREMENT_NUMBER = #{requirementNumber}
  206. </if>
  207. <if test="requirementType != null and requirementType != ''">
  208. or REQUIREMENT_TYPE = #{requirementType}
  209. </if>
  210. <if test="capacityTypeId != null">
  211. or CAPACITY_TYPE_ID = #{capacityTypeId}
  212. </if>
  213. <if test="requirementTruckTime != null">
  214. or TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = '#{requirementTruckTime}'
  215. </if>
  216. <if test="requirementShipperId != null">
  217. or REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
  218. </if>
  219. <if test="requirementWorkType != null">
  220. or REQUIREMENT_WORK_TYPE = #{requirementWorkType}
  221. </if>
  222. <if test="requirementWorkContent != null and requirementWorkContent != ''">
  223. or REQUIREMENT_WORK_CONTENT = #{requirementWorkContent}
  224. </if>
  225. <if test="lineId != null">
  226. or LINE_ID = #{lineId}
  227. </if>
  228. <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
  229. or REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment}
  230. </if>
  231. <if test="requirementEstimatedDuration != null">
  232. or REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
  233. </if>
  234. <if test="requirementOverlimit != null and requirementOverlimit != ''">
  235. or REQUIREMENT_OVERLIMIT = #{requirementOverlimit}
  236. </if>
  237. <if test="requiremntUnitId != null">
  238. or REQUIREMNT_UNIT_ID = #{requiremntUnitId}
  239. </if>
  240. <if test="requirementStatus != null">
  241. or REQUIREMENT_STATUS = #{requirementStatus}
  242. </if>
  243. <if test="insertUsername != null and insertUsername != ''">
  244. or INSERT_USERNAME = #{insertUsername}
  245. </if>
  246. <if test="insertTime != null">
  247. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  248. </if>
  249. <if test="updateUsername != null and updateUsername != ''">
  250. or UPDATE_USERNAME = #{updateUsername}
  251. </if>
  252. <if test="updateTime != null">
  253. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  254. </if>
  255. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  256. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  257. </if>
  258. <if test="deleted != null">
  259. or DELETED = #{deleted}
  260. </if>
  261. <if test="requirementUnloadUnitId != null">
  262. or REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId}
  263. </if>
  264. </delete>
  265. <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  266. insert into AMSTRUCK_INWARD_REQUIREMENT (REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER,
  267. REQUIREMENT_TYPE, CAPACITY_TYPE_ID, REQUIREMENT_TRUCK_TIME,
  268. REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE,
  269. REQUIREMENT_WORK_CONTENT, LINE_ID, REQUIREMENT_WORK_ENVIRONMENT,
  270. REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
  271. REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME,
  272. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  273. INSERT_UPDATE_REMARK, DELETED, REQUIREMENT_UNLOAD_UNIT_ID)
  274. values (#{requirementId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL},
  275. #{requirementNumber,jdbcType=VARCHAR},
  276. #{requirementType,jdbcType=VARCHAR}, #{capacityTypeId,jdbcType=DECIMAL},
  277. #{requirementTruckTime,jdbcType=TIMESTAMP},
  278. #{requirementShipperId,jdbcType=DECIMAL}, #{requirementWorkType,jdbcType=DECIMAL},
  279. #{requirementWorkContent,jdbcType=VARCHAR}, #{lineId,jdbcType=DECIMAL},
  280. #{requirementWorkEnvironment,jdbcType=VARCHAR},
  281. #{requirementEstimatedDuration,jdbcType=DECIMAL}, #{requirementOverlimit,jdbcType=VARCHAR},
  282. #{requiremntUnitId,jdbcType=DECIMAL}, #{requirementStatus,jdbcType=DECIMAL},
  283. #{insertUsername,jdbcType=VARCHAR},
  284. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  285. #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  286. #{requirementUnloadUnitId,jdbcType=DECIMAL})
  287. </insert>
  288. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  289. insert into AMSTRUCK_INWARD_REQUIREMENT
  290. <trim prefix="(" suffix=")" suffixOverrides=",">
  291. <if test="requirementId != null">
  292. REQUIREMENT_ID,
  293. </if>
  294. <if test="purchaseOrderId != null">
  295. PURCHASE_ORDER_ID,
  296. </if>
  297. <if test="requirementNumber != null">
  298. REQUIREMENT_NUMBER,
  299. </if>
  300. <if test="requirementType != null">
  301. REQUIREMENT_TYPE,
  302. </if>
  303. <if test="capacityTypeId != null">
  304. CAPACITY_TYPE_ID,
  305. </if>
  306. <if test="requirementTruckTime != null">
  307. REQUIREMENT_TRUCK_TIME,
  308. </if>
  309. <if test="requirementShipperId != null">
  310. REQUIREMENT_SHIPPER_ID,
  311. </if>
  312. <if test="requirementWorkType != null">
  313. REQUIREMENT_WORK_TYPE,
  314. </if>
  315. <if test="requirementWorkContent != null">
  316. REQUIREMENT_WORK_CONTENT,
  317. </if>
  318. <if test="lineId != null">
  319. LINE_ID,
  320. </if>
  321. <if test="requirementWorkEnvironment != null">
  322. REQUIREMENT_WORK_ENVIRONMENT,
  323. </if>
  324. <if test="requirementEstimatedDuration != null">
  325. REQUIREMENT_ESTIMATED_DURATION,
  326. </if>
  327. <if test="requirementOverlimit != null">
  328. REQUIREMENT_OVERLIMIT,
  329. </if>
  330. <if test="requiremntUnitId != null">
  331. REQUIREMNT_UNIT_ID,
  332. </if>
  333. <if test="requirementStatus != null">
  334. REQUIREMENT_STATUS,
  335. </if>
  336. <if test="insertUsername != null">
  337. INSERT_USERNAME,
  338. </if>
  339. <if test="insertTime != null">
  340. INSERT_TIME,
  341. </if>
  342. <if test="updateUsername != null">
  343. UPDATE_USERNAME,
  344. </if>
  345. <if test="updateTime != null">
  346. UPDATE_TIME,
  347. </if>
  348. <if test="insertUpdateRemark != null">
  349. INSERT_UPDATE_REMARK,
  350. </if>
  351. <if test="deleted != null">
  352. DELETED,
  353. </if>
  354. <if test="requirementUnloadUnitId != null">
  355. REQUIREMENT_UNLOAD_UNIT_ID,
  356. </if>
  357. </trim>
  358. <trim prefix="values (" suffix=")" suffixOverrides=",">
  359. <if test="requirementId != null">
  360. #{requirementId,jdbcType=DECIMAL},
  361. </if>
  362. <if test="purchaseOrderId != null">
  363. #{purchaseOrderId,jdbcType=DECIMAL},
  364. </if>
  365. <if test="requirementNumber != null">
  366. #{requirementNumber,jdbcType=VARCHAR},
  367. </if>
  368. <if test="requirementType != null">
  369. #{requirementType,jdbcType=VARCHAR},
  370. </if>
  371. <if test="capacityTypeId != null">
  372. #{capacityTypeId,jdbcType=DECIMAL},
  373. </if>
  374. <if test="requirementTruckTime != null">
  375. #{requirementTruckTime,jdbcType=TIMESTAMP},
  376. </if>
  377. <if test="requirementShipperId != null">
  378. #{requirementShipperId,jdbcType=DECIMAL},
  379. </if>
  380. <if test="requirementWorkType != null">
  381. #{requirementWorkType,jdbcType=DECIMAL},
  382. </if>
  383. <if test="requirementWorkContent != null">
  384. #{requirementWorkContent,jdbcType=VARCHAR},
  385. </if>
  386. <if test="lineId != null">
  387. #{lineId,jdbcType=DECIMAL},
  388. </if>
  389. <if test="requirementWorkEnvironment != null">
  390. #{requirementWorkEnvironment,jdbcType=VARCHAR},
  391. </if>
  392. <if test="requirementEstimatedDuration != null">
  393. #{requirementEstimatedDuration,jdbcType=DECIMAL},
  394. </if>
  395. <if test="requirementOverlimit != null">
  396. #{requirementOverlimit,jdbcType=VARCHAR},
  397. </if>
  398. <if test="requiremntUnitId != null">
  399. #{requiremntUnitId,jdbcType=DECIMAL},
  400. </if>
  401. <if test="requirementStatus != null">
  402. #{requirementStatus,jdbcType=DECIMAL},
  403. </if>
  404. <if test="insertUsername != null">
  405. #{insertUsername,jdbcType=VARCHAR},
  406. </if>
  407. <if test="insertTime != null">
  408. #{insertTime,jdbcType=TIMESTAMP},
  409. </if>
  410. <if test="updateUsername != null">
  411. #{updateUsername,jdbcType=VARCHAR},
  412. </if>
  413. <if test="updateTime != null">
  414. #{updateTime,jdbcType=TIMESTAMP},
  415. </if>
  416. <if test="insertUpdateRemark != null">
  417. #{insertUpdateRemark,jdbcType=VARCHAR},
  418. </if>
  419. <if test="deleted != null">
  420. #{deleted,jdbcType=DECIMAL},
  421. </if>
  422. <if test="requirementUnloadUnitId != null">
  423. #{requirementUnloadUnitId,jdbcType=DECIMAL},
  424. </if>
  425. </trim>
  426. </insert>
  427. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  428. update AMSTRUCK_INWARD_REQUIREMENT
  429. set PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
  430. REQUIREMENT_NUMBER = #{requirementNumber,jdbcType=VARCHAR},
  431. REQUIREMENT_TYPE = #{requirementType,jdbcType=VARCHAR},
  432. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  433. REQUIREMENT_TRUCK_TIME = #{requirementTruckTime,jdbcType=TIMESTAMP},
  434. REQUIREMENT_SHIPPER_ID = #{requirementShipperId,jdbcType=DECIMAL},
  435. REQUIREMENT_WORK_TYPE = #{requirementWorkType,jdbcType=DECIMAL},
  436. REQUIREMENT_WORK_CONTENT = #{requirementWorkContent,jdbcType=VARCHAR},
  437. LINE_ID = #{lineId,jdbcType=DECIMAL},
  438. REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment,jdbcType=VARCHAR},
  439. REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration,jdbcType=DECIMAL},
  440. REQUIREMENT_OVERLIMIT = #{requirementOverlimit,jdbcType=VARCHAR},
  441. REQUIREMNT_UNIT_ID = #{requiremntUnitId,jdbcType=DECIMAL},
  442. REQUIREMENT_STATUS = #{requirementStatus,jdbcType=DECIMAL},
  443. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  444. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  445. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  446. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  447. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  448. DELETED = #{deleted,jdbcType=DECIMAL},
  449. REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId,jdbcType=DECIMAL}
  450. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  451. </update>
  452. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  453. update AMSTRUCK_INWARD_REQUIREMENT
  454. <set>
  455. <if test="purchaseOrderId != null">
  456. PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
  457. </if>
  458. <if test="requirementNumber != null">
  459. REQUIREMENT_NUMBER = #{requirementNumber,jdbcType=VARCHAR},
  460. </if>
  461. <if test="requirementType != null">
  462. REQUIREMENT_TYPE = #{requirementType,jdbcType=VARCHAR},
  463. </if>
  464. <if test="capacityTypeId != null">
  465. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  466. </if>
  467. <if test="requirementTruckTime != null">
  468. REQUIREMENT_TRUCK_TIME = #{requirementTruckTime,jdbcType=TIMESTAMP},
  469. </if>
  470. <if test="requirementShipperId != null">
  471. REQUIREMENT_SHIPPER_ID = #{requirementShipperId,jdbcType=DECIMAL},
  472. </if>
  473. <if test="requirementWorkType != null">
  474. REQUIREMENT_WORK_TYPE = #{requirementWorkType,jdbcType=DECIMAL},
  475. </if>
  476. <if test="requirementWorkContent != null">
  477. REQUIREMENT_WORK_CONTENT = #{requirementWorkContent,jdbcType=VARCHAR},
  478. </if>
  479. <if test="lineId != null">
  480. LINE_ID = #{lineId,jdbcType=DECIMAL},
  481. </if>
  482. <if test="requirementWorkEnvironment != null">
  483. REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment,jdbcType=VARCHAR},
  484. </if>
  485. <if test="requirementEstimatedDuration != null">
  486. REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration,jdbcType=DECIMAL},
  487. </if>
  488. <if test="requirementOverlimit != null">
  489. REQUIREMENT_OVERLIMIT = #{requirementOverlimit,jdbcType=VARCHAR},
  490. </if>
  491. <if test="requiremntUnitId != null">
  492. REQUIREMNT_UNIT_ID = #{requiremntUnitId,jdbcType=DECIMAL},
  493. </if>
  494. <if test="requirementStatus != null">
  495. REQUIREMENT_STATUS = #{requirementStatus,jdbcType=DECIMAL},
  496. </if>
  497. <if test="insertUsername != null">
  498. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  499. </if>
  500. <if test="insertTime != null">
  501. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  502. </if>
  503. <if test="updateUsername != null">
  504. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  505. </if>
  506. <if test="updateTime != null">
  507. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  508. </if>
  509. <if test="insertUpdateRemark != null">
  510. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  511. </if>
  512. <if test="deleted != null">
  513. DELETED = #{deleted,jdbcType=DECIMAL},
  514. </if>
  515. <if test="requirementUnloadUnitId != null">
  516. REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId,jdbcType=DECIMAL},
  517. </if>
  518. </set>
  519. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  520. </update>
  521. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  522. <include refid="select"/>
  523. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  524. </select>
  525. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  526. <include refid="select"/>
  527. <include refid="where"/>
  528. </select>
  529. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  530. <include refid="select"/>
  531. <include refid="whereLike"/>
  532. </select>
  533. <insert id="batchInsert" parameterType="java.util.List">
  534. insert into AMSTRUCK_INWARD_REQUIREMENT
  535. (REQUIREMENT_ID,
  536. PURCHASE_ORDER_ID, REQUIREMENT_NUMBER,
  537. REQUIREMENT_TYPE, CAPACITY_TYPE_ID,
  538. REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID,
  539. REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT,
  540. LINE_ID, REQUIREMENT_WORK_ENVIRONMENT,
  541. REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
  542. REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS,
  543. INSERT_USERNAME, INSERT_TIME,
  544. UPDATE_USERNAME, UPDATE_TIME,
  545. INSERT_UPDATE_REMARK, DELETED,
  546. REQUIREMENT_UNLOAD_UNIT_ID)
  547. ( <foreach collection="list" item="item" separator="union all">
  548. select
  549. #{item.requirementId,jdbcType=DECIMAL},
  550. #{item.purchaseOrderId,jdbcType=DECIMAL}, #{item.requirementNumber,jdbcType=VARCHAR},
  551. #{item.requirementType,jdbcType=VARCHAR}, #{item.capacityTypeId,jdbcType=DECIMAL},
  552. #{item.requirementTruckTime,jdbcType=TIMESTAMP}, #{item.requirementShipperId,jdbcType=DECIMAL},
  553. #{item.requirementWorkType,jdbcType=DECIMAL}, #{item.requirementWorkContent,jdbcType=VARCHAR},
  554. #{item.lineId,jdbcType=DECIMAL}, #{item.requirementWorkEnvironment,jdbcType=VARCHAR},
  555. #{item.requirementEstimatedDuration,jdbcType=DECIMAL}, #{item.requirementOverlimit,jdbcType=VARCHAR},
  556. #{item.requiremntUnitId,jdbcType=DECIMAL}, #{item.requirementStatus,jdbcType=DECIMAL},
  557. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  558. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  559. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
  560. #{item.requirementUnloadUnitId,jdbcType=DECIMAL} from dual
  561. </foreach> )
  562. </insert>
  563. <update id="batchUpdate" parameterType="java.util.List">
  564. update AMSTRUCK_INWARD_REQUIREMENT
  565. set
  566. REQUIREMENT_ID=
  567. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  568. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementId,jdbcType=DECIMAL}
  569. </foreach>
  570. ,PURCHASE_ORDER_ID=
  571. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  572. when #{item.requirementId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
  573. </foreach>
  574. ,REQUIREMENT_NUMBER=
  575. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  576. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementNumber,jdbcType=VARCHAR}
  577. </foreach>
  578. ,REQUIREMENT_TYPE=
  579. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  580. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementType,jdbcType=VARCHAR}
  581. </foreach>
  582. ,CAPACITY_TYPE_ID=
  583. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  584. when #{item.requirementId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
  585. </foreach>
  586. ,REQUIREMENT_TRUCK_TIME=
  587. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  588. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementTruckTime,jdbcType=TIMESTAMP}
  589. </foreach>
  590. ,REQUIREMENT_SHIPPER_ID=
  591. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  592. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementShipperId,jdbcType=DECIMAL}
  593. </foreach>
  594. ,REQUIREMENT_WORK_TYPE=
  595. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  596. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkType,jdbcType=DECIMAL}
  597. </foreach>
  598. ,REQUIREMENT_WORK_CONTENT=
  599. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  600. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkContent,jdbcType=VARCHAR}
  601. </foreach>
  602. ,LINE_ID=
  603. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  604. when #{item.requirementId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
  605. </foreach>
  606. ,REQUIREMENT_WORK_ENVIRONMENT=
  607. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  608. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkEnvironment,jdbcType=VARCHAR}
  609. </foreach>
  610. ,REQUIREMENT_ESTIMATED_DURATION=
  611. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  612. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementEstimatedDuration,jdbcType=DECIMAL}
  613. </foreach>
  614. ,REQUIREMENT_OVERLIMIT=
  615. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  616. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementOverlimit,jdbcType=VARCHAR}
  617. </foreach>
  618. ,REQUIREMNT_UNIT_ID=
  619. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  620. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requiremntUnitId,jdbcType=DECIMAL}
  621. </foreach>
  622. ,REQUIREMENT_STATUS=
  623. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  624. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementStatus,jdbcType=DECIMAL}
  625. </foreach>
  626. ,INSERT_USERNAME=
  627. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  628. when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  629. </foreach>
  630. ,INSERT_TIME=
  631. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  632. when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  633. </foreach>
  634. ,UPDATE_USERNAME=
  635. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  636. when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  637. </foreach>
  638. ,UPDATE_TIME=
  639. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  640. when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  641. </foreach>
  642. ,INSERT_UPDATE_REMARK=
  643. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  644. when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  645. </foreach>
  646. ,DELETED=
  647. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  648. when #{item.requirementId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  649. </foreach>
  650. ,REQUIREMENT_UNLOAD_UNIT_ID=
  651. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  652. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementUnloadUnitId,jdbcType=DECIMAL}
  653. </foreach>
  654. where REQUIREMENT_ID in
  655. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  656. #{item.requirementId,jdbcType=DECIMAL}
  657. </foreach>
  658. </update>
  659. <delete id="batchDelete" parameterType="java.util.List">
  660. delete from AMSTRUCK_INWARD_REQUIREMENT
  661. where REQUIREMENT_ID in
  662. <foreach collection="list" item="id" open="(" close=")" separator=",">
  663. #{id}
  664. </foreach>
  665. </delete>
  666. <!-- 友情提示!!!-->
  667. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  668. <!-- 展示用车需求 -->
  669. <select id="getTruckRequirementList" resultType="java.util.Map" parameterType="java.util.Map">
  670. SELECT * FROM
  671. (SELECT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  672. RM.MATERIAL_NAME AS "materialName",
  673. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  674. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  675. AIR.REQUIREMENT_TYPE AS "requirementType",
  676. RCT.CAPACITY_TYPE_NAME AS "capacityTypeName",
  677. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  678. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  679. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  680. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  681. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  682. AIR.REQUIREMENT_OVERLIMIT AS "requirementOverlimit",
  683. RS.SHIPPER_NAME AS "shipperName",
  684. AIR.INSERT_TIME AS "insertTime",
  685. AIR.INSERT_USERNAME AS "insertUsername",
  686. AIR.REQUIREMENT_ID AS "requirementId",
  687. ARM.MATERIAL_COUNT AS "materialNumber",
  688. RW.WAREHOUSE_NAME AS "wareHouseName"
  689. FROM AMSTRUCK_INWARD_REQUIREMENT AIR
  690. LEFT JOIN AMS_PURCHASE_ORDER APO
  691. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  692. LEFT JOIN RMS_WAREHOUSE RW
  693. ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
  694. LEFT JOIN DIL_BATCH DB
  695. ON DB.BATCH_ID = APO.BATCH_ID
  696. LEFT JOIN RMS_MATERIAL RM
  697. ON RM.MATERIAL_ID = DB.MATERIAL_ID
  698. LEFT JOIN RMS_CAPACITY_TYPE RCT ON AIR.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
  699. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  700. LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
  701. ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  702. WHERE AIR.REQUIREMENT_STATUS = #{requirementStatus}
  703. AND AIR.DELETED = 0)
  704. <where>
  705. <if test="purchaseOrderNo != null">
  706. and
  707. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  708. "purchaseOrderNo" like '%${item}%'
  709. </foreach>
  710. </if>
  711. <if test="materialName != null">
  712. and
  713. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  714. "materialName" like '%${item}%'
  715. </foreach>
  716. </if>
  717. <if test="materialNumber != null">
  718. and
  719. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  720. "materialNumber" like '%${item}%'
  721. </foreach>
  722. </if>
  723. <if test="resultForeignShipName != null">
  724. and
  725. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  726. "resultForeignShipName" like '%${item}%'
  727. </foreach>
  728. </if>
  729. <if test="requirementNumber != null">
  730. and
  731. <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
  732. "requirementNumber" like '%${item}%'
  733. </foreach>
  734. </if>
  735. <if test="requirementType != null">
  736. and
  737. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  738. "requirementType" like '%${item}%'
  739. </foreach>
  740. </if>
  741. <if test="capacityTypeName != null">
  742. and
  743. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  744. "capacityTypeName" like '%${item}%'
  745. </foreach>
  746. </if>
  747. <if test="requirementTruckTime != null">
  748. and
  749. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  750. "requirementTruckTime" like '%${item}%'
  751. </foreach>
  752. </if>
  753. <if test="requirementWorkType != null">
  754. and
  755. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  756. "requirementWorkType" like '%${item}%'
  757. </foreach>
  758. </if>
  759. <if test="requirementWorkContent != null">
  760. and
  761. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  762. "requirementWorkContent" like '%${item}%'
  763. </foreach>
  764. </if>
  765. <if test="requirementWorkEnvironment != null">
  766. and
  767. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  768. "requirementWorkEnvironment" like '%${item}%'
  769. </foreach>
  770. </if>
  771. <if test="requirementEstimatedDuration != null">
  772. and
  773. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  774. "requirementEstimatedDuration" like '%${item}%'
  775. </foreach>
  776. </if>
  777. <if test="requirementOverlimit != null">
  778. and
  779. <foreach collection="requirementOverlimit" item="item" open="(" separator="or" close=")">
  780. "requirementOverlimit" like '%${item}%'
  781. </foreach>
  782. </if>
  783. <if test="shipperName != null">
  784. and
  785. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  786. "shipperName" like '%${item}%'
  787. </foreach>
  788. </if>
  789. <if test="wareHouseName != null">
  790. and
  791. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  792. "wareHouseName" like '%${item}%'
  793. </foreach>
  794. </if>
  795. <if test="insertTime != null">
  796. and
  797. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  798. "insertTime" like '%${item}%'
  799. </foreach>
  800. </if>
  801. <if test="insertUsername != null">
  802. and
  803. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  804. "insertUsername" like '%${item}%'
  805. </foreach>
  806. </if>
  807. </where>
  808. <include refid="orderBy"></include>
  809. </select>
  810. <!-- 展示用车需求 -->
  811. <select id="getFinishTruckRequirementList" resultType="java.util.Map" parameterType="java.util.Map">
  812. SELECT * FROM
  813. (SELECT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  814. RM.MATERIAL_NAME AS "materialName",
  815. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  816. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  817. AIR.REQUIREMENT_TYPE AS "requirementType",
  818. RCT.CAPACITY_TYPE_NAME AS "capacityTypeName",
  819. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  820. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  821. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  822. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  823. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  824. AIR.REQUIREMENT_OVERLIMIT AS "requirementOverlimit",
  825. RS.SHIPPER_NAME AS "shipperName",
  826. AIR.INSERT_TIME AS "insertTime",
  827. AIR.INSERT_USERNAME AS "insertUsername",
  828. AIR.REQUIREMENT_ID AS "requirementId",
  829. ARM.MATERIAL_COUNT AS "materialNumber",
  830. AIR.UPDATE_TIME AS "updateTime",
  831. AIR.UPDATE_USERNAME AS "updateUserName",
  832. RW.WAREHOUSE_NAME AS "wareHouseName"
  833. FROM (
  834. SELECT AIR2.REQUIREMENT_ID
  835. FROM AMSTRUCK_INWARD_REQUIREMENT AIR2
  836. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  837. ON AIR2.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  838. WHERE ARP.PLAN_ID IS NULL
  839. ) AIRP
  840. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  841. ON AIR.REQUIREMENT_ID = AIRP.REQUIREMENT_ID
  842. LEFT JOIN AMS_PURCHASE_ORDER APO
  843. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  844. LEFT JOIN DIL_BATCH DB
  845. ON DB.BATCH_ID = APO.BATCH_ID
  846. LEFT JOIN RMS_MATERIAL RM
  847. ON RM.MATERIAL_ID = DB.MATERIAL_ID
  848. LEFT JOIN RMS_CAPACITY_TYPE RCT ON AIR.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
  849. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  850. LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
  851. ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  852. LEFT JOIN RMS_WAREHOUSE RW
  853. ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
  854. WHERE AIR.REQUIREMENT_STATUS = #{requirementStatus}
  855. AND AIR.DELETED = 0)
  856. <where>
  857. <if test="purchaseOrderNo != null">
  858. and
  859. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  860. "purchaseOrderNo" like '%${item}%'
  861. </foreach>
  862. </if>
  863. <if test="materialName != null">
  864. and
  865. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  866. "materialName" like '%${item}%'
  867. </foreach>
  868. </if>
  869. <if test="materialNumber != null">
  870. and
  871. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  872. "materialNumber" like '%${item}%'
  873. </foreach>
  874. </if>
  875. <if test="resultForeignShipName != null">
  876. and
  877. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  878. "resultForeignShipName" like '%${item}%'
  879. </foreach>
  880. </if>
  881. <if test="requirementNumber != null">
  882. and
  883. <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
  884. "requirementNumber" like '%${item}%'
  885. </foreach>
  886. </if>
  887. <if test="requirementType != null">
  888. and
  889. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  890. "requirementType" like '%${item}%'
  891. </foreach>
  892. </if>
  893. <if test="capacityTypeName != null">
  894. and
  895. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  896. "capacityTypeName" like '%${item}%'
  897. </foreach>
  898. </if>
  899. <if test="requirementTruckTime != null">
  900. and
  901. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  902. "requirementTruckTime" like '%${item}%'
  903. </foreach>
  904. </if>
  905. <if test="requirementWorkType != null">
  906. and
  907. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  908. "requirementWorkType" like '%${item}%'
  909. </foreach>
  910. </if>
  911. <if test="requirementWorkContent != null">
  912. and
  913. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  914. "requirementWorkContent" like '%${item}%'
  915. </foreach>
  916. </if>
  917. <if test="requirementWorkEnvironment != null">
  918. and
  919. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  920. "requirementWorkEnvironment" like '%${item}%'
  921. </foreach>
  922. </if>
  923. <if test="requirementEstimatedDuration != null">
  924. and
  925. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  926. "requirementEstimatedDuration" like '%${item}%'
  927. </foreach>
  928. </if>
  929. <if test="requirementOverlimit != null">
  930. and
  931. <foreach collection="requirementOverlimit" item="item" open="(" separator="or" close=")">
  932. "requirementOverlimit" like '%${item}%'
  933. </foreach>
  934. </if>
  935. <if test="shipperName != null">
  936. and
  937. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  938. "shipperName" like '%${item}%'
  939. </foreach>
  940. </if>
  941. <if test="insertTime != null">
  942. and
  943. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  944. "insertTime" like '%${item}%'
  945. </foreach>
  946. </if>
  947. <if test="insertUsername != null">
  948. and
  949. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  950. "insertUsername" like '%${item}%'
  951. </foreach>
  952. </if>
  953. <if test="updateTime != null">
  954. and
  955. <foreach collection="updateTime" item="item" open="(" separator="or" close=")">
  956. "updateTime" like '%${item}%'
  957. </foreach>
  958. </if>
  959. <if test="updateUsername != null">
  960. and
  961. <foreach collection="updateUsername" item="item" open="(" separator="or" close=")">
  962. "updateUsername" like '%${item}%'
  963. </foreach>
  964. </if>
  965. <if test="wareHouseName != null">
  966. and
  967. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  968. "wareHouseName" like '%${item}%'
  969. </foreach>
  970. </if>
  971. </where>
  972. <include refid="orderBy"></include>
  973. </select>
  974. <sql id="orderBy">
  975. <if test="orderField != null and orderField != ''">
  976. order by "${orderField}"
  977. <if test="orderType != null and orderType != ''">
  978. ${orderType}
  979. </if>
  980. </if>
  981. <if test="orderField == null ">
  982. order by "insertTime" desc
  983. </if>
  984. </sql>
  985. <select id="getMaterialNumber" parameterType="DECIMAL" resultType="java.util.Map">
  986. SELECT ARM.MATERIAL_COUNT AS "materialNumber"
  987. FROM AMSTRUCK_REQUIREMENT_MATERIAL ARM
  988. </select>
  989. <select id="selectRequirement" parameterType="DECIMAL" resultType="java.util.Map">
  990. SELECT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  991. APO.PURCHASE_ORDER_ID AS "purchaseOrderId",
  992. RM.MATERIAL_NAME AS "materialName",
  993. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  994. RW.WAREHOUSE_NAME AS "wareHouseName",
  995. AIR.REQUIREMNT_UNIT_ID AS "requiremntUnitId",
  996. AIR.REQUIREMENT_UNLOAD_UNIT_ID AS "requirementUnloadUnitId",
  997. AIR.REQUIREMENT_TYPE AS "requirementType",
  998. AIR.CAPACITY_TYPE_ID AS "capacityTypeId",
  999. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  1000. AIR.REQUIREMENT_SHIPPER_ID AS "requirementShipperId",
  1001. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  1002. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  1003. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  1004. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  1005. AIR.REQUIREMENT_OVERLIMIT AS "requirementOverlimit"
  1006. FROM AMSTRUCK_INWARD_REQUIREMENT AIR
  1007. LEFT JOIN AMS_PURCHASE_ORDER APO
  1008. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1009. LEFT JOIN DIL_BATCH DB
  1010. ON APO.BATCH_ID = DB.BATCH_ID
  1011. LEFT JOIN RMS_MATERIAL RM
  1012. ON RM.MATERIAL_ID = DB.MATERIAL_ID
  1013. LEFT JOIN RMS_WAREHOUSE RW
  1014. ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
  1015. WHERE AIR.REQUIREMENT_ID = #{requirementId}
  1016. </select>
  1017. <!-- 查询批次和采购订单信息 -->
  1018. <select id="getPurchaseIdByBatch" parameterType="java.util.Map" resultType="java.util.Map">
  1019. SELECT * FROM(
  1020. SELECT DISTINCT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  1021. APO.PURCHASE_ORDER_ID AS "purchaseOrderId",
  1022. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  1023. RM.MATERIAL_NAME AS "materialName",
  1024. DB.INSERT_TIME AS "insertTime"
  1025. FROM (SELECT * FROM AMS_PURCHASE_ORDER APO
  1026. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  1027. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1028. WHERE AIR.PURCHASE_ORDER_ID IS NULL) APOIR
  1029. LEFT JOIN DIL_BATCH DB
  1030. ON DB.BATCH_ID = APOIR.BATCH_ID
  1031. LEFT JOIN AMS_PURCHASE_ORDER APO
  1032. ON APO.BATCH_ID = DB.BATCH_ID
  1033. LEFT JOIN RMS_MATERIAL RM
  1034. ON RM.MATERIAL_ID = DB.MATERIAL_ID)
  1035. <where>
  1036. <if test="purchaseOrderNo != null">
  1037. and
  1038. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1039. "purchaseOrderNo" like '%${item}%'
  1040. </foreach>
  1041. </if>
  1042. <if test="materialName != null">
  1043. and
  1044. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1045. "materialName" like '%${item}%'
  1046. </foreach>
  1047. </if>
  1048. <if test="resultForeignShipName != null">
  1049. and
  1050. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1051. "resultForeignShipName" like '%${item}%'
  1052. </foreach>
  1053. </if>
  1054. </where>
  1055. <include refid="orderBy"></include>
  1056. </select>
  1057. <select id="getCapacityType" resultType="java.util.Map">
  1058. SELECT RCT.CAPACITY_TYPE_ID AS "id",
  1059. RCT.CAPACITY_TYPE_ID AS "value",
  1060. RCT.CAPACITY_TYPE_NAME AS "label"
  1061. FROM RMS_CAPACITY_TYPE RCT
  1062. </select>
  1063. <select id="getShipperUser" resultType="java.util.Map">
  1064. SELECT RS.SHIPPER_ID AS "id",
  1065. RS.SHIPPER_ID AS "value",
  1066. RS.SHIPPER_NAME AS "label"
  1067. FROM RMS_SHIPPER RS
  1068. </select>
  1069. <!-- 仓库模代框 -->
  1070. <select id="getWareHouse" parameterType="java.util.Map" resultType="java.util.Map">
  1071. SELECT RW.WAREHOUSE_ID AS "wareHouseId",
  1072. RW.WAREHOUSE_NAME AS "wareHouseName"
  1073. FROM RMS_WAREHOUSE RW
  1074. </select>
  1075. <select id="getMaterialId" parameterType="DECIMAL" resultType="DECIMAL">
  1076. SELECT DB.MATERIAL_ID AS "materialId"
  1077. FROM AMS_PURCHASE_ORDER APO
  1078. LEFT JOIN DIL_BATCH DB
  1079. ON DB.BATCH_ID = APO.BATCH_ID
  1080. WHERE APO.PURCHASE_ORDER_ID = #{purchaseOrderId}
  1081. </select>
  1082. </mapper>