TmsshipWaterQualityResultMapper.xml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  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.TmsshipWaterQualityResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmsshipWaterQualityResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId"/>
  6. <result column="TOTAL_RESULT_ID" jdbcType="DECIMAL" property="totalResultId"/>
  7. <result column="RESULT_PLANNED_DATE" jdbcType="TIMESTAMP" property="resultPlannedDate"/>
  8. <result column="RESULT_CARGO_RIGHTS_DATE" jdbcType="TIMESTAMP" property="resultCargoRightsDate"/>
  9. <result column="RESULT_SHIPMENT_RATIO" jdbcType="DECIMAL" property="resultShipmentRatio"/>
  10. <result column="RESULT_EMPTY_HEAVY_WATER_METER" jdbcType="DECIMAL" property="resultEmptyHeavyWaterMeter"/>
  11. <result column="RESULT_MOISTURE_CONTENT" jdbcType="DECIMAL" property="resultMoistureContent"/>
  12. <result column="RESULT_WATER_TONNAGE" jdbcType="DECIMAL" property="resultWaterTonnage"/>
  13. <result column="RESULT_INSPECTION_FEES" jdbcType="DECIMAL" property="resultInspectionFees"/>
  14. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName"/>
  15. <result column="DELETE_TIME" jdbcType="VARCHAR" property="deleteTime"/>
  16. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
  17. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
  18. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
  19. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
  20. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
  21. <result column="RESULT_ES_DELIVERY_DATE" jdbcType="TIMESTAMP" property="resultEsDeliveryDate"/>
  22. <result column="DELETED" jdbcType="DECIMAL" property="deleted"/>
  23. </resultMap>
  24. <sql id="columns">
  25. RESULT_ID, TOTAL_RESULT_ID, RESULT_PLANNED_DATE, RESULT_CARGO_RIGHTS_DATE, RESULT_SHIPMENT_RATIO,
  26. RESULT_EMPTY_HEAVY_WATER_METER, RESULT_MOISTURE_CONTENT, RESULT_WATER_TONNAGE, RESULT_INSPECTION_FEES,
  27. DELETE_NAME, DELETE_TIME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  28. INSERT_UPDATE_REMARK, RESULT_ES_DELIVERY_DATE, DELETED
  29. </sql>
  30. <sql id="columns_alias">
  31. t.RESULT_ID, t.TOTAL_RESULT_ID, t.RESULT_PLANNED_DATE, t.RESULT_CARGO_RIGHTS_DATE,
  32. t.RESULT_SHIPMENT_RATIO, t.RESULT_EMPTY_HEAVY_WATER_METER, t.RESULT_MOISTURE_CONTENT,
  33. t.RESULT_WATER_TONNAGE, t.RESULT_INSPECTION_FEES, t.DELETE_NAME, t.DELETE_TIME, t.INSERT_USERNAME,
  34. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.RESULT_ES_DELIVERY_DATE,
  35. t.DELETED
  36. </sql>
  37. <sql id="select">
  38. SELECT
  39. <include refid="columns"/>
  40. FROM TMSSHIP_WATER_QUALITY_RESULT
  41. </sql>
  42. <sql id="select_alias">
  43. SELECT
  44. <include refid="columns_alias"/>
  45. FROM TMSSHIP_WATER_QUALITY_RESULT t
  46. </sql>
  47. <sql id="where">
  48. <where>
  49. <if test="resultId != null">
  50. and RESULT_ID = #{resultId}
  51. </if>
  52. <if test="totalResultId != null">
  53. and TOTAL_RESULT_ID = #{totalResultId}
  54. </if>
  55. <if test="resultPlannedDate != null">
  56. and TO_CHAR(RESULT_PLANNED_DATE,'yyyy-MM-dd') = #{resultPlannedDate}
  57. </if>
  58. <if test="resultCargoRightsDate != null">
  59. and TO_CHAR(RESULT_CARGO_RIGHTS_DATE,'yyyy-MM-dd') = #{resultCargoRightsDate}
  60. </if>
  61. <if test="resultShipmentRatio != null">
  62. and RESULT_SHIPMENT_RATIO = #{resultShipmentRatio}
  63. </if>
  64. <if test="resultEmptyHeavyWaterMeter != null">
  65. and RESULT_EMPTY_HEAVY_WATER_METER = #{resultEmptyHeavyWaterMeter}
  66. </if>
  67. <if test="resultMoistureContent != null">
  68. and RESULT_MOISTURE_CONTENT = #{resultMoistureContent}
  69. </if>
  70. <if test="resultWaterTonnage != null">
  71. and RESULT_WATER_TONNAGE = #{resultWaterTonnage}
  72. </if>
  73. <if test="resultInspectionFees != null">
  74. and RESULT_INSPECTION_FEES = #{resultInspectionFees}
  75. </if>
  76. <if test="deleteName != null and deleteName != ''">
  77. and DELETE_NAME = #{deleteName}
  78. </if>
  79. <if test="deleteTime != null and deleteTime != ''">
  80. and DELETE_TIME = #{deleteTime}
  81. </if>
  82. <if test="insertUsername != null and insertUsername != ''">
  83. and INSERT_USERNAME = #{insertUsername}
  84. </if>
  85. <if test="insertTime != null">
  86. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  87. </if>
  88. <if test="updateUsername != null and updateUsername != ''">
  89. and UPDATE_USERNAME = #{updateUsername}
  90. </if>
  91. <if test="updateTime != null">
  92. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  93. </if>
  94. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  95. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  96. </if>
  97. <if test="resultEsDeliveryDate != null">
  98. and TO_CHAR(RESULT_ES_DELIVERY_DATE,'yyyy-MM-dd') = #{resultEsDeliveryDate}
  99. </if>
  100. <if test="deleted != null">
  101. and DELETED = #{deleted}
  102. </if>
  103. </where>
  104. </sql>
  105. <sql id="whereLike">
  106. <where>
  107. <if test="resultId != null">
  108. and RESULT_ID = #{resultId}
  109. </if>
  110. <if test="totalResultId != null">
  111. and TOTAL_RESULT_ID = #{totalResultId}
  112. </if>
  113. <if test="resultPlannedDate != null">
  114. and TO_CHAR(RESULT_PLANNED_DATE,'yyyy-MM-dd') = #{resultPlannedDate}
  115. </if>
  116. <if test="resultCargoRightsDate != null">
  117. and TO_CHAR(RESULT_CARGO_RIGHTS_DATE,'yyyy-MM-dd') = #{resultCargoRightsDate}
  118. </if>
  119. <if test="resultShipmentRatio != null">
  120. and RESULT_SHIPMENT_RATIO = #{resultShipmentRatio}
  121. </if>
  122. <if test="resultEmptyHeavyWaterMeter != null">
  123. and RESULT_EMPTY_HEAVY_WATER_METER = #{resultEmptyHeavyWaterMeter}
  124. </if>
  125. <if test="resultMoistureContent != null">
  126. and RESULT_MOISTURE_CONTENT = #{resultMoistureContent}
  127. </if>
  128. <if test="resultWaterTonnage != null">
  129. and RESULT_WATER_TONNAGE = #{resultWaterTonnage}
  130. </if>
  131. <if test="resultInspectionFees != null">
  132. and RESULT_INSPECTION_FEES = #{resultInspectionFees}
  133. </if>
  134. <if test="deleteName != null and deleteName != ''">
  135. and DELETE_NAME LIKE '%${deleteName}%'
  136. </if>
  137. <if test="deleteTime != null and deleteTime != ''">
  138. and DELETE_TIME LIKE '%${deleteTime}%'
  139. </if>
  140. <if test="insertUsername != null and insertUsername != ''">
  141. and INSERT_USERNAME LIKE '%${insertUsername}%'
  142. </if>
  143. <if test="insertTime != null">
  144. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  145. </if>
  146. <if test="updateUsername != null and updateUsername != ''">
  147. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  148. </if>
  149. <if test="updateTime != null">
  150. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  151. </if>
  152. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  153. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  154. </if>
  155. <if test="resultEsDeliveryDate != null">
  156. and TO_CHAR(RESULT_ES_DELIVERY_DATE,'yyyy-MM-dd') = #{resultEsDeliveryDate}
  157. </if>
  158. <if test="deleted != null">
  159. and DELETED = #{deleted}
  160. </if>
  161. </where>
  162. </sql>
  163. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  164. delete
  165. from TMSSHIP_WATER_QUALITY_RESULT
  166. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  167. </delete>
  168. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  169. delete from TMSSHIP_WATER_QUALITY_RESULT
  170. where 1!=1
  171. <if test="totalResultId != null">
  172. or TOTAL_RESULT_ID = #{totalResultId}
  173. </if>
  174. <if test="resultPlannedDate != null">
  175. or TO_CHAR(RESULT_PLANNED_DATE,'yyyy-MM-dd') = '#{resultPlannedDate}'
  176. </if>
  177. <if test="resultCargoRightsDate != null">
  178. or TO_CHAR(RESULT_CARGO_RIGHTS_DATE,'yyyy-MM-dd') = '#{resultCargoRightsDate}'
  179. </if>
  180. <if test="resultShipmentRatio != null">
  181. or RESULT_SHIPMENT_RATIO = #{resultShipmentRatio}
  182. </if>
  183. <if test="resultEmptyHeavyWaterMeter != null">
  184. or RESULT_EMPTY_HEAVY_WATER_METER = #{resultEmptyHeavyWaterMeter}
  185. </if>
  186. <if test="resultMoistureContent != null">
  187. or RESULT_MOISTURE_CONTENT = #{resultMoistureContent}
  188. </if>
  189. <if test="resultWaterTonnage != null">
  190. or RESULT_WATER_TONNAGE = #{resultWaterTonnage}
  191. </if>
  192. <if test="resultInspectionFees != null">
  193. or RESULT_INSPECTION_FEES = #{resultInspectionFees}
  194. </if>
  195. <if test="deleteName != null and deleteName != ''">
  196. or DELETE_NAME = #{deleteName}
  197. </if>
  198. <if test="deleteTime != null and deleteTime != ''">
  199. or DELETE_TIME = #{deleteTime}
  200. </if>
  201. <if test="insertUsername != null and insertUsername != ''">
  202. or INSERT_USERNAME = #{insertUsername}
  203. </if>
  204. <if test="insertTime != null">
  205. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  206. </if>
  207. <if test="updateUsername != null and updateUsername != ''">
  208. or UPDATE_USERNAME = #{updateUsername}
  209. </if>
  210. <if test="updateTime != null">
  211. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  212. </if>
  213. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  214. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  215. </if>
  216. <if test="resultEsDeliveryDate != null">
  217. or TO_CHAR(RESULT_ES_DELIVERY_DATE,'yyyy-MM-dd') = '#{resultEsDeliveryDate}'
  218. </if>
  219. <if test="deleted != null">
  220. or DELETED = #{deleted}
  221. </if>
  222. </delete>
  223. <insert id="insert" parameterType="com.steerinfo.dil.model.TmsshipWaterQualityResult">
  224. insert into TMSSHIP_WATER_QUALITY_RESULT (RESULT_ID, TOTAL_RESULT_ID, RESULT_PLANNED_DATE,
  225. RESULT_CARGO_RIGHTS_DATE, RESULT_SHIPMENT_RATIO,
  226. RESULT_EMPTY_HEAVY_WATER_METER, RESULT_MOISTURE_CONTENT,
  227. RESULT_WATER_TONNAGE, RESULT_INSPECTION_FEES,
  228. DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
  229. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  230. INSERT_UPDATE_REMARK, RESULT_ES_DELIVERY_DATE,
  231. DELETED)
  232. values (#{resultId,jdbcType=DECIMAL}, #{totalResultId,jdbcType=DECIMAL},
  233. #{resultPlannedDate,jdbcType=TIMESTAMP},
  234. #{resultCargoRightsDate,jdbcType=TIMESTAMP}, #{resultShipmentRatio,jdbcType=DECIMAL},
  235. #{resultEmptyHeavyWaterMeter,jdbcType=DECIMAL}, #{resultMoistureContent,jdbcType=DECIMAL},
  236. #{resultWaterTonnage,jdbcType=DECIMAL}, #{resultInspectionFees,jdbcType=DECIMAL},
  237. #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR},
  238. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  239. #{insertUpdateRemark,jdbcType=VARCHAR}, #{resultEsDeliveryDate,jdbcType=TIMESTAMP},
  240. #{deleted,jdbcType=DECIMAL})
  241. </insert>
  242. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmsshipWaterQualityResult">
  243. insert into TMSSHIP_WATER_QUALITY_RESULT
  244. <trim prefix="(" suffix=")" suffixOverrides=",">
  245. <if test="resultId != null">
  246. RESULT_ID,
  247. </if>
  248. <if test="totalResultId != null">
  249. TOTAL_RESULT_ID,
  250. </if>
  251. <if test="resultPlannedDate != null">
  252. RESULT_PLANNED_DATE,
  253. </if>
  254. <if test="resultCargoRightsDate != null">
  255. RESULT_CARGO_RIGHTS_DATE,
  256. </if>
  257. <if test="resultShipmentRatio != null">
  258. RESULT_SHIPMENT_RATIO,
  259. </if>
  260. <if test="resultEmptyHeavyWaterMeter != null">
  261. RESULT_EMPTY_HEAVY_WATER_METER,
  262. </if>
  263. <if test="resultMoistureContent != null">
  264. RESULT_MOISTURE_CONTENT,
  265. </if>
  266. <if test="resultWaterTonnage != null">
  267. RESULT_WATER_TONNAGE,
  268. </if>
  269. <if test="resultInspectionFees != null">
  270. RESULT_INSPECTION_FEES,
  271. </if>
  272. <if test="deleteName != null">
  273. DELETE_NAME,
  274. </if>
  275. <if test="deleteTime != null">
  276. DELETE_TIME,
  277. </if>
  278. <if test="insertUsername != null">
  279. INSERT_USERNAME,
  280. </if>
  281. <if test="insertTime != null">
  282. INSERT_TIME,
  283. </if>
  284. <if test="updateUsername != null">
  285. UPDATE_USERNAME,
  286. </if>
  287. <if test="updateTime != null">
  288. UPDATE_TIME,
  289. </if>
  290. <if test="insertUpdateRemark != null">
  291. INSERT_UPDATE_REMARK,
  292. </if>
  293. <if test="resultEsDeliveryDate != null">
  294. RESULT_ES_DELIVERY_DATE,
  295. </if>
  296. <if test="deleted != null">
  297. DELETED,
  298. </if>
  299. </trim>
  300. <trim prefix="values (" suffix=")" suffixOverrides=",">
  301. <if test="resultId != null">
  302. #{resultId,jdbcType=DECIMAL},
  303. </if>
  304. <if test="totalResultId != null">
  305. #{totalResultId,jdbcType=DECIMAL},
  306. </if>
  307. <if test="resultPlannedDate != null">
  308. #{resultPlannedDate,jdbcType=TIMESTAMP},
  309. </if>
  310. <if test="resultCargoRightsDate != null">
  311. #{resultCargoRightsDate,jdbcType=TIMESTAMP},
  312. </if>
  313. <if test="resultShipmentRatio != null">
  314. #{resultShipmentRatio,jdbcType=DECIMAL},
  315. </if>
  316. <if test="resultEmptyHeavyWaterMeter != null">
  317. #{resultEmptyHeavyWaterMeter,jdbcType=DECIMAL},
  318. </if>
  319. <if test="resultMoistureContent != null">
  320. #{resultMoistureContent,jdbcType=DECIMAL},
  321. </if>
  322. <if test="resultWaterTonnage != null">
  323. #{resultWaterTonnage,jdbcType=DECIMAL},
  324. </if>
  325. <if test="resultInspectionFees != null">
  326. #{resultInspectionFees,jdbcType=DECIMAL},
  327. </if>
  328. <if test="deleteName != null">
  329. #{deleteName,jdbcType=VARCHAR},
  330. </if>
  331. <if test="deleteTime != null">
  332. #{deleteTime,jdbcType=VARCHAR},
  333. </if>
  334. <if test="insertUsername != null">
  335. #{insertUsername,jdbcType=VARCHAR},
  336. </if>
  337. <if test="insertTime != null">
  338. #{insertTime,jdbcType=TIMESTAMP},
  339. </if>
  340. <if test="updateUsername != null">
  341. #{updateUsername,jdbcType=VARCHAR},
  342. </if>
  343. <if test="updateTime != null">
  344. #{updateTime,jdbcType=TIMESTAMP},
  345. </if>
  346. <if test="insertUpdateRemark != null">
  347. #{insertUpdateRemark,jdbcType=VARCHAR},
  348. </if>
  349. <if test="resultEsDeliveryDate != null">
  350. #{resultEsDeliveryDate,jdbcType=TIMESTAMP},
  351. </if>
  352. <if test="deleted != null">
  353. #{deleted,jdbcType=DECIMAL},
  354. </if>
  355. </trim>
  356. </insert>
  357. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmsshipWaterQualityResult">
  358. update TMSSHIP_WATER_QUALITY_RESULT
  359. set TOTAL_RESULT_ID = #{totalResultId,jdbcType=DECIMAL},
  360. RESULT_PLANNED_DATE = #{resultPlannedDate,jdbcType=TIMESTAMP},
  361. RESULT_CARGO_RIGHTS_DATE = #{resultCargoRightsDate,jdbcType=TIMESTAMP},
  362. RESULT_SHIPMENT_RATIO = #{resultShipmentRatio,jdbcType=DECIMAL},
  363. RESULT_EMPTY_HEAVY_WATER_METER = #{resultEmptyHeavyWaterMeter,jdbcType=DECIMAL},
  364. RESULT_MOISTURE_CONTENT = #{resultMoistureContent,jdbcType=DECIMAL},
  365. RESULT_WATER_TONNAGE = #{resultWaterTonnage,jdbcType=DECIMAL},
  366. RESULT_INSPECTION_FEES = #{resultInspectionFees,jdbcType=DECIMAL},
  367. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  368. DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
  369. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  370. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  371. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  372. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  373. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  374. RESULT_ES_DELIVERY_DATE = #{resultEsDeliveryDate,jdbcType=TIMESTAMP},
  375. DELETED = #{deleted,jdbcType=DECIMAL}
  376. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  377. </update>
  378. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmsshipWaterQualityResult">
  379. update TMSSHIP_WATER_QUALITY_RESULT
  380. <set>
  381. <if test="totalResultId != null">
  382. TOTAL_RESULT_ID = #{totalResultId,jdbcType=DECIMAL},
  383. </if>
  384. <if test="resultPlannedDate != null">
  385. RESULT_PLANNED_DATE = #{resultPlannedDate,jdbcType=TIMESTAMP},
  386. </if>
  387. <if test="resultCargoRightsDate != null">
  388. RESULT_CARGO_RIGHTS_DATE = #{resultCargoRightsDate,jdbcType=TIMESTAMP},
  389. </if>
  390. <if test="resultShipmentRatio != null">
  391. RESULT_SHIPMENT_RATIO = #{resultShipmentRatio,jdbcType=DECIMAL},
  392. </if>
  393. <if test="resultEmptyHeavyWaterMeter != null">
  394. RESULT_EMPTY_HEAVY_WATER_METER = #{resultEmptyHeavyWaterMeter,jdbcType=DECIMAL},
  395. </if>
  396. <if test="resultMoistureContent != null">
  397. RESULT_MOISTURE_CONTENT = #{resultMoistureContent,jdbcType=DECIMAL},
  398. </if>
  399. <if test="resultWaterTonnage != null">
  400. RESULT_WATER_TONNAGE = #{resultWaterTonnage,jdbcType=DECIMAL},
  401. </if>
  402. <if test="resultInspectionFees != null">
  403. RESULT_INSPECTION_FEES = #{resultInspectionFees,jdbcType=DECIMAL},
  404. </if>
  405. <if test="deleteName != null">
  406. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  407. </if>
  408. <if test="deleteTime != null">
  409. DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
  410. </if>
  411. <if test="insertUsername != null">
  412. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  413. </if>
  414. <if test="insertTime != null">
  415. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  416. </if>
  417. <if test="updateUsername != null">
  418. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  419. </if>
  420. <if test="updateTime != null">
  421. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  422. </if>
  423. <if test="insertUpdateRemark != null">
  424. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  425. </if>
  426. <if test="resultEsDeliveryDate != null">
  427. RESULT_ES_DELIVERY_DATE = #{resultEsDeliveryDate,jdbcType=TIMESTAMP},
  428. </if>
  429. <if test="deleted != null">
  430. DELETED = #{deleted,jdbcType=DECIMAL},
  431. </if>
  432. </set>
  433. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  434. </update>
  435. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  436. <include refid="select"/>
  437. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  438. </select>
  439. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  440. <include refid="select"/>
  441. <include refid="where"/>
  442. </select>
  443. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  444. <include refid="select"/>
  445. <include refid="whereLike"/>
  446. </select>
  447. <insert id="batchInsert" parameterType="java.util.List">
  448. insert into TMSSHIP_WATER_QUALITY_RESULT
  449. (RESULT_ID,
  450. TOTAL_RESULT_ID, RESULT_PLANNED_DATE,
  451. RESULT_CARGO_RIGHTS_DATE, RESULT_SHIPMENT_RATIO,
  452. RESULT_EMPTY_HEAVY_WATER_METER, RESULT_MOISTURE_CONTENT,
  453. RESULT_WATER_TONNAGE, RESULT_INSPECTION_FEES,
  454. DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
  455. INSERT_TIME, UPDATE_USERNAME,
  456. UPDATE_TIME, INSERT_UPDATE_REMARK,
  457. RESULT_ES_DELIVERY_DATE, DELETED
  458. )
  459. ( <foreach collection="list" item="item" separator="union all">
  460. select
  461. #{item.resultId,jdbcType=DECIMAL},
  462. #{item.totalResultId,jdbcType=DECIMAL}, #{item.resultPlannedDate,jdbcType=TIMESTAMP},
  463. #{item.resultCargoRightsDate,jdbcType=TIMESTAMP}, #{item.resultShipmentRatio,jdbcType=DECIMAL},
  464. #{item.resultEmptyHeavyWaterMeter,jdbcType=DECIMAL}, #{item.resultMoistureContent,jdbcType=DECIMAL},
  465. #{item.resultWaterTonnage,jdbcType=DECIMAL}, #{item.resultInspectionFees,jdbcType=DECIMAL},
  466. #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=VARCHAR},
  467. #{item.insertUsername,jdbcType=VARCHAR},
  468. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  469. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  470. #{item.resultEsDeliveryDate,jdbcType=TIMESTAMP}, #{item.deleted,jdbcType=DECIMAL}
  471. from dual
  472. </foreach> )
  473. </insert>
  474. <update id="batchUpdate" parameterType="java.util.List">
  475. update TMSSHIP_WATER_QUALITY_RESULT
  476. set
  477. RESULT_ID=
  478. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  479. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  480. </foreach>
  481. ,TOTAL_RESULT_ID=
  482. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  483. when #{item.resultId,jdbcType=DECIMAL} then #{item.totalResultId,jdbcType=DECIMAL}
  484. </foreach>
  485. ,RESULT_PLANNED_DATE=
  486. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  487. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultPlannedDate,jdbcType=TIMESTAMP}
  488. </foreach>
  489. ,RESULT_CARGO_RIGHTS_DATE=
  490. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  491. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultCargoRightsDate,jdbcType=TIMESTAMP}
  492. </foreach>
  493. ,RESULT_SHIPMENT_RATIO=
  494. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  495. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultShipmentRatio,jdbcType=DECIMAL}
  496. </foreach>
  497. ,RESULT_EMPTY_HEAVY_WATER_METER=
  498. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  499. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEmptyHeavyWaterMeter,jdbcType=DECIMAL}
  500. </foreach>
  501. ,RESULT_MOISTURE_CONTENT=
  502. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  503. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMoistureContent,jdbcType=DECIMAL}
  504. </foreach>
  505. ,RESULT_WATER_TONNAGE=
  506. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  507. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultWaterTonnage,jdbcType=DECIMAL}
  508. </foreach>
  509. ,RESULT_INSPECTION_FEES=
  510. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  511. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultInspectionFees,jdbcType=DECIMAL}
  512. </foreach>
  513. ,DELETE_NAME=
  514. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  515. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  516. </foreach>
  517. ,DELETE_TIME=
  518. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  519. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
  520. </foreach>
  521. ,INSERT_USERNAME=
  522. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  523. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  524. </foreach>
  525. ,INSERT_TIME=
  526. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  527. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  528. </foreach>
  529. ,UPDATE_USERNAME=
  530. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  531. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  532. </foreach>
  533. ,UPDATE_TIME=
  534. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  535. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  536. </foreach>
  537. ,INSERT_UPDATE_REMARK=
  538. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  539. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  540. </foreach>
  541. ,RESULT_ES_DELIVERY_DATE=
  542. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  543. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEsDeliveryDate,jdbcType=TIMESTAMP}
  544. </foreach>
  545. ,DELETED=
  546. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  547. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  548. </foreach>
  549. where RESULT_ID in
  550. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  551. #{item.resultId,jdbcType=DECIMAL}
  552. </foreach>
  553. </update>
  554. <delete id="batchDelete" parameterType="java.util.List">
  555. delete from TMSSHIP_WATER_QUALITY_RESULT
  556. where RESULT_ID in
  557. <foreach collection="list" item="id" open="(" close=")" separator=",">
  558. #{id}
  559. </foreach>
  560. </delete>
  561. <!-- 友情提示!!!-->
  562. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  563. <select id="selectMaxId" resultType="DECIMAL">
  564. SELECT MAX(RESULT_ID) + 1
  565. FROM TMSSHIP_WATER_QUALITY_RESULT
  566. </select>
  567. <!--查询所有水分质检作业-->
  568. <sql id="orderByInsertTime">
  569. <if test="orderField != null and orderField != ''">
  570. order by "${orderField}"
  571. <if test="orderType != null and orderType != ''">
  572. ${orderType}
  573. </if>
  574. </if>
  575. <if test="orderField == null ">
  576. order by "insertTime" desc
  577. </if>
  578. </sql>
  579. <select id="selectWaterQualityList" resultType="java.util.Map">
  580. SELECT * FROM (
  581. SELECT DISTINCT ttr.ORDER_ID as "orderId",
  582. twqr.INSERT_TIME as "insertTime",
  583. twqr.RESULT_ID as "resultId",
  584. rm.MATERIAL_NAME as "materialName",
  585. db.RESULT_FOREIGN_SHIP_NAME as "foreignShipName",
  586. rpo.PORT_NAME as "loadPort",
  587. twqr.RESULT_PLANNED_DATE as "planDate",
  588. twqr.RESULT_ES_DELIVERY_DATE as "expectNoticeDate",
  589. twqr.RESULT_CARGO_RIGHTS_DATE as "cargoDate",
  590. adn.PURCHASE_CONTRACT_MOISTURE as "purchaseContractMoisture",
  591. tlsr.RESULT_LOAD_SHIP_DATE as "loadTime",
  592. oic.INSTRUCTION_PLANNED_LOADING as "planWeight",
  593. rc.CAPACITY_NUMBER as "capacityName",
  594. tlsr.RESULT_ACTUAL_INSTALLATIONS as "realWeight",
  595. twqr.RESULT_EMPTY_HEAVY_WATER_METER as "waterGauge",
  596. twqr.RESULT_MOISTURE_CONTENT as "moistureContent",
  597. twqr.RESULT_WATER_TONNAGE as "waterWeight",
  598. twqr.RESULT_INSPECTION_FEES as "testFee",
  599. twqr.RESULT_SHIPMENT_RATIO as "loadRatio"
  600. FROM TMSSHIP_WATER_QUALITY_RESULT twqr
  601. LEFT JOIN TMSSHIP_TOTAL_RESULT ttr
  602. ON twqr.TOTAL_RESULT_ID = ttr.RESULT_ID
  603. LEFT JOIN OMSSHIP_INSTRUCTIONS_CAPACITY oic
  604. ON oic.INSTRUCTIONS_CAPACITY_ID = ttr.ORDER_ID
  605. LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
  606. ON oic.INSTRUCTIONS_ID = osi.SHIPMENT_INSTRUCTIONS_ID
  607. LEFT JOIN DIL_BATCH db
  608. ON osi.BATCH_ID = db.BATCH_ID
  609. LEFT JOIN RMS_MATERIAL rm
  610. ON db.MATERIAL_ID = rm.MATERIAL_ID
  611. LEFT JOIN RMS_CAPACITY rc
  612. ON rc.CAPACITY_ID = oic.CAPACITY_ID
  613. LEFT JOIN TMSSHIP_LOAD_SHIP_RESULT tlsr
  614. ON ttr.RESULT_ID = tlsr.TOTAL_RESULT_ID
  615. LEFT JOIN RMS_PORT rpo
  616. ON tlsr.ARRIVAL_PORT_ID = rpo.PORT_ID
  617. LEFT JOIN AMSSHIP_DELIVERY_NOTICE adn
  618. ON adn.BATCH_ID = db.BATCH_ID
  619. WHERE twqr.DELETED = 0)
  620. <where>
  621. <if test="materialName != null">
  622. and
  623. <foreach collection="materialName" item="item" open="(" separator="," close=")">
  624. "materialName" in #{item}
  625. </foreach>
  626. </if>
  627. <if test="foreignShipName != null">
  628. and
  629. <foreach collection="foreignShipName" item="item" open="(" separator="," close=")">
  630. "foreignShipName" in #{item}
  631. </foreach>
  632. </if>
  633. <if test="loadPort != null">
  634. and
  635. <foreach collection="loadPort" item="item" open="(" separator="," close=")">
  636. "loadPort" in #{item}
  637. </foreach>
  638. </if>
  639. <if test="planDate != null">
  640. and
  641. <foreach collection="planDate" item="item" open="(" separator="," close=")">
  642. "planDate" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  643. </foreach>
  644. </if>
  645. <if test="expectNoticeDate != null">
  646. and
  647. <foreach collection="expectNoticeDate" item="item" open="(" separator="," close=")">
  648. "expectNoticeDate" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  649. </foreach>
  650. </if>
  651. <if test="cargoDate != null">
  652. and
  653. <foreach collection="cargoDate" item="item" open="(" separator="," close=")">
  654. "cargoDate" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  655. </foreach>
  656. </if>
  657. <if test="purchaseContractMoisture != null">
  658. and
  659. <foreach collection="purchaseContractMoisture" item="item" open="(" separator="," close=")">
  660. "purchaseContractMoisture" in #{item}
  661. </foreach>
  662. </if>
  663. <if test="loadTime != null">
  664. and
  665. <foreach collection="loadTime" item="item" open="(" separator="," close=")">
  666. "loadTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  667. </foreach>
  668. </if>
  669. <if test="planWeight != null">
  670. and
  671. <foreach collection="planWeight" item="item" open="(" separator="," close=")">
  672. "planWeight" in #{item}
  673. </foreach>
  674. </if>
  675. <if test="capacityName != null">
  676. and
  677. <foreach collection="capacityName" item="item" open="(" separator="," close=")">
  678. "capacityName" in #{item}
  679. </foreach>
  680. </if>
  681. <if test="realWeight != null">
  682. and
  683. <foreach collection="realWeight" item="item" open="(" separator="," close=")">
  684. "realWeight" in #{item}
  685. </foreach>
  686. </if>
  687. <if test="waterGauge != null">
  688. and
  689. <foreach collection="waterGauge" item="item" open="(" separator="," close=")">
  690. "waterGauge" in #{item}
  691. </foreach>
  692. </if>
  693. <if test="moistureContent != null">
  694. and
  695. <foreach collection="moistureContent" item="item" open="(" separator="," close=")">
  696. "moistureContent" in #{item}
  697. </foreach>
  698. </if>
  699. <if test="waterWeight != null">
  700. and
  701. <foreach collection="waterWeight" item="item" open="(" separator="," close=")">
  702. "waterWeight" in #{item}
  703. </foreach>
  704. </if>
  705. <if test="testFee != null">
  706. and
  707. <foreach collection="testFee" item="item" open="(" separator="," close=")">
  708. "testFee" in #{item}
  709. </foreach>
  710. </if>
  711. <if test="loadRatio != null">
  712. and
  713. <foreach collection="loadRatio" item="item" open="(" separator="," close=")">
  714. "loadRatio" in #{item}
  715. </foreach>
  716. </if>
  717. </where>
  718. <include refid="orderByInsertTime"></include>
  719. </select>
  720. <select id="selectWaterQuality" parameterType="DECIMAL" resultType="java.util.Map">
  721. SELECT RESULT_PLANNED_DATE "resultPlannedDate",
  722. RESULT_CARGO_RIGHTS_DATE "resultCargoRightsDate",
  723. RESULT_EMPTY_HEAVY_WATER_METER "resultEmptyHeavyWaterMeter",
  724. RESULT_WATER_TONNAGE "resultWaterTonnage",
  725. RESULT_INSPECTION_FEES "resultInspectionFees",
  726. RESULT_ES_DELIVERY_DATE "resultEsDeliveryDate"
  727. FROM TMSSHIP_WATER_QUALITY_RESULT
  728. WHERE RESULT_ID = #{resultId}
  729. </select>
  730. <select id="selectRealWeight" parameterType="DECIMAL" resultType="DECIMAL">
  731. SELECT RESULT_ACTUAL_INSTALLATIONS
  732. FROM TMSSHIP_LOAD_SHIP_RESULT
  733. WHERE TOTAL_RESULT_ID = #{totalResultId}
  734. </select>
  735. <select id="selectInstructionsId" parameterType="DECIMAL" resultType="DECIMAL">
  736. SELECT INSTRUCTIONS_ID
  737. FROM OMSSHIP_INSTRUCTIONS_CAPACITY
  738. WHERE INSTRUCTIONS_CAPACITY_ID = #{orderId}
  739. </select>
  740. <!-- 得到放货日期 -->
  741. <select id="getDeliveryDate" parameterType="DECIMAL" resultType="java.util.Date">
  742. SELECT ACTR.RESULT_DATE_OF_LOANS AS "resultEsDeliveryDate"
  743. FROM OMSSHIP_INSTRUCTIONS_CAPACITY OIC
  744. LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS OSI
  745. ON OSI.SHIPMENT_INSTRUCTIONS_ID = OIC.INSTRUCTIONS_ID
  746. LEFT JOIN AMSSHIP_CARGO_TRANSFER_RESULT ACTR
  747. ON ACTR.BATCH_ID = OSI.BATCH_ID
  748. WHERE OIC.INSTRUCTIONS_CAPACITY_ID = #{orderId}
  749. </select>
  750. </mapper>