AmstruckInwardRequirementMapper.xml 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487
  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. r_c_type.capacity_type_name "capacityTypeName",
  822. actp.price_value "priceValue"
  823. FROM
  824. AMSTRUCK_INWARD_REQUIREMENT AIR
  825. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  826. LEFT JOIN amstruck_requirement_material arm ON air.requirement_id = arm.requirement_id
  827. LEFT JOIN rms_warehouse rw1 ON rw1.warehouse_id = arm.requirement_unload_unit_id
  828. LEFT JOIN rms_warehouse rw2 ON rw2.warehouse_id = arm.requirement_platform_id
  829. LEFT JOIN rms_material rm ON rm.material_id = arm.material_id
  830. LEFT JOIN amstruck_inward_requirement air ON air.requirement_id = arm.requirement_id
  831. LEFT JOIN RMS_TRANS_RANGE RTR ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
  832. LEFT JOIN RMS_MATERIAL_TYPE RMT ON RMT.MATERIAL_TYPE_ID = RM.MATERIAL_TYPE_ID
  833. LEFT JOIN RMS_CAPACITY_TYPE r_c_type ON air.capacity_type_id = r_c_type.CAPACITY_TYPE_ID
  834. left join ams_contract_transport_price actp on actp.capacity_type_id = r_c_type.capacity_type_id
  835. WHERE
  836. AIR.DELETED = 0
  837. AND AIR.PURCHASE_ORDER_ID IS NULL
  838. AND nvl(ACTP.DELETED,0) = 0
  839. <if test="con !=null ">
  840. AND AIR.INSERT_USERNAME LIKE #{con}
  841. </if>
  842. <if test="requirementStatus ==0 ">
  843. AND AIR.REQUIREMENT_STATUS = 0
  844. </if>
  845. <if test="requirementStatus ==1 ">
  846. AND AIR.REQUIREMENT_STATUS in (1,2)
  847. </if>
  848. <if test="oneDate != null">
  849. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
  850. </if>
  851. <if test="startDate != null">
  852. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
  853. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= AIR.INSERT_TIME
  854. </if>
  855. )
  856. <where>
  857. <if test="index != null">
  858. and "likeIndex" like #{index} or "rangeValue" like #{index}
  859. </if>
  860. <if test="requirementType != null">
  861. and
  862. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  863. "requirementType" like '%${item}%'
  864. </foreach>
  865. </if>
  866. <if test="materialName != null">
  867. and
  868. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  869. "materialName" like '%${item}%'
  870. </foreach>
  871. </if>
  872. <if test="loadName != null">
  873. and
  874. <foreach collection="loadName" item="item" open="(" separator="or" close=")">
  875. "loadName" like '%${item}%'
  876. </foreach>
  877. </if>
  878. <if test="unloadName != null">
  879. and
  880. <foreach collection="unloadName" item="item" open="(" separator="or" close=")">
  881. "unloadName" like '%${item}%'
  882. </foreach>
  883. </if>
  884. <if test="requirementTruckTime != null">
  885. and
  886. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  887. "requirementTruckTime" like '%${item}%'
  888. </foreach>
  889. </if>
  890. <if test="requirementWorkType != null">
  891. and
  892. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  893. "requirementWorkType" like '%${item}%'
  894. </foreach>
  895. </if>
  896. <if test="requirementWorkContent != null">
  897. and
  898. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  899. "requirementWorkContent" like '%${item}%'
  900. </foreach>
  901. </if>
  902. <if test="requirementWorkEnvironment != null">
  903. and
  904. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  905. "requirementWorkEnvironment" like '%${item}%'
  906. </foreach>
  907. </if>
  908. <if test="requirementEstimatedDuration != null">
  909. and
  910. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  911. "requirementEstimatedDuration" like '%${item}%'
  912. </foreach>
  913. </if>
  914. <if test="requirementOverlimit != null">
  915. and
  916. <foreach collection="requirementOverlimit" item="item" open="(" separator="or" close=")">
  917. "requirementOverlimit" like '%${item}%'
  918. </foreach>
  919. </if>
  920. <if test="shipperName != null">
  921. and
  922. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  923. "shipperName" like '%${item}%'
  924. </foreach>
  925. </if>
  926. <if test="wareHouseName != null">
  927. and
  928. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  929. "wareHouseName" like '%${item}%'
  930. </foreach>
  931. </if>
  932. <if test="dueDate != null">
  933. and
  934. <foreach collection="dueDate" item="item" open="(" separator="or" close=")">
  935. "dueDate" like '%${item}%'
  936. </foreach>
  937. </if>
  938. <if test="insertTime != null">
  939. and
  940. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  941. "insertTime" like '%${item}%'
  942. </foreach>
  943. </if>
  944. <if test="insertUsername != null">
  945. and
  946. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  947. "insertUsername" like '%${item}%'
  948. </foreach>
  949. </if>
  950. <if test="capacityTypeName != null">
  951. and
  952. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  953. "capacityTypeName" like '%${item}%'
  954. </foreach>
  955. </if>
  956. </where>
  957. <include refid="orderBy"></include>
  958. </select>
  959. <!-- 展示用车需求 -->
  960. <select id="getFinishTruckRequirementList" resultType="java.util.Map" parameterType="java.util.Map">
  961. SELECT
  962. *
  963. FROM
  964. (
  965. SELECT
  966. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  967. AIR.REQUIREMENT_TYPE AS "requirementType",
  968. RTR.TRANS_RANGE_VALUE AS "rangeValue",
  969. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  970. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  971. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  972. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  973. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  974. AIR.REQUIREMENT_OVERLIMIT AS "requirementOverlimit",
  975. AIR.LOADING_REMARK AS "loadingRemark",
  976. RS.SHIPPER_NAME AS "shipperName",
  977. AIR.INSERT_TIME AS "insertTime",
  978. AIR.INSERT_USERNAME AS "insertUsername",
  979. AIR.REQUIREMENT_ID AS "requirementId",
  980. AIR.UPDATE_TIME AS "updateTime",
  981. AIR.DUE_DATE AS "dueDate",
  982. AIR.UPDATE_USERNAME AS "updateUserName",
  983. rw1.warehouse_name "unloadName",
  984. rw1.WAREHOUSE_ID "unloadId",
  985. rw2.warehouse_name "loadName",
  986. rw2.WAREHOUSE_ID "loadId",
  987. arm.material_weight "materialWeight",
  988. arm.material_count "materialCount",
  989. arm.MATERIAL_ID "materialId",
  990. rm.material_name || rm.material_specification || '(' || rm.material_model || ')' "materialName",
  991. AIR.INSERT_UPDATE_REMARK "Tel",
  992. actp.price_value "priceValue"
  993. FROM
  994. ( SELECT AIR2.REQUIREMENT_ID,AIR2.capacity_type_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
  995. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR ON AIR.REQUIREMENT_ID = AIRP.REQUIREMENT_ID
  996. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  997. LEFT JOIN amstruck_requirement_material arm ON air.requirement_id = arm.requirement_id
  998. LEFT JOIN rms_warehouse rw1 ON rw1.warehouse_id = arm.requirement_unload_unit_id
  999. LEFT JOIN rms_warehouse rw2 ON rw2.warehouse_id = arm.requirement_platform_id
  1000. LEFT JOIN rms_material rm ON rm.material_id = arm.material_id
  1001. LEFT JOIN amstruck_inward_requirement air ON air.requirement_id = arm.requirement_id
  1002. LEFT JOIN RMS_TRANS_RANGE RTR ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
  1003. LEFT JOIN RMS_CAPACITY_TYPE r_c_type ON AIRP.capacity_type_id = r_c_type.CAPACITY_TYPE_ID
  1004. left join ams_contract_transport_price actp on actp.capacity_type_id =r_c_type.capacity_type_id
  1005. WHERE
  1006. AIR.REQUIREMENT_STATUS = #{ requirementStatus }
  1007. AND AIR.DELETED = 0
  1008. AND nvl(ACTP.DELETED,0) = 0
  1009. <if test="con !=null ">
  1010. AND AIR.INSERT_USERNAME LIKE #{con}
  1011. </if>
  1012. )
  1013. <where>
  1014. <if test="materialName != null">
  1015. and
  1016. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1017. "materialName" like '%${item}%'
  1018. </foreach>
  1019. </if>
  1020. <if test="materialNumber != null">
  1021. and
  1022. <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
  1023. "materialNumber" like '%${item}%'
  1024. </foreach>
  1025. </if>
  1026. <if test="requirementNumber != null">
  1027. and
  1028. <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
  1029. "requirementNumber" like '%${item}%'
  1030. </foreach>
  1031. </if>
  1032. <if test="requirementType != null">
  1033. and
  1034. <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
  1035. "requirementType" like '%${item}%'
  1036. </foreach>
  1037. </if>
  1038. <if test="capacityTypeName != null">
  1039. and
  1040. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  1041. "capacityTypeName" like '%${item}%'
  1042. </foreach>
  1043. </if>
  1044. <if test="requirementTruckTime != null">
  1045. and
  1046. <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
  1047. "requirementTruckTime" like '%${item}%'
  1048. </foreach>
  1049. </if>
  1050. <if test="requirementWorkType != null">
  1051. and
  1052. <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
  1053. "requirementWorkType" like '%${item}%'
  1054. </foreach>
  1055. </if>
  1056. <if test="requirementWorkContent != null">
  1057. and
  1058. <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
  1059. "requirementWorkContent" like '%${item}%'
  1060. </foreach>
  1061. </if>
  1062. <if test="requirementWorkEnvironment != null">
  1063. and
  1064. <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
  1065. "requirementWorkEnvironment" like '%${item}%'
  1066. </foreach>
  1067. </if>
  1068. <if test="requirementEstimatedDuration != null">
  1069. and
  1070. <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
  1071. "requirementEstimatedDuration" like '%${item}%'
  1072. </foreach>
  1073. </if>
  1074. <if test="requirementOverlimit != null">
  1075. and
  1076. <foreach collection="requirementOverlimit" item="item" open="(" separator="or" close=")">
  1077. "requirementOverlimit" like '%${item}%'
  1078. </foreach>
  1079. </if>
  1080. <if test="shipperName != null">
  1081. and
  1082. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1083. "shipperName" like '%${item}%'
  1084. </foreach>
  1085. </if>
  1086. <if test="insertTime != null">
  1087. and
  1088. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  1089. "insertTime" like '%${item}%'
  1090. </foreach>
  1091. </if>
  1092. <if test="dueDate != null">
  1093. and
  1094. <foreach collection="dueDate" item="item" open="(" separator="or" close=")">
  1095. "dueDate" like '%${item}%'
  1096. </foreach>
  1097. </if>
  1098. <if test="insertUsername != null">
  1099. and
  1100. <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
  1101. "insertUsername" like '%${item}%'
  1102. </foreach>
  1103. </if>
  1104. <if test="updateTime != null">
  1105. and
  1106. <foreach collection="updateTime" item="item" open="(" separator="or" close=")">
  1107. "updateTime" like '%${item}%'
  1108. </foreach>
  1109. </if>
  1110. <if test="updateUsername != null">
  1111. and
  1112. <foreach collection="updateUsername" item="item" open="(" separator="or" close=")">
  1113. "updateUsername" like '%${item}%'
  1114. </foreach>
  1115. </if>
  1116. <if test="wareHouseName != null">
  1117. and
  1118. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  1119. "wareHouseName" like '%${item}%'
  1120. </foreach>
  1121. </if>
  1122. </where>
  1123. <include refid="orderBy"></include>
  1124. </select>
  1125. <sql id="orderBy">
  1126. <if test="orderField != null and orderField != ''">
  1127. order by "${orderField}"
  1128. <if test="orderType != null and orderType != ''">
  1129. ${orderType}
  1130. </if>
  1131. </if>
  1132. <if test="orderField == null ">
  1133. order by "insertTime" desc
  1134. </if>
  1135. </sql>
  1136. <select id="getMaterialNumber" parameterType="DECIMAL" resultType="java.util.Map">
  1137. SELECT ARM.MATERIAL_COUNT AS "materialNumber"
  1138. FROM AMSTRUCK_REQUIREMENT_MATERIAL ARM
  1139. </select>
  1140. <select id="selectRequirement" parameterType="DECIMAL" resultType="java.util.Map">
  1141. SELECT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  1142. APO.PURCHASE_ORDER_ID AS "purchaseOrderId",
  1143. RM.MATERIAL_NAME AS "materialName",
  1144. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  1145. RW.WAREHOUSE_NAME AS "wareHouseName",
  1146. ARM.MATERIAL_WEIGHT AS "materialWeight",
  1147. AIR.REQUIREMNT_UNIT_ID AS "requiremntUnitId",
  1148. AIR.REQUIREMENT_UNLOAD_UNIT_ID AS "requirementUnloadUnitId",
  1149. AIR.REQUIREMENT_TYPE AS "requirementType",
  1150. AIR.CAPACITY_TYPE_ID AS "capacityTypeId",
  1151. AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
  1152. AIR.REQUIREMENT_SHIPPER_ID AS "requirementShipperId",
  1153. AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
  1154. AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
  1155. AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
  1156. AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
  1157. AIR.REQUIREMENT_OVERLIMIT AS "requirementOverlimit",
  1158. RS.SHIPPER_NAME AS "receiveUnitName",
  1159. RSR.SUPPLIER_NAME AS "sendUnitName",
  1160. RWUL.WAREHOUSE_NAME AS "unWarehouseName"
  1161. FROM AMSTRUCK_INWARD_REQUIREMENT AIR
  1162. LEFT JOIN AMS_PURCHASE_ORDER APO
  1163. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1164. LEFT JOIN RMS_SHIPPER RS
  1165. ON RS.SHIPPER_ID = APO.RECEIVE_UNIT_ID
  1166. LEFT JOIN RMS_SUPPLIER RSR
  1167. ON RSR.SUPPLIER_ID = APO.RECEIVE_UNIT_ID
  1168. LEFT JOIN DIL_BATCH DB
  1169. ON APO.BATCH_ID = DB.BATCH_ID
  1170. LEFT JOIN RMS_MATERIAL RM
  1171. ON RM.MATERIAL_ID = DB.MATERIAL_ID
  1172. LEFT JOIN RMS_WAREHOUSE RW
  1173. ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
  1174. LEFT JOIN RMS_WAREHOUSE RWUL
  1175. ON RWUL.WAREHOUSE_ID = AIR.REQUIREMENT_UNLOAD_UNIT_ID
  1176. LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
  1177. ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  1178. WHERE AIR.REQUIREMENT_ID = #{requirementId}
  1179. </select>
  1180. <!-- 查询批次和采购订单信息 -->
  1181. <select id="getPurchaseIdByBatch" parameterType="java.util.Map" resultType="java.util.Map">
  1182. SELECT * FROM(
  1183. SELECT DISTINCT APO.PURCHASE_ORDER_NO AS "purchaseOrderNo",
  1184. APO.PURCHASE_ORDER_ID AS "purchaseOrderId",
  1185. DB.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
  1186. RM.MATERIAL_NAME AS "materialName",
  1187. DB.INSERT_TIME AS "insertTime",
  1188. RS.SHIPPER_NAME "shipperName",
  1189. RSR.SUPPLIER_NAME "supplierName"
  1190. FROM (SELECT *
  1191. FROM AMS_PURCHASE_ORDER APO
  1192. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  1193. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1194. WHERE AIR.PURCHASE_ORDER_ID IS NULL) APOIR
  1195. JOIN DIL_BATCH DB
  1196. ON DB.BATCH_ID = APOIR.BATCH_ID
  1197. JOIN AMS_PURCHASE_ORDER APO
  1198. ON APO.BATCH_ID = DB.BATCH_ID
  1199. JOIN RMS_SHIPPER RS
  1200. ON RS.SHIPPER_ID = APO.RECEIVE_UNIT_ID
  1201. JOIN RMS_SUPPLIER RSR
  1202. ON RSR.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  1203. JOIN RMS_MATERIAL RM
  1204. ON RM.MATERIAL_ID = DB.MATERIAL_ID)
  1205. <where>
  1206. <if test="purchaseOrderNo != null">
  1207. and
  1208. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1209. "purchaseOrderNo" like '%${item}%'
  1210. </foreach>
  1211. </if>
  1212. <if test="materialName != null">
  1213. and
  1214. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1215. "materialName" like '%${item}%'
  1216. </foreach>
  1217. </if>
  1218. <if test="resultForeignShipName != null">
  1219. and
  1220. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1221. "resultForeignShipName" like '%${item}%'
  1222. </foreach>
  1223. </if>
  1224. <if test="shipperName != null">
  1225. and
  1226. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1227. "shipperName" like '%${item}%'
  1228. </foreach>
  1229. </if>
  1230. <if test="supplierName != null">
  1231. and
  1232. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  1233. "supplierName" like '%${item}%'
  1234. </foreach>
  1235. </if>
  1236. </where>
  1237. <include refid="orderBy"></include>
  1238. </select>
  1239. <select id="getCapacityType" resultType="java.util.Map">
  1240. SELECT RCT.CAPACITY_TYPE_ID AS "id",
  1241. RCT.CAPACITY_TYPE_ID AS "value",
  1242. RCT.CAPACITY_TYPE_NAME AS "label"
  1243. FROM RMS_CAPACITY_TYPE RCT
  1244. </select>
  1245. <select id="getShipperUser" resultType="java.util.Map">
  1246. SELECT RS.SHIPPER_ID AS "id",
  1247. RS.SHIPPER_ID AS "value",
  1248. RS.SHIPPER_NAME AS "label"
  1249. FROM RMS_SHIPPER RS
  1250. </select>
  1251. <!-- 仓库模代框 -->
  1252. <select id="getWareHouse" parameterType="java.util.Map" resultType="java.util.Map">
  1253. SELECT RW.WAREHOUSE_ID AS "wareHouseId",
  1254. RW.WAREHOUSE_NAME AS "wareHouseName",
  1255. rs.shipper_abbreviation as "shipperName",
  1256. rs.shipper_company_branch as "companyBranchName",
  1257. rs.shipper_branch_factory as "branchFactory"
  1258. FROM RMS_WAREHOUSE RW
  1259. left join rms_shipper rs
  1260. on rs.shipper_id = rw.shipper_id
  1261. <where>
  1262. <if test="wareHouseName != null">
  1263. and
  1264. <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
  1265. "wareHouseName" like '%${item}%'
  1266. </foreach>
  1267. </if>
  1268. <if test="shipperName != null">
  1269. and
  1270. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1271. "shipperName" like '%${item}%'
  1272. </foreach>
  1273. </if>
  1274. <if test="companyBranchName != null">
  1275. and
  1276. <foreach collection="companyBranchName" item="item" open="(" separator="or" close=")">
  1277. "companyBranchName" like '%${item}%'
  1278. </foreach>
  1279. </if>
  1280. <if test="branchFactory != null">
  1281. and
  1282. <foreach collection="branchFactory" item="item" open="(" separator="or" close=")">
  1283. "branchFactory" like '%${item}%'
  1284. </foreach>
  1285. </if>
  1286. </where>
  1287. </select>
  1288. <select id="getMaterialId" parameterType="DECIMAL" resultType="DECIMAL">
  1289. SELECT DB.MATERIAL_ID AS "materialId"
  1290. FROM AMS_PURCHASE_ORDER APO
  1291. LEFT JOIN DIL_BATCH DB
  1292. ON DB.BATCH_ID = APO.BATCH_ID
  1293. WHERE APO.PURCHASE_ORDER_ID = #{purchaseOrderId}
  1294. </select>
  1295. <select id="getPurRequirementList" resultType="java.util.Map" parameterType="map">
  1296. select * from (
  1297. SELECT
  1298. AIR.REQUIREMENT_ID "requirementId",
  1299. AIP.PLAN_ID "planId",
  1300. RTR.TRANS_RANGE_VALUE "rangeValue",
  1301. APO.PURCHASE_ORDER_ID "purchaseOrderId",
  1302. AIR.REQUIREMENT_NUMBER "requirementNo",
  1303. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1304. RS.SUPPLIER_NAME "supplierName",
  1305. RC.CONSIGNEE_COMPANY_NAME "consigneeName",
  1306. RW.WAREHOUSE_NAME "warehouseName",
  1307. RW1.WAREHOUSE_NAME "loadPointName",
  1308. rm.material_id "materialId",
  1309. AIP.PLAN_STATUS "planStatus",
  1310. RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "materialName",
  1311. RCR.CARRIER_NAME "carrierName",
  1312. AIP.PLAN_EABLE_STATUS "enable",
  1313. AIP.PLAN_EABLE_STATUS "enable1",
  1314. AIR.INSERT_TIME "insertTime",
  1315. DB.RESULT_FOREIGN_SHIP_NAME "shipName",
  1316. APO.PURCHASE_ORDER_NO||RS.SUPPLIER_NAME||RW.WAREHOUSE_NAME||RM.MATERIAL_NAME||DB.RESULT_FOREIGN_SHIP_NAME "likeCon"
  1317. FROM AMSTRUCK_INWARD_REQUIREMENT AIR
  1318. LEFT JOIN AMS_PURCHASE_ORDER APO
  1319. ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1320. LEFT JOIN RMS_SUPPLIER RS
  1321. ON RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  1322. LEFT JOIN RMS_CONSIGNEE RC
  1323. ON RC.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  1324. LEFT JOIN RMS_WAREHOUSE RW
  1325. ON RW.WAREHOUSE_ID = AIR.REQUIREMENT_UNLOAD_UNIT_ID
  1326. LEFT JOIN RMS_WAREHOUSE RW1
  1327. ON RW1.WAREHOUSE_ID = AIR.REQUIREMENT_PLATFORM_ID
  1328. LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
  1329. ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  1330. LEFT JOIN RMS_MATERIAL RM
  1331. ON RM.MATERIAL_ID = ARM.MATERIAL_ID
  1332. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  1333. ON ARP.REQUIREMENT_ID = AIR.REQUIREMENT_ID
  1334. LEFT JOIN AMSTRUCK_INWARD_PLAN AIP
  1335. ON AIP.PLAN_ID = ARP.PLAN_ID
  1336. LEFT JOIN RMS_CARRIER RCR
  1337. ON RCR.CARRIER_ID = AIP.CARRIER_ID
  1338. LEFT JOIN RMS_TRANS_RANGE RTR
  1339. ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
  1340. LEFT JOIN DIL_BATCH DB
  1341. ON DB.BATCH_ID = APO.BATCH_ID
  1342. WHERE AIR.PURCHASE_ORDER_ID IS NOT NULL
  1343. AND AIR.REQUIREMENT_STATUS = #{requirementStatus}
  1344. AND AIR.DELETED = 0
  1345. <if test="userId != null">
  1346. and air.insert_username = #{userId}
  1347. </if>
  1348. <if test="planId != null">
  1349. and AIP.PLAN_ID = #{planId}
  1350. </if>
  1351. <if test="carrierSsoId != null">
  1352. and AIP.CARRIER_ID = (select rc.carrier_id from rms_carrier rc
  1353. where rc.carrier_sso_id = #{carrierSsoId})
  1354. </if>
  1355. <if test="enableStatus != null">
  1356. and AIP.PLAN_EABLE_STATUS = #{enableStatus}
  1357. </if>
  1358. <if test="planStatus != null">
  1359. and AIP.PLAN_STATUS = #{planStatus}
  1360. </if>
  1361. <if test="oneDate != null and planStatus != 2 and planStatus != 3 ">
  1362. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
  1363. </if>
  1364. <if test="startDate != null and planStatus != 2 and planStatus != 3 ">
  1365. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
  1366. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= AIR.INSERT_TIME
  1367. </if>
  1368. )
  1369. <where>
  1370. <if test="con != null">
  1371. and "likeCon" like #{con}
  1372. </if>
  1373. <if test="requirementNo != null">
  1374. and
  1375. <foreach collection="requirementNo" item="item" open="(" separator="or" close=")">
  1376. "requirementNo" like '%${item}%'
  1377. </foreach>
  1378. </if>
  1379. <if test="purchaseOrderNo != null">
  1380. and
  1381. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1382. "purchaseOrderNo" like '%${item}%'
  1383. </foreach>
  1384. </if>
  1385. <if test="supplierName != null">
  1386. and
  1387. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  1388. "supplierName" like '%${item}%'
  1389. </foreach>
  1390. </if>
  1391. <if test="consigneeName != null">
  1392. and
  1393. <foreach collection="consigneeName" item="item" open="(" separator="or" close=")">
  1394. "consigneeName" like '%${item}%'
  1395. </foreach>
  1396. </if>
  1397. <if test="warehouseName != null">
  1398. and
  1399. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1400. "warehouseName" like '%${item}%'
  1401. </foreach>
  1402. </if>
  1403. <if test="materialName != null">
  1404. and
  1405. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1406. "materialName" like '%${item}%'
  1407. </foreach>
  1408. </if>
  1409. <if test="carrierName != null">
  1410. and
  1411. <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
  1412. "carrierName" like '%${item}%'
  1413. </foreach>
  1414. </if>
  1415. <if test="insertTime != null">
  1416. and
  1417. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  1418. "insertTime" like '%${item}%'
  1419. </foreach>
  1420. </if>
  1421. </where>
  1422. <include refid="orderBy"></include>
  1423. </select>
  1424. <select id="selectPurOrderId" resultType="java.math.BigDecimal" parameterType="java.lang.Integer">
  1425. select AIR.PURCHASE_ORDER_ID from AMSTRUCK_INWARD_REQUIREMENT AIR
  1426. WHERE AIR.REQUIREMENT_ID = #{requirementId}
  1427. </select>
  1428. <select id="getBilletRequirementList" resultType="java.util.Map">
  1429. SELECT * FROM (
  1430. SELECT
  1431. AIR.REQUIREMENT_NUMBER AS "requirementNumber",
  1432. AIR.REQUIREMENT_TYPE AS "requirementType",
  1433. RTR.TRANS_RANGE_VALUE AS "rangeValue",
  1434. RS.SHIPPER_NAME AS "shipperName",
  1435. AIR.INSERT_TIME AS "insertTime",
  1436. rw1.warehouse_name "unloadName",
  1437. rw2.warehouse_name "loadName",
  1438. arm.material_count "materialCount",
  1439. rm.material_name "materialName",
  1440. rm.material_specification "materialSpe",
  1441. rm.MATERIAL_MODEL "materialModel",
  1442. ARM.MATERIAL_LUNO "materialLuNo",
  1443. AIR.REQUIREMENT_ID "requirementId"
  1444. FROM
  1445. AMSTRUCK_INWARD_REQUIREMENT AIR
  1446. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  1447. LEFT JOIN amstruck_requirement_material arm ON air.requirement_id = arm.requirement_id
  1448. LEFT JOIN rms_warehouse rw1 ON rw1.warehouse_id = arm.requirement_unload_unit_id
  1449. LEFT JOIN rms_warehouse rw2 ON rw2.warehouse_id = arm.requirement_platform_id
  1450. LEFT JOIN rms_material rm ON rm.material_id = arm.material_id
  1451. LEFT JOIN amstruck_inward_requirement air ON air.requirement_id = arm.requirement_id
  1452. LEFT JOIN RMS_TRANS_RANGE RTR ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
  1453. LEFT JOIN RMS_MATERIAL_TYPE RMT ON RMT.MATERIAL_TYPE_ID = RM.MATERIAL_TYPE_ID
  1454. WHERE
  1455. AIR.DELETED = 0
  1456. AND AIR.PURCHASE_ORDER_ID IS NULL
  1457. AND ARM.MATERIAL_LUNO IS NOT NULL
  1458. <if test="oneDate != null">
  1459. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
  1460. </if>
  1461. <if test="startDate != null">
  1462. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
  1463. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= AIR.INSERT_TIME
  1464. </if>
  1465. )
  1466. </select>
  1467. <update id="closeOrderByRequirementId" parameterType="decimal">
  1468. update OMSTRUCK_ORDER OO
  1469. set oo.ORDER_STATUS = 7,
  1470. oo.INSERT_UPDATE_REMARK = '提前关闭运单'
  1471. where
  1472. OO.ORDER_STATUS = 4
  1473. AND OO.ORDER_TYPE = 11
  1474. AND oo.ORDER_PLAN_ID =
  1475. (SELECT ARP.PLAN_ID FROM AMSTRUCK_REQUIREMENT_PLAN ARP
  1476. WHERE ARP.REQUIREMENT_ID = #{requirementId}
  1477. )
  1478. </update>
  1479. </mapper>