PayOrderMapper.xml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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="payDate" column="pay_date" />
  41. <result property="createdDate" column="created_date" />
  42. <result property="orderType" column="order_type" />
  43. <result property="carNo" column="car_no" />
  44. <result property="customerPhone" column="customer_phone" />
  45. <result property="customerGrade" column="customer_grade" />
  46. <result property="wxNum" column="wx_num" />
  47. <result property="zfbNum" column="zfb_num" />
  48. <result property="xjNum" column="xj_num" />
  49. </resultMap>
  50. <sql id="selectPayOrderVo">
  51. select order_id, order_no, station_id, station_name, status, consumer_id, consumer, oil_gun, oil_name, oil_pirce, oil_type, order_liters, amt, receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_no, member_amt, print_count, pay_type, pay_way, oil_personnel, pay_date, created_date, order_type, car_no, customer_phone, customer_grade from pay_order
  52. </sql>
  53. <select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
  54. <include refid="selectPayOrderVo"/>
  55. <where>
  56. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  57. <if test="stationId != null "> and station_id = #{stationId}</if>
  58. <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
  59. <if test="status != null and status != ''"> and status = #{status}</if>
  60. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  61. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  62. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  63. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  64. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  65. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  66. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  67. <if test="amt != null "> and amt = #{amt}</if>
  68. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  69. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  70. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  71. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  72. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  73. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  74. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  75. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  76. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  77. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  78. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  79. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  80. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  81. <if test="score != null "> and score = #{score}</if>
  82. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  83. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  84. <if test="printCount != null "> and print_count = #{printCount}</if>
  85. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  86. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  87. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  88. <if test="payDate != null "> and pay_date = #{payDate}</if>
  89. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  90. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  91. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  92. <if test="customerPhone != null and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
  93. <if test="customerGrade != null and customerGrade != ''"> and customer_grade = #{customerGrade}</if>
  94. <if test="likeConsumer != null and likeConsumer != ''"> and consumer like concat('%',#{likeConsumer}, '%')</if>
  95. <if test="likeCarNo != null and likeCarNo != ''"> and car_no like concat('%',#{likeCarNo}, '%') </if>
  96. <if test="likeCustomerPhone != null and likeCustomerPhone != ''"> and customer_phone like concat('%',#{likeCustomerPhone}, '%') </if>
  97. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  98. AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  99. </if>
  100. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  101. AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  102. </if>
  103. </where>
  104. order by order_id desc
  105. </select>
  106. <!--查询导出数据-->
  107. <select id="selectPayOrderExport" parameterType="PayOrder" resultMap="PayOrderResult">
  108. select order_no,oil_name,oil_pirce,order_liters, amt,consumer,oil_personnel,oil_gun,pay_type,pay_way
  109. from pay_order
  110. <where>
  111. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  112. <if test="stationId != null "> and station_id = #{stationId}</if>
  113. <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
  114. <if test="status != null and status != ''"> and status = #{status}</if>
  115. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  116. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  117. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  118. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  119. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  120. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  121. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  122. <if test="amt != null "> and amt = #{amt}</if>
  123. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  124. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  125. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  126. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  127. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  128. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  129. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  130. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  131. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  132. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  133. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  134. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  135. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  136. <if test="score != null "> and score = #{score}</if>
  137. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  138. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  139. <if test="printCount != null "> and print_count = #{printCount}</if>
  140. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  141. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  142. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  143. <if test="payDate != null "> and pay_date = #{payDate}</if>
  144. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  145. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  146. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  147. <if test="customerPhone != null and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
  148. <if test="customerGrade != null and customerGrade != ''"> and customer_grade = #{customerGrade}</if>
  149. </where>
  150. order by order_id desc
  151. </select>
  152. <select id="selectPayOrderById" parameterType="Long" resultMap="PayOrderResult">
  153. <include refid="selectPayOrderVo"/>
  154. where order_id = #{orderId}
  155. </select>
  156. <select id="selectDaySources" parameterType="Long" resultMap="PayOrderResult">
  157. SELECT SUM(amt) as amt,sum(order_liters) as order_liters
  158. from pay_order
  159. <where>
  160. <if test="createdDate != null "> and created_date like concat(#{createdDate}, '%') </if>
  161. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  162. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  163. </if>
  164. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  165. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  166. </if>
  167. </where>
  168. </select>
  169. <select id="selectOilTypeSources" parameterType="Long" resultMap="PayOrderResult">
  170. SELECT SUM(amt) as amt,sum(order_liters) as order_liters, oil_type
  171. from pay_order
  172. <where>
  173. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  174. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  175. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  176. </if>
  177. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  178. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  179. </if>
  180. </where>
  181. GROUP BY oil_type
  182. </select>
  183. <select id="selectOverViewData" parameterType="Long" resultMap="PayOrderResult">
  184. SELECT SUM(wx_amt) as wx_amt,sum(zfb_amt) as zfb_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
  185. from pay_order
  186. <where>
  187. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  188. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  189. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  190. </if>
  191. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  192. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  193. </if>
  194. </where>
  195. </select>
  196. <!--日报数据-->
  197. <select id="selectDayReport" parameterType="Long" resultMap="PayOrderResult">
  198. SELECT date_format( b.pay_date, '%Y-%m-%d' ) as pay_date,sum(b.amt) as amt,sum(b.qyamt) as qy_amt, sum(b.cyamt) as cy_amt,sum(b.order_liters) as order_liters ,count(b.order_no) order_no ,sum(b.member_amt) as menber_amt
  199. from (SELECT a.*,(SELECT sum(amt) as qyamt from pay_order where order_no=a.order_no and oil_type=2) as qyamt , (SELECT sum(amt) as qyamt from pay_order where order_no=a.order_no and oil_type=1) as cyamt
  200. from pay_order a) b
  201. GROUP BY date_format( pay_date, '%Y-%m-%d' )
  202. </select>
  203. <!-- 日报折线图油品数据-->
  204. <select id="listQydata" parameterType="Long" resultMap="PayOrderResult">
  205. SELECT sum(amt) as amt,date_format(created_date,'%Y-%m-%d') as created_date
  206. from pay_order
  207. <where>
  208. <if test="oilName != null "> and oil_name = #{oilName}</if>
  209. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  210. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  211. </if>
  212. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  213. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  214. </if>
  215. </where>
  216. GROUP BY oil_name ,date_format(created_date,'%Y-%m-%d')
  217. </select>
  218. <!-- 日报折线图X轴数据-->
  219. <select id="listXdata" parameterType="Long" resultMap="PayOrderResult">
  220. SELECT date_format(created_date,'%Y-%m-%d') as created_date
  221. from pay_order
  222. <where>
  223. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  224. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  225. </if>
  226. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  227. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  228. </if>
  229. </where>
  230. GROUP BY date_format(created_date,'%Y-%m-%d')
  231. </select>
  232. <!--查询数据,根据员工汇总数据-->
  233. <select id="selectPersonnelStructure" parameterType="Long" resultMap="PayOrderResult">
  234. 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
  235. from pay_order a
  236. <where>
  237. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  238. <if test="status != null and status != ''"> and status = #{status}</if>
  239. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  240. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  241. </if>
  242. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  243. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  244. </if>
  245. </where>
  246. GROUP BY a.oil_personnel
  247. </select>
  248. <!--初始化数据班结数据,根据油品汇总 -->
  249. <select id="selectOilStructure" parameterType="Long" resultMap="PayOrderResult">
  250. 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
  251. from pay_order a
  252. <where>
  253. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  254. <if test="status != null and status != ''"> and status = #{status}</if>
  255. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  256. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  257. </if>
  258. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  259. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  260. </if>
  261. </where>
  262. GROUP BY a.oil_name
  263. </select>
  264. <!--初始化数据班结数据,根据员工/支付方式汇总 -->
  265. <select id="selectPersonnelPayStructure" parameterType="Long" resultMap="PayOrderResult">
  266. 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
  267. from pay_order a
  268. <where>
  269. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  270. <if test="status != null and status != ''"> and status = #{status}</if>
  271. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  272. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  273. </if>
  274. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  275. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  276. </if>
  277. </where>
  278. GROUP BY a.oil_personnel
  279. </select>
  280. <insert id="insertPayOrder" parameterType="PayOrder" useGeneratedKeys="true" keyProperty="orderId">
  281. insert into pay_order
  282. <trim prefix="(" suffix=")" suffixOverrides=",">
  283. <if test="orderNo != null">order_no,</if>
  284. <if test="stationId != null">station_id,</if>
  285. <if test="stationName != null">station_name,</if>
  286. <if test="status != null">status,</if>
  287. <if test="consumerId != null">consumer_id,</if>
  288. <if test="consumer != null">consumer,</if>
  289. <if test="oilGun != null">oil_gun,</if>
  290. <if test="oilName != null">oil_name,</if>
  291. <if test="oilPirce != null">oil_pirce,</if>
  292. <if test="oilType != null">oil_type,</if>
  293. <if test="orderLiters != null">order_liters,</if>
  294. <if test="amt != null">amt,</if>
  295. <if test="receivableAmt != null">receivable_amt,</if>
  296. <if test="receivedAmt != null">received_amt,</if>
  297. <if test="discountAmt != null">discount_amt,</if>
  298. <if test="discountCouponAmt != null">discount_coupon_amt,</if>
  299. <if test="discountCoupon != null">discount_coupon,</if>
  300. <if test="wxAmt != null">wx_amt,</if>
  301. <if test="zfbAmt != null">zfb_amt,</if>
  302. <if test="posAmt != null">pos_amt,</if>
  303. <if test="xjAmt != null">xj_amt,</if>
  304. <if test="didiAppAmt != null">didi_app_amt,</if>
  305. <if test="tyAppAmt != null">ty_app_amt,</if>
  306. <if test="otherAmt != null">other_amt,</if>
  307. <if test="dzkAmt != null">dzk_amt,</if>
  308. <if test="score != null">score,</if>
  309. <if test="memberNo != null">member_no,</if>
  310. <if test="memberAmt != null">member_amt,</if>
  311. <if test="printCount != null">print_count,</if>
  312. <if test="payType != null">pay_type,</if>
  313. <if test="payWay != null">pay_way,</if>
  314. <if test="oilPersonnel != null">oil_personnel,</if>
  315. <if test="payDate != null">pay_date,</if>
  316. <if test="createdDate != null">created_date,</if>
  317. <if test="orderType != null">order_type,</if>
  318. <if test="carNo != null">car_no,</if>
  319. <if test="customerPhone != null">customer_phone,</if>
  320. <if test="customerGrade != null">customer_grade,</if>
  321. </trim>
  322. <trim prefix="values (" suffix=")" suffixOverrides=",">
  323. <if test="orderNo != null">#{orderNo},</if>
  324. <if test="stationId != null">#{stationId},</if>
  325. <if test="stationName != null">#{stationName},</if>
  326. <if test="status != null">#{status},</if>
  327. <if test="consumerId != null">#{consumerId},</if>
  328. <if test="consumer != null">#{consumer},</if>
  329. <if test="oilGun != null">#{oilGun},</if>
  330. <if test="oilName != null">#{oilName},</if>
  331. <if test="oilPirce != null">#{oilPirce},</if>
  332. <if test="oilType != null">#{oilType},</if>
  333. <if test="orderLiters != null">#{orderLiters},</if>
  334. <if test="amt != null">#{amt},</if>
  335. <if test="receivableAmt != null">#{receivableAmt},</if>
  336. <if test="receivedAmt != null">#{receivedAmt},</if>
  337. <if test="discountAmt != null">#{discountAmt},</if>
  338. <if test="discountCouponAmt != null">#{discountCouponAmt},</if>
  339. <if test="discountCoupon != null">#{discountCoupon},</if>
  340. <if test="wxAmt != null">#{wxAmt},</if>
  341. <if test="zfbAmt != null">#{zfbAmt},</if>
  342. <if test="posAmt != null">#{posAmt},</if>
  343. <if test="xjAmt != null">#{xjAmt},</if>
  344. <if test="didiAppAmt != null">#{didiAppAmt},</if>
  345. <if test="tyAppAmt != null">#{tyAppAmt},</if>
  346. <if test="otherAmt != null">#{otherAmt},</if>
  347. <if test="dzkAmt != null">#{dzkAmt},</if>
  348. <if test="score != null">#{score},</if>
  349. <if test="memberNo != null">#{memberNo},</if>
  350. <if test="memberAmt != null">#{memberAmt},</if>
  351. <if test="printCount != null">#{printCount},</if>
  352. <if test="payType != null">#{payType},</if>
  353. <if test="payWay != null">#{payWay},</if>
  354. <if test="oilPersonnel != null">#{oilPersonnel},</if>
  355. <if test="payDate != null">#{payDate},</if>
  356. <if test="createdDate != null">#{createdDate},</if>
  357. <if test="orderType != null">#{orderType},</if>
  358. <if test="carNo != null">#{carNo},</if>
  359. <if test="customerPhone != null">#{customerPhone},</if>
  360. <if test="customerGrade != null">#{customerGrade},</if>
  361. </trim>
  362. </insert>
  363. <update id="updatePayOrder" parameterType="PayOrder">
  364. update pay_order
  365. <trim prefix="SET" suffixOverrides=",">
  366. <if test="orderNo != null">order_no = #{orderNo},</if>
  367. <if test="stationId != null">station_id = #{stationId},</if>
  368. <if test="stationName != null">station_name = #{stationName},</if>
  369. <if test="status != null">status = #{status},</if>
  370. <if test="consumerId != null">consumer_id = #{consumerId},</if>
  371. <if test="consumer != null">consumer = #{consumer},</if>
  372. <if test="oilGun != null">oil_gun = #{oilGun},</if>
  373. <if test="oilName != null">oil_name = #{oilName},</if>
  374. <if test="oilPirce != null">oil_pirce = #{oilPirce},</if>
  375. <if test="oilType != null">oil_type = #{oilType},</if>
  376. <if test="orderLiters != null">order_liters = #{orderLiters},</if>
  377. <if test="amt != null">amt = #{amt},</if>
  378. <if test="receivableAmt != null">receivable_amt = #{receivableAmt},</if>
  379. <if test="receivedAmt != null">received_amt = #{receivedAmt},</if>
  380. <if test="discountAmt != null">discount_amt = #{discountAmt},</if>
  381. <if test="discountCouponAmt != null">discount_coupon_amt = #{discountCouponAmt},</if>
  382. <if test="discountCoupon != null">discount_coupon = #{discountCoupon},</if>
  383. <if test="wxAmt != null">wx_amt = #{wxAmt},</if>
  384. <if test="zfbAmt != null">zfb_amt = #{zfbAmt},</if>
  385. <if test="posAmt != null">pos_amt = #{posAmt},</if>
  386. <if test="xjAmt != null">xj_amt = #{xjAmt},</if>
  387. <if test="didiAppAmt != null">didi_app_amt = #{didiAppAmt},</if>
  388. <if test="tyAppAmt != null">ty_app_amt = #{tyAppAmt},</if>
  389. <if test="otherAmt != null">other_amt = #{otherAmt},</if>
  390. <if test="dzkAmt != null">dzk_amt = #{dzkAmt},</if>
  391. <if test="score != null">score = #{score},</if>
  392. <if test="memberNo != null">member_no = #{memberNo},</if>
  393. <if test="memberAmt != null">member_amt = #{memberAmt},</if>
  394. <if test="printCount != null">print_count = #{printCount},</if>
  395. <if test="payType != null">pay_type = #{payType},</if>
  396. <if test="payWay != null">pay_way = #{payWay},</if>
  397. <if test="oilPersonnel != null">oil_personnel = #{oilPersonnel},</if>
  398. <if test="payDate != null">pay_date = #{payDate},</if>
  399. <if test="createdDate != null">created_date = #{createdDate},</if>
  400. <if test="orderType != null">order_type = #{orderType},</if>
  401. <if test="carNo != null">car_no = #{carNo},</if>
  402. <if test="customerPhone != null">customer_phone = #{customerPhone},</if>
  403. <if test="customerGrade != null">customer_grade = #{customerGrade},</if>
  404. </trim>
  405. where order_id = #{orderId}
  406. </update>
  407. <delete id="deletePayOrderById" parameterType="Long">
  408. delete from pay_order where order_id = #{orderId}
  409. </delete>
  410. <delete id="deletePayOrderByIds" parameterType="String">
  411. delete from pay_order where order_id in
  412. <foreach item="orderId" collection="array" open="(" separator="," close=")">
  413. #{orderId}
  414. </foreach>
  415. </delete>
  416. </mapper>