AmstruckInwardRequirementMapper.xml 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342
  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="VARCHAR" 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. <result column="REQUIREMENT_PLATFORM_ID" jdbcType="DECIMAL" property="requirementPlatformId" />
  28. <result column="REQUIREMENT_LINK_TYPE" jdbcType="DECIMAL" property="requirementLinkType" />
  29. <result column="DUE_DATE" jdbcType="TIMESTAMP" property="dueDate" />
  30. <result column="IS_MINERAL" jdbcType="VARCHAR" property="isMineral" />
  31. </resultMap>
  32. <sql id="columns">
  33. REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER, REQUIREMENT_TYPE, CAPACITY_TYPE_ID,
  34. REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT,
  35. LINE_ID, REQUIREMENT_WORK_ENVIRONMENT, REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
  36. REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  37. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, REQUIREMENT_UNLOAD_UNIT_ID, REQUIREMENT_PLATFORM_ID,
  38. REQUIREMENT_LINK_TYPE, DUE_DATE, IS_MINERAL
  39. </sql>
  40. <sql id="columns_alias">
  41. t.REQUIREMENT_ID, t.PURCHASE_ORDER_ID, t.REQUIREMENT_NUMBER, t.REQUIREMENT_TYPE,
  42. t.CAPACITY_TYPE_ID, t.REQUIREMENT_TRUCK_TIME, t.REQUIREMENT_SHIPPER_ID, t.REQUIREMENT_WORK_TYPE,
  43. t.REQUIREMENT_WORK_CONTENT, t.LINE_ID, t.REQUIREMENT_WORK_ENVIRONMENT, t.REQUIREMENT_ESTIMATED_DURATION,
  44. t.REQUIREMENT_OVERLIMIT, t.REQUIREMNT_UNIT_ID, t.REQUIREMENT_STATUS, t.INSERT_USERNAME,
  45. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
  46. t.REQUIREMENT_UNLOAD_UNIT_ID, t.REQUIREMENT_PLATFORM_ID, t.REQUIREMENT_LINK_TYPE,
  47. t.DUE_DATE, t.IS_MINERAL
  48. </sql>
  49. <sql id="select">
  50. SELECT <include refid="columns" /> FROM AMSTRUCK_INWARD_REQUIREMENT
  51. </sql>
  52. <sql id="select_alias">
  53. SELECT <include refid="columns_alias" /> FROM AMSTRUCK_INWARD_REQUIREMENT t
  54. </sql>
  55. <sql id="where">
  56. <where>
  57. <if test="requirementId != null">
  58. and REQUIREMENT_ID = #{requirementId}
  59. </if>
  60. <if test="purchaseOrderId != null">
  61. and PURCHASE_ORDER_ID = #{purchaseOrderId}
  62. </if>
  63. <if test="requirementNumber != null and requirementNumber != ''">
  64. and REQUIREMENT_NUMBER = #{requirementNumber}
  65. </if>
  66. <if test="requirementType != null and requirementType != ''">
  67. and REQUIREMENT_TYPE = #{requirementType}
  68. </if>
  69. <if test="capacityTypeId != null">
  70. and CAPACITY_TYPE_ID = #{capacityTypeId}
  71. </if>
  72. <if test="requirementTruckTime != null">
  73. and TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = #{requirementTruckTime}
  74. </if>
  75. <if test="requirementShipperId != null">
  76. and REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
  77. </if>
  78. <if test="requirementWorkType != null and requirementWorkType != ''">
  79. and REQUIREMENT_WORK_TYPE = #{requirementWorkType}
  80. </if>
  81. <if test="requirementWorkContent != null and requirementWorkContent != ''">
  82. and REQUIREMENT_WORK_CONTENT = #{requirementWorkContent}
  83. </if>
  84. <if test="lineId != null">
  85. and LINE_ID = #{lineId}
  86. </if>
  87. <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
  88. and REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment}
  89. </if>
  90. <if test="requirementEstimatedDuration != null">
  91. and REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
  92. </if>
  93. <if test="requirementOverlimit != null and requirementOverlimit != ''">
  94. and REQUIREMENT_OVERLIMIT = #{requirementOverlimit}
  95. </if>
  96. <if test="requiremntUnitId != null">
  97. and REQUIREMNT_UNIT_ID = #{requiremntUnitId}
  98. </if>
  99. <if test="requirementStatus != null">
  100. and REQUIREMENT_STATUS = #{requirementStatus}
  101. </if>
  102. <if test="insertUsername != null and insertUsername != ''">
  103. and INSERT_USERNAME = #{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 = #{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 = #{insertUpdateRemark}
  116. </if>
  117. <if test="deleted != null">
  118. and DELETED = #{deleted}
  119. </if>
  120. <if test="requirementUnloadUnitId != null">
  121. and REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId}
  122. </if>
  123. <if test="requirementPlatformId != null">
  124. and REQUIREMENT_PLATFORM_ID = #{requirementPlatformId}
  125. </if>
  126. <if test="requirementLinkType != null">
  127. and REQUIREMENT_LINK_TYPE = #{requirementLinkType}
  128. </if>
  129. <if test="dueDate != null">
  130. and TO_CHAR(DUE_DATE,'yyyy-MM-dd') = #{dueDate}
  131. </if>
  132. <if test="isMineral != null and isMineral != ''">
  133. and IS_MINERAL = #{isMineral}
  134. </if>
  135. </where>
  136. </sql>
  137. <sql id="whereLike">
  138. <where>
  139. <if test="requirementId != null">
  140. and REQUIREMENT_ID = #{requirementId}
  141. </if>
  142. <if test="purchaseOrderId != null">
  143. and PURCHASE_ORDER_ID = #{purchaseOrderId}
  144. </if>
  145. <if test="requirementNumber != null and requirementNumber != ''">
  146. and REQUIREMENT_NUMBER LIKE '%${requirementNumber}%'
  147. </if>
  148. <if test="requirementType != null and requirementType != ''">
  149. and REQUIREMENT_TYPE LIKE '%${requirementType}%'
  150. </if>
  151. <if test="capacityTypeId != null">
  152. and CAPACITY_TYPE_ID = #{capacityTypeId}
  153. </if>
  154. <if test="requirementTruckTime != null">
  155. and TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = #{requirementTruckTime}
  156. </if>
  157. <if test="requirementShipperId != null">
  158. and REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
  159. </if>
  160. <if test="requirementWorkType != null and requirementWorkType != ''">
  161. and REQUIREMENT_WORK_TYPE LIKE '%${requirementWorkType}%'
  162. </if>
  163. <if test="requirementWorkContent != null and requirementWorkContent != ''">
  164. and REQUIREMENT_WORK_CONTENT LIKE '%${requirementWorkContent}%'
  165. </if>
  166. <if test="lineId != null">
  167. and LINE_ID = #{lineId}
  168. </if>
  169. <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
  170. and REQUIREMENT_WORK_ENVIRONMENT LIKE '%${requirementWorkEnvironment}%'
  171. </if>
  172. <if test="requirementEstimatedDuration != null">
  173. and REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
  174. </if>
  175. <if test="requirementOverlimit != null and requirementOverlimit != ''">
  176. and REQUIREMENT_OVERLIMIT LIKE '%${requirementOverlimit}%'
  177. </if>
  178. <if test="requiremntUnitId != null">
  179. and REQUIREMNT_UNIT_ID = #{requiremntUnitId}
  180. </if>
  181. <if test="requirementStatus != null">
  182. and REQUIREMENT_STATUS = #{requirementStatus}
  183. </if>
  184. <if test="insertUsername != null and insertUsername != ''">
  185. and INSERT_USERNAME LIKE '%${insertUsername}%'
  186. </if>
  187. <if test="insertTime != null">
  188. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  189. </if>
  190. <if test="updateUsername != null and updateUsername != ''">
  191. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  192. </if>
  193. <if test="updateTime != null">
  194. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  195. </if>
  196. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  197. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  198. </if>
  199. <if test="deleted != null">
  200. and DELETED = #{deleted}
  201. </if>
  202. <if test="requirementUnloadUnitId != null">
  203. and REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId}
  204. </if>
  205. <if test="requirementPlatformId != null">
  206. and REQUIREMENT_PLATFORM_ID = #{requirementPlatformId}
  207. </if>
  208. <if test="requirementLinkType != null">
  209. and REQUIREMENT_LINK_TYPE = #{requirementLinkType}
  210. </if>
  211. <if test="dueDate != null">
  212. and TO_CHAR(DUE_DATE,'yyyy-MM-dd') = #{dueDate}
  213. </if>
  214. <if test="isMineral != null and isMineral != ''">
  215. and IS_MINERAL LIKE '%${isMineral}%'
  216. </if>
  217. </where>
  218. </sql>
  219. <delete id="deleteByPrimaryKey" parameterType="decimal">
  220. delete from AMSTRUCK_INWARD_REQUIREMENT
  221. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  222. </delete>
  223. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  224. delete from AMSTRUCK_INWARD_REQUIREMENT
  225. where 1!=1
  226. <if test="purchaseOrderId != null">
  227. or PURCHASE_ORDER_ID = #{purchaseOrderId}
  228. </if>
  229. <if test="requirementNumber != null and requirementNumber != ''">
  230. or REQUIREMENT_NUMBER = #{requirementNumber}
  231. </if>
  232. <if test="requirementType != null and requirementType != ''">
  233. or REQUIREMENT_TYPE = #{requirementType}
  234. </if>
  235. <if test="capacityTypeId != null">
  236. or CAPACITY_TYPE_ID = #{capacityTypeId}
  237. </if>
  238. <if test="requirementTruckTime != null">
  239. or TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = '#{requirementTruckTime}'
  240. </if>
  241. <if test="requirementShipperId != null">
  242. or REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
  243. </if>
  244. <if test="requirementWorkType != null and requirementWorkType != ''">
  245. or REQUIREMENT_WORK_TYPE = #{requirementWorkType}
  246. </if>
  247. <if test="requirementWorkContent != null and requirementWorkContent != ''">
  248. or REQUIREMENT_WORK_CONTENT = #{requirementWorkContent}
  249. </if>
  250. <if test="lineId != null">
  251. or LINE_ID = #{lineId}
  252. </if>
  253. <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
  254. or REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment}
  255. </if>
  256. <if test="requirementEstimatedDuration != null">
  257. or REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
  258. </if>
  259. <if test="requirementOverlimit != null and requirementOverlimit != ''">
  260. or REQUIREMENT_OVERLIMIT = #{requirementOverlimit}
  261. </if>
  262. <if test="requiremntUnitId != null">
  263. or REQUIREMNT_UNIT_ID = #{requiremntUnitId}
  264. </if>
  265. <if test="requirementStatus != null">
  266. or REQUIREMENT_STATUS = #{requirementStatus}
  267. </if>
  268. <if test="insertUsername != null and insertUsername != ''">
  269. or INSERT_USERNAME = #{insertUsername}
  270. </if>
  271. <if test="insertTime != null">
  272. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  273. </if>
  274. <if test="updateUsername != null and updateUsername != ''">
  275. or UPDATE_USERNAME = #{updateUsername}
  276. </if>
  277. <if test="updateTime != null">
  278. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  279. </if>
  280. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  281. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  282. </if>
  283. <if test="deleted != null">
  284. or DELETED = #{deleted}
  285. </if>
  286. <if test="requirementUnloadUnitId != null">
  287. or REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId}
  288. </if>
  289. <if test="requirementPlatformId != null">
  290. or REQUIREMENT_PLATFORM_ID = #{requirementPlatformId}
  291. </if>
  292. <if test="requirementLinkType != null">
  293. or REQUIREMENT_LINK_TYPE = #{requirementLinkType}
  294. </if>
  295. <if test="dueDate != null">
  296. or TO_CHAR(DUE_DATE,'yyyy-MM-dd') = '#{dueDate}'
  297. </if>
  298. <if test="isMineral != null and isMineral != ''">
  299. or IS_MINERAL = #{isMineral}
  300. </if>
  301. </delete>
  302. <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  303. insert into AMSTRUCK_INWARD_REQUIREMENT (REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER,
  304. REQUIREMENT_TYPE, CAPACITY_TYPE_ID, REQUIREMENT_TRUCK_TIME,
  305. REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE,
  306. REQUIREMENT_WORK_CONTENT, LINE_ID, REQUIREMENT_WORK_ENVIRONMENT,
  307. REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
  308. REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME,
  309. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  310. INSERT_UPDATE_REMARK, DELETED, REQUIREMENT_UNLOAD_UNIT_ID,
  311. REQUIREMENT_PLATFORM_ID, REQUIREMENT_LINK_TYPE,
  312. DUE_DATE, IS_MINERAL)
  313. values (#{requirementId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{requirementNumber,jdbcType=VARCHAR},
  314. #{requirementType,jdbcType=VARCHAR}, #{capacityTypeId,jdbcType=DECIMAL}, #{requirementTruckTime,jdbcType=TIMESTAMP},
  315. #{requirementShipperId,jdbcType=DECIMAL}, #{requirementWorkType,jdbcType=VARCHAR},
  316. #{requirementWorkContent,jdbcType=VARCHAR}, #{lineId,jdbcType=DECIMAL}, #{requirementWorkEnvironment,jdbcType=VARCHAR},
  317. #{requirementEstimatedDuration,jdbcType=DECIMAL}, #{requirementOverlimit,jdbcType=VARCHAR},
  318. #{requiremntUnitId,jdbcType=DECIMAL}, #{requirementStatus,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR},
  319. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  320. #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{requirementUnloadUnitId,jdbcType=DECIMAL},
  321. #{requirementPlatformId,jdbcType=DECIMAL}, #{requirementLinkType,jdbcType=DECIMAL},
  322. #{dueDate,jdbcType=TIMESTAMP}, #{isMineral,jdbcType=VARCHAR})
  323. </insert>
  324. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  325. insert into AMSTRUCK_INWARD_REQUIREMENT
  326. <trim prefix="(" suffix=")" suffixOverrides=",">
  327. <if test="requirementId != null">
  328. REQUIREMENT_ID,
  329. </if>
  330. <if test="purchaseOrderId != null">
  331. PURCHASE_ORDER_ID,
  332. </if>
  333. <if test="requirementNumber != null">
  334. REQUIREMENT_NUMBER,
  335. </if>
  336. <if test="requirementType != null">
  337. REQUIREMENT_TYPE,
  338. </if>
  339. <if test="capacityTypeId != null">
  340. CAPACITY_TYPE_ID,
  341. </if>
  342. <if test="requirementTruckTime != null">
  343. REQUIREMENT_TRUCK_TIME,
  344. </if>
  345. <if test="requirementShipperId != null">
  346. REQUIREMENT_SHIPPER_ID,
  347. </if>
  348. <if test="requirementWorkType != null">
  349. REQUIREMENT_WORK_TYPE,
  350. </if>
  351. <if test="requirementWorkContent != null">
  352. REQUIREMENT_WORK_CONTENT,
  353. </if>
  354. <if test="lineId != null">
  355. LINE_ID,
  356. </if>
  357. <if test="requirementWorkEnvironment != null">
  358. REQUIREMENT_WORK_ENVIRONMENT,
  359. </if>
  360. <if test="requirementEstimatedDuration != null">
  361. REQUIREMENT_ESTIMATED_DURATION,
  362. </if>
  363. <if test="requirementOverlimit != null">
  364. REQUIREMENT_OVERLIMIT,
  365. </if>
  366. <if test="requiremntUnitId != null">
  367. REQUIREMNT_UNIT_ID,
  368. </if>
  369. <if test="requirementStatus != null">
  370. REQUIREMENT_STATUS,
  371. </if>
  372. <if test="insertUsername != null">
  373. INSERT_USERNAME,
  374. </if>
  375. <if test="insertTime != null">
  376. INSERT_TIME,
  377. </if>
  378. <if test="updateUsername != null">
  379. UPDATE_USERNAME,
  380. </if>
  381. <if test="updateTime != null">
  382. UPDATE_TIME,
  383. </if>
  384. <if test="insertUpdateRemark != null">
  385. INSERT_UPDATE_REMARK,
  386. </if>
  387. <if test="deleted != null">
  388. DELETED,
  389. </if>
  390. <if test="requirementUnloadUnitId != null">
  391. REQUIREMENT_UNLOAD_UNIT_ID,
  392. </if>
  393. <if test="requirementPlatformId != null">
  394. REQUIREMENT_PLATFORM_ID,
  395. </if>
  396. <if test="requirementLinkType != null">
  397. REQUIREMENT_LINK_TYPE,
  398. </if>
  399. <if test="dueDate != null">
  400. DUE_DATE,
  401. </if>
  402. <if test="isMineral != null">
  403. IS_MINERAL,
  404. </if>
  405. </trim>
  406. <trim prefix="values (" suffix=")" suffixOverrides=",">
  407. <if test="requirementId != null">
  408. #{requirementId,jdbcType=DECIMAL},
  409. </if>
  410. <if test="purchaseOrderId != null">
  411. #{purchaseOrderId,jdbcType=DECIMAL},
  412. </if>
  413. <if test="requirementNumber != null">
  414. #{requirementNumber,jdbcType=VARCHAR},
  415. </if>
  416. <if test="requirementType != null">
  417. #{requirementType,jdbcType=VARCHAR},
  418. </if>
  419. <if test="capacityTypeId != null">
  420. #{capacityTypeId,jdbcType=DECIMAL},
  421. </if>
  422. <if test="requirementTruckTime != null">
  423. #{requirementTruckTime,jdbcType=TIMESTAMP},
  424. </if>
  425. <if test="requirementShipperId != null">
  426. #{requirementShipperId,jdbcType=DECIMAL},
  427. </if>
  428. <if test="requirementWorkType != null">
  429. #{requirementWorkType,jdbcType=VARCHAR},
  430. </if>
  431. <if test="requirementWorkContent != null">
  432. #{requirementWorkContent,jdbcType=VARCHAR},
  433. </if>
  434. <if test="lineId != null">
  435. #{lineId,jdbcType=DECIMAL},
  436. </if>
  437. <if test="requirementWorkEnvironment != null">
  438. #{requirementWorkEnvironment,jdbcType=VARCHAR},
  439. </if>
  440. <if test="requirementEstimatedDuration != null">
  441. #{requirementEstimatedDuration,jdbcType=DECIMAL},
  442. </if>
  443. <if test="requirementOverlimit != null">
  444. #{requirementOverlimit,jdbcType=VARCHAR},
  445. </if>
  446. <if test="requiremntUnitId != null">
  447. #{requiremntUnitId,jdbcType=DECIMAL},
  448. </if>
  449. <if test="requirementStatus != null">
  450. #{requirementStatus,jdbcType=DECIMAL},
  451. </if>
  452. <if test="insertUsername != null">
  453. #{insertUsername,jdbcType=VARCHAR},
  454. </if>
  455. <if test="insertTime != null">
  456. #{insertTime,jdbcType=TIMESTAMP},
  457. </if>
  458. <if test="updateUsername != null">
  459. #{updateUsername,jdbcType=VARCHAR},
  460. </if>
  461. <if test="updateTime != null">
  462. #{updateTime,jdbcType=TIMESTAMP},
  463. </if>
  464. <if test="insertUpdateRemark != null">
  465. #{insertUpdateRemark,jdbcType=VARCHAR},
  466. </if>
  467. <if test="deleted != null">
  468. #{deleted,jdbcType=DECIMAL},
  469. </if>
  470. <if test="requirementUnloadUnitId != null">
  471. #{requirementUnloadUnitId,jdbcType=DECIMAL},
  472. </if>
  473. <if test="requirementPlatformId != null">
  474. #{requirementPlatformId,jdbcType=DECIMAL},
  475. </if>
  476. <if test="requirementLinkType != null">
  477. #{requirementLinkType,jdbcType=DECIMAL},
  478. </if>
  479. <if test="dueDate != null">
  480. #{dueDate,jdbcType=TIMESTAMP},
  481. </if>
  482. <if test="isMineral != null">
  483. #{isMineral,jdbcType=VARCHAR},
  484. </if>
  485. </trim>
  486. </insert>
  487. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  488. update AMSTRUCK_INWARD_REQUIREMENT
  489. set PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
  490. REQUIREMENT_NUMBER = #{requirementNumber,jdbcType=VARCHAR},
  491. REQUIREMENT_TYPE = #{requirementType,jdbcType=VARCHAR},
  492. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  493. REQUIREMENT_TRUCK_TIME = #{requirementTruckTime,jdbcType=TIMESTAMP},
  494. REQUIREMENT_SHIPPER_ID = #{requirementShipperId,jdbcType=DECIMAL},
  495. REQUIREMENT_WORK_TYPE = #{requirementWorkType,jdbcType=VARCHAR},
  496. REQUIREMENT_WORK_CONTENT = #{requirementWorkContent,jdbcType=VARCHAR},
  497. LINE_ID = #{lineId,jdbcType=DECIMAL},
  498. REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment,jdbcType=VARCHAR},
  499. REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration,jdbcType=DECIMAL},
  500. REQUIREMENT_OVERLIMIT = #{requirementOverlimit,jdbcType=VARCHAR},
  501. REQUIREMNT_UNIT_ID = #{requiremntUnitId,jdbcType=DECIMAL},
  502. REQUIREMENT_STATUS = #{requirementStatus,jdbcType=DECIMAL},
  503. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  504. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  505. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  506. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  507. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  508. DELETED = #{deleted,jdbcType=DECIMAL},
  509. REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId,jdbcType=DECIMAL},
  510. REQUIREMENT_PLATFORM_ID = #{requirementPlatformId,jdbcType=DECIMAL},
  511. REQUIREMENT_LINK_TYPE = #{requirementLinkType,jdbcType=DECIMAL},
  512. DUE_DATE = #{dueDate,jdbcType=TIMESTAMP},
  513. IS_MINERAL = #{isMineral,jdbcType=VARCHAR}
  514. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  515. </update>
  516. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  517. update AMSTRUCK_INWARD_REQUIREMENT
  518. <set>
  519. <if test="purchaseOrderId != null">
  520. PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
  521. </if>
  522. <if test="requirementNumber != null">
  523. REQUIREMENT_NUMBER = #{requirementNumber,jdbcType=VARCHAR},
  524. </if>
  525. <if test="requirementType != null">
  526. REQUIREMENT_TYPE = #{requirementType,jdbcType=VARCHAR},
  527. </if>
  528. <if test="capacityTypeId != null">
  529. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  530. </if>
  531. <if test="requirementTruckTime != null">
  532. REQUIREMENT_TRUCK_TIME = #{requirementTruckTime,jdbcType=TIMESTAMP},
  533. </if>
  534. <if test="requirementShipperId != null">
  535. REQUIREMENT_SHIPPER_ID = #{requirementShipperId,jdbcType=DECIMAL},
  536. </if>
  537. <if test="requirementWorkType != null">
  538. REQUIREMENT_WORK_TYPE = #{requirementWorkType,jdbcType=VARCHAR},
  539. </if>
  540. <if test="requirementWorkContent != null">
  541. REQUIREMENT_WORK_CONTENT = #{requirementWorkContent,jdbcType=VARCHAR},
  542. </if>
  543. <if test="lineId != null">
  544. LINE_ID = #{lineId,jdbcType=DECIMAL},
  545. </if>
  546. <if test="requirementWorkEnvironment != null">
  547. REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment,jdbcType=VARCHAR},
  548. </if>
  549. <if test="requirementEstimatedDuration != null">
  550. REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration,jdbcType=DECIMAL},
  551. </if>
  552. <if test="requirementOverlimit != null">
  553. REQUIREMENT_OVERLIMIT = #{requirementOverlimit,jdbcType=VARCHAR},
  554. </if>
  555. <if test="requiremntUnitId != null">
  556. REQUIREMNT_UNIT_ID = #{requiremntUnitId,jdbcType=DECIMAL},
  557. </if>
  558. <if test="requirementStatus != null">
  559. REQUIREMENT_STATUS = #{requirementStatus,jdbcType=DECIMAL},
  560. </if>
  561. <if test="insertUsername != null">
  562. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  563. </if>
  564. <if test="insertTime != null">
  565. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  566. </if>
  567. <if test="updateUsername != null">
  568. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  569. </if>
  570. <if test="updateTime != null">
  571. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  572. </if>
  573. <if test="insertUpdateRemark != null">
  574. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  575. </if>
  576. <if test="deleted != null">
  577. DELETED = #{deleted,jdbcType=DECIMAL},
  578. </if>
  579. <if test="requirementUnloadUnitId != null">
  580. REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId,jdbcType=DECIMAL},
  581. </if>
  582. <if test="requirementPlatformId != null">
  583. REQUIREMENT_PLATFORM_ID = #{requirementPlatformId,jdbcType=DECIMAL},
  584. </if>
  585. <if test="requirementLinkType != null">
  586. REQUIREMENT_LINK_TYPE = #{requirementLinkType,jdbcType=DECIMAL},
  587. </if>
  588. <if test="dueDate != null">
  589. DUE_DATE = #{dueDate,jdbcType=TIMESTAMP},
  590. </if>
  591. <if test="isMineral != null">
  592. IS_MINERAL = #{isMineral,jdbcType=VARCHAR},
  593. </if>
  594. </set>
  595. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  596. </update>
  597. <select id="selectByPrimaryKey" parameterType="decimal" resultMap="BaseResultMap">
  598. <include refid="select" />
  599. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  600. </select>
  601. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  602. <include refid="select" />
  603. <include refid="where" />
  604. </select>
  605. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  606. <include refid="select" />
  607. <include refid="whereLike" />
  608. </select>
  609. <insert id="batchInsert" parameterType="java.util.List">
  610. insert into AMSTRUCK_INWARD_REQUIREMENT
  611. (REQUIREMENT_ID,
  612. PURCHASE_ORDER_ID, REQUIREMENT_NUMBER,
  613. REQUIREMENT_TYPE, CAPACITY_TYPE_ID,
  614. REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID,
  615. REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT,
  616. LINE_ID, REQUIREMENT_WORK_ENVIRONMENT,
  617. REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
  618. REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS,
  619. INSERT_USERNAME, INSERT_TIME,
  620. UPDATE_USERNAME, UPDATE_TIME,
  621. INSERT_UPDATE_REMARK, DELETED,
  622. REQUIREMENT_UNLOAD_UNIT_ID, REQUIREMENT_PLATFORM_ID,
  623. REQUIREMENT_LINK_TYPE, DUE_DATE,
  624. IS_MINERAL)
  625. ( <foreach collection="list" item="item" separator="union all">
  626. select
  627. #{item.requirementId,jdbcType=DECIMAL},
  628. #{item.purchaseOrderId,jdbcType=DECIMAL}, #{item.requirementNumber,jdbcType=VARCHAR},
  629. #{item.requirementType,jdbcType=VARCHAR}, #{item.capacityTypeId,jdbcType=DECIMAL},
  630. #{item.requirementTruckTime,jdbcType=TIMESTAMP}, #{item.requirementShipperId,jdbcType=DECIMAL},
  631. #{item.requirementWorkType,jdbcType=VARCHAR}, #{item.requirementWorkContent,jdbcType=VARCHAR},
  632. #{item.lineId,jdbcType=DECIMAL}, #{item.requirementWorkEnvironment,jdbcType=VARCHAR},
  633. #{item.requirementEstimatedDuration,jdbcType=DECIMAL}, #{item.requirementOverlimit,jdbcType=VARCHAR},
  634. #{item.requiremntUnitId,jdbcType=DECIMAL}, #{item.requirementStatus,jdbcType=DECIMAL},
  635. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  636. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  637. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
  638. #{item.requirementUnloadUnitId,jdbcType=DECIMAL}, #{item.requirementPlatformId,jdbcType=DECIMAL},
  639. #{item.requirementLinkType,jdbcType=DECIMAL}, #{item.dueDate,jdbcType=TIMESTAMP},
  640. #{item.isMineral,jdbcType=VARCHAR} from dual
  641. </foreach> )
  642. </insert>
  643. <update id="batchUpdate" parameterType="java.util.List">
  644. update AMSTRUCK_INWARD_REQUIREMENT
  645. set
  646. REQUIREMENT_ID=
  647. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  648. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementId,jdbcType=DECIMAL}
  649. </foreach>
  650. ,PURCHASE_ORDER_ID=
  651. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  652. when #{item.requirementId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
  653. </foreach>
  654. ,REQUIREMENT_NUMBER=
  655. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  656. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementNumber,jdbcType=VARCHAR}
  657. </foreach>
  658. ,REQUIREMENT_TYPE=
  659. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  660. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementType,jdbcType=VARCHAR}
  661. </foreach>
  662. ,CAPACITY_TYPE_ID=
  663. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  664. when #{item.requirementId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
  665. </foreach>
  666. ,REQUIREMENT_TRUCK_TIME=
  667. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  668. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementTruckTime,jdbcType=TIMESTAMP}
  669. </foreach>
  670. ,REQUIREMENT_SHIPPER_ID=
  671. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  672. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementShipperId,jdbcType=DECIMAL}
  673. </foreach>
  674. ,REQUIREMENT_WORK_TYPE=
  675. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  676. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkType,jdbcType=VARCHAR}
  677. </foreach>
  678. ,REQUIREMENT_WORK_CONTENT=
  679. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  680. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkContent,jdbcType=VARCHAR}
  681. </foreach>
  682. ,LINE_ID=
  683. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  684. when #{item.requirementId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
  685. </foreach>
  686. ,REQUIREMENT_WORK_ENVIRONMENT=
  687. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  688. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkEnvironment,jdbcType=VARCHAR}
  689. </foreach>
  690. ,REQUIREMENT_ESTIMATED_DURATION=
  691. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  692. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementEstimatedDuration,jdbcType=DECIMAL}
  693. </foreach>
  694. ,REQUIREMENT_OVERLIMIT=
  695. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  696. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementOverlimit,jdbcType=VARCHAR}
  697. </foreach>
  698. ,REQUIREMNT_UNIT_ID=
  699. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  700. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requiremntUnitId,jdbcType=DECIMAL}
  701. </foreach>
  702. ,REQUIREMENT_STATUS=
  703. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  704. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementStatus,jdbcType=DECIMAL}
  705. </foreach>
  706. ,INSERT_USERNAME=
  707. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  708. when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  709. </foreach>
  710. ,INSERT_TIME=
  711. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  712. when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  713. </foreach>
  714. ,UPDATE_USERNAME=
  715. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  716. when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  717. </foreach>
  718. ,UPDATE_TIME=
  719. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  720. when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  721. </foreach>
  722. ,INSERT_UPDATE_REMARK=
  723. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  724. when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  725. </foreach>
  726. ,DELETED=
  727. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  728. when #{item.requirementId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  729. </foreach>
  730. ,REQUIREMENT_UNLOAD_UNIT_ID=
  731. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  732. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementUnloadUnitId,jdbcType=DECIMAL}
  733. </foreach>
  734. ,REQUIREMENT_PLATFORM_ID=
  735. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  736. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementPlatformId,jdbcType=DECIMAL}
  737. </foreach>
  738. ,REQUIREMENT_LINK_TYPE=
  739. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  740. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementLinkType,jdbcType=DECIMAL}
  741. </foreach>
  742. ,DUE_DATE=
  743. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  744. when #{item.requirementId,jdbcType=DECIMAL} then #{item.dueDate,jdbcType=TIMESTAMP}
  745. </foreach>
  746. ,IS_MINERAL=
  747. <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
  748. when #{item.requirementId,jdbcType=DECIMAL} then #{item.isMineral,jdbcType=VARCHAR}
  749. </foreach>
  750. where REQUIREMENT_ID in
  751. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  752. #{item.requirementId,jdbcType=DECIMAL}
  753. </foreach>
  754. </update>
  755. <delete id="batchDelete" parameterType="java.util.List">
  756. delete from AMSTRUCK_INWARD_REQUIREMENT
  757. where REQUIREMENT_ID in
  758. <foreach close=")" collection="list" item="id" open="(" separator=",">
  759. #{id}
  760. </foreach>
  761. </delete>
  762. <!-- 友情提示!!!-->
  763. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  764. <!-- 展示用车需求 -->
  765. <select id="getTruckRequirementList" resultType="java.util.Map" parameterType="java.util.Map">
  766. SELECT
  767. *
  768. FROM
  769. (
  770. SELECT
  771. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  772. AIR.REQUIREMENT_TYPE AS "requirementType",
  773. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  774. RTR.TRANS_RANGE_VALUE AS "rangeValue",
  775. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  776. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  777. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  778. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  779. AIR.REQUIREMENT_OVERLIMIT AS "requirementOverlimit",
  780. RS.SHIPPER_NAME AS "shipperName",
  781. AIR.INSERT_TIME AS "insertTime",
  782. AIR.DUE_DATE AS "dueDate",
  783. AIR.INSERT_USERNAME AS "insertUsername",
  784. AIR.REQUIREMENT_ID AS "requirementId",
  785. rw1.warehouse_name "unloadName",
  786. rw1.WAREHOUSE_ID "unloadId",
  787. rw2.warehouse_name "loadName",
  788. rw2.WAREHOUSE_ID "loadId",
  789. arm.material_weight "materialWeight",
  790. arm.material_count "materialCount",
  791. arm.MATERIAL_ID "materialId",
  792. rm.material_name || rm.material_specification || '(' || rm.material_model || ')' "materialName",
  793. AIR.INSERT_UPDATE_REMARK "Tel"
  794. FROM
  795. AMSTRUCK_INWARD_REQUIREMENT AIR
  796. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  797. LEFT JOIN amstruck_requirement_material arm ON air.requirement_id = arm.requirement_id
  798. LEFT JOIN rms_warehouse rw1 ON rw1.warehouse_id = arm.requirement_unload_unit_id
  799. LEFT JOIN rms_warehouse rw2 ON rw2.warehouse_id = arm.requirement_platform_id
  800. LEFT JOIN rms_material rm ON rm.material_id = arm.material_id
  801. LEFT JOIN amstruck_inward_requirement air ON air.requirement_id = arm.requirement_id
  802. LEFT JOIN RMS_TRANS_RANGE RTR ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
  803. WHERE
  804. AIR.DELETED = 0
  805. AND AIR.PURCHASE_ORDER_ID IS NULL
  806. <if test="con !=null ">
  807. AND AIR.INSERT_USERNAME LIKE #{con}
  808. </if>
  809. <if test="requirementStatus ==0 ">
  810. AND AIR.REQUIREMENT_STATUS = 0
  811. </if>
  812. <if test="requirementStatus ==1 ">
  813. AND AIR.REQUIREMENT_STATUS in (1,2)
  814. </if>
  815. )
  816. <where>
  817. <if test="requirementType != null">
  818. and
  819. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  820. "requirementType" like '%${item}%'
  821. </foreach>
  822. </if>
  823. <if test="requirementTruckTime != null">
  824. and
  825. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  826. "requirementTruckTime" like '%${item}%'
  827. </foreach>
  828. </if>
  829. <if test="requirementWorkType != null">
  830. and
  831. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  832. "requirementWorkType" like '%${item}%'
  833. </foreach>
  834. </if>
  835. <if test="requirementWorkContent != null">
  836. and
  837. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  838. "requirementWorkContent" like '%${item}%'
  839. </foreach>
  840. </if>
  841. <if test="requirementWorkEnvironment != null">
  842. and
  843. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  844. "requirementWorkEnvironment" like '%${item}%'
  845. </foreach>
  846. </if>
  847. <if test="requirementEstimatedDuration != null">
  848. and
  849. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  850. "requirementEstimatedDuration" like '%${item}%'
  851. </foreach>
  852. </if>
  853. <if test="requirementOverlimit != null">
  854. and
  855. <foreach collection="requirementOverlimit" item="item" open="(" separator="or" close=")">
  856. "requirementOverlimit" like '%${item}%'
  857. </foreach>
  858. </if>
  859. <if test="shipperName != null">
  860. and
  861. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  862. "shipperName" like '%${item}%'
  863. </foreach>
  864. </if>
  865. <if test="wareHouseName != null">
  866. and
  867. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  868. "wareHouseName" like '%${item}%'
  869. </foreach>
  870. </if>
  871. <if test="dueDate != null">
  872. and
  873. <foreach collection="dueDate" item="item" open="(" separator="or" close=")">
  874. "dueDate" like '%${item}%'
  875. </foreach>
  876. </if>
  877. <if test="insertTime != null">
  878. and
  879. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  880. "insertTime" like '%${item}%'
  881. </foreach>
  882. </if>
  883. <if test="insertUsername != null">
  884. and
  885. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  886. "insertUsername" like '%${item}%'
  887. </foreach>
  888. </if>
  889. </where>
  890. <include refid="orderBy"></include>
  891. </select>
  892. <!-- 展示用车需求 -->
  893. <select id="getFinishTruckRequirementList" resultType="java.util.Map" parameterType="java.util.Map">
  894. SELECT
  895. *
  896. FROM
  897. (
  898. SELECT
  899. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  900. AIR.REQUIREMENT_TYPE AS "requirementType",
  901. RTR.TRANS_RANGE_VALUE AS "rangeValue",
  902. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  903. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  904. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  905. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  906. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  907. AIR.REQUIREMENT_OVERLIMIT AS "requirementOverlimit",
  908. RS.SHIPPER_NAME AS "shipperName",
  909. AIR.INSERT_TIME AS "insertTime",
  910. AIR.INSERT_USERNAME AS "insertUsername",
  911. AIR.REQUIREMENT_ID AS "requirementId",
  912. AIR.UPDATE_TIME AS "updateTime",
  913. AIR.DUE_DATE AS "dueDate",
  914. AIR.UPDATE_USERNAME AS "updateUserName",
  915. rw1.warehouse_name "unloadName",
  916. rw1.WAREHOUSE_ID "unloadId",
  917. rw2.warehouse_name "loadName",
  918. rw2.WAREHOUSE_ID "loadId",
  919. arm.material_weight "materialWeight",
  920. arm.material_count "materialCount",
  921. arm.MATERIAL_ID "materialId",
  922. rm.material_name || rm.material_specification || '(' || rm.material_model || ')' "materialName",
  923. AIR.INSERT_UPDATE_REMARK "Tel"
  924. FROM
  925. ( SELECT AIR2.REQUIREMENT_ID FROM AMSTRUCK_INWARD_REQUIREMENT AIR2 LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP ON AIR2.REQUIREMENT_ID = ARP.REQUIREMENT_ID WHERE ARP.PLAN_ID IS NULL ) AIRP
  926. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR ON AIR.REQUIREMENT_ID = AIRP.REQUIREMENT_ID
  927. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  928. LEFT JOIN amstruck_requirement_material arm ON air.requirement_id = arm.requirement_id
  929. LEFT JOIN rms_warehouse rw1 ON rw1.warehouse_id = arm.requirement_unload_unit_id
  930. LEFT JOIN rms_warehouse rw2 ON rw2.warehouse_id = arm.requirement_platform_id
  931. LEFT JOIN rms_material rm ON rm.material_id = arm.material_id
  932. LEFT JOIN amstruck_inward_requirement air ON air.requirement_id = arm.requirement_id
  933. LEFT JOIN RMS_TRANS_RANGE RTR ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
  934. WHERE
  935. AIR.REQUIREMENT_STATUS = #{ requirementStatus }
  936. AND AIR.DELETED = 0
  937. <if test="con !=null ">
  938. AND AIR.INSERT_USERNAME LIKE #{con}
  939. </if>
  940. )
  941. <where>
  942. <if test="materialName != null">
  943. and
  944. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  945. "materialName" like '%${item}%'
  946. </foreach>
  947. </if>
  948. <if test="materialNumber != null">
  949. and
  950. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  951. "materialNumber" like '%${item}%'
  952. </foreach>
  953. </if>
  954. <if test="requirementNumber != null">
  955. and
  956. <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
  957. "requirementNumber" like '%${item}%'
  958. </foreach>
  959. </if>
  960. <if test="requirementType != null">
  961. and
  962. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  963. "requirementType" like '%${item}%'
  964. </foreach>
  965. </if>
  966. <if test="capacityTypeName != null">
  967. and
  968. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  969. "capacityTypeName" like '%${item}%'
  970. </foreach>
  971. </if>
  972. <if test="requirementTruckTime != null">
  973. and
  974. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  975. "requirementTruckTime" like '%${item}%'
  976. </foreach>
  977. </if>
  978. <if test="requirementWorkType != null">
  979. and
  980. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  981. "requirementWorkType" like '%${item}%'
  982. </foreach>
  983. </if>
  984. <if test="requirementWorkContent != null">
  985. and
  986. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  987. "requirementWorkContent" like '%${item}%'
  988. </foreach>
  989. </if>
  990. <if test="requirementWorkEnvironment != null">
  991. and
  992. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  993. "requirementWorkEnvironment" like '%${item}%'
  994. </foreach>
  995. </if>
  996. <if test="requirementEstimatedDuration != null">
  997. and
  998. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  999. "requirementEstimatedDuration" like '%${item}%'
  1000. </foreach>
  1001. </if>
  1002. <if test="requirementOverlimit != null">
  1003. and
  1004. <foreach collection="requirementOverlimit" item="item" open="(" separator="or" close=")">
  1005. "requirementOverlimit" like '%${item}%'
  1006. </foreach>
  1007. </if>
  1008. <if test="shipperName != null">
  1009. and
  1010. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1011. "shipperName" like '%${item}%'
  1012. </foreach>
  1013. </if>
  1014. <if test="insertTime != null">
  1015. and
  1016. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  1017. "insertTime" like '%${item}%'
  1018. </foreach>
  1019. </if>
  1020. <if test="dueDate != null">
  1021. and
  1022. <foreach collection="dueDate" item="item" open="(" separator="or" close=")">
  1023. "dueDate" like '%${item}%'
  1024. </foreach>
  1025. </if>
  1026. <if test="insertUsername != null">
  1027. and
  1028. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  1029. "insertUsername" like '%${item}%'
  1030. </foreach>
  1031. </if>
  1032. <if test="updateTime != null">
  1033. and
  1034. <foreach collection="updateTime" item="item" open="(" separator="or" close=")">
  1035. "updateTime" like '%${item}%'
  1036. </foreach>
  1037. </if>
  1038. <if test="updateUsername != null">
  1039. and
  1040. <foreach collection="updateUsername" item="item" open="(" separator="or" close=")">
  1041. "updateUsername" like '%${item}%'
  1042. </foreach>
  1043. </if>
  1044. <if test="wareHouseName != null">
  1045. and
  1046. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  1047. "wareHouseName" like '%${item}%'
  1048. </foreach>
  1049. </if>
  1050. </where>
  1051. <include refid="orderBy"></include>
  1052. </select>
  1053. <sql id="orderBy">
  1054. <if test="orderField != null and orderField != ''">
  1055. order by "${orderField}"
  1056. <if test="orderType != null and orderType != ''">
  1057. ${orderType}
  1058. </if>
  1059. </if>
  1060. <if test="orderField == null ">
  1061. order by "insertTime" desc
  1062. </if>
  1063. </sql>
  1064. <select id="getMaterialNumber" parameterType="DECIMAL" resultType="java.util.Map">
  1065. SELECT ARM.MATERIAL_COUNT AS "materialNumber"
  1066. FROM AMSTRUCK_REQUIREMENT_MATERIAL ARM
  1067. </select>
  1068. <select id="selectRequirement" parameterType="DECIMAL" resultType="java.util.Map">
  1069. SELECT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  1070. APO.PURCHASE_ORDER_ID AS "purchaseOrderId",
  1071. RM.MATERIAL_NAME AS "materialName",
  1072. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  1073. RW.WAREHOUSE_NAME AS "wareHouseName",
  1074. ARM.MATERIAL_WEIGHT AS "materialWeight",
  1075. AIR.REQUIREMNT_UNIT_ID AS "requiremntUnitId",
  1076. AIR.REQUIREMENT_UNLOAD_UNIT_ID AS "requirementUnloadUnitId",
  1077. AIR.REQUIREMENT_TYPE AS "requirementType",
  1078. AIR.CAPACITY_TYPE_ID AS "capacityTypeId",
  1079. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  1080. AIR.REQUIREMENT_SHIPPER_ID AS "requirementShipperId",
  1081. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  1082. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  1083. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  1084. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  1085. AIR.REQUIREMENT_OVERLIMIT AS "requirementOverlimit",
  1086. RS.SHIPPER_NAME AS "receiveUnitName",
  1087. RSR.SUPPLIER_NAME AS "sendUnitName",
  1088. RWUL.WAREHOUSE_NAME AS "unWarehouseName"
  1089. FROM AMSTRUCK_INWARD_REQUIREMENT AIR
  1090. LEFT JOIN AMS_PURCHASE_ORDER APO
  1091. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1092. LEFT JOIN RMS_SHIPPER RS
  1093. ON RS.SHIPPER_ID = APO.RECEIVE_UNIT_ID
  1094. LEFT JOIN RMS_SUPPLIER RSR
  1095. ON RSR.SUPPLIER_ID = APO.RECEIVE_UNIT_ID
  1096. LEFT JOIN DIL_BATCH DB
  1097. ON APO.BATCH_ID = DB.BATCH_ID
  1098. LEFT JOIN RMS_MATERIAL RM
  1099. ON RM.MATERIAL_ID = DB.MATERIAL_ID
  1100. LEFT JOIN RMS_WAREHOUSE RW
  1101. ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
  1102. LEFT JOIN RMS_WAREHOUSE RWUL
  1103. ON RWUL.WAREHOUSE_ID = AIR.REQUIREMENT_UNLOAD_UNIT_ID
  1104. LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
  1105. ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  1106. WHERE AIR.REQUIREMENT_ID = #{requirementId}
  1107. </select>
  1108. <!-- 查询批次和采购订单信息 -->
  1109. <select id="getPurchaseIdByBatch" parameterType="java.util.Map" resultType="java.util.Map">
  1110. SELECT * FROM(
  1111. SELECT DISTINCT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  1112. APO.PURCHASE_ORDER_ID AS "purchaseOrderId",
  1113. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  1114. RM.MATERIAL_NAME AS "materialName",
  1115. DB.INSERT_TIME AS "insertTime",
  1116. RS.SHIPPER_NAME "shipperName",
  1117. RSR.SUPPLIER_NAME "supplierName"
  1118. FROM (SELECT *
  1119. FROM AMS_PURCHASE_ORDER APO
  1120. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  1121. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1122. WHERE AIR.PURCHASE_ORDER_ID IS NULL) APOIR
  1123. JOIN DIL_BATCH DB
  1124. ON DB.BATCH_ID = APOIR.BATCH_ID
  1125. JOIN AMS_PURCHASE_ORDER APO
  1126. ON APO.BATCH_ID = DB.BATCH_ID
  1127. JOIN RMS_SHIPPER RS
  1128. ON RS.SHIPPER_ID = APO.RECEIVE_UNIT_ID
  1129. JOIN RMS_SUPPLIER RSR
  1130. ON RSR.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  1131. JOIN RMS_MATERIAL RM
  1132. ON RM.MATERIAL_ID = DB.MATERIAL_ID)
  1133. <where>
  1134. <if test="purchaseOrderNo != null">
  1135. and
  1136. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1137. "purchaseOrderNo" like '%${item}%'
  1138. </foreach>
  1139. </if>
  1140. <if test="materialName != null">
  1141. and
  1142. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1143. "materialName" like '%${item}%'
  1144. </foreach>
  1145. </if>
  1146. <if test="resultForeignShipName != null">
  1147. and
  1148. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1149. "resultForeignShipName" like '%${item}%'
  1150. </foreach>
  1151. </if>
  1152. <if test="shipperName != null">
  1153. and
  1154. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1155. "shipperName" like '%${item}%'
  1156. </foreach>
  1157. </if>
  1158. <if test="supplierName != null">
  1159. and
  1160. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  1161. "supplierName" like '%${item}%'
  1162. </foreach>
  1163. </if>
  1164. </where>
  1165. <include refid="orderBy"></include>
  1166. </select>
  1167. <select id="getCapacityType" resultType="java.util.Map">
  1168. SELECT RCT.CAPACITY_TYPE_ID AS "id",
  1169. RCT.CAPACITY_TYPE_ID AS "value",
  1170. RCT.CAPACITY_TYPE_NAME AS "label"
  1171. FROM RMS_CAPACITY_TYPE RCT
  1172. </select>
  1173. <select id="getShipperUser" resultType="java.util.Map">
  1174. SELECT RS.SHIPPER_ID AS "id",
  1175. RS.SHIPPER_ID AS "value",
  1176. RS.SHIPPER_NAME AS "label"
  1177. FROM RMS_SHIPPER RS
  1178. </select>
  1179. <!-- 仓库模代框 -->
  1180. <select id="getWareHouse" parameterType="java.util.Map" resultType="java.util.Map">
  1181. SELECT RW.WAREHOUSE_ID AS "wareHouseId",
  1182. RW.WAREHOUSE_NAME AS "wareHouseName",
  1183. rs.shipper_abbreviation as "shipperName",
  1184. rs.shipper_company_branch as "companyBranchName",
  1185. rs.shipper_branch_factory as "branchFactory"
  1186. FROM RMS_WAREHOUSE RW
  1187. left join rms_shipper rs
  1188. on rs.shipper_id = rw.shipper_id
  1189. <where>
  1190. <if test="wareHouseName != null">
  1191. and
  1192. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  1193. "wareHouseName" like '%${item}%'
  1194. </foreach>
  1195. </if>
  1196. <if test="shipperName != null">
  1197. and
  1198. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1199. "shipperName" like '%${item}%'
  1200. </foreach>
  1201. </if>
  1202. <if test="companyBranchName != null">
  1203. and
  1204. <foreach collection="companyBranchName" item="item" open="(" separator="or" close=")">
  1205. "companyBranchName" like '%${item}%'
  1206. </foreach>
  1207. </if>
  1208. <if test="branchFactory != null">
  1209. and
  1210. <foreach collection="branchFactory" item="item" open="(" separator="or" close=")">
  1211. "branchFactory" like '%${item}%'
  1212. </foreach>
  1213. </if>
  1214. </where>
  1215. </select>
  1216. <select id="getMaterialId" parameterType="DECIMAL" resultType="DECIMAL">
  1217. SELECT DB.MATERIAL_ID AS "materialId"
  1218. FROM AMS_PURCHASE_ORDER APO
  1219. LEFT JOIN DIL_BATCH DB
  1220. ON DB.BATCH_ID = APO.BATCH_ID
  1221. WHERE APO.PURCHASE_ORDER_ID = #{purchaseOrderId}
  1222. </select>
  1223. <select id="getPurRequirementList" resultType="java.util.Map" parameterType="map">
  1224. select * from (
  1225. SELECT
  1226. AIR.REQUIREMENT_ID "requirementId",
  1227. AIP.PLAN_ID "planId",
  1228. RTR.TRANS_RANGE_VALUE "rangeValue",
  1229. APO.PURCHASE_ORDER_ID "purchaseOrderId",
  1230. AIR.REQUIREMENT_NUMBER "requirementNo",
  1231. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1232. RS.SUPPLIER_NAME "supplierName",
  1233. RC.CONSIGNEE_COMPANY_NAME "consigneeName",
  1234. RW.WAREHOUSE_NAME "warehouseName",
  1235. rm.material_id "materialId",
  1236. AIP.PLAN_STATUS "planStatus",
  1237. RM.MATERIAL_NAME "materialName",
  1238. RCR.CARRIER_NAME "carrierName",
  1239. AIP.PLAN_EABLE_STATUS "enable",
  1240. AIR.INSERT_TIME "insertTime"
  1241. FROM AMSTRUCK_INWARD_REQUIREMENT AIR
  1242. LEFT JOIN AMS_PURCHASE_ORDER APO
  1243. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1244. LEFT JOIN RMS_SUPPLIER RS
  1245. ON RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  1246. LEFT JOIN RMS_CONSIGNEE RC
  1247. ON RC.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  1248. LEFT JOIN RMS_WAREHOUSE RW
  1249. ON RW.WAREHOUSE_ID = AIR.REQUIREMENT_UNLOAD_UNIT_ID
  1250. LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
  1251. ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  1252. LEFT JOIN RMS_MATERIAL RM
  1253. ON RM.MATERIAL_ID = ARM.MATERIAL_ID
  1254. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  1255. ON ARP.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  1256. LEFT JOIN AMSTRUCK_INWARD_PLAN AIP
  1257. ON AIP.PLAN_ID = ARP.PLAN_ID
  1258. LEFT JOIN RMS_CARRIER RCR
  1259. ON RCR.CARRIER_ID = AIP.CARRIER_ID
  1260. LEFT JOIN RMS_TRANS_RANGE RTR
  1261. ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
  1262. WHERE AIR.PURCHASE_ORDER_ID IS NOT NULL
  1263. AND AIR.REQUIREMENT_STATUS = #{requirementStatus}
  1264. AND AIR.DELETED = 0
  1265. <if test="userId != null">
  1266. and air.insert_username = #{userId}
  1267. </if>
  1268. <if test="carrierSsoId != null">
  1269. and AIP.CARRIER_ID = (select rc.carrier_id from rms_carrier rc
  1270. where rc.carrier_sso_id = #{carrierSsoId})
  1271. </if>
  1272. <if test="enableStatus != null">
  1273. and AIP.PLAN_EABLE_STATUS = #{enableStatus}
  1274. </if>
  1275. <if test="planStatus != null">
  1276. and AIP.PLAN_STATUS = #{planStatus}
  1277. </if>
  1278. )
  1279. <where>
  1280. <if test="requirementNo != null">
  1281. and
  1282. <foreach collection="requirementNo" item="item" open="(" separator="or" close=")">
  1283. "requirementNo" like '%${item}%'
  1284. </foreach>
  1285. </if>
  1286. <if test="purchaseOrderNo != null">
  1287. and
  1288. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1289. "purchaseOrderNo" like '%${item}%'
  1290. </foreach>
  1291. </if>
  1292. <if test="supplierName != null">
  1293. and
  1294. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  1295. "supplierName" like '%${item}%'
  1296. </foreach>
  1297. </if>
  1298. <if test="consigneeName != null">
  1299. and
  1300. <foreach collection="consigneeName" item="item" open="(" separator="or" close=")">
  1301. "consigneeName" like '%${item}%'
  1302. </foreach>
  1303. </if>
  1304. <if test="warehouseName != null">
  1305. and
  1306. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1307. "warehouseName" like '%${item}%'
  1308. </foreach>
  1309. </if>
  1310. <if test="materialName != null">
  1311. and
  1312. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1313. "materialName" like '%${item}%'
  1314. </foreach>
  1315. </if>
  1316. <if test="carrierName != null">
  1317. and
  1318. <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
  1319. "carrierName" like '%${item}%'
  1320. </foreach>
  1321. </if>
  1322. <if test="insertTime != null">
  1323. and
  1324. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  1325. "insertTime" like '%${item}%'
  1326. </foreach>
  1327. </if>
  1328. </where>
  1329. <include refid="orderBy"></include>
  1330. </select>
  1331. <select id="selectPurOrderId" resultType="java.math.BigDecimal" parameterType="java.lang.Integer">
  1332. select AIR.PURCHASE_ORDER_ID from AMSTRUCK_INWARD_REQUIREMENT AIR
  1333. WHERE AIR.REQUIREMENT_ID = #{requirementId}
  1334. </select>
  1335. </mapper>