AmstruckInwardRequirementMapper.xml 69 KB

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