BmstrainSettlementMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  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.BmstrainSettlementMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.BmstrainSettlement">
  5. <id column="SETTLEMENT_ID" jdbcType="DECIMAL" property="settlementId" />
  6. <result column="SETTLEMENT_DATE" jdbcType="TIMESTAMP" property="settlementDate" />
  7. <result column="SETTLEMENT_DAY_WAGONS" jdbcType="DECIMAL" property="settlementDayWagons" />
  8. <result column="SETTLEMENT_DAY_TONNAGE" jdbcType="DECIMAL" property="settlementDayTonnage" />
  9. <result column="SETTLEMENT_DAY_TRANSPORT_COST" jdbcType="DECIMAL" property="settlementDayTransportCost" />
  10. <result column="SETTLEMENT_DAY_FLOAT_COST" jdbcType="DECIMAL" property="settlementDayFloatCost" />
  11. <result column="SETTLEMENT_DAY_MARGIN" jdbcType="DECIMAL" property="settlementDayMargin" />
  12. <result column="SETTLEMENT_MONTH_WAGONS" jdbcType="DECIMAL" property="settlementMonthWagons" />
  13. <result column="SETTLEMENT_MONTH_TONNAGE" jdbcType="DECIMAL" property="settlementMonthTonnage" />
  14. <result column="SETTLEMENT_MONTH_TOTAL_MONTH" jdbcType="DECIMAL" property="settlementMonthTotalMonth" />
  15. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  16. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  17. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  18. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  19. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  20. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  21. </resultMap>
  22. <sql id="columns">
  23. SETTLEMENT_ID, SETTLEMENT_DATE, SETTLEMENT_DAY_WAGONS, SETTLEMENT_DAY_TONNAGE, SETTLEMENT_DAY_TRANSPORT_COST,
  24. SETTLEMENT_DAY_FLOAT_COST, SETTLEMENT_DAY_MARGIN, SETTLEMENT_MONTH_WAGONS, SETTLEMENT_MONTH_TONNAGE,
  25. SETTLEMENT_MONTH_TOTAL_MONTH, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  26. INSERT_UPDATE_REMARK, DELETED
  27. </sql>
  28. <sql id="columns_alias">
  29. t.SETTLEMENT_ID, t.SETTLEMENT_DATE, t.SETTLEMENT_DAY_WAGONS, t.SETTLEMENT_DAY_TONNAGE,
  30. t.SETTLEMENT_DAY_TRANSPORT_COST, t.SETTLEMENT_DAY_FLOAT_COST, t.SETTLEMENT_DAY_MARGIN,
  31. t.SETTLEMENT_MONTH_WAGONS, t.SETTLEMENT_MONTH_TONNAGE, t.SETTLEMENT_MONTH_TOTAL_MONTH,
  32. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  33. t.DELETED
  34. </sql>
  35. <sql id="select">
  36. SELECT <include refid="columns" /> FROM BMSTRAIN_SETTLEMENT
  37. </sql>
  38. <sql id="select_alias">
  39. SELECT <include refid="columns_alias" /> FROM BMSTRAIN_SETTLEMENT t
  40. </sql>
  41. <sql id="where">
  42. <where>
  43. <if test="settlementId != null">
  44. and SETTLEMENT_ID = #{settlementId}
  45. </if>
  46. <if test="settlementDate != null">
  47. and TO_CHAR(SETTLEMENT_DATE,'yyyy-MM-dd') = #{settlementDate}
  48. </if>
  49. <if test="settlementDayWagons != null">
  50. and SETTLEMENT_DAY_WAGONS = #{settlementDayWagons}
  51. </if>
  52. <if test="settlementDayTonnage != null">
  53. and SETTLEMENT_DAY_TONNAGE = #{settlementDayTonnage}
  54. </if>
  55. <if test="settlementDayTransportCost != null">
  56. and SETTLEMENT_DAY_TRANSPORT_COST = #{settlementDayTransportCost}
  57. </if>
  58. <if test="settlementDayFloatCost != null">
  59. and SETTLEMENT_DAY_FLOAT_COST = #{settlementDayFloatCost}
  60. </if>
  61. <if test="settlementDayMargin != null">
  62. and SETTLEMENT_DAY_MARGIN = #{settlementDayMargin}
  63. </if>
  64. <if test="settlementMonthWagons != null">
  65. and SETTLEMENT_MONTH_WAGONS = #{settlementMonthWagons}
  66. </if>
  67. <if test="settlementMonthTonnage != null">
  68. and SETTLEMENT_MONTH_TONNAGE = #{settlementMonthTonnage}
  69. </if>
  70. <if test="settlementMonthTotalMonth != null">
  71. and SETTLEMENT_MONTH_TOTAL_MONTH = #{settlementMonthTotalMonth}
  72. </if>
  73. <if test="insertUsername != null and insertUsername != ''">
  74. and INSERT_USERNAME = #{insertUsername}
  75. </if>
  76. <if test="insertTime != null">
  77. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  78. </if>
  79. <if test="updateUsername != null and updateUsername != ''">
  80. and UPDATE_USERNAME = #{updateUsername}
  81. </if>
  82. <if test="updateTime != null">
  83. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  84. </if>
  85. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  86. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  87. </if>
  88. <if test="deleted != null">
  89. and DELETED = #{deleted}
  90. </if>
  91. </where>
  92. </sql>
  93. <sql id="whereLike">
  94. <where>
  95. <if test="settlementId != null">
  96. and SETTLEMENT_ID = #{settlementId}
  97. </if>
  98. <if test="settlementDate != null">
  99. and TO_CHAR(SETTLEMENT_DATE,'yyyy-MM-dd') = #{settlementDate}
  100. </if>
  101. <if test="settlementDayWagons != null">
  102. and SETTLEMENT_DAY_WAGONS = #{settlementDayWagons}
  103. </if>
  104. <if test="settlementDayTonnage != null">
  105. and SETTLEMENT_DAY_TONNAGE = #{settlementDayTonnage}
  106. </if>
  107. <if test="settlementDayTransportCost != null">
  108. and SETTLEMENT_DAY_TRANSPORT_COST = #{settlementDayTransportCost}
  109. </if>
  110. <if test="settlementDayFloatCost != null">
  111. and SETTLEMENT_DAY_FLOAT_COST = #{settlementDayFloatCost}
  112. </if>
  113. <if test="settlementDayMargin != null">
  114. and SETTLEMENT_DAY_MARGIN = #{settlementDayMargin}
  115. </if>
  116. <if test="settlementMonthWagons != null">
  117. and SETTLEMENT_MONTH_WAGONS = #{settlementMonthWagons}
  118. </if>
  119. <if test="settlementMonthTonnage != null">
  120. and SETTLEMENT_MONTH_TONNAGE = #{settlementMonthTonnage}
  121. </if>
  122. <if test="settlementMonthTotalMonth != null">
  123. and SETTLEMENT_MONTH_TOTAL_MONTH = #{settlementMonthTotalMonth}
  124. </if>
  125. <if test="insertUsername != null and insertUsername != ''">
  126. and INSERT_USERNAME LIKE '%${insertUsername}%'
  127. </if>
  128. <if test="insertTime != null">
  129. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  130. </if>
  131. <if test="updateUsername != null and updateUsername != ''">
  132. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  133. </if>
  134. <if test="updateTime != null">
  135. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  136. </if>
  137. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  138. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  139. </if>
  140. <if test="deleted != null">
  141. and DELETED = #{deleted}
  142. </if>
  143. </where>
  144. </sql>
  145. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  146. delete from BMSTRAIN_SETTLEMENT
  147. where SETTLEMENT_ID = #{settlementId,jdbcType=DECIMAL}
  148. </delete>
  149. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  150. delete from BMSTRAIN_SETTLEMENT
  151. where 1!=1
  152. <if test="settlementDate != null">
  153. or TO_CHAR(SETTLEMENT_DATE,'yyyy-MM-dd') = '#{settlementDate}'
  154. </if>
  155. <if test="settlementDayWagons != null">
  156. or SETTLEMENT_DAY_WAGONS = #{settlementDayWagons}
  157. </if>
  158. <if test="settlementDayTonnage != null">
  159. or SETTLEMENT_DAY_TONNAGE = #{settlementDayTonnage}
  160. </if>
  161. <if test="settlementDayTransportCost != null">
  162. or SETTLEMENT_DAY_TRANSPORT_COST = #{settlementDayTransportCost}
  163. </if>
  164. <if test="settlementDayFloatCost != null">
  165. or SETTLEMENT_DAY_FLOAT_COST = #{settlementDayFloatCost}
  166. </if>
  167. <if test="settlementDayMargin != null">
  168. or SETTLEMENT_DAY_MARGIN = #{settlementDayMargin}
  169. </if>
  170. <if test="settlementMonthWagons != null">
  171. or SETTLEMENT_MONTH_WAGONS = #{settlementMonthWagons}
  172. </if>
  173. <if test="settlementMonthTonnage != null">
  174. or SETTLEMENT_MONTH_TONNAGE = #{settlementMonthTonnage}
  175. </if>
  176. <if test="settlementMonthTotalMonth != null">
  177. or SETTLEMENT_MONTH_TOTAL_MONTH = #{settlementMonthTotalMonth}
  178. </if>
  179. <if test="insertUsername != null and insertUsername != ''">
  180. or INSERT_USERNAME = #{insertUsername}
  181. </if>
  182. <if test="insertTime != null">
  183. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  184. </if>
  185. <if test="updateUsername != null and updateUsername != ''">
  186. or UPDATE_USERNAME = #{updateUsername}
  187. </if>
  188. <if test="updateTime != null">
  189. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  190. </if>
  191. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  192. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  193. </if>
  194. <if test="deleted != null">
  195. or DELETED = #{deleted}
  196. </if>
  197. </delete>
  198. <insert id="insert" parameterType="com.steerinfo.dil.model.BmstrainSettlement">
  199. insert into BMSTRAIN_SETTLEMENT (SETTLEMENT_ID, SETTLEMENT_DATE, SETTLEMENT_DAY_WAGONS,
  200. SETTLEMENT_DAY_TONNAGE, SETTLEMENT_DAY_TRANSPORT_COST,
  201. SETTLEMENT_DAY_FLOAT_COST, SETTLEMENT_DAY_MARGIN,
  202. SETTLEMENT_MONTH_WAGONS, SETTLEMENT_MONTH_TONNAGE,
  203. SETTLEMENT_MONTH_TOTAL_MONTH, INSERT_USERNAME,
  204. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  205. INSERT_UPDATE_REMARK, DELETED)
  206. values (#{settlementId,jdbcType=DECIMAL}, #{settlementDate,jdbcType=TIMESTAMP}, #{settlementDayWagons,jdbcType=DECIMAL},
  207. #{settlementDayTonnage,jdbcType=DECIMAL}, #{settlementDayTransportCost,jdbcType=DECIMAL},
  208. #{settlementDayFloatCost,jdbcType=DECIMAL}, #{settlementDayMargin,jdbcType=DECIMAL},
  209. #{settlementMonthWagons,jdbcType=DECIMAL}, #{settlementMonthTonnage,jdbcType=DECIMAL},
  210. #{settlementMonthTotalMonth,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR},
  211. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  212. #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL})
  213. </insert>
  214. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmstrainSettlement">
  215. insert into BMSTRAIN_SETTLEMENT
  216. <trim prefix="(" suffix=")" suffixOverrides=",">
  217. <if test="settlementId != null">
  218. SETTLEMENT_ID,
  219. </if>
  220. <if test="settlementDate != null">
  221. SETTLEMENT_DATE,
  222. </if>
  223. <if test="settlementDayWagons != null">
  224. SETTLEMENT_DAY_WAGONS,
  225. </if>
  226. <if test="settlementDayTonnage != null">
  227. SETTLEMENT_DAY_TONNAGE,
  228. </if>
  229. <if test="settlementDayTransportCost != null">
  230. SETTLEMENT_DAY_TRANSPORT_COST,
  231. </if>
  232. <if test="settlementDayFloatCost != null">
  233. SETTLEMENT_DAY_FLOAT_COST,
  234. </if>
  235. <if test="settlementDayMargin != null">
  236. SETTLEMENT_DAY_MARGIN,
  237. </if>
  238. <if test="settlementMonthWagons != null">
  239. SETTLEMENT_MONTH_WAGONS,
  240. </if>
  241. <if test="settlementMonthTonnage != null">
  242. SETTLEMENT_MONTH_TONNAGE,
  243. </if>
  244. <if test="settlementMonthTotalMonth != null">
  245. SETTLEMENT_MONTH_TOTAL_MONTH,
  246. </if>
  247. <if test="insertUsername != null">
  248. INSERT_USERNAME,
  249. </if>
  250. <if test="insertTime != null">
  251. INSERT_TIME,
  252. </if>
  253. <if test="updateUsername != null">
  254. UPDATE_USERNAME,
  255. </if>
  256. <if test="updateTime != null">
  257. UPDATE_TIME,
  258. </if>
  259. <if test="insertUpdateRemark != null">
  260. INSERT_UPDATE_REMARK,
  261. </if>
  262. <if test="deleted != null">
  263. DELETED,
  264. </if>
  265. </trim>
  266. <trim prefix="values (" suffix=")" suffixOverrides=",">
  267. <if test="settlementId != null">
  268. #{settlementId,jdbcType=DECIMAL},
  269. </if>
  270. <if test="settlementDate != null">
  271. #{settlementDate,jdbcType=TIMESTAMP},
  272. </if>
  273. <if test="settlementDayWagons != null">
  274. #{settlementDayWagons,jdbcType=DECIMAL},
  275. </if>
  276. <if test="settlementDayTonnage != null">
  277. #{settlementDayTonnage,jdbcType=DECIMAL},
  278. </if>
  279. <if test="settlementDayTransportCost != null">
  280. #{settlementDayTransportCost,jdbcType=DECIMAL},
  281. </if>
  282. <if test="settlementDayFloatCost != null">
  283. #{settlementDayFloatCost,jdbcType=DECIMAL},
  284. </if>
  285. <if test="settlementDayMargin != null">
  286. #{settlementDayMargin,jdbcType=DECIMAL},
  287. </if>
  288. <if test="settlementMonthWagons != null">
  289. #{settlementMonthWagons,jdbcType=DECIMAL},
  290. </if>
  291. <if test="settlementMonthTonnage != null">
  292. #{settlementMonthTonnage,jdbcType=DECIMAL},
  293. </if>
  294. <if test="settlementMonthTotalMonth != null">
  295. #{settlementMonthTotalMonth,jdbcType=DECIMAL},
  296. </if>
  297. <if test="insertUsername != null">
  298. #{insertUsername,jdbcType=VARCHAR},
  299. </if>
  300. <if test="insertTime != null">
  301. #{insertTime,jdbcType=TIMESTAMP},
  302. </if>
  303. <if test="updateUsername != null">
  304. #{updateUsername,jdbcType=VARCHAR},
  305. </if>
  306. <if test="updateTime != null">
  307. #{updateTime,jdbcType=TIMESTAMP},
  308. </if>
  309. <if test="insertUpdateRemark != null">
  310. #{insertUpdateRemark,jdbcType=VARCHAR},
  311. </if>
  312. <if test="deleted != null">
  313. #{deleted,jdbcType=DECIMAL},
  314. </if>
  315. </trim>
  316. </insert>
  317. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmstrainSettlement">
  318. update BMSTRAIN_SETTLEMENT
  319. set SETTLEMENT_DATE = #{settlementDate,jdbcType=TIMESTAMP},
  320. SETTLEMENT_DAY_WAGONS = #{settlementDayWagons,jdbcType=DECIMAL},
  321. SETTLEMENT_DAY_TONNAGE = #{settlementDayTonnage,jdbcType=DECIMAL},
  322. SETTLEMENT_DAY_TRANSPORT_COST = #{settlementDayTransportCost,jdbcType=DECIMAL},
  323. SETTLEMENT_DAY_FLOAT_COST = #{settlementDayFloatCost,jdbcType=DECIMAL},
  324. SETTLEMENT_DAY_MARGIN = #{settlementDayMargin,jdbcType=DECIMAL},
  325. SETTLEMENT_MONTH_WAGONS = #{settlementMonthWagons,jdbcType=DECIMAL},
  326. SETTLEMENT_MONTH_TONNAGE = #{settlementMonthTonnage,jdbcType=DECIMAL},
  327. SETTLEMENT_MONTH_TOTAL_MONTH = #{settlementMonthTotalMonth,jdbcType=DECIMAL},
  328. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  329. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  330. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  331. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  332. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  333. DELETED = #{deleted,jdbcType=DECIMAL}
  334. where SETTLEMENT_ID = #{settlementId,jdbcType=DECIMAL}
  335. </update>
  336. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmstrainSettlement">
  337. update BMSTRAIN_SETTLEMENT
  338. <set>
  339. <if test="settlementDate != null">
  340. SETTLEMENT_DATE = #{settlementDate,jdbcType=TIMESTAMP},
  341. </if>
  342. <if test="settlementDayWagons != null">
  343. SETTLEMENT_DAY_WAGONS = #{settlementDayWagons,jdbcType=DECIMAL},
  344. </if>
  345. <if test="settlementDayTonnage != null">
  346. SETTLEMENT_DAY_TONNAGE = #{settlementDayTonnage,jdbcType=DECIMAL},
  347. </if>
  348. <if test="settlementDayTransportCost != null">
  349. SETTLEMENT_DAY_TRANSPORT_COST = #{settlementDayTransportCost,jdbcType=DECIMAL},
  350. </if>
  351. <if test="settlementDayFloatCost != null">
  352. SETTLEMENT_DAY_FLOAT_COST = #{settlementDayFloatCost,jdbcType=DECIMAL},
  353. </if>
  354. <if test="settlementDayMargin != null">
  355. SETTLEMENT_DAY_MARGIN = #{settlementDayMargin,jdbcType=DECIMAL},
  356. </if>
  357. <if test="settlementMonthWagons != null">
  358. SETTLEMENT_MONTH_WAGONS = #{settlementMonthWagons,jdbcType=DECIMAL},
  359. </if>
  360. <if test="settlementMonthTonnage != null">
  361. SETTLEMENT_MONTH_TONNAGE = #{settlementMonthTonnage,jdbcType=DECIMAL},
  362. </if>
  363. <if test="settlementMonthTotalMonth != null">
  364. SETTLEMENT_MONTH_TOTAL_MONTH = #{settlementMonthTotalMonth,jdbcType=DECIMAL},
  365. </if>
  366. <if test="insertUsername != null">
  367. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  368. </if>
  369. <if test="insertTime != null">
  370. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  371. </if>
  372. <if test="updateUsername != null">
  373. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  374. </if>
  375. <if test="updateTime != null">
  376. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  377. </if>
  378. <if test="insertUpdateRemark != null">
  379. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  380. </if>
  381. <if test="deleted != null">
  382. DELETED = #{deleted,jdbcType=DECIMAL},
  383. </if>
  384. </set>
  385. where SETTLEMENT_ID = #{settlementId,jdbcType=DECIMAL}
  386. </update>
  387. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  388. <include refid="select" />
  389. where SETTLEMENT_ID = #{settlementId,jdbcType=DECIMAL}
  390. </select>
  391. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  392. <include refid="select" />
  393. <include refid="where" />
  394. </select>
  395. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  396. <include refid="select" />
  397. <include refid="whereLike" />
  398. </select>
  399. <insert id="batchInsert" parameterType="java.util.List">
  400. insert into BMSTRAIN_SETTLEMENT
  401. (SETTLEMENT_ID,
  402. SETTLEMENT_DATE, SETTLEMENT_DAY_WAGONS,
  403. SETTLEMENT_DAY_TONNAGE, SETTLEMENT_DAY_TRANSPORT_COST,
  404. SETTLEMENT_DAY_FLOAT_COST, SETTLEMENT_DAY_MARGIN,
  405. SETTLEMENT_MONTH_WAGONS, SETTLEMENT_MONTH_TONNAGE,
  406. SETTLEMENT_MONTH_TOTAL_MONTH, INSERT_USERNAME,
  407. INSERT_TIME, UPDATE_USERNAME,
  408. UPDATE_TIME, INSERT_UPDATE_REMARK,
  409. DELETED)
  410. ( <foreach collection="list" item="item" separator="union all">
  411. select
  412. #{item.settlementId,jdbcType=DECIMAL},
  413. #{item.settlementDate,jdbcType=TIMESTAMP}, #{item.settlementDayWagons,jdbcType=DECIMAL},
  414. #{item.settlementDayTonnage,jdbcType=DECIMAL}, #{item.settlementDayTransportCost,jdbcType=DECIMAL},
  415. #{item.settlementDayFloatCost,jdbcType=DECIMAL}, #{item.settlementDayMargin,jdbcType=DECIMAL},
  416. #{item.settlementMonthWagons,jdbcType=DECIMAL}, #{item.settlementMonthTonnage,jdbcType=DECIMAL},
  417. #{item.settlementMonthTotalMonth,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
  418. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  419. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  420. #{item.deleted,jdbcType=DECIMAL} from dual
  421. </foreach> )
  422. </insert>
  423. <update id="batchUpdate" parameterType="java.util.List">
  424. update BMSTRAIN_SETTLEMENT
  425. set
  426. SETTLEMENT_ID=
  427. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  428. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementId,jdbcType=DECIMAL}
  429. </foreach>
  430. ,SETTLEMENT_DATE=
  431. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  432. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementDate,jdbcType=TIMESTAMP}
  433. </foreach>
  434. ,SETTLEMENT_DAY_WAGONS=
  435. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  436. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementDayWagons,jdbcType=DECIMAL}
  437. </foreach>
  438. ,SETTLEMENT_DAY_TONNAGE=
  439. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  440. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementDayTonnage,jdbcType=DECIMAL}
  441. </foreach>
  442. ,SETTLEMENT_DAY_TRANSPORT_COST=
  443. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  444. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementDayTransportCost,jdbcType=DECIMAL}
  445. </foreach>
  446. ,SETTLEMENT_DAY_FLOAT_COST=
  447. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  448. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementDayFloatCost,jdbcType=DECIMAL}
  449. </foreach>
  450. ,SETTLEMENT_DAY_MARGIN=
  451. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  452. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementDayMargin,jdbcType=DECIMAL}
  453. </foreach>
  454. ,SETTLEMENT_MONTH_WAGONS=
  455. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  456. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementMonthWagons,jdbcType=DECIMAL}
  457. </foreach>
  458. ,SETTLEMENT_MONTH_TONNAGE=
  459. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  460. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementMonthTonnage,jdbcType=DECIMAL}
  461. </foreach>
  462. ,SETTLEMENT_MONTH_TOTAL_MONTH=
  463. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  464. when #{item.settlementId,jdbcType=DECIMAL} then #{item.settlementMonthTotalMonth,jdbcType=DECIMAL}
  465. </foreach>
  466. ,INSERT_USERNAME=
  467. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  468. when #{item.settlementId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  469. </foreach>
  470. ,INSERT_TIME=
  471. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  472. when #{item.settlementId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  473. </foreach>
  474. ,UPDATE_USERNAME=
  475. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  476. when #{item.settlementId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  477. </foreach>
  478. ,UPDATE_TIME=
  479. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  480. when #{item.settlementId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  481. </foreach>
  482. ,INSERT_UPDATE_REMARK=
  483. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  484. when #{item.settlementId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  485. </foreach>
  486. ,DELETED=
  487. <foreach close="end" collection="list" index="index" item="item" open="case SETTLEMENT_ID" separator=" ">
  488. when #{item.settlementId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  489. </foreach>
  490. where SETTLEMENT_ID in
  491. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  492. #{item.settlementId,jdbcType=DECIMAL}
  493. </foreach>
  494. </update>
  495. <delete id="batchDelete" parameterType="java.util.List">
  496. delete from BMSTRAIN_SETTLEMENT
  497. where SETTLEMENT_ID in
  498. <foreach close=")" collection="list" item="id" open="(" separator=",">
  499. #{id}
  500. </foreach>
  501. </delete>
  502. <!-- 友情提示!!!-->
  503. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  504. <select id="getTrainSettlement" parameterType="DECIMAL" resultType="java.util.Map">
  505. -- SELECT
  506. --
  507. -- FROM BMSTRAIN_SETTLEMENT BS
  508. </select>
  509. </mapper>