BmstruckDetailsOrderMapper.xml 24 KB

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