AmstruckInwardRequirementMapper.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.steerinfo.dil.mapper.AmstruckInwardRequirementMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmstruckInwardRequirement">
  5. <id column="REQUIREMENT_ID" jdbcType="DECIMAL" property="requirementId" />
  6. <result column="PURCHASE_ORDER_ID" jdbcType="DECIMAL" property="purchaseOrderId" />
  7. <result column="REQUIREMENT_NUMBER" jdbcType="VARCHAR" property="requirementNumber" />
  8. <result column="REQUIREMENT_TYPE" jdbcType="VARCHAR" property="requirementType" />
  9. <result column="CAPACITY_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId" />
  10. <result column="REQUIREMENT_TRUCK_TIME" jdbcType="TIMESTAMP" property="requirementTruckTime" />
  11. <result column="REQUIREMENT_SHIPPER_ID" jdbcType="DECIMAL" property="requirementShipperId" />
  12. <result column="REQUIREMENT_WORK_TYPE" jdbcType="DECIMAL" property="requirementWorkType" />
  13. <result column="REQUIREMENT_WORK_CONTENT" jdbcType="VARCHAR" property="requirementWorkContent" />
  14. <result column="LINE_ID" jdbcType="DECIMAL" property="lineId" />
  15. <result column="REQUIREMENT_WORK_ENVIRONMENT" jdbcType="VARCHAR" property="requirementWorkEnvironment" />
  16. <result column="REQUIREMENT_ESTIMATED_DURATION" jdbcType="DECIMAL" property="requirementEstimatedDuration" />
  17. <result column="REQUIREMENT_OVERLIMIT" jdbcType="VARCHAR" property="requirementOverlimit" />
  18. <result column="REQUIREMNT_UNIT_ID" jdbcType="DECIMAL" property="requiremntUnitId" />
  19. <result column="REQUIREMENT_STATUS" jdbcType="DECIMAL" property="requirementStatus" />
  20. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  21. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  22. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  23. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  24. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  25. </resultMap>
  26. <sql id="columns">
  27. REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER, REQUIREMENT_TYPE, CAPACITY_TYPE_ID,
  28. REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT,
  29. LINE_ID, REQUIREMENT_WORK_ENVIRONMENT, REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
  30. REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  31. UPDATE_TIME, INSERT_UPDATE_REMARK
  32. </sql>
  33. <sql id="columns_alias">
  34. t.REQUIREMENT_ID, t.PURCHASE_ORDER_ID, t.REQUIREMENT_NUMBER, t.REQUIREMENT_TYPE,
  35. t.CAPACITY_TYPE_ID, t.REQUIREMENT_TRUCK_TIME, t.REQUIREMENT_SHIPPER_ID, t.REQUIREMENT_WORK_TYPE,
  36. t.REQUIREMENT_WORK_CONTENT, t.LINE_ID, t.REQUIREMENT_WORK_ENVIRONMENT, t.REQUIREMENT_ESTIMATED_DURATION,
  37. t.REQUIREMENT_OVERLIMIT, t.REQUIREMNT_UNIT_ID, t.REQUIREMENT_STATUS, t.INSERT_USERNAME,
  38. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
  39. </sql>
  40. <sql id="select">
  41. SELECT <include refid="columns"/> FROM AMSTRUCK_INWARD_REQUIREMENT
  42. </sql>
  43. <sql id="select_alias">
  44. SELECT <include refid="columns_alias"/> FROM AMSTRUCK_INWARD_REQUIREMENT t
  45. </sql>
  46. <sql id="where">
  47. <where>
  48. <if test="requirementId != null">
  49. and REQUIREMENT_ID = #{requirementId}
  50. </if>
  51. <if test="purchaseOrderId != null">
  52. and PURCHASE_ORDER_ID = #{purchaseOrderId}
  53. </if>
  54. <if test="requirementNumber != null and requirementNumber != ''">
  55. and REQUIREMENT_NUMBER = #{requirementNumber}
  56. </if>
  57. <if test="requirementType != null and requirementType != ''">
  58. and REQUIREMENT_TYPE = #{requirementType}
  59. </if>
  60. <if test="capacityTypeId != null">
  61. and CAPACITY_TYPE_ID = #{capacityTypeId}
  62. </if>
  63. <if test="requirementTruckTime != null">
  64. and TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = #{requirementTruckTime}
  65. </if>
  66. <if test="requirementShipperId != null">
  67. and REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
  68. </if>
  69. <if test="requirementWorkType != null">
  70. and REQUIREMENT_WORK_TYPE = #{requirementWorkType}
  71. </if>
  72. <if test="requirementWorkContent != null and requirementWorkContent != ''">
  73. and REQUIREMENT_WORK_CONTENT = #{requirementWorkContent}
  74. </if>
  75. <if test="lineId != null">
  76. and LINE_ID = #{lineId}
  77. </if>
  78. <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
  79. and REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment}
  80. </if>
  81. <if test="requirementEstimatedDuration != null">
  82. and REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
  83. </if>
  84. <if test="requirementOverlimit != null and requirementOverlimit != ''">
  85. and REQUIREMENT_OVERLIMIT = #{requirementOverlimit}
  86. </if>
  87. <if test="requiremntUnitId != null">
  88. and REQUIREMNT_UNIT_ID = #{requiremntUnitId}
  89. </if>
  90. <if test="requirementStatus != null">
  91. and REQUIREMENT_STATUS = #{requirementStatus}
  92. </if>
  93. <if test="insertUsername != null and insertUsername != ''">
  94. and INSERT_USERNAME = #{insertUsername}
  95. </if>
  96. <if test="insertTime != null">
  97. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  98. </if>
  99. <if test="updateUsername != null and updateUsername != ''">
  100. and UPDATE_USERNAME = #{updateUsername}
  101. </if>
  102. <if test="updateTime != null">
  103. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  104. </if>
  105. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  106. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  107. </if>
  108. </where>
  109. </sql>
  110. <sql id="whereLike">
  111. <where>
  112. <if test="requirementId != null">
  113. and REQUIREMENT_ID = #{requirementId}
  114. </if>
  115. <if test="purchaseOrderId != null">
  116. and PURCHASE_ORDER_ID = #{purchaseOrderId}
  117. </if>
  118. <if test="requirementNumber != null and requirementNumber != ''">
  119. and REQUIREMENT_NUMBER LIKE '%${requirementNumber}%'
  120. </if>
  121. <if test="requirementType != null and requirementType != ''">
  122. and REQUIREMENT_TYPE LIKE '%${requirementType}%'
  123. </if>
  124. <if test="capacityTypeId != null">
  125. and CAPACITY_TYPE_ID = #{capacityTypeId}
  126. </if>
  127. <if test="requirementTruckTime != null">
  128. and TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = #{requirementTruckTime}
  129. </if>
  130. <if test="requirementShipperId != null">
  131. and REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
  132. </if>
  133. <if test="requirementWorkType != null">
  134. and REQUIREMENT_WORK_TYPE = #{requirementWorkType}
  135. </if>
  136. <if test="requirementWorkContent != null and requirementWorkContent != ''">
  137. and REQUIREMENT_WORK_CONTENT LIKE '%${requirementWorkContent}%'
  138. </if>
  139. <if test="lineId != null">
  140. and LINE_ID = #{lineId}
  141. </if>
  142. <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
  143. and REQUIREMENT_WORK_ENVIRONMENT LIKE '%${requirementWorkEnvironment}%'
  144. </if>
  145. <if test="requirementEstimatedDuration != null">
  146. and REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
  147. </if>
  148. <if test="requirementOverlimit != null and requirementOverlimit != ''">
  149. and REQUIREMENT_OVERLIMIT LIKE '%${requirementOverlimit}%'
  150. </if>
  151. <if test="requiremntUnitId != null">
  152. and REQUIREMNT_UNIT_ID = #{requiremntUnitId}
  153. </if>
  154. <if test="requirementStatus != null">
  155. and REQUIREMENT_STATUS = #{requirementStatus}
  156. </if>
  157. <if test="insertUsername != null and insertUsername != ''">
  158. and INSERT_USERNAME LIKE '%${insertUsername}%'
  159. </if>
  160. <if test="insertTime != null">
  161. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  162. </if>
  163. <if test="updateUsername != null and updateUsername != ''">
  164. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  165. </if>
  166. <if test="updateTime != null">
  167. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  168. </if>
  169. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  170. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  171. </if>
  172. </where>
  173. </sql>
  174. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  175. delete from AMSTRUCK_INWARD_REQUIREMENT
  176. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  177. </delete>
  178. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  179. delete from AMSTRUCK_INWARD_REQUIREMENT
  180. where 1!=1
  181. <if test="purchaseOrderId != null">
  182. or PURCHASE_ORDER_ID = #{purchaseOrderId}
  183. </if>
  184. <if test="requirementNumber != null and requirementNumber != ''">
  185. or REQUIREMENT_NUMBER = #{requirementNumber}
  186. </if>
  187. <if test="requirementType != null and requirementType != ''">
  188. or REQUIREMENT_TYPE = #{requirementType}
  189. </if>
  190. <if test="capacityTypeId != null">
  191. or CAPACITY_TYPE_ID = #{capacityTypeId}
  192. </if>
  193. <if test="requirementTruckTime != null">
  194. or TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = '#{requirementTruckTime}'
  195. </if>
  196. <if test="requirementShipperId != null">
  197. or REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
  198. </if>
  199. <if test="requirementWorkType != null">
  200. or REQUIREMENT_WORK_TYPE = #{requirementWorkType}
  201. </if>
  202. <if test="requirementWorkContent != null and requirementWorkContent != ''">
  203. or REQUIREMENT_WORK_CONTENT = #{requirementWorkContent}
  204. </if>
  205. <if test="lineId != null">
  206. or LINE_ID = #{lineId}
  207. </if>
  208. <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
  209. or REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment}
  210. </if>
  211. <if test="requirementEstimatedDuration != null">
  212. or REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
  213. </if>
  214. <if test="requirementOverlimit != null and requirementOverlimit != ''">
  215. or REQUIREMENT_OVERLIMIT = #{requirementOverlimit}
  216. </if>
  217. <if test="requiremntUnitId != null">
  218. or REQUIREMNT_UNIT_ID = #{requiremntUnitId}
  219. </if>
  220. <if test="requirementStatus != null">
  221. or REQUIREMENT_STATUS = #{requirementStatus}
  222. </if>
  223. <if test="insertUsername != null and insertUsername != ''">
  224. or INSERT_USERNAME = #{insertUsername}
  225. </if>
  226. <if test="insertTime != null">
  227. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  228. </if>
  229. <if test="updateUsername != null and updateUsername != ''">
  230. or UPDATE_USERNAME = #{updateUsername}
  231. </if>
  232. <if test="updateTime != null">
  233. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  234. </if>
  235. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  236. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  237. </if>
  238. </delete>
  239. <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  240. insert into AMSTRUCK_INWARD_REQUIREMENT (REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER,
  241. REQUIREMENT_TYPE, CAPACITY_TYPE_ID, REQUIREMENT_TRUCK_TIME,
  242. REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE,
  243. REQUIREMENT_WORK_CONTENT, LINE_ID, REQUIREMENT_WORK_ENVIRONMENT,
  244. REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
  245. REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME,
  246. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  247. INSERT_UPDATE_REMARK)
  248. values (#{requirementId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{requirementNumber,jdbcType=VARCHAR},
  249. #{requirementType,jdbcType=VARCHAR}, #{capacityTypeId,jdbcType=DECIMAL}, #{requirementTruckTime,jdbcType=TIMESTAMP},
  250. #{requirementShipperId,jdbcType=DECIMAL}, #{requirementWorkType,jdbcType=DECIMAL},
  251. #{requirementWorkContent,jdbcType=VARCHAR}, #{lineId,jdbcType=DECIMAL}, #{requirementWorkEnvironment,jdbcType=VARCHAR},
  252. #{requirementEstimatedDuration,jdbcType=DECIMAL}, #{requirementOverlimit,jdbcType=VARCHAR},
  253. #{requiremntUnitId,jdbcType=DECIMAL}, #{requirementStatus,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR},
  254. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  255. #{insertUpdateRemark,jdbcType=VARCHAR})
  256. </insert>
  257. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  258. insert into AMSTRUCK_INWARD_REQUIREMENT
  259. <trim prefix="(" suffix=")" suffixOverrides=",">
  260. <if test="requirementId != null">
  261. REQUIREMENT_ID,
  262. </if>
  263. <if test="purchaseOrderId != null">
  264. PURCHASE_ORDER_ID,
  265. </if>
  266. <if test="requirementNumber != null">
  267. REQUIREMENT_NUMBER,
  268. </if>
  269. <if test="requirementType != null">
  270. REQUIREMENT_TYPE,
  271. </if>
  272. <if test="capacityTypeId != null">
  273. CAPACITY_TYPE_ID,
  274. </if>
  275. <if test="requirementTruckTime != null">
  276. REQUIREMENT_TRUCK_TIME,
  277. </if>
  278. <if test="requirementShipperId != null">
  279. REQUIREMENT_SHIPPER_ID,
  280. </if>
  281. <if test="requirementWorkType != null">
  282. REQUIREMENT_WORK_TYPE,
  283. </if>
  284. <if test="requirementWorkContent != null">
  285. REQUIREMENT_WORK_CONTENT,
  286. </if>
  287. <if test="lineId != null">
  288. LINE_ID,
  289. </if>
  290. <if test="requirementWorkEnvironment != null">
  291. REQUIREMENT_WORK_ENVIRONMENT,
  292. </if>
  293. <if test="requirementEstimatedDuration != null">
  294. REQUIREMENT_ESTIMATED_DURATION,
  295. </if>
  296. <if test="requirementOverlimit != null">
  297. REQUIREMENT_OVERLIMIT,
  298. </if>
  299. <if test="requiremntUnitId != null">
  300. REQUIREMNT_UNIT_ID,
  301. </if>
  302. <if test="requirementStatus != null">
  303. REQUIREMENT_STATUS,
  304. </if>
  305. <if test="insertUsername != null">
  306. INSERT_USERNAME,
  307. </if>
  308. <if test="insertTime != null">
  309. INSERT_TIME,
  310. </if>
  311. <if test="updateUsername != null">
  312. UPDATE_USERNAME,
  313. </if>
  314. <if test="updateTime != null">
  315. UPDATE_TIME,
  316. </if>
  317. <if test="insertUpdateRemark != null">
  318. INSERT_UPDATE_REMARK,
  319. </if>
  320. </trim>
  321. <trim prefix="values (" suffix=")" suffixOverrides=",">
  322. <if test="requirementId != null">
  323. #{requirementId,jdbcType=DECIMAL},
  324. </if>
  325. <if test="purchaseOrderId != null">
  326. #{purchaseOrderId,jdbcType=DECIMAL},
  327. </if>
  328. <if test="requirementNumber != null">
  329. #{requirementNumber,jdbcType=VARCHAR},
  330. </if>
  331. <if test="requirementType != null">
  332. #{requirementType,jdbcType=VARCHAR},
  333. </if>
  334. <if test="capacityTypeId != null">
  335. #{capacityTypeId,jdbcType=DECIMAL},
  336. </if>
  337. <if test="requirementTruckTime != null">
  338. #{requirementTruckTime,jdbcType=TIMESTAMP},
  339. </if>
  340. <if test="requirementShipperId != null">
  341. #{requirementShipperId,jdbcType=DECIMAL},
  342. </if>
  343. <if test="requirementWorkType != null">
  344. #{requirementWorkType,jdbcType=DECIMAL},
  345. </if>
  346. <if test="requirementWorkContent != null">
  347. #{requirementWorkContent,jdbcType=VARCHAR},
  348. </if>
  349. <if test="lineId != null">
  350. #{lineId,jdbcType=DECIMAL},
  351. </if>
  352. <if test="requirementWorkEnvironment != null">
  353. #{requirementWorkEnvironment,jdbcType=VARCHAR},
  354. </if>
  355. <if test="requirementEstimatedDuration != null">
  356. #{requirementEstimatedDuration,jdbcType=DECIMAL},
  357. </if>
  358. <if test="requirementOverlimit != null">
  359. #{requirementOverlimit,jdbcType=VARCHAR},
  360. </if>
  361. <if test="requiremntUnitId != null">
  362. #{requiremntUnitId,jdbcType=DECIMAL},
  363. </if>
  364. <if test="requirementStatus != null">
  365. #{requirementStatus,jdbcType=DECIMAL},
  366. </if>
  367. <if test="insertUsername != null">
  368. #{insertUsername,jdbcType=VARCHAR},
  369. </if>
  370. <if test="insertTime != null">
  371. #{insertTime,jdbcType=TIMESTAMP},
  372. </if>
  373. <if test="updateUsername != null">
  374. #{updateUsername,jdbcType=VARCHAR},
  375. </if>
  376. <if test="updateTime != null">
  377. #{updateTime,jdbcType=TIMESTAMP},
  378. </if>
  379. <if test="insertUpdateRemark != null">
  380. #{insertUpdateRemark,jdbcType=VARCHAR},
  381. </if>
  382. </trim>
  383. </insert>
  384. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  385. update AMSTRUCK_INWARD_REQUIREMENT
  386. set PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
  387. REQUIREMENT_NUMBER = #{requirementNumber,jdbcType=VARCHAR},
  388. REQUIREMENT_TYPE = #{requirementType,jdbcType=VARCHAR},
  389. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  390. REQUIREMENT_TRUCK_TIME = #{requirementTruckTime,jdbcType=TIMESTAMP},
  391. REQUIREMENT_SHIPPER_ID = #{requirementShipperId,jdbcType=DECIMAL},
  392. REQUIREMENT_WORK_TYPE = #{requirementWorkType,jdbcType=DECIMAL},
  393. REQUIREMENT_WORK_CONTENT = #{requirementWorkContent,jdbcType=VARCHAR},
  394. LINE_ID = #{lineId,jdbcType=DECIMAL},
  395. REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment,jdbcType=VARCHAR},
  396. REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration,jdbcType=DECIMAL},
  397. REQUIREMENT_OVERLIMIT = #{requirementOverlimit,jdbcType=VARCHAR},
  398. REQUIREMNT_UNIT_ID = #{requiremntUnitId,jdbcType=DECIMAL},
  399. REQUIREMENT_STATUS = #{requirementStatus,jdbcType=DECIMAL},
  400. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  401. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  402. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  403. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  404. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
  405. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  406. </update>
  407. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
  408. update AMSTRUCK_INWARD_REQUIREMENT
  409. <set>
  410. <if test="purchaseOrderId != null">
  411. PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
  412. </if>
  413. <if test="requirementNumber != null">
  414. REQUIREMENT_NUMBER = #{requirementNumber,jdbcType=VARCHAR},
  415. </if>
  416. <if test="requirementType != null">
  417. REQUIREMENT_TYPE = #{requirementType,jdbcType=VARCHAR},
  418. </if>
  419. <if test="capacityTypeId != null">
  420. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  421. </if>
  422. <if test="requirementTruckTime != null">
  423. REQUIREMENT_TRUCK_TIME = #{requirementTruckTime,jdbcType=TIMESTAMP},
  424. </if>
  425. <if test="requirementShipperId != null">
  426. REQUIREMENT_SHIPPER_ID = #{requirementShipperId,jdbcType=DECIMAL},
  427. </if>
  428. <if test="requirementWorkType != null">
  429. REQUIREMENT_WORK_TYPE = #{requirementWorkType,jdbcType=DECIMAL},
  430. </if>
  431. <if test="requirementWorkContent != null">
  432. REQUIREMENT_WORK_CONTENT = #{requirementWorkContent,jdbcType=VARCHAR},
  433. </if>
  434. <if test="lineId != null">
  435. LINE_ID = #{lineId,jdbcType=DECIMAL},
  436. </if>
  437. <if test="requirementWorkEnvironment != null">
  438. REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment,jdbcType=VARCHAR},
  439. </if>
  440. <if test="requirementEstimatedDuration != null">
  441. REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration,jdbcType=DECIMAL},
  442. </if>
  443. <if test="requirementOverlimit != null">
  444. REQUIREMENT_OVERLIMIT = #{requirementOverlimit,jdbcType=VARCHAR},
  445. </if>
  446. <if test="requiremntUnitId != null">
  447. REQUIREMNT_UNIT_ID = #{requiremntUnitId,jdbcType=DECIMAL},
  448. </if>
  449. <if test="requirementStatus != null">
  450. REQUIREMENT_STATUS = #{requirementStatus,jdbcType=DECIMAL},
  451. </if>
  452. <if test="insertUsername != null">
  453. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  454. </if>
  455. <if test="insertTime != null">
  456. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  457. </if>
  458. <if test="updateUsername != null">
  459. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  460. </if>
  461. <if test="updateTime != null">
  462. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  463. </if>
  464. <if test="insertUpdateRemark != null">
  465. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  466. </if>
  467. </set>
  468. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  469. </update>
  470. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  471. <include refid="select"/>
  472. where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
  473. </select>
  474. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  475. <include refid="select"/>
  476. <include refid="where"/>
  477. </select>
  478. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  479. <include refid="select"/>
  480. <include refid="whereLike"/>
  481. </select>
  482. <insert id="batchInsert" parameterType="java.util.List">
  483. insert into AMSTRUCK_INWARD_REQUIREMENT
  484. (REQUIREMENT_ID,
  485. PURCHASE_ORDER_ID, REQUIREMENT_NUMBER,
  486. REQUIREMENT_TYPE, CAPACITY_TYPE_ID,
  487. REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID,
  488. REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT,
  489. LINE_ID, REQUIREMENT_WORK_ENVIRONMENT,
  490. REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
  491. REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS,
  492. INSERT_USERNAME, INSERT_TIME,
  493. UPDATE_USERNAME, UPDATE_TIME,
  494. INSERT_UPDATE_REMARK)
  495. ( <foreach collection="list" item="item" separator="union all">
  496. select
  497. #{item.requirementId,jdbcType=DECIMAL},
  498. #{item.purchaseOrderId,jdbcType=DECIMAL}, #{item.requirementNumber,jdbcType=VARCHAR},
  499. #{item.requirementType,jdbcType=VARCHAR}, #{item.capacityTypeId,jdbcType=DECIMAL},
  500. #{item.requirementTruckTime,jdbcType=TIMESTAMP}, #{item.requirementShipperId,jdbcType=DECIMAL},
  501. #{item.requirementWorkType,jdbcType=DECIMAL}, #{item.requirementWorkContent,jdbcType=VARCHAR},
  502. #{item.lineId,jdbcType=DECIMAL}, #{item.requirementWorkEnvironment,jdbcType=VARCHAR},
  503. #{item.requirementEstimatedDuration,jdbcType=DECIMAL}, #{item.requirementOverlimit,jdbcType=VARCHAR},
  504. #{item.requiremntUnitId,jdbcType=DECIMAL}, #{item.requirementStatus,jdbcType=DECIMAL},
  505. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  506. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  507. #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
  508. </foreach> )
  509. </insert>
  510. <update id="batchUpdate" parameterType="java.util.List">
  511. update AMSTRUCK_INWARD_REQUIREMENT
  512. set
  513. REQUIREMENT_ID=
  514. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  515. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementId,jdbcType=DECIMAL}
  516. </foreach>
  517. ,PURCHASE_ORDER_ID=
  518. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  519. when #{item.requirementId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
  520. </foreach>
  521. ,REQUIREMENT_NUMBER=
  522. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  523. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementNumber,jdbcType=VARCHAR}
  524. </foreach>
  525. ,REQUIREMENT_TYPE=
  526. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  527. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementType,jdbcType=VARCHAR}
  528. </foreach>
  529. ,CAPACITY_TYPE_ID=
  530. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  531. when #{item.requirementId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
  532. </foreach>
  533. ,REQUIREMENT_TRUCK_TIME=
  534. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  535. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementTruckTime,jdbcType=TIMESTAMP}
  536. </foreach>
  537. ,REQUIREMENT_SHIPPER_ID=
  538. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  539. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementShipperId,jdbcType=DECIMAL}
  540. </foreach>
  541. ,REQUIREMENT_WORK_TYPE=
  542. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  543. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkType,jdbcType=DECIMAL}
  544. </foreach>
  545. ,REQUIREMENT_WORK_CONTENT=
  546. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  547. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkContent,jdbcType=VARCHAR}
  548. </foreach>
  549. ,LINE_ID=
  550. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  551. when #{item.requirementId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
  552. </foreach>
  553. ,REQUIREMENT_WORK_ENVIRONMENT=
  554. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  555. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkEnvironment,jdbcType=VARCHAR}
  556. </foreach>
  557. ,REQUIREMENT_ESTIMATED_DURATION=
  558. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  559. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementEstimatedDuration,jdbcType=DECIMAL}
  560. </foreach>
  561. ,REQUIREMENT_OVERLIMIT=
  562. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  563. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementOverlimit,jdbcType=VARCHAR}
  564. </foreach>
  565. ,REQUIREMNT_UNIT_ID=
  566. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  567. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requiremntUnitId,jdbcType=DECIMAL}
  568. </foreach>
  569. ,REQUIREMENT_STATUS=
  570. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  571. when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementStatus,jdbcType=DECIMAL}
  572. </foreach>
  573. ,INSERT_USERNAME=
  574. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  575. when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  576. </foreach>
  577. ,INSERT_TIME=
  578. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  579. when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  580. </foreach>
  581. ,UPDATE_USERNAME=
  582. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  583. when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  584. </foreach>
  585. ,UPDATE_TIME=
  586. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  587. when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  588. </foreach>
  589. ,INSERT_UPDATE_REMARK=
  590. <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
  591. when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  592. </foreach>
  593. where REQUIREMENT_ID in
  594. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  595. #{item.requirementId,jdbcType=DECIMAL}
  596. </foreach>
  597. </update>
  598. <delete id="batchDelete" parameterType="java.util.List">
  599. delete from AMSTRUCK_INWARD_REQUIREMENT
  600. where REQUIREMENT_ID in
  601. <foreach collection="list" item="id" open="(" close=")" separator=",">
  602. #{id}
  603. </foreach>
  604. </delete>
  605. <!-- 友情提示!!!-->
  606. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  607. <!-- 展示用车需求 -->
  608. <select id="getTruckRequirementList" resultType="java.util.Map" parameterType="java.util.Map">
  609. select air.purchase_order_id as "purchaseOrderId",
  610. air.requirement_number as "requirementNumber",
  611. air.requirement_type as "requirementType",
  612. rct.capacity_type_name as "capacityTypeName",
  613. air.requirement_truck_time as "requirementTruckTime",
  614. rl.line_end_node_desc as "lineEndNodeDesc",
  615. air.requirement_work_type as "requirementWorkType",
  616. air.requirement_work_content as "requirementWorkContent",
  617. air.requirement_work_environment as "requirementWorkEnvironment",
  618. air.requirement_estimated_duration as "requirementEstimatedDuration",
  619. air.requirement_overlimit as "requirementOverlimit",
  620. rs.shipper_name as "shipperName"
  621. from amstruck_inward_requirement air
  622. left join rms_capacity_type rct on air.capacity_type_id=rct.capacity_type_id
  623. left join rms_shipper rs on rs.shipper_id=air.requirement_shipper_id
  624. left join rms_line rl on air.line_id=rl.line_id
  625. where air.requirement_status=0
  626. </select>
  627. </mapper>