BmstruckStatementMapper.xml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  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.BmstruckStatementMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.BmstruckStatement">
  5. <id column="STATEMENT_ID" jdbcType="DECIMAL" property="statementId"/>
  6. <result column="STATEMENT_NUMBER" jdbcType="VARCHAR" property="statementNumber"/>
  7. <result column="COST_ID" jdbcType="DECIMAL" property="costId"/>
  8. <result column="STATEMENT_PAYMENT_UNIT" jdbcType="VARCHAR" property="statementPaymentUnit"/>
  9. <result column="STATEMENT_EXCLUD_TAX" jdbcType="DECIMAL" property="statementExcludTax"/>
  10. <result column="STATEMENT_INCLUD_TAX" jdbcType="DECIMAL" property="statementIncludTax"/>
  11. <result column="STATEMENT_REMARK" jdbcType="VARCHAR" property="statementRemark"/>
  12. <result column="STATEMENT_SETTLEMENT_STATUS" jdbcType="VARCHAR" property="statementSettlementStatus"/>
  13. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
  14. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
  15. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
  16. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
  17. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
  18. </resultMap>
  19. <sql id="columns">
  20. STATEMENT_ID, STATEMENT_NUMBER, COST_ID, STATEMENT_PAYMENT_UNIT, STATEMENT_EXCLUD_TAX,
  21. STATEMENT_INCLUD_TAX, STATEMENT_REMARK, STATEMENT_SETTLEMENT_STATUS, INSERT_USERNAME,
  22. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
  23. </sql>
  24. <sql id="columns_alias">
  25. t.STATEMENT_ID, t.STATEMENT_NUMBER, t.COST_ID, t.STATEMENT_PAYMENT_UNIT, t.STATEMENT_EXCLUD_TAX,
  26. t.STATEMENT_INCLUD_TAX, t.STATEMENT_REMARK, t.STATEMENT_SETTLEMENT_STATUS, t.INSERT_USERNAME,
  27. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
  28. </sql>
  29. <sql id="select">
  30. SELECT
  31. <include refid="columns"/>
  32. FROM BMSTRUCK_STATEMENT
  33. </sql>
  34. <sql id="select_alias">
  35. SELECT
  36. <include refid="columns_alias"/>
  37. FROM BMSTRUCK_STATEMENT t
  38. </sql>
  39. <sql id="where">
  40. <where>
  41. <if test="statementId != null">
  42. and STATEMENT_ID = #{statementId}
  43. </if>
  44. <if test="statementNumber != null and statementNumber != ''">
  45. and STATEMENT_NUMBER = #{statementNumber}
  46. </if>
  47. <if test="costId != null">
  48. and COST_ID = #{costId}
  49. </if>
  50. <if test="statementPaymentUnit != null and statementPaymentUnit != ''">
  51. and STATEMENT_PAYMENT_UNIT = #{statementPaymentUnit}
  52. </if>
  53. <if test="statementExcludTax != null">
  54. and STATEMENT_EXCLUD_TAX = #{statementExcludTax}
  55. </if>
  56. <if test="statementIncludTax != null">
  57. and STATEMENT_INCLUD_TAX = #{statementIncludTax}
  58. </if>
  59. <if test="statementRemark != null and statementRemark != ''">
  60. and STATEMENT_REMARK = #{statementRemark}
  61. </if>
  62. <if test="statementSettlementStatus != null and statementSettlementStatus != ''">
  63. and STATEMENT_SETTLEMENT_STATUS = #{statementSettlementStatus}
  64. </if>
  65. <if test="insertUsername != null and insertUsername != ''">
  66. and INSERT_USERNAME = #{insertUsername}
  67. </if>
  68. <if test="insertTime != null">
  69. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  70. </if>
  71. <if test="updateUsername != null and updateUsername != ''">
  72. and UPDATE_USERNAME = #{updateUsername}
  73. </if>
  74. <if test="updateTime != null">
  75. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  76. </if>
  77. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  78. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  79. </if>
  80. </where>
  81. </sql>
  82. <sql id="whereLike">
  83. <where>
  84. <if test="statementId != null">
  85. and STATEMENT_ID = #{statementId}
  86. </if>
  87. <if test="statementNumber != null and statementNumber != ''">
  88. and STATEMENT_NUMBER LIKE '%${statementNumber}%'
  89. </if>
  90. <if test="costId != null">
  91. and COST_ID = #{costId}
  92. </if>
  93. <if test="statementPaymentUnit != null and statementPaymentUnit != ''">
  94. and STATEMENT_PAYMENT_UNIT LIKE '%${statementPaymentUnit}%'
  95. </if>
  96. <if test="statementExcludTax != null">
  97. and STATEMENT_EXCLUD_TAX = #{statementExcludTax}
  98. </if>
  99. <if test="statementIncludTax != null">
  100. and STATEMENT_INCLUD_TAX = #{statementIncludTax}
  101. </if>
  102. <if test="statementRemark != null and statementRemark != ''">
  103. and STATEMENT_REMARK LIKE '%${statementRemark}%'
  104. </if>
  105. <if test="statementSettlementStatus != null and statementSettlementStatus != ''">
  106. and STATEMENT_SETTLEMENT_STATUS LIKE '%${statementSettlementStatus}%'
  107. </if>
  108. <if test="insertUsername != null and insertUsername != ''">
  109. and INSERT_USERNAME LIKE '%${insertUsername}%'
  110. </if>
  111. <if test="insertTime != null">
  112. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  113. </if>
  114. <if test="updateUsername != null and updateUsername != ''">
  115. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  116. </if>
  117. <if test="updateTime != null">
  118. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  119. </if>
  120. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  121. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  122. </if>
  123. </where>
  124. </sql>
  125. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  126. delete
  127. from BMSTRUCK_STATEMENT
  128. where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
  129. </delete>
  130. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  131. delete from BMSTRUCK_STATEMENT
  132. where 1!=1
  133. <if test="statementNumber != null and statementNumber != ''">
  134. or STATEMENT_NUMBER = #{statementNumber}
  135. </if>
  136. <if test="costId != null">
  137. or COST_ID = #{costId}
  138. </if>
  139. <if test="statementPaymentUnit != null and statementPaymentUnit != ''">
  140. or STATEMENT_PAYMENT_UNIT = #{statementPaymentUnit}
  141. </if>
  142. <if test="statementExcludTax != null">
  143. or STATEMENT_EXCLUD_TAX = #{statementExcludTax}
  144. </if>
  145. <if test="statementIncludTax != null">
  146. or STATEMENT_INCLUD_TAX = #{statementIncludTax}
  147. </if>
  148. <if test="statementRemark != null and statementRemark != ''">
  149. or STATEMENT_REMARK = #{statementRemark}
  150. </if>
  151. <if test="statementSettlementStatus != null and statementSettlementStatus != ''">
  152. or STATEMENT_SETTLEMENT_STATUS = #{statementSettlementStatus}
  153. </if>
  154. <if test="insertUsername != null and insertUsername != ''">
  155. or INSERT_USERNAME = #{insertUsername}
  156. </if>
  157. <if test="insertTime != null">
  158. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  159. </if>
  160. <if test="updateUsername != null and updateUsername != ''">
  161. or UPDATE_USERNAME = #{updateUsername}
  162. </if>
  163. <if test="updateTime != null">
  164. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  165. </if>
  166. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  167. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  168. </if>
  169. </delete>
  170. <insert id="insert" parameterType="com.steerinfo.dil.model.BmstruckStatement">
  171. insert into BMSTRUCK_STATEMENT (STATEMENT_ID, STATEMENT_NUMBER, COST_ID,
  172. STATEMENT_PAYMENT_UNIT, STATEMENT_EXCLUD_TAX,
  173. STATEMENT_INCLUD_TAX, STATEMENT_REMARK, STATEMENT_SETTLEMENT_STATUS,
  174. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  175. UPDATE_TIME, INSERT_UPDATE_REMARK)
  176. values (#{statementId,jdbcType=DECIMAL}, #{statementNumber,jdbcType=VARCHAR}, #{costId,jdbcType=DECIMAL},
  177. #{statementPaymentUnit,jdbcType=VARCHAR}, #{statementExcludTax,jdbcType=DECIMAL},
  178. #{statementIncludTax,jdbcType=DECIMAL}, #{statementRemark,jdbcType=VARCHAR},
  179. #{statementSettlementStatus,jdbcType=VARCHAR},
  180. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  181. #{updateUsername,jdbcType=VARCHAR},
  182. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
  183. </insert>
  184. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmstruckStatement">
  185. insert into BMSTRUCK_STATEMENT
  186. <trim prefix="(" suffix=")" suffixOverrides=",">
  187. <if test="statementId != null">
  188. STATEMENT_ID,
  189. </if>
  190. <if test="statementNumber != null">
  191. STATEMENT_NUMBER,
  192. </if>
  193. <if test="costId != null">
  194. COST_ID,
  195. </if>
  196. <if test="statementPaymentUnit != null">
  197. STATEMENT_PAYMENT_UNIT,
  198. </if>
  199. <if test="statementExcludTax != null">
  200. STATEMENT_EXCLUD_TAX,
  201. </if>
  202. <if test="statementIncludTax != null">
  203. STATEMENT_INCLUD_TAX,
  204. </if>
  205. <if test="statementRemark != null">
  206. STATEMENT_REMARK,
  207. </if>
  208. <if test="statementSettlementStatus != null">
  209. STATEMENT_SETTLEMENT_STATUS,
  210. </if>
  211. <if test="insertUsername != null">
  212. INSERT_USERNAME,
  213. </if>
  214. <if test="insertTime != null">
  215. INSERT_TIME,
  216. </if>
  217. <if test="updateUsername != null">
  218. UPDATE_USERNAME,
  219. </if>
  220. <if test="updateTime != null">
  221. UPDATE_TIME,
  222. </if>
  223. <if test="insertUpdateRemark != null">
  224. INSERT_UPDATE_REMARK,
  225. </if>
  226. </trim>
  227. <trim prefix="values (" suffix=")" suffixOverrides=",">
  228. <if test="statementId != null">
  229. #{statementId,jdbcType=DECIMAL},
  230. </if>
  231. <if test="statementNumber != null">
  232. #{statementNumber,jdbcType=VARCHAR},
  233. </if>
  234. <if test="costId != null">
  235. #{costId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="statementPaymentUnit != null">
  238. #{statementPaymentUnit,jdbcType=VARCHAR},
  239. </if>
  240. <if test="statementExcludTax != null">
  241. #{statementExcludTax,jdbcType=DECIMAL},
  242. </if>
  243. <if test="statementIncludTax != null">
  244. #{statementIncludTax,jdbcType=DECIMAL},
  245. </if>
  246. <if test="statementRemark != null">
  247. #{statementRemark,jdbcType=VARCHAR},
  248. </if>
  249. <if test="statementSettlementStatus != null">
  250. #{statementSettlementStatus,jdbcType=VARCHAR},
  251. </if>
  252. <if test="insertUsername != null">
  253. #{insertUsername,jdbcType=VARCHAR},
  254. </if>
  255. <if test="insertTime != null">
  256. #{insertTime,jdbcType=TIMESTAMP},
  257. </if>
  258. <if test="updateUsername != null">
  259. #{updateUsername,jdbcType=VARCHAR},
  260. </if>
  261. <if test="updateTime != null">
  262. #{updateTime,jdbcType=TIMESTAMP},
  263. </if>
  264. <if test="insertUpdateRemark != null">
  265. #{insertUpdateRemark,jdbcType=VARCHAR},
  266. </if>
  267. </trim>
  268. </insert>
  269. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmstruckStatement">
  270. update BMSTRUCK_STATEMENT
  271. set STATEMENT_NUMBER = #{statementNumber,jdbcType=VARCHAR},
  272. COST_ID = #{costId,jdbcType=DECIMAL},
  273. STATEMENT_PAYMENT_UNIT = #{statementPaymentUnit,jdbcType=VARCHAR},
  274. STATEMENT_EXCLUD_TAX = #{statementExcludTax,jdbcType=DECIMAL},
  275. STATEMENT_INCLUD_TAX = #{statementIncludTax,jdbcType=DECIMAL},
  276. STATEMENT_REMARK = #{statementRemark,jdbcType=VARCHAR},
  277. STATEMENT_SETTLEMENT_STATUS = #{statementSettlementStatus,jdbcType=VARCHAR},
  278. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  279. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  280. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  281. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  282. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
  283. where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
  284. </update>
  285. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmstruckStatement">
  286. update BMSTRUCK_STATEMENT
  287. <set>
  288. <if test="statementNumber != null">
  289. STATEMENT_NUMBER = #{statementNumber,jdbcType=VARCHAR},
  290. </if>
  291. <if test="costId != null">
  292. COST_ID = #{costId,jdbcType=DECIMAL},
  293. </if>
  294. <if test="statementPaymentUnit != null">
  295. STATEMENT_PAYMENT_UNIT = #{statementPaymentUnit,jdbcType=VARCHAR},
  296. </if>
  297. <if test="statementExcludTax != null">
  298. STATEMENT_EXCLUD_TAX = #{statementExcludTax,jdbcType=DECIMAL},
  299. </if>
  300. <if test="statementIncludTax != null">
  301. STATEMENT_INCLUD_TAX = #{statementIncludTax,jdbcType=DECIMAL},
  302. </if>
  303. <if test="statementRemark != null">
  304. STATEMENT_REMARK = #{statementRemark,jdbcType=VARCHAR},
  305. </if>
  306. <if test="statementSettlementStatus != null">
  307. STATEMENT_SETTLEMENT_STATUS = #{statementSettlementStatus,jdbcType=VARCHAR},
  308. </if>
  309. <if test="insertUsername != null">
  310. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  311. </if>
  312. <if test="insertTime != null">
  313. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  314. </if>
  315. <if test="updateUsername != null">
  316. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  317. </if>
  318. <if test="updateTime != null">
  319. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  320. </if>
  321. <if test="insertUpdateRemark != null">
  322. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  323. </if>
  324. </set>
  325. where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
  326. </update>
  327. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  328. <include refid="select"/>
  329. where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
  330. </select>
  331. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  332. <include refid="select"/>
  333. <include refid="where"/>
  334. </select>
  335. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  336. <include refid="select"/>
  337. <include refid="whereLike"/>
  338. </select>
  339. <insert id="batchInsert" parameterType="java.util.List">
  340. insert into BMSTRUCK_STATEMENT
  341. (STATEMENT_ID,
  342. STATEMENT_NUMBER, COST_ID, STATEMENT_PAYMENT_UNIT,
  343. STATEMENT_EXCLUD_TAX, STATEMENT_INCLUD_TAX,
  344. STATEMENT_REMARK, STATEMENT_SETTLEMENT_STATUS,
  345. INSERT_USERNAME, INSERT_TIME,
  346. UPDATE_USERNAME, UPDATE_TIME,
  347. INSERT_UPDATE_REMARK)
  348. ( <foreach collection="list" item="item" separator="union all">
  349. select
  350. #{item.statementId,jdbcType=DECIMAL},
  351. #{item.statementNumber,jdbcType=VARCHAR}, #{item.costId,jdbcType=DECIMAL},
  352. #{item.statementPaymentUnit,jdbcType=VARCHAR},
  353. #{item.statementExcludTax,jdbcType=DECIMAL}, #{item.statementIncludTax,jdbcType=DECIMAL},
  354. #{item.statementRemark,jdbcType=VARCHAR}, #{item.statementSettlementStatus,jdbcType=VARCHAR},
  355. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  356. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  357. #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
  358. </foreach> )
  359. </insert>
  360. <update id="batchUpdate" parameterType="java.util.List">
  361. update BMSTRUCK_STATEMENT
  362. set
  363. STATEMENT_ID=
  364. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  365. when #{item.statementId,jdbcType=DECIMAL} then #{item.statementId,jdbcType=DECIMAL}
  366. </foreach>
  367. ,STATEMENT_NUMBER=
  368. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  369. when #{item.statementId,jdbcType=DECIMAL} then #{item.statementNumber,jdbcType=VARCHAR}
  370. </foreach>
  371. ,COST_ID=
  372. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  373. when #{item.statementId,jdbcType=DECIMAL} then #{item.costId,jdbcType=DECIMAL}
  374. </foreach>
  375. ,STATEMENT_PAYMENT_UNIT=
  376. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  377. when #{item.statementId,jdbcType=DECIMAL} then #{item.statementPaymentUnit,jdbcType=VARCHAR}
  378. </foreach>
  379. ,STATEMENT_EXCLUD_TAX=
  380. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  381. when #{item.statementId,jdbcType=DECIMAL} then #{item.statementExcludTax,jdbcType=DECIMAL}
  382. </foreach>
  383. ,STATEMENT_INCLUD_TAX=
  384. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  385. when #{item.statementId,jdbcType=DECIMAL} then #{item.statementIncludTax,jdbcType=DECIMAL}
  386. </foreach>
  387. ,STATEMENT_REMARK=
  388. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  389. when #{item.statementId,jdbcType=DECIMAL} then #{item.statementRemark,jdbcType=VARCHAR}
  390. </foreach>
  391. ,STATEMENT_SETTLEMENT_STATUS=
  392. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  393. when #{item.statementId,jdbcType=DECIMAL} then #{item.statementSettlementStatus,jdbcType=VARCHAR}
  394. </foreach>
  395. ,INSERT_USERNAME=
  396. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  397. when #{item.statementId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  398. </foreach>
  399. ,INSERT_TIME=
  400. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  401. when #{item.statementId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  402. </foreach>
  403. ,UPDATE_USERNAME=
  404. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  405. when #{item.statementId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  406. </foreach>
  407. ,UPDATE_TIME=
  408. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  409. when #{item.statementId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  410. </foreach>
  411. ,INSERT_UPDATE_REMARK=
  412. <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
  413. when #{item.statementId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  414. </foreach>
  415. where STATEMENT_ID in
  416. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  417. #{item.statementId,jdbcType=DECIMAL}
  418. </foreach>
  419. </update>
  420. <delete id="batchDelete" parameterType="java.util.List">
  421. delete from BMSTRUCK_STATEMENT
  422. where STATEMENT_ID in
  423. <foreach collection="list" item="id" open="(" close=")" separator=",">
  424. #{id}
  425. </foreach>
  426. </delete>
  427. <!-- 友情提示!!!-->
  428. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  429. <!-- 展示汽运账单列表 -->
  430. <select id="getTruckStatementList" parameterType="java.util.Map" resultType="java.util.Map">
  431. SELECT *
  432. FROM (
  433. SELECT BS.STATEMENT_NUMBER AS "statementNumber",
  434. BS.INSERT_TIME AS "insertTime",
  435. BS.STATEMENT_PAYMENT_UNIT AS "statementPaymentUnit",
  436. BS.STATEMENT_EXCLUD_TAX AS "statementExcludTax",
  437. BC.CHECK_CARRIER_STATUS AS "checkCarrierStatus",
  438. BC.CHECK_RECEIVE_CUSTOMER_STATUS AS "checkReceiveCustomerStatus",
  439. BC.CHECK_SHIPPER_STATUS AS "checkShipperStatus",
  440. BS.STATEMENT_ID AS "statementId",
  441. BC.CARRIER_ID AS "carrierId",
  442. BC.SHIPPER_ID AS "shipperId"
  443. FROM BMSTRUCK_STATEMENT BS
  444. LEFT JOIN BMSTRUCK_CHECK BC
  445. ON BC.STATEMENT_ID = BS.STATEMENT_ID
  446. )
  447. <where>
  448. <if test="statementNumber!= null">
  449. and
  450. <foreach collection="statementNumber" item="item" open="(" separator="," close=")">
  451. "statementNumber" in #{item}
  452. </foreach>
  453. </if>
  454. <if test="insertTime!= null">
  455. and
  456. <foreach collection="insertTime" item="item" open="(" separator="," close=")">
  457. "insertTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  458. </foreach>
  459. </if>
  460. <if test="statementPaymentUnit!= null">
  461. and
  462. <foreach collection="statementPaymentUnit" item="item" open="(" separator="," close=")">
  463. "statementPaymentUnit" in #{item}
  464. </foreach>
  465. </if>
  466. <if test="statementExcludTax!= null">
  467. and
  468. <foreach collection="statementExcludTax" item="item" open="(" separator="," close=")">
  469. "statementExcludTax" in #{item}
  470. </foreach>
  471. </if>
  472. </where>
  473. <include refid="orderBy"></include>
  474. </select>
  475. <sql id="orderBy">
  476. <if test="orderField != null and orderField != ''">
  477. order by "${orderField}"
  478. <if test="orderType != null and orderType != ''">
  479. ${orderType}
  480. </if>
  481. </if>
  482. <if test="orderField == null ">
  483. order by "insertTime" desc
  484. </if>
  485. </sql>
  486. <!-- 销售汽运账单下的详单 -->
  487. <select id="getSaleTruckStatementDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
  488. SELECT * FROM(
  489. SELECT DISTINCT
  490. bdo.INSERT_TIME as "insertTime",
  491. bdo.DETAILS_ID as "detailsId",
  492. oo.ORDER_ID as "orderId",
  493. bdo.DETAILS_NO as "detailsNo",
  494. oo.ORDER_NUMBER as "orderNumber",
  495. bdo.DETAILS_TIME as "detailsTime",
  496. rc.CAPACITY_NUMBER as "capacityNumber",
  497. rct.CAPACITY_TYPE_NAME as "capacityTypeName",
  498. rs.SHIPPER_NAME as "shipperName",
  499. rco.CONSIGNEE_RECEIVE_ADDRESS as "consigneeReceiveAddress",
  500. actp.PRICE_VALUE as "priceValue",
  501. bdo.DETAILS_AMOUNT as "detailsAmount"
  502. FROM BMSTRUCK_DETAILS_ORDER bdo
  503. LEFT JOIN OMSTRUCK_ORDER oo
  504. ON oo.ORDER_ID = bdo.ORDER_ID
  505. LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
  506. ON oo.ORDER_PLAN_ID = asom.SALE_ORDER_MATERIAL_ID
  507. LEFT JOIN AMS_SALE_ORDER aso
  508. ON aso.SALE_ORDER_ID = asom.SALE_ORDER_ID
  509. LEFT JOIN RMS_SHIPPER rs
  510. ON rs.SHIPPER_ID = aso.SHIPPER_ID
  511. LEFT JOIN RMS_CONSIGNEE rco
  512. ON rco.CONSIGNEE_ID = aso.RECEIVE_ID
  513. LEFT JOIN RMS_CAPACITY rc
  514. ON oo.CAPACITY_ID = rc.CAPACITY_ID
  515. LEFT JOIN RMS_CAPACITY_TYPE rct
  516. ON rct.CAPACITY_TYPE_ID = rc.CAPACITY_TYPE_ID
  517. LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
  518. ON actp.PRICE_ID = bdo.PRICE_ID
  519. LEFT JOIN BMSTRUCK_DETAILS_STATEMENT bds
  520. ON bdo.DETAILS_ID = bds.DETAILS_ID
  521. WHERE bds.STATEMENT_ID = #{statementId}
  522. AND bdo.WETHER_TO_STATEMENT = 0
  523. )
  524. <where>
  525. <if test="detailsNo!= null">
  526. and
  527. <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
  528. "detailsNo" in #{item}
  529. </foreach>
  530. </if>
  531. <if test="orderNumber!= null">
  532. and
  533. <foreach collection="orderNumber" item="item" open="(" separator="," close=")">
  534. "orderNumber" in #{item}
  535. </foreach>
  536. </if>
  537. <if test="detailsTime!= null">
  538. and
  539. <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
  540. "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  541. </foreach>
  542. </if>
  543. <if test="capacityNumber!= null">
  544. and
  545. <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
  546. "capacityNumber" in #{item}
  547. </foreach>
  548. </if>
  549. <if test="capacityTypeName!= null">
  550. and
  551. <foreach collection="capacityTypeName" item="item" open="(" separator="," close=")">
  552. "capacityTypeName" in #{item}
  553. </foreach>
  554. </if>
  555. <if test="shipperName!= null">
  556. and
  557. <foreach collection="shipperName" item="item" open="(" separator="," close=")">
  558. "shipperName" in #{item}
  559. </foreach>
  560. </if>
  561. <if test="consigneeReceiveAddress!= null">
  562. and
  563. <foreach collection="consigneeReceiveAddress" item="item" open="(" separator="," close=")">
  564. "consigneeReceiveAddress" in #{item}
  565. </foreach>
  566. </if>
  567. <if test="priceValue!= null">
  568. and
  569. <foreach collection="priceValue" item="item" open="(" separator="," close=")">
  570. "priceValue" in #{item}
  571. </foreach>
  572. </if>
  573. <if test="detailsAmount!= null">
  574. and
  575. <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
  576. "detailsAmount" in #{item}
  577. </foreach>
  578. </if>
  579. </where>
  580. <include refid="orderBy"></include>
  581. </select>
  582. </mapper>