AmsshipDeliveryAttorneyMapper.xml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  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.AmsshipDeliveryAttorneyMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
  5. <id column="ATTORNEY_ID" jdbcType="DECIMAL" property="attorneyId" />
  6. <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
  7. <result column="REQUESTER_GROUP_ID" jdbcType="DECIMAL" property="requesterGroupId" />
  8. <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
  9. <result column="PORT_ID" jdbcType="DECIMAL" property="portId" />
  10. <result column="DOWN_SWIM_PORT_ID" jdbcType="DECIMAL" property="downSwimPortId" />
  11. <result column="ATTORNEY_PICKUP_CONTACT_PERSON" jdbcType="VARCHAR" property="attorneyPickupContactPerson" />
  12. <result column="ATTORENY_PICKUP_IDCARD" jdbcType="VARCHAR" property="attorenyPickupIdcard" />
  13. <result column="ATTORNEY_CONTACT_TELEPHONE" jdbcType="VARCHAR" property="attorneyContactTelephone" />
  14. <result column="ATTORNEY_TIME" jdbcType="TIMESTAMP" property="attorneyTime" />
  15. <result column="ATTORNEY_PDFFILE" jdbcType="VARCHAR" property="attorneyPdffile" />
  16. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
  17. <result column="DELETE_TIME" jdbcType="VARCHAR" property="deleteTime" />
  18. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  19. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  20. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  21. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  22. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  23. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  24. <result column="ATTORNEY_DISTRIBUTION_STATUS" jdbcType="DECIMAL" property="attorneyDistributionStatus" />
  25. </resultMap>
  26. <sql id="columns">
  27. ATTORNEY_ID, BATCH_ID, REQUESTER_GROUP_ID, CARRIER_ID, PORT_ID, DOWN_SWIM_PORT_ID,
  28. ATTORNEY_PICKUP_CONTACT_PERSON, ATTORENY_PICKUP_IDCARD, ATTORNEY_CONTACT_TELEPHONE,
  29. ATTORNEY_TIME, ATTORNEY_PDFFILE, DELETE_NAME, DELETE_TIME, INSERT_USERNAME, INSERT_TIME,
  30. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, ATTORNEY_DISTRIBUTION_STATUS
  31. </sql>
  32. <sql id="columns_alias">
  33. t.ATTORNEY_ID, t.BATCH_ID, t.REQUESTER_GROUP_ID, t.CARRIER_ID, t.PORT_ID, t.DOWN_SWIM_PORT_ID,
  34. t.ATTORNEY_PICKUP_CONTACT_PERSON, t.ATTORENY_PICKUP_IDCARD, t.ATTORNEY_CONTACT_TELEPHONE,
  35. t.ATTORNEY_TIME, t.ATTORNEY_PDFFILE, t.DELETE_NAME, t.DELETE_TIME, t.INSERT_USERNAME,
  36. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
  37. t.ATTORNEY_DISTRIBUTION_STATUS
  38. </sql>
  39. <sql id="select">
  40. SELECT <include refid="columns" /> FROM AMSSHIP_DELIVERY_ATTORNEY
  41. </sql>
  42. <sql id="select_alias">
  43. SELECT <include refid="columns_alias" /> FROM AMSSHIP_DELIVERY_ATTORNEY t
  44. </sql>
  45. <sql id="where">
  46. <where>
  47. <if test="attorneyId != null">
  48. and ATTORNEY_ID = #{attorneyId}
  49. </if>
  50. <if test="batchId != null">
  51. and BATCH_ID = #{batchId}
  52. </if>
  53. <if test="requesterGroupId != null">
  54. and REQUESTER_GROUP_ID = #{requesterGroupId}
  55. </if>
  56. <if test="carrierId != null">
  57. and CARRIER_ID = #{carrierId}
  58. </if>
  59. <if test="portId != null">
  60. and PORT_ID = #{portId}
  61. </if>
  62. <if test="downSwimPortId != null">
  63. and DOWN_SWIM_PORT_ID = #{downSwimPortId}
  64. </if>
  65. <if test="attorneyPickupContactPerson != null and attorneyPickupContactPerson != ''">
  66. and ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson}
  67. </if>
  68. <if test="attorenyPickupIdcard != null and attorenyPickupIdcard != ''">
  69. and ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard}
  70. </if>
  71. <if test="attorneyContactTelephone != null and attorneyContactTelephone != ''">
  72. and ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone}
  73. </if>
  74. <if test="attorneyTime != null">
  75. and TO_CHAR(ATTORNEY_TIME,'yyyy-MM-dd') = #{attorneyTime}
  76. </if>
  77. <if test="attorneyPdffile != null and attorneyPdffile != ''">
  78. and ATTORNEY_PDFFILE = #{attorneyPdffile}
  79. </if>
  80. <if test="deleteName != null and deleteName != ''">
  81. and DELETE_NAME = #{deleteName}
  82. </if>
  83. <if test="deleteTime != null and deleteTime != ''">
  84. and DELETE_TIME = #{deleteTime}
  85. </if>
  86. <if test="insertUsername != null and insertUsername != ''">
  87. and INSERT_USERNAME = #{insertUsername}
  88. </if>
  89. <if test="insertTime != null">
  90. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  91. </if>
  92. <if test="updateUsername != null and updateUsername != ''">
  93. and UPDATE_USERNAME = #{updateUsername}
  94. </if>
  95. <if test="updateTime != null">
  96. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  97. </if>
  98. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  99. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  100. </if>
  101. <if test="deleted != null">
  102. and DELETED = #{deleted}
  103. </if>
  104. <if test="attorneyDistributionStatus != null">
  105. and ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus}
  106. </if>
  107. </where>
  108. </sql>
  109. <sql id="whereLike">
  110. <where>
  111. <if test="attorneyId != null">
  112. and ATTORNEY_ID = #{attorneyId}
  113. </if>
  114. <if test="batchId != null">
  115. and BATCH_ID = #{batchId}
  116. </if>
  117. <if test="requesterGroupId != null">
  118. and REQUESTER_GROUP_ID = #{requesterGroupId}
  119. </if>
  120. <if test="carrierId != null">
  121. and CARRIER_ID = #{carrierId}
  122. </if>
  123. <if test="portId != null">
  124. and PORT_ID = #{portId}
  125. </if>
  126. <if test="downSwimPortId != null">
  127. and DOWN_SWIM_PORT_ID = #{downSwimPortId}
  128. </if>
  129. <if test="attorneyPickupContactPerson != null and attorneyPickupContactPerson != ''">
  130. and ATTORNEY_PICKUP_CONTACT_PERSON LIKE '%${attorneyPickupContactPerson}%'
  131. </if>
  132. <if test="attorenyPickupIdcard != null and attorenyPickupIdcard != ''">
  133. and ATTORENY_PICKUP_IDCARD LIKE '%${attorenyPickupIdcard}%'
  134. </if>
  135. <if test="attorneyContactTelephone != null and attorneyContactTelephone != ''">
  136. and ATTORNEY_CONTACT_TELEPHONE LIKE '%${attorneyContactTelephone}%'
  137. </if>
  138. <if test="attorneyTime != null">
  139. and TO_CHAR(ATTORNEY_TIME,'yyyy-MM-dd') = #{attorneyTime}
  140. </if>
  141. <if test="attorneyPdffile != null and attorneyPdffile != ''">
  142. and ATTORNEY_PDFFILE LIKE '%${attorneyPdffile}%'
  143. </if>
  144. <if test="deleteName != null and deleteName != ''">
  145. and DELETE_NAME LIKE '%${deleteName}%'
  146. </if>
  147. <if test="deleteTime != null and deleteTime != ''">
  148. and DELETE_TIME LIKE '%${deleteTime}%'
  149. </if>
  150. <if test="insertUsername != null and insertUsername != ''">
  151. and INSERT_USERNAME LIKE '%${insertUsername}%'
  152. </if>
  153. <if test="insertTime != null">
  154. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  155. </if>
  156. <if test="updateUsername != null and updateUsername != ''">
  157. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  158. </if>
  159. <if test="updateTime != null">
  160. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  161. </if>
  162. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  163. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  164. </if>
  165. <if test="deleted != null">
  166. and DELETED = #{deleted}
  167. </if>
  168. <if test="attorneyDistributionStatus != null">
  169. and ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus}
  170. </if>
  171. </where>
  172. </sql>
  173. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  174. delete from AMSSHIP_DELIVERY_ATTORNEY
  175. where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
  176. </delete>
  177. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  178. delete from AMSSHIP_DELIVERY_ATTORNEY
  179. where 1!=1
  180. <if test="batchId != null">
  181. or BATCH_ID = #{batchId}
  182. </if>
  183. <if test="requesterGroupId != null">
  184. or REQUESTER_GROUP_ID = #{requesterGroupId}
  185. </if>
  186. <if test="carrierId != null">
  187. or CARRIER_ID = #{carrierId}
  188. </if>
  189. <if test="portId != null">
  190. or PORT_ID = #{portId}
  191. </if>
  192. <if test="downSwimPortId != null">
  193. or DOWN_SWIM_PORT_ID = #{downSwimPortId}
  194. </if>
  195. <if test="attorneyPickupContactPerson != null and attorneyPickupContactPerson != ''">
  196. or ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson}
  197. </if>
  198. <if test="attorenyPickupIdcard != null and attorenyPickupIdcard != ''">
  199. or ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard}
  200. </if>
  201. <if test="attorneyContactTelephone != null and attorneyContactTelephone != ''">
  202. or ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone}
  203. </if>
  204. <if test="attorneyTime != null">
  205. or TO_CHAR(ATTORNEY_TIME,'yyyy-MM-dd') = '#{attorneyTime}'
  206. </if>
  207. <if test="attorneyPdffile != null and attorneyPdffile != ''">
  208. or ATTORNEY_PDFFILE = #{attorneyPdffile}
  209. </if>
  210. <if test="deleteName != null and deleteName != ''">
  211. or DELETE_NAME = #{deleteName}
  212. </if>
  213. <if test="deleteTime != null and deleteTime != ''">
  214. or DELETE_TIME = #{deleteTime}
  215. </if>
  216. <if test="insertUsername != null and insertUsername != ''">
  217. or INSERT_USERNAME = #{insertUsername}
  218. </if>
  219. <if test="insertTime != null">
  220. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  221. </if>
  222. <if test="updateUsername != null and updateUsername != ''">
  223. or UPDATE_USERNAME = #{updateUsername}
  224. </if>
  225. <if test="updateTime != null">
  226. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  227. </if>
  228. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  229. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  230. </if>
  231. <if test="deleted != null">
  232. or DELETED = #{deleted}
  233. </if>
  234. <if test="attorneyDistributionStatus != null">
  235. or ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus}
  236. </if>
  237. </delete>
  238. <insert id="insert" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
  239. insert into AMSSHIP_DELIVERY_ATTORNEY (ATTORNEY_ID, BATCH_ID, REQUESTER_GROUP_ID,
  240. CARRIER_ID, PORT_ID, DOWN_SWIM_PORT_ID,
  241. ATTORNEY_PICKUP_CONTACT_PERSON, ATTORENY_PICKUP_IDCARD,
  242. ATTORNEY_CONTACT_TELEPHONE, ATTORNEY_TIME,
  243. ATTORNEY_PDFFILE, DELETE_NAME, DELETE_TIME,
  244. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  245. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
  246. ATTORNEY_DISTRIBUTION_STATUS)
  247. values (#{attorneyId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL}, #{requesterGroupId,jdbcType=DECIMAL},
  248. #{carrierId,jdbcType=DECIMAL}, #{portId,jdbcType=DECIMAL}, #{downSwimPortId,jdbcType=DECIMAL},
  249. #{attorneyPickupContactPerson,jdbcType=VARCHAR}, #{attorenyPickupIdcard,jdbcType=VARCHAR},
  250. #{attorneyContactTelephone,jdbcType=VARCHAR}, #{attorneyTime,jdbcType=TIMESTAMP},
  251. #{attorneyPdffile,jdbcType=VARCHAR}, #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR},
  252. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  253. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  254. #{attorneyDistributionStatus,jdbcType=DECIMAL})
  255. </insert>
  256. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
  257. insert into AMSSHIP_DELIVERY_ATTORNEY
  258. <trim prefix="(" suffix=")" suffixOverrides=",">
  259. <if test="attorneyId != null">
  260. ATTORNEY_ID,
  261. </if>
  262. <if test="batchId != null">
  263. BATCH_ID,
  264. </if>
  265. <if test="requesterGroupId != null">
  266. REQUESTER_GROUP_ID,
  267. </if>
  268. <if test="carrierId != null">
  269. CARRIER_ID,
  270. </if>
  271. <if test="portId != null">
  272. PORT_ID,
  273. </if>
  274. <if test="downSwimPortId != null">
  275. DOWN_SWIM_PORT_ID,
  276. </if>
  277. <if test="attorneyPickupContactPerson != null">
  278. ATTORNEY_PICKUP_CONTACT_PERSON,
  279. </if>
  280. <if test="attorenyPickupIdcard != null">
  281. ATTORENY_PICKUP_IDCARD,
  282. </if>
  283. <if test="attorneyContactTelephone != null">
  284. ATTORNEY_CONTACT_TELEPHONE,
  285. </if>
  286. <if test="attorneyTime != null">
  287. ATTORNEY_TIME,
  288. </if>
  289. <if test="attorneyPdffile != null">
  290. ATTORNEY_PDFFILE,
  291. </if>
  292. <if test="deleteName != null">
  293. DELETE_NAME,
  294. </if>
  295. <if test="deleteTime != null">
  296. DELETE_TIME,
  297. </if>
  298. <if test="insertUsername != null">
  299. INSERT_USERNAME,
  300. </if>
  301. <if test="insertTime != null">
  302. INSERT_TIME,
  303. </if>
  304. <if test="updateUsername != null">
  305. UPDATE_USERNAME,
  306. </if>
  307. <if test="updateTime != null">
  308. UPDATE_TIME,
  309. </if>
  310. <if test="insertUpdateRemark != null">
  311. INSERT_UPDATE_REMARK,
  312. </if>
  313. <if test="deleted != null">
  314. DELETED,
  315. </if>
  316. <if test="attorneyDistributionStatus != null">
  317. ATTORNEY_DISTRIBUTION_STATUS,
  318. </if>
  319. </trim>
  320. <trim prefix="values (" suffix=")" suffixOverrides=",">
  321. <if test="attorneyId != null">
  322. #{attorneyId,jdbcType=DECIMAL},
  323. </if>
  324. <if test="batchId != null">
  325. #{batchId,jdbcType=DECIMAL},
  326. </if>
  327. <if test="requesterGroupId != null">
  328. #{requesterGroupId,jdbcType=DECIMAL},
  329. </if>
  330. <if test="carrierId != null">
  331. #{carrierId,jdbcType=DECIMAL},
  332. </if>
  333. <if test="portId != null">
  334. #{portId,jdbcType=DECIMAL},
  335. </if>
  336. <if test="downSwimPortId != null">
  337. #{downSwimPortId,jdbcType=DECIMAL},
  338. </if>
  339. <if test="attorneyPickupContactPerson != null">
  340. #{attorneyPickupContactPerson,jdbcType=VARCHAR},
  341. </if>
  342. <if test="attorenyPickupIdcard != null">
  343. #{attorenyPickupIdcard,jdbcType=VARCHAR},
  344. </if>
  345. <if test="attorneyContactTelephone != null">
  346. #{attorneyContactTelephone,jdbcType=VARCHAR},
  347. </if>
  348. <if test="attorneyTime != null">
  349. #{attorneyTime,jdbcType=TIMESTAMP},
  350. </if>
  351. <if test="attorneyPdffile != null">
  352. #{attorneyPdffile,jdbcType=VARCHAR},
  353. </if>
  354. <if test="deleteName != null">
  355. #{deleteName,jdbcType=VARCHAR},
  356. </if>
  357. <if test="deleteTime != null">
  358. #{deleteTime,jdbcType=VARCHAR},
  359. </if>
  360. <if test="insertUsername != null">
  361. #{insertUsername,jdbcType=VARCHAR},
  362. </if>
  363. <if test="insertTime != null">
  364. #{insertTime,jdbcType=TIMESTAMP},
  365. </if>
  366. <if test="updateUsername != null">
  367. #{updateUsername,jdbcType=VARCHAR},
  368. </if>
  369. <if test="updateTime != null">
  370. #{updateTime,jdbcType=TIMESTAMP},
  371. </if>
  372. <if test="insertUpdateRemark != null">
  373. #{insertUpdateRemark,jdbcType=VARCHAR},
  374. </if>
  375. <if test="deleted != null">
  376. #{deleted,jdbcType=DECIMAL},
  377. </if>
  378. <if test="attorneyDistributionStatus != null">
  379. #{attorneyDistributionStatus,jdbcType=DECIMAL},
  380. </if>
  381. </trim>
  382. </insert>
  383. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
  384. update AMSSHIP_DELIVERY_ATTORNEY
  385. set BATCH_ID = #{batchId,jdbcType=DECIMAL},
  386. REQUESTER_GROUP_ID = #{requesterGroupId,jdbcType=DECIMAL},
  387. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  388. PORT_ID = #{portId,jdbcType=DECIMAL},
  389. DOWN_SWIM_PORT_ID = #{downSwimPortId,jdbcType=DECIMAL},
  390. ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson,jdbcType=VARCHAR},
  391. ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard,jdbcType=VARCHAR},
  392. ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone,jdbcType=VARCHAR},
  393. ATTORNEY_TIME = #{attorneyTime,jdbcType=TIMESTAMP},
  394. ATTORNEY_PDFFILE = #{attorneyPdffile,jdbcType=VARCHAR},
  395. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  396. DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
  397. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  398. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  399. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  400. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  401. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  402. DELETED = #{deleted,jdbcType=DECIMAL},
  403. ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus,jdbcType=DECIMAL}
  404. where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
  405. </update>
  406. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
  407. update AMSSHIP_DELIVERY_ATTORNEY
  408. <set>
  409. <if test="batchId != null">
  410. BATCH_ID = #{batchId,jdbcType=DECIMAL},
  411. </if>
  412. <if test="requesterGroupId != null">
  413. REQUESTER_GROUP_ID = #{requesterGroupId,jdbcType=DECIMAL},
  414. </if>
  415. <if test="carrierId != null">
  416. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  417. </if>
  418. <if test="portId != null">
  419. PORT_ID = #{portId,jdbcType=DECIMAL},
  420. </if>
  421. <if test="downSwimPortId != null">
  422. DOWN_SWIM_PORT_ID = #{downSwimPortId,jdbcType=DECIMAL},
  423. </if>
  424. <if test="attorneyPickupContactPerson != null">
  425. ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson,jdbcType=VARCHAR},
  426. </if>
  427. <if test="attorenyPickupIdcard != null">
  428. ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard,jdbcType=VARCHAR},
  429. </if>
  430. <if test="attorneyContactTelephone != null">
  431. ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone,jdbcType=VARCHAR},
  432. </if>
  433. <if test="attorneyTime != null">
  434. ATTORNEY_TIME = #{attorneyTime,jdbcType=TIMESTAMP},
  435. </if>
  436. <if test="attorneyPdffile != null">
  437. ATTORNEY_PDFFILE = #{attorneyPdffile,jdbcType=VARCHAR},
  438. </if>
  439. <if test="deleteName != null">
  440. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  441. </if>
  442. <if test="deleteTime != null">
  443. DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
  444. </if>
  445. <if test="insertUsername != null">
  446. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  447. </if>
  448. <if test="insertTime != null">
  449. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  450. </if>
  451. <if test="updateUsername != null">
  452. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  453. </if>
  454. <if test="updateTime != null">
  455. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  456. </if>
  457. <if test="insertUpdateRemark != null">
  458. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  459. </if>
  460. <if test="deleted != null">
  461. DELETED = #{deleted,jdbcType=DECIMAL},
  462. </if>
  463. <if test="attorneyDistributionStatus != null">
  464. ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus,jdbcType=DECIMAL},
  465. </if>
  466. </set>
  467. where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
  468. </update>
  469. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  470. <include refid="select" />
  471. where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
  472. </select>
  473. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  474. <include refid="select" />
  475. <include refid="where" />
  476. </select>
  477. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  478. <include refid="select" />
  479. <include refid="whereLike" />
  480. </select>
  481. <insert id="batchInsert" parameterType="java.util.List">
  482. insert into AMSSHIP_DELIVERY_ATTORNEY
  483. (ATTORNEY_ID,
  484. BATCH_ID, REQUESTER_GROUP_ID, CARRIER_ID,
  485. PORT_ID, DOWN_SWIM_PORT_ID, ATTORNEY_PICKUP_CONTACT_PERSON,
  486. ATTORENY_PICKUP_IDCARD, ATTORNEY_CONTACT_TELEPHONE,
  487. ATTORNEY_TIME, ATTORNEY_PDFFILE,
  488. DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
  489. INSERT_TIME, UPDATE_USERNAME,
  490. UPDATE_TIME, INSERT_UPDATE_REMARK,
  491. DELETED, ATTORNEY_DISTRIBUTION_STATUS
  492. )
  493. ( <foreach collection="list" item="item" separator="union all">
  494. select
  495. #{item.attorneyId,jdbcType=DECIMAL},
  496. #{item.batchId,jdbcType=DECIMAL}, #{item.requesterGroupId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL},
  497. #{item.portId,jdbcType=DECIMAL}, #{item.downSwimPortId,jdbcType=DECIMAL}, #{item.attorneyPickupContactPerson,jdbcType=VARCHAR},
  498. #{item.attorenyPickupIdcard,jdbcType=VARCHAR}, #{item.attorneyContactTelephone,jdbcType=VARCHAR},
  499. #{item.attorneyTime,jdbcType=TIMESTAMP}, #{item.attorneyPdffile,jdbcType=VARCHAR},
  500. #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
  501. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  502. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  503. #{item.deleted,jdbcType=DECIMAL}, #{item.attorneyDistributionStatus,jdbcType=DECIMAL}
  504. from dual
  505. </foreach> )
  506. </insert>
  507. <update id="batchUpdate" parameterType="java.util.List">
  508. update AMSSHIP_DELIVERY_ATTORNEY
  509. set
  510. ATTORNEY_ID=
  511. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  512. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyId,jdbcType=DECIMAL}
  513. </foreach>
  514. ,BATCH_ID=
  515. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  516. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
  517. </foreach>
  518. ,REQUESTER_GROUP_ID=
  519. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  520. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.requesterGroupId,jdbcType=DECIMAL}
  521. </foreach>
  522. ,CARRIER_ID=
  523. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  524. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
  525. </foreach>
  526. ,PORT_ID=
  527. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  528. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
  529. </foreach>
  530. ,DOWN_SWIM_PORT_ID=
  531. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  532. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.downSwimPortId,jdbcType=DECIMAL}
  533. </foreach>
  534. ,ATTORNEY_PICKUP_CONTACT_PERSON=
  535. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  536. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyPickupContactPerson,jdbcType=VARCHAR}
  537. </foreach>
  538. ,ATTORENY_PICKUP_IDCARD=
  539. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  540. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorenyPickupIdcard,jdbcType=VARCHAR}
  541. </foreach>
  542. ,ATTORNEY_CONTACT_TELEPHONE=
  543. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  544. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyContactTelephone,jdbcType=VARCHAR}
  545. </foreach>
  546. ,ATTORNEY_TIME=
  547. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  548. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyTime,jdbcType=TIMESTAMP}
  549. </foreach>
  550. ,ATTORNEY_PDFFILE=
  551. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  552. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyPdffile,jdbcType=VARCHAR}
  553. </foreach>
  554. ,DELETE_NAME=
  555. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  556. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  557. </foreach>
  558. ,DELETE_TIME=
  559. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  560. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
  561. </foreach>
  562. ,INSERT_USERNAME=
  563. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  564. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  565. </foreach>
  566. ,INSERT_TIME=
  567. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  568. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  569. </foreach>
  570. ,UPDATE_USERNAME=
  571. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  572. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  573. </foreach>
  574. ,UPDATE_TIME=
  575. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  576. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  577. </foreach>
  578. ,INSERT_UPDATE_REMARK=
  579. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  580. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  581. </foreach>
  582. ,DELETED=
  583. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  584. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  585. </foreach>
  586. ,ATTORNEY_DISTRIBUTION_STATUS=
  587. <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
  588. when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyDistributionStatus,jdbcType=DECIMAL}
  589. </foreach>
  590. where ATTORNEY_ID in
  591. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  592. #{item.attorneyId,jdbcType=DECIMAL}
  593. </foreach>
  594. </update>
  595. <delete id="batchDelete" parameterType="java.util.List">
  596. delete from AMSSHIP_DELIVERY_ATTORNEY
  597. where ATTORNEY_ID in
  598. <foreach close=")" collection="list" item="id" open="(" separator=",">
  599. #{id}
  600. </foreach>
  601. </delete>
  602. <!-- 友情提示!!!-->
  603. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  604. <!--展示提货委托列表-->
  605. <select id="selectdeliveryAttorney" resultType="java.util.Map">
  606. select DISTINCT
  607. t3.SHIPPER_NAME "shipperName",
  608. RP.PORT_ALL_NAME "carrierName",
  609. dbi.INFACTORY_SHIP_NAME as "infactoryShipName",--进厂船名
  610. t6.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  611. t8.MATERIAL_NAME "materialName",
  612. RP2.PORT_NAME "portName",
  613. RP2.PORT_ALL_NAME "pickupAllName",
  614. t5.PORT_NAME "portName1",
  615. t1.ATTORNEY_PICKUP_CONTACT_PERSON "attorneyPickupContactPerson",
  616. t1.ATTORENY_PICKUP_IDCARD "attorneyPickupIdcard",
  617. t1.ATTORNEY_CONTACT_TELEPHONE "attorneyContactTelephone",
  618. t1.ATTORNEY_TIME "attorneyTime",
  619. t2.RESULT_NUMBER_OF_LOANS "purchaseOrderMaterialNum",
  620. t5.PORT_ALL_NAME "portAllName",
  621. T1.CARRIER_ID "carrierId",
  622. t1.REQUESTER_GROUP_ID "groupId",
  623. t1.ATTORNEY_ID "attorneyId",
  624. dbi.BATCH_INFACOTRY_ID "batchId",
  625. t1.INSERT_TIME "insertTime"
  626. from AMSSHIP_DELIVERY_ATTORNEY t1
  627. left join AMSSHIP_DELIVERY_NOTICE t2
  628. on t1.BATCH_ID=t2.BATCH_ID
  629. left join RMS_SHIPPER t3
  630. on t1.REQUESTER_GROUP_ID=t3.SHIPPER_ID
  631. LEFT JOIN RMS_PORT RP
  632. ON RP.PORT_ID=T1.CARRIER_ID
  633. left join RMS_PORT t5
  634. on t1.PORT_ID=t5.PORT_ID
  635. LEFT JOIN RMS_PORT RP2
  636. ON RP2.PORT_ID=T1.DOWN_SWIM_PORT_ID
  637. left join DIL_BATCH_INFACOTRY dbi --批次中间表
  638. on t1.BATCH_ID=dbi.BATCH_INFACOTRY_ID
  639. left join DIL_BATCH t6
  640. on dbi.BATCH_ID=t6.BATCH_ID
  641. left join RMS_MATERIAL t8
  642. on t6.MATERIAL_ID=t8.MATERIAL_ID
  643. where t1.deleted = 0 and t1.ATTORNEY_DISTRIBUTION_STATUS=#{status}
  644. <if test="con != null" >
  645. and dbi.INFACTORY_SHIP_NAME || t6.RESULT_FOREIGN_SHIP_NAME || t8.MATERIAL_NAME || t2.RESULT_NUMBER_OF_LOANS like #{con}
  646. </if>
  647. <where>
  648. <if test="shipperName!= null">
  649. and t3.SHIPPER_NAME in
  650. <foreach close=")" collection="shipperName" item="item" open="(" separator=",">
  651. #{item}
  652. </foreach>
  653. </if>
  654. <if test="materialName!= null">
  655. and t8.MATERIAL_NAME in
  656. <foreach close=")" collection="materialName" item="item" open="(" separator=",">
  657. #{item}
  658. </foreach>
  659. </if>
  660. <if test="portName!= null">
  661. and t5.PORT_NAME in
  662. <foreach close=")" collection="portName" item="item" open="(" separator=",">
  663. #{item}
  664. </foreach>
  665. </if>
  666. <if test="portName1!= null">
  667. and t5.PORT_NAME in
  668. <foreach close=")" collection="portName1" item="item" open="(" separator=",">
  669. #{item}
  670. </foreach>
  671. </if>
  672. </where>
  673. <include refid="orderByInsertTime" />
  674. </select>
  675. <!--根据时间排序-->
  676. <sql id="orderByInsertTime">
  677. <if test="orderField != null and orderField != ''">
  678. order by "${orderField}"
  679. <if test="orderType != null and orderType != ''">
  680. ${orderType}
  681. </if>
  682. </if>
  683. <if test="orderField == null ">
  684. order by "insertTime" desc
  685. </if>
  686. </sql>
  687. <!-- 下拉框中获取收货人单位 -->
  688. <select id="getPortName" resultType="java.util.LinkedHashMap">
  689. select RP.PORT_ID "id",
  690. RP.PORT_ID "value",
  691. RP.PORT_NAME "label"
  692. from RMS_PORT RP
  693. WHERE RP.PORT_TYPE_ID = 2
  694. </select>
  695. <!-- 下拉框中获取放货通知单id-->
  696. <select id="getNoticeId" resultType="java.util.LinkedHashMap">
  697. select ADN.NOTICE_ID "id",
  698. ADN.NOTICE_ID "value",
  699. ADN.NOTICE_ID "label"
  700. from AMSSHIP_DELIVERY_NOTICE ADN
  701. </select>
  702. <!-- 根据主键id进行查询,用于渲染表单-->
  703. <select id="getDeliveryAttorneyId" resultType="java.util.Map">
  704. select
  705. (DB.RESULT_FOREIGN_SHIP_NAME || '-' || RM.MATERIAL_NAME || '-' || dbi.INFACTORY_SHIP_NAME) "batchId",
  706. t1.PORT_ID "portId",
  707. t1.REQUESTER_GROUP_ID "requesterGroupId",
  708. t1.CARRIER_ID "carrierId",
  709. t1.DOWN_SWIM_PORT_ID "downSwimPortId",
  710. t1.ATTORNEY_PICKUP_CONTACT_PERSON "attorneyPickupContactPerson",
  711. t1.ATTORENY_PICKUP_IDCARD "attorenyPickupIdcard",
  712. t1.ATTORNEY_CONTACT_TELEPHONE "attorneyContactTelephone",
  713. t1.ATTORNEY_TIME "attorneyTime",
  714. dbi.INFACTORY_SHIP_NAME "infactoryShipName",--进厂船名
  715. dbi.BATCH_INFACOTRY_ID "batchInfactoryId"
  716. from AMSSHIP_DELIVERY_ATTORNEY t1
  717. left join DIL_BATCH_INFACOTRY dbi --批次中间表
  718. on dbi.BATCH_INFACOTRY_ID=T1.BATCH_ID
  719. left join DIL_BATCH DB
  720. ON DB.BATCH_ID=dbi.BATCH_ID
  721. LEFT JOIN RMS_MATERIAL RM
  722. ON RM.MATERIAL_ID=DB.MATERIAL_ID
  723. where t1.ATTORNEY_ID = #{attorneyId}
  724. </select>
  725. <!--得到提货通知单id-->
  726. <select id="getAttorneyId" resultType="java.util.LinkedHashMap">
  727. SELECT ada.ATTORNEY_ID "id",
  728. ada.ATTORNEY_ID "value",
  729. ada.ATTORNEY_PICKUP_CONTACT_PERSON "label"
  730. FROM AMSSHIP_DELIVERY_ATTORNEY ada
  731. </select>
  732. <!--得到发件人id(港口)-->
  733. <select id="getPortId" resultType="java.util.LinkedHashMap">
  734. SELECT rp.PORT_ID "id",
  735. rp.PORT_ID "value",
  736. rp.PORT_NAME "label"
  737. FROM RMS_PORT rp
  738. </select>
  739. <!--得到收件人id(下游码头)-->
  740. <select id="getPierId" resultType="java.util.LinkedHashMap">
  741. SELECT rp.PIER_ID "id",
  742. rp.PIER_ID "value",
  743. rp.PIER_NAME "label"
  744. FROM RMS_PIER rp
  745. </select>
  746. <select id="getRmRawId" resultType="java.util.LinkedHashMap">
  747. SELECT rrmr.GM_ID "id",
  748. rrmr.GM_ID "value",
  749. rrmr.GM_TONNAGE "label"
  750. FROM WMSH_GRID_MATERIAL rrmr
  751. </select>
  752. </mapper>