PayOrderMapper.xml 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.yijia.station.mapper.PayOrderMapper">
  6. <resultMap type="PayOrder" id="PayOrderResult">
  7. <result property="orderId" column="order_id" />
  8. <result property="orderNo" column="order_no" />
  9. <result property="stationId" column="station_id" />
  10. <result property="stationName" column="station_name" />
  11. <result property="status" column="status" />
  12. <result property="consumerId" column="consumer_id" />
  13. <result property="consumer" column="consumer" />
  14. <result property="oilGun" column="oil_gun" />
  15. <result property="oilName" column="oil_name" />
  16. <result property="oilPirce" column="oil_pirce" />
  17. <result property="oilType" column="oil_type" />
  18. <result property="orderLiters" column="order_liters" />
  19. <result property="amt" column="amt" />
  20. <result property="receivableAmt" column="receivable_amt" />
  21. <result property="receivedAmt" column="received_amt" />
  22. <result property="discountAmt" column="discount_amt" />
  23. <result property="discountCouponAmt" column="discount_coupon_amt" />
  24. <result property="discountCoupon" column="discount_coupon" />
  25. <result property="wxAmt" column="wx_amt" />
  26. <result property="zfbAmt" column="zfb_amt" />
  27. <result property="posAmt" column="pos_amt" />
  28. <result property="xjAmt" column="xj_amt" />
  29. <result property="didiAppAmt" column="didi_app_amt" />
  30. <result property="tyAppAmt" column="ty_app_amt" />
  31. <result property="otherAmt" column="other_amt" />
  32. <result property="dzkAmt" column="dzk_amt" />
  33. <result property="score" column="score" />
  34. <result property="memberNo" column="member_no" />
  35. <result property="memberAmt" column="member_amt" />
  36. <result property="printCount" column="print_count" />
  37. <result property="payType" column="pay_type" />
  38. <result property="payWay" column="pay_way" />
  39. <result property="oilPersonnel" column="oil_personnel" />
  40. <result property="oilPersonnelId" column="oil_personnel_id" />
  41. <result property="payDate" column="pay_date" />
  42. <result property="createdDate" column="created_date" />
  43. <result property="orderType" column="order_type" />
  44. <result property="carNo" column="car_no" />
  45. <result property="customerPhone" column="customer_phone" />
  46. <result property="customerGrade" column="customer_grade" />
  47. <result property="wxNum" column="wx_num" />
  48. <result property="zfbNum" column="zfb_num" />
  49. <result property="xjNum" column="xj_num" />
  50. <result property="qyAmt" column="qy_amt" />
  51. <result property="cyAmt" column="cy_amt" />
  52. <result property="sellAmt" column="sell_amt" />
  53. <result property="sellDiscountAmt" column="sell_discount_amt" />
  54. <result property="mobilePhone" column="mobile_phone" />
  55. <result property="sellOilPrice" column="sell_oil_price" />
  56. <result property="driverOilPrice" column="driver_oil_price" />
  57. <result property="countNum" column="count_num" />
  58. <result property="driverDiscountAmt" column="driver_discount_amt" />
  59. </resultMap>
  60. <sql id="selectPayOrderVo">
  61. select order_id, order_no, station_id,d.dept_name as station_name, p.status,consumer_id, consumer, oil_gun,
  62. oil_name, oil_pirce, oil_type, order_liters, amt, receivable_amt, received_amt, discount_amt,sell_oil_price,driver_oil_price,oil_personnel_id,
  63. discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt,
  64. other_amt, dzk_amt, score, member_no, member_amt, print_count, pay_type, pay_way, oil_personnel,
  65. pay_date, created_date, order_type, car_no, customer_phone, customer_grade,sell_amt,sell_discount_amt,driver_discount_amt
  66. from pay_order p join sys_dept d on p.station_id =d.dept_id
  67. </sql>
  68. <select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
  69. <include refid="selectPayOrderVo"/>
  70. <where>
  71. <if test="orderNo != null and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
  72. <if test="stationId != null "> and station_id = #{stationId}</if>
  73. <if test="status != null and status != ''"> and p.status = #{status}</if>
  74. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  75. <if test="consumer != null and consumer != ''"> and consumer like concat('%', #{consumer}, '%')</if>
  76. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  77. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  78. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  79. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  80. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  81. <if test="amt != null "> and amt = #{amt}</if>
  82. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  83. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  84. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  85. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  86. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  87. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  88. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  89. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  90. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  91. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  92. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  93. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  94. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  95. <if test="score != null "> and score = #{score}</if>
  96. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  97. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  98. <if test="printCount != null "> and print_count = #{printCount}</if>
  99. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  100. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  101. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  102. <if test="oilPersonnelId != null and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</if>
  103. <if test="payDate != null "> and pay_date = #{payDate}</if>
  104. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  105. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  106. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  107. <if test="customerPhone != null and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
  108. <if test="customerGrade != null and customerGrade != ''"> and customer_grade = #{customerGrade}</if>
  109. <if test="likeConsumer != null and likeConsumer != ''"> and consumer like concat('%',#{likeConsumer}, '%')</if>
  110. <if test="likeCarNo != null and likeCarNo != ''"> and car_no like concat('%',#{likeCarNo}, '%') </if>
  111. <if test="likeCustomerPhone != null and likeCustomerPhone != ''"> and customer_phone like concat('%',#{likeCustomerPhone}, '%') </if>
  112. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  113. AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  114. </if>
  115. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  116. AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  117. </if>
  118. <if test="stationIdList != null ">
  119. and station_id in
  120. <foreach item="item" index="index" collection="stationIdList"
  121. open="(" separator="," close=")">
  122. #{item}
  123. </foreach>
  124. </if>
  125. </where>
  126. order by order_id desc
  127. </select>
  128. <!--查询导出数据-->
  129. <select id="selectPayOrderExport" parameterType="PayOrder" resultMap="PayOrderResult">
  130. select order_no,oil_name,oil_pirce,order_liters, amt,consumer,oil_personnel,oil_gun,pay_type,pay_way,sell_oil_price,driver_oil_price
  131. from pay_order
  132. <where>
  133. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  134. <if test="stationId != null "> and station_id = #{stationId}</if>
  135. <if test="status != null and status != ''"> and status = #{status}</if>
  136. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  137. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  138. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  139. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  140. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  141. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  142. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  143. <if test="amt != null "> and amt = #{amt}</if>
  144. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  145. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  146. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  147. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  148. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  149. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  150. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  151. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  152. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  153. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  154. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  155. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  156. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  157. <if test="score != null "> and score = #{score}</if>
  158. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  159. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  160. <if test="printCount != null "> and print_count = #{printCount}</if>
  161. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  162. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  163. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  164. <if test="payDate != null "> and pay_date = #{payDate}</if>
  165. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  166. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  167. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  168. <if test="customerPhone != null and customerPhone != ''"> and customer_phone like concat('%',#{customerPhone}, '%') </if>
  169. <if test="customerGrade != null and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if>
  170. <if test="stationIdList != null ">
  171. and station_id in
  172. <foreach item="item" index="index" collection="stationIdList"
  173. open="(" separator="," close=")">
  174. #{item}
  175. </foreach>
  176. </if>
  177. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  178. AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  179. </if>
  180. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  181. AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  182. </if>
  183. </where>
  184. order by order_id desc
  185. </select>
  186. <!--用戶信息关联订单查询-->
  187. <select id="selectUserPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
  188. SELECT order_id,dept_name as station_name,oil_name,order_no,p.oil_pirce,order_liters,receivable_amt,amt,sell_amt,sell_discount_amt,amt,discount_amt,pay_date,mobile_phone as customer_phone,sell_oil_price,driver_oil_price,driver_discount_amt
  189. from pay_order p
  190. left join sys_dept d on d.dept_id =p.station_id
  191. join app_user_info a on a.user_id=p.consumer_id
  192. <where>
  193. <if test="orderNo != null and orderNo != ''"> and p.order_no = #{orderNo}</if>
  194. <if test="stationId != null "> and p.station_id = #{stationId}</if>
  195. <if test="status != null and status != ''"> and p.status = #{status}</if>
  196. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  197. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  198. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  199. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  200. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  201. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  202. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  203. <if test="amt != null "> and amt = #{amt}</if>
  204. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  205. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  206. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  207. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  208. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  209. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  210. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  211. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  212. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  213. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  214. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  215. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  216. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  217. <if test="score != null "> and score = #{score}</if>
  218. <if test="oilPersonnelId != null and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</if>
  219. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  220. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  221. <if test="printCount != null "> and print_count = #{printCount}</if>
  222. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  223. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  224. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  225. <if test="payDate != null "> and pay_date = #{payDate}</if>
  226. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  227. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  228. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  229. <if test="customerPhone != null and customerPhone != ''"> and mobile_phone like concat('%',#{customerPhone}, '%') </if>
  230. <if test="customerGrade != null and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if>
  231. <if test="stationIdList != null ">
  232. and p.station_id in
  233. <foreach item="item" index="index" collection="stationIdList"
  234. open="(" separator="," close=")">
  235. #{item}
  236. </foreach>
  237. </if>
  238. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  239. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  240. </if>
  241. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  242. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  243. </if>
  244. </where>
  245. order by order_id desc
  246. </select>
  247. <!--查询LNG导出数据-->
  248. <select id="selectLNGPayOrderExport" parameterType="PayOrder" resultMap="PayOrderResult">
  249. SELECT order_id,dept_name as station_name,oil_name,order_no,p.oil_pirce,order_liters,receivable_amt,amt,sell_amt,sell_discount_amt,amt,discount_amt,pay_date,mobile_phone,sell_oil_price,driver_oil_price,driver_discount_amt
  250. from pay_order p
  251. left join sys_dept d on d.dept_id =p.station_id
  252. join app_user_info a on a.user_id=p.consumer_id
  253. <where>
  254. <if test="orderNo != null and orderNo != ''"> and p.order_no = #{orderNo}</if>
  255. <if test="stationId != null "> and p.station_id = #{stationId}</if>
  256. <if test="status != null and status != ''"> and p.status = #{status}</if>
  257. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  258. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  259. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  260. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  261. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  262. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  263. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  264. <if test="amt != null "> and amt = #{amt}</if>
  265. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  266. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  267. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  268. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  269. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  270. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  271. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  272. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  273. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  274. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  275. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  276. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  277. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  278. <if test="score != null "> and score = #{score}</if>
  279. <if test="oilPersonnelId != null and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</if>
  280. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  281. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  282. <if test="printCount != null "> and print_count = #{printCount}</if>
  283. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  284. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  285. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  286. <if test="payDate != null "> and pay_date = #{payDate}</if>
  287. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  288. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  289. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  290. <if test="customerPhone != null and customerPhone != ''"> and mobile_phone like concat('%',#{customerPhone}, '%') </if>
  291. <if test="customerGrade != null and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if>
  292. <if test="stationIdList != null ">
  293. and p.station_id in
  294. <foreach item="item" index="index" collection="stationIdList"
  295. open="(" separator="," close=")">
  296. #{item}
  297. </foreach>
  298. </if>
  299. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  300. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  301. </if>
  302. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  303. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  304. </if>
  305. </where>
  306. order by order_id desc
  307. </select>
  308. <select id="LNGDeptList" parameterType="PayOrder" resultMap="PayOrderResult">
  309. SELECT dept_name as station_name,order_id,order_no,oil_name,p.oil_pirce,sell_oil_price,order_liters,receivable_amt,sell_amt,pay_date,driver_discount_amt,
  310. concat(LEFT (mobile_phone, 3), '****', RIGHT (mobile_phone, 4)) mobile_phone
  311. from pay_order p
  312. left join sys_dept d on d.dept_id =p.station_id
  313. join app_user_info a on a.user_id=p.consumer_id
  314. <where>
  315. <if test="orderNo != null and orderNo != ''"> and p.order_no = #{orderNo}</if>
  316. <if test="stationId != null "> and p.station_id = #{stationId}</if>
  317. <if test="status != null and status != ''"> and p.status = #{status}</if>
  318. <if test="consumerId != null "> and p.consumer_id = #{consumerId}</if>
  319. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  320. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  321. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  322. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  323. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  324. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  325. <if test="amt != null "> and amt = #{amt}</if>
  326. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  327. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  328. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  329. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  330. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  331. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  332. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  333. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  334. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  335. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  336. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  337. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  338. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  339. <if test="score != null "> and score = #{score}</if>
  340. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  341. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  342. <if test="printCount != null "> and print_count = #{printCount}</if>
  343. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  344. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  345. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  346. <if test="payDate != null "> and pay_date = #{payDate}</if>
  347. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  348. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  349. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  350. <if test="customerPhone != null and customerPhone != ''"> and customer_phone like concat('%',#{customerPhone}, '%') </if>
  351. <if test="customerGrade != null and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if>
  352. <if test="stationIdList != null ">
  353. and p.station_id in
  354. <foreach item="item" index="index" collection="stationIdList"
  355. open="(" separator="," close=")">
  356. #{item}
  357. </foreach>
  358. </if>
  359. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  360. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  361. </if>
  362. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  363. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  364. </if>
  365. </where>
  366. order by order_id desc
  367. </select>
  368. <select id="selectPayOrderById" parameterType="Long" resultMap="PayOrderResult">
  369. select order_id, order_no, p.station_id, p.station_name, p.status,consumer_id, consumer, oil_gun,
  370. oil_name, oil_pirce, oil_type, order_liters, amt, receivable_amt, received_amt, discount_amt,sell_oil_price,driver_oil_price,
  371. discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt,
  372. other_amt, dzk_amt, score, member_no, member_amt, print_count, pay_type, pay_way, oil_personnel,oil_personnel_id,
  373. pay_date, created_date, order_type, car_no,customer_grade,sell_amt,sell_discount_amt,d.mobile_phone as customer_phone
  374. from pay_order p join app_user_info d on p.consumer_id =d.user_id
  375. where order_id = #{orderId}
  376. </select>
  377. <select id="selectDaySources" parameterType="PayOrder" resultMap="PayOrderResult">
  378. SELECT SUM(amt) as amt,sum(order_liters) as order_liters,sum(sell_amt) as sell_amt,count(1) count_num
  379. from pay_order
  380. <where>
  381. <if test="stationId != null "> and station_id = #{stationId}</if>
  382. <if test="status != null "> and status = #{status}</if>
  383. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  384. <if test="createdDate != null "> and created_date like concat(#{createdDate}, '%') </if>
  385. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  386. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  387. </if>
  388. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  389. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  390. </if>
  391. <if test="stationIdList != null ">
  392. and station_id in
  393. <foreach item="item" index="index" collection="stationIdList"
  394. open="(" separator="," close=")">
  395. #{item}
  396. </foreach>
  397. </if>
  398. </where>
  399. </select>
  400. <select id="selectOilTypeSources" parameterType="Long" resultMap="PayOrderResult">
  401. SELECT SUM(amt) as amt,sum(order_liters) as order_liters,sum(sell_amt) sell_amt, oil_type,count(1) count_num
  402. from pay_order
  403. <where>
  404. <if test="stationId != null "> and station_id = #{stationId}</if>
  405. <if test="status != null "> and status = #{status}</if>
  406. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  407. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  408. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  409. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  410. </if>
  411. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  412. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  413. </if>
  414. <if test="stationIdList != null ">
  415. and station_id in
  416. <foreach item="item" index="index" collection="stationIdList"
  417. open="(" separator="," close=")">
  418. #{item}
  419. </foreach>
  420. </if>
  421. </where>
  422. GROUP BY oil_type
  423. </select>
  424. <select id="dayOilTypeSources" parameterType="Long" resultMap="PayOrderResult">
  425. SELECT oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,sum(order_liters) as order_liters,SUM(receivable_amt) as receivable_amt,
  426. sum(discount_amt) as discount_amt,sum(discount_coupon_amt) as discount_coupon_amt,sum(amt) as amt,
  427. sum(member_amt) as member_amt,sum(wx_amt) as wx_amt,sum(zfb_amt) as zfb_amt
  428. from pay_order
  429. <where>
  430. <if test="stationId != null "> and station_id = #{stationId}</if>
  431. <if test="status != null "> and status = #{status}</if>
  432. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  433. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  434. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  435. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  436. </if>
  437. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  438. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  439. </if>
  440. <if test="stationIdList != null ">
  441. and station_id in
  442. <foreach item="item" index="index" collection="stationIdList"
  443. open="(" separator="," close=")">
  444. #{item}
  445. </foreach>
  446. </if>
  447. </where>
  448. GROUP BY oil_name
  449. </select>
  450. <select id="selectOverViewData" parameterType="Long" resultMap="PayOrderResult">
  451. SELECT SUM(wx_amt) as wx_amt,sum(zfb_amt) as zfb_amt, sum(dzk_amt) as dzk_amt,sum(pos_amt) as pos_amt, sum(xj_amt) as xj_amt,sum(didi_app_amt) as didi_app_amt,sum(ty_app_amt) as ty_app_amt,sum(other_amt) as other_amt,sum(member_amt) as member_amt
  452. from pay_order
  453. <where>
  454. <if test="stationId != null "> and station_id = #{stationId}</if>
  455. <if test="status != null "> and status = #{status}</if>
  456. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  457. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  458. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  459. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  460. </if>
  461. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  462. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  463. </if>
  464. <if test="stationIdList != null ">
  465. and station_id in
  466. <foreach item="item" index="index" collection="stationIdList"
  467. open="(" separator="," close=")">
  468. #{item}
  469. </foreach>
  470. </if>
  471. </where>
  472. </select>
  473. <!--日报数据-->
  474. <select id="selectDayReport" parameterType="Long" resultMap="PayOrderResult">
  475. SELECT
  476. b.created_date,
  477. sum( b.amt ) amt,
  478. sum( b.order_liters ) order_liters,
  479. sum( b.member_amt ) member_amt,
  480. sum( b.receivable_amt ) receivable_amt,
  481. sum( b.received_amt ) received_amt,
  482. MAX(CASE b.oil_type WHEN '1' THEN amt ELSE 0 END) AS qy_amt,
  483. MAX(CASE b.oil_type WHEN '2' THEN amt ELSE 0 END) AS cy_amt,
  484. sum(b.order_no) order_no
  485. from (
  486. SELECT
  487. date_format( a.created_date, '%Y-%m-%d' ) as created_date,
  488. sum( a.amt ) amt,
  489. sum( a.order_liters ) order_liters,
  490. sum( a.member_amt ) member_amt,
  491. sum( a.receivable_amt ) receivable_amt,
  492. sum( a.received_amt ) received_amt,
  493. a.oil_type,
  494. count( 1 ) order_no
  495. FROM
  496. pay_order a
  497. <where>
  498. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  499. <if test="status != null "> and a.status = #{status}</if>
  500. <if test="orderType != null and orderType != ''"> and a.order_type = #{orderType}</if>
  501. <if test="stationIdList != null ">
  502. and a.station_id in
  503. <foreach item="item" index="index" collection="stationIdList"
  504. open="(" separator="," close=")">
  505. #{item}
  506. </foreach>
  507. </if>
  508. </where>
  509. GROUP BY
  510. date_format( a.created_date, '%Y-%m-%d' ),a.oil_type
  511. ) b
  512. GROUP BY b.created_date
  513. ORDER BY b.created_date desc
  514. </select>
  515. <!-- 日报折线图油品数据-->
  516. <select id="listQydata" parameterType="Long" resultMap="PayOrderResult">
  517. SELECT sum(amt) as amt,date_format(created_date,'%Y-%m-%d') as created_date
  518. from pay_order
  519. <where>
  520. <if test="stationId != null "> and station_id = #{stationId}</if>
  521. <if test="status != null and status != ''"> and status = #{status}</if>
  522. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  523. <if test="oilName != null "> and oil_name = #{oilName}</if>
  524. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  525. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  526. </if>
  527. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  528. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  529. </if>
  530. <if test="stationIdList != null ">
  531. and station_id in
  532. <foreach item="item" index="index" collection="stationIdList"
  533. open="(" separator="," close=")">
  534. #{item}
  535. </foreach>
  536. </if>
  537. </where>
  538. GROUP BY oil_name ,date_format(created_date,'%Y-%m-%d')
  539. </select>
  540. <!-- 日报折线图X轴数据-->
  541. <select id="listXdata" parameterType="Long" resultMap="PayOrderResult">
  542. SELECT date_format(created_date,'%Y-%m-%d') as created_date
  543. from pay_order
  544. <where>
  545. <if test="stationId != null "> and station_id = #{stationId}</if>
  546. <if test="status != null and status != ''"> and status = #{status}</if>
  547. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  548. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  549. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  550. </if>
  551. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  552. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  553. </if>
  554. <if test="stationIdList != null ">
  555. and station_id in
  556. <foreach item="item" index="index" collection="stationIdList"
  557. open="(" separator="," close=")">
  558. #{item}
  559. </foreach>
  560. </if>
  561. </where>
  562. GROUP BY date_format(created_date,'%Y-%m-%d')
  563. </select>
  564. <!--查询数据,根据员工汇总数据-->
  565. <select id="selectPersonnelStructure" parameterType="Long" resultMap="PayOrderResult">
  566. SELECT a.oil_personnel,GROUP_CONCAT(DISTINCT a.oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no
  567. from pay_order a
  568. <where>
  569. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  570. <if test="status != null and status != ''"> and status = #{status}</if>
  571. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  572. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  573. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  574. </if>
  575. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  576. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  577. </if>
  578. <if test="stationIdList != null ">
  579. and station_id in
  580. <foreach item="item" index="index" collection="stationIdList"
  581. open="(" separator="," close=")">
  582. #{item}
  583. </foreach>
  584. </if>
  585. </where>
  586. GROUP BY a.oil_personnel
  587. </select>
  588. <!--初始化数据班结数据,根据油品汇总 -->
  589. <select id="selectOilStructure" parameterType="Long" resultMap="PayOrderResult">
  590. SELECT a.oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(order_liters),2) as order_liters,COUNT(order_no) as order_no
  591. from pay_order a
  592. <where>
  593. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  594. <if test="status != null and status != ''"> and status = #{status}</if>
  595. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  596. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  597. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  598. </if>
  599. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  600. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  601. </if>
  602. </where>
  603. GROUP BY a.oil_name
  604. </select>
  605. <!--初始化数据班结数据,根据员工/支付方式汇总 -->
  606. <select id="selectPersonnelPayStructure" parameterType="Long" resultMap="PayOrderResult">
  607. SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,count(wx_amt) wx_num,count(zfb_amt) zfb_num,count(xj_amt) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt
  608. from pay_order a
  609. <where>
  610. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  611. <if test="status != null and status != ''"> and status = #{status}</if>
  612. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  613. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  614. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  615. </if>
  616. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  617. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  618. </if>
  619. </where>
  620. GROUP BY a.oil_personnel
  621. </select>
  622. <!--查询本站第一笔数据-->
  623. <select id="getPayOrderInfoMin" parameterType="Long" resultMap="PayOrderResult">
  624. SELECT * from pay_order where order_id = (
  625. SELECT min(order_id)
  626. from pay_order
  627. <where>
  628. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  629. <if test="stationId != null "> and station_id = #{stationId}</if>
  630. <if test="status != null and status != ''"> and status = #{status}</if>
  631. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  632. </where>
  633. )
  634. </select>
  635. <insert id="insertPayOrder" parameterType="PayOrder" useGeneratedKeys="true" keyProperty="orderId">
  636. insert into pay_order
  637. <trim prefix="(" suffix=")" suffixOverrides=",">
  638. <if test="orderNo != null">order_no,</if>
  639. <if test="stationId != null">station_id,</if>
  640. <if test="status != null">status,</if>
  641. <if test="consumerId != null">consumer_id,</if>
  642. <if test="consumer != null">consumer,</if>
  643. <if test="oilGun != null">oil_gun,</if>
  644. <if test="oilName != null">oil_name,</if>
  645. <if test="oilPirce != null">oil_pirce,</if>
  646. <if test="oilType != null">oil_type,</if>
  647. <if test="orderLiters != null">order_liters,</if>
  648. <if test="amt != null">amt,</if>
  649. <if test="receivableAmt != null">receivable_amt,</if>
  650. <if test="receivedAmt != null">received_amt,</if>
  651. <if test="discountAmt != null">discount_amt,</if>
  652. <if test="discountCouponAmt != null">discount_coupon_amt,</if>
  653. <if test="discountCoupon != null">discount_coupon,</if>
  654. <if test="wxAmt != null">wx_amt,</if>
  655. <if test="zfbAmt != null">zfb_amt,</if>
  656. <if test="posAmt != null">pos_amt,</if>
  657. <if test="xjAmt != null">xj_amt,</if>
  658. <if test="didiAppAmt != null">didi_app_amt,</if>
  659. <if test="tyAppAmt != null">ty_app_amt,</if>
  660. <if test="otherAmt != null">other_amt,</if>
  661. <if test="dzkAmt != null">dzk_amt,</if>
  662. <if test="score != null">score,</if>
  663. <if test="memberNo != null">member_no,</if>
  664. <if test="memberAmt != null">member_amt,</if>
  665. <if test="printCount != null">print_count,</if>
  666. <if test="payType != null">pay_type,</if>
  667. <if test="payWay != null">pay_way,</if>
  668. <if test="oilPersonnel != null">oil_personnel,</if>
  669. <if test="payDate != null">pay_date,</if>
  670. <if test="createdDate != null">created_date,</if>
  671. <if test="orderType != null">order_type,</if>
  672. <if test="carNo != null">car_no,</if>
  673. <if test="customerPhone != null">customer_phone,</if>
  674. <if test="customerGrade != null">customer_grade,</if>
  675. </trim>
  676. <trim prefix="values (" suffix=")" suffixOverrides=",">
  677. <if test="orderNo != null">#{orderNo},</if>
  678. <if test="stationId != null">#{stationId},</if>
  679. <if test="status != null">#{status},</if>
  680. <if test="consumerId != null">#{consumerId},</if>
  681. <if test="consumer != null">#{consumer},</if>
  682. <if test="oilGun != null">#{oilGun},</if>
  683. <if test="oilName != null">#{oilName},</if>
  684. <if test="oilPirce != null">#{oilPirce},</if>
  685. <if test="oilType != null">#{oilType},</if>
  686. <if test="orderLiters != null">#{orderLiters},</if>
  687. <if test="amt != null">#{amt},</if>
  688. <if test="receivableAmt != null">#{receivableAmt},</if>
  689. <if test="receivedAmt != null">#{receivedAmt},</if>
  690. <if test="discountAmt != null">#{discountAmt},</if>
  691. <if test="discountCouponAmt != null">#{discountCouponAmt},</if>
  692. <if test="discountCoupon != null">#{discountCoupon},</if>
  693. <if test="wxAmt != null">#{wxAmt},</if>
  694. <if test="zfbAmt != null">#{zfbAmt},</if>
  695. <if test="posAmt != null">#{posAmt},</if>
  696. <if test="xjAmt != null">#{xjAmt},</if>
  697. <if test="didiAppAmt != null">#{didiAppAmt},</if>
  698. <if test="tyAppAmt != null">#{tyAppAmt},</if>
  699. <if test="otherAmt != null">#{otherAmt},</if>
  700. <if test="dzkAmt != null">#{dzkAmt},</if>
  701. <if test="score != null">#{score},</if>
  702. <if test="memberNo != null">#{memberNo},</if>
  703. <if test="memberAmt != null">#{memberAmt},</if>
  704. <if test="printCount != null">#{printCount},</if>
  705. <if test="payType != null">#{payType},</if>
  706. <if test="payWay != null">#{payWay},</if>
  707. <if test="oilPersonnel != null">#{oilPersonnel},</if>
  708. <if test="payDate != null">#{payDate},</if>
  709. <if test="createdDate != null">#{createdDate},</if>
  710. <if test="orderType != null">#{orderType},</if>
  711. <if test="carNo != null">#{carNo},</if>
  712. <if test="customerPhone != null">#{customerPhone},</if>
  713. <if test="customerGrade != null">#{customerGrade},</if>
  714. </trim>
  715. </insert>
  716. <update id="updatePayOrder" parameterType="PayOrder">
  717. update pay_order
  718. <trim prefix="SET" suffixOverrides=",">
  719. <if test="orderNo != null">order_no = #{orderNo},</if>
  720. <if test="stationId != null">station_id = #{stationId},</if>
  721. <if test="status != null">status = #{status},</if>
  722. <if test="consumerId != null">consumer_id = #{consumerId},</if>
  723. <if test="consumer != null">consumer = #{consumer},</if>
  724. <if test="oilGun != null">oil_gun = #{oilGun},</if>
  725. <if test="oilName != null">oil_name = #{oilName},</if>
  726. <if test="oilPirce != null">oil_pirce = #{oilPirce},</if>
  727. <if test="oilType != null">oil_type = #{oilType},</if>
  728. <if test="orderLiters != null">order_liters = #{orderLiters},</if>
  729. <if test="amt != null">amt = #{amt},</if>
  730. <if test="receivableAmt != null">receivable_amt = #{receivableAmt},</if>
  731. <if test="receivedAmt != null">received_amt = #{receivedAmt},</if>
  732. <if test="discountAmt != null">discount_amt = #{discountAmt},</if>
  733. <if test="discountCouponAmt != null">discount_coupon_amt = #{discountCouponAmt},</if>
  734. <if test="discountCoupon != null">discount_coupon = #{discountCoupon},</if>
  735. <if test="wxAmt != null">wx_amt = #{wxAmt},</if>
  736. <if test="zfbAmt != null">zfb_amt = #{zfbAmt},</if>
  737. <if test="posAmt != null">pos_amt = #{posAmt},</if>
  738. <if test="xjAmt != null">xj_amt = #{xjAmt},</if>
  739. <if test="didiAppAmt != null">didi_app_amt = #{didiAppAmt},</if>
  740. <if test="tyAppAmt != null">ty_app_amt = #{tyAppAmt},</if>
  741. <if test="otherAmt != null">other_amt = #{otherAmt},</if>
  742. <if test="dzkAmt != null">dzk_amt = #{dzkAmt},</if>
  743. <if test="score != null">score = #{score},</if>
  744. <if test="memberNo != null">member_no = #{memberNo},</if>
  745. <if test="memberAmt != null">member_amt = #{memberAmt},</if>
  746. <if test="printCount != null">print_count = #{printCount},</if>
  747. <if test="payType != null">pay_type = #{payType},</if>
  748. <if test="payWay != null">pay_way = #{payWay},</if>
  749. <if test="oilPersonnel != null">oil_personnel = #{oilPersonnel},</if>
  750. <if test="payDate != null">pay_date = #{payDate},</if>
  751. <if test="createdDate != null">created_date = #{createdDate},</if>
  752. <if test="orderType != null">order_type = #{orderType},</if>
  753. <if test="carNo != null">car_no = #{carNo},</if>
  754. <if test="customerPhone != null">customer_phone = #{customerPhone},</if>
  755. <if test="customerGrade != null">customer_grade = #{customerGrade},</if>
  756. </trim>
  757. where order_id = #{orderId}
  758. </update>
  759. <delete id="deletePayOrderById" parameterType="Long">
  760. delete from pay_order where order_id = #{orderId}
  761. </delete>
  762. <delete id="deletePayOrderByIds" parameterType="String">
  763. delete from pay_order where order_id in
  764. <foreach item="orderId" collection="array" open="(" separator="," close=")">
  765. #{orderId}
  766. </foreach>
  767. </delete>
  768. </mapper>