PayOrderMapper.xml 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483
  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. <result property="refundUser" column="refund_user" />
  60. <result property="refundDate" column="refund_date" />
  61. <result property="examinUser" column="examin_user" />
  62. <result property="examinDate" column="examin_date" />
  63. <result property="examinStatus" column="examin_status" />
  64. <result property="refundSuccessDate" column="refund_success_date" />
  65. <result property="dzkNum" column="dzk_num" />
  66. <result property="num" column="num" />
  67. <result property="printNum" column="print_num" />
  68. <result property="userName" column="user_name" />
  69. <result property="thirdPayment" column="third_payment" />
  70. </resultMap>
  71. <sql id="selectPayOrderVo">
  72. select order_id, order_no, station_id,d.dept_name as station_name, p.status,consumer_id, consumer, oil_gun,
  73. oil_name, oil_pirce, oil_type, order_liters, amt, receivable_amt, received_amt, discount_amt,sell_oil_price,driver_oil_price,oil_personnel_id,
  74. discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt,
  75. other_amt, dzk_amt, score, member_no, member_amt, print_count, pay_type, pay_way, oil_personnel,
  76. pay_date, created_date, order_type, car_no, customer_phone, customer_grade,sell_amt,sell_discount_amt,driver_discount_amt,
  77. examin_user,examin_date,refund_user,refund_date,examin_status,refund_success_date,p.third_payment
  78. from pay_order p join sys_dept d on p.station_id =d.dept_id
  79. </sql>
  80. <select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
  81. <include refid="selectPayOrderVo"/>
  82. <where>
  83. <if test="orderNo != null and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
  84. <if test="stationId != null "> and station_id = #{stationId}</if>
  85. <if test="status != null and status != ''"> and p.status = #{status}</if>
  86. <if test="status == null or status == ''"> and p.status != 0 and p.status != 5 </if>
  87. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  88. <if test="consumer != null and consumer != ''"> and consumer like concat('%', #{consumer}, '%')</if>
  89. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  90. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  91. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  92. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  93. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  94. <if test="amt != null "> and amt = #{amt}</if>
  95. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  96. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  97. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  98. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  99. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  100. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  101. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  102. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  103. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  104. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  105. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  106. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  107. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  108. <if test="score != null "> and score = #{score}</if>
  109. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  110. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  111. <if test="printCount != null "> and print_count = #{printCount}</if>
  112. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  113. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  114. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  115. <if test="oilPersonnelId != null and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</if>
  116. <if test="payDate != null "> and pay_date = #{payDate}</if>
  117. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  118. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  119. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  120. <if test="customerPhone != null and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
  121. <if test="customerGrade != null and customerGrade != ''"> and customer_grade = #{customerGrade}</if>
  122. <if test="refundUser != null and refundUser != ''"> and refund_user = #{refundUser}</if>
  123. <if test="refundDate != null and refundDate != ''"> and refund_date = #{refundDate}</if>
  124. <if test="thirdPayment != null and thirdPayment != ''"> and p.third_payment = #{thirdPayment}</if>
  125. <if test="examinUser != null and examinUser != ''"> and examin_user = #{examinUser}</if>
  126. <if test="examinDate != null and examinDate != ''"> and examin_date = #{examinDate}</if>
  127. <if test="examinStatus != null and examinStatus != ''">
  128. <if test="examinStatus == '-1'">
  129. and examin_status !=0 and examin_status is not NULL
  130. </if>
  131. <if test="examinStatus != '-1'">
  132. and examin_status = #{examinStatus}
  133. </if>
  134. </if>
  135. <if test="likeConsumer != null and likeConsumer != ''"> and consumer like concat('%',#{likeConsumer}, '%')</if>
  136. <if test="likeCarNo != null and likeCarNo != ''"> and car_no like concat('%',#{likeCarNo}, '%') </if>
  137. <if test="likeCustomerPhone != null and likeCustomerPhone != ''"> and customer_phone like concat('%',#{likeCustomerPhone}, '%') </if>
  138. <if test="refundSuccessStatus == '1'.toString() ">
  139. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  140. AND date_format(refund_success_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  141. </if>
  142. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  143. AND date_format(refund_success_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  144. </if>
  145. </if>
  146. <if test="refundSuccessStatus != '1'.toString() ">
  147. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  148. AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  149. </if>
  150. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  151. AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  152. </if>
  153. </if>
  154. <if test="stationIdList != null ">
  155. and station_id in
  156. <foreach item="item" index="index" collection="stationIdList"
  157. open="(" separator="," close=")">
  158. #{item}
  159. </foreach>
  160. </if>
  161. </where>
  162. order by order_id desc
  163. </select>
  164. <select id="selectAllPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
  165. SELECT
  166. p.order_id,
  167. p.order_no,
  168. p.station_id,
  169. d.dept_name AS station_name,
  170. p.STATUS,
  171. p.consumer_id,
  172. p.consumer,
  173. p.oil_gun,
  174. p.oil_name,
  175. p.oil_pirce,
  176. p.oil_type,
  177. p.order_liters,
  178. p.amt,
  179. p.receivable_amt,
  180. p.received_amt,
  181. p.discount_amt,
  182. p.sell_oil_price,
  183. p.driver_oil_price,
  184. p.oil_personnel_id,
  185. p.discount_coupon_amt,
  186. p.discount_coupon,
  187. p.wx_amt,
  188. p.zfb_amt,
  189. p.pos_amt,
  190. p.xj_amt,
  191. p.didi_app_amt,
  192. p.ty_app_amt,
  193. p.other_amt,
  194. p.dzk_amt,
  195. p.score,
  196. p.member_no,
  197. p.member_amt,
  198. p.print_count,
  199. p.pay_type,
  200. p.pay_way,
  201. p.oil_personnel,
  202. p.pay_date,
  203. p.created_date,
  204. p.order_type,
  205. p.car_no,
  206. p.customer_phone,
  207. p.customer_grade,
  208. p.sell_amt,
  209. p.sell_discount_amt,
  210. p.driver_discount_amt,
  211. p.examin_user,
  212. p.examin_date,
  213. p.refund_user,
  214. p.refund_date,
  215. p.examin_status,
  216. p.refund_success_date,
  217. p.third_payment
  218. FROM
  219. pay_order p
  220. JOIN sys_dept d ON p.station_id = d.dept_id
  221. left join app_user_info a on p.consumer_id=a.user_id
  222. <where>
  223. <if test="orderNo != null and orderNo != ''"> and p.order_no like concat('%', #{orderNo}, '%')</if>
  224. <if test="stationId != null "> and p.station_id = #{stationId}</if>
  225. <if test="status != null and status != ''"> and p.status = #{status}</if>
  226. <if test="status == null or status == ''"> and p.status != 5 </if>
  227. <if test="consumerId != null "> and p.consumer_id = #{consumerId}</if>
  228. <if test="consumer != null and consumer != ''"> and p.consumer like concat('%', #{consumer}, '%')</if>
  229. <if test="oilGun != null and oilGun != ''"> and p.oil_gun = #{oilGun}</if>
  230. <if test="oilName != null and oilName != ''"> and p.oil_name like concat('%', #{oilName}, '%')</if>
  231. <if test="oilPirce != null "> and p.oil_pirce = #{oilPirce}</if>
  232. <if test="oilType != null and oilType != ''"> and p.oil_type = #{oilType}</if>
  233. <if test="orderLiters != null "> and p.order_liters = #{orderLiters}</if>
  234. <if test="amt != null "> and p.amt = #{amt}</if>
  235. <if test="receivableAmt != null "> and p.receivable_amt = #{receivableAmt}</if>
  236. <if test="receivedAmt != null "> and p.received_amt = #{receivedAmt}</if>
  237. <if test="discountAmt != null "> and p.discount_amt = #{discountAmt}</if>
  238. <if test="discountCouponAmt != null "> and p.discount_coupon_amt = #{discountCouponAmt}</if>
  239. <if test="discountCoupon != null and discountCoupon != ''"> and p.discount_coupon = #{discountCoupon}</if>
  240. <if test="wxAmt != null "> and p.wx_amt = #{wxAmt}</if>
  241. <if test="zfbAmt != null "> and p.zfb_amt = #{zfbAmt}</if>
  242. <if test="posAmt != null "> and p.pos_amt = #{posAmt}</if>
  243. <if test="xjAmt != null "> and p.xj_amt = #{xjAmt}</if>
  244. <if test="didiAppAmt != null "> and p.didi_app_amt = #{didiAppAmt}</if>
  245. <if test="tyAppAmt != null "> and p.ty_app_amt = #{tyAppAmt}</if>
  246. <if test="otherAmt != null "> and p.other_amt = #{otherAmt}</if>
  247. <if test="dzkAmt != null "> and p.dzk_amt = #{dzkAmt}</if>
  248. <if test="score != null "> and p.score = #{score}</if>
  249. <if test="memberNo != null and memberNo != ''"> and p.member_no = #{memberNo}</if>
  250. <if test="memberAmt != null "> and p.member_amt = #{memberAmt}</if>
  251. <if test="printCount != null "> and p.print_count = #{printCount}</if>
  252. <if test="payType != null and payType != ''"> and p.pay_type = #{payType}</if>
  253. <if test="payWay != null and payWay != ''"> and p.pay_way = #{payWay}</if>
  254. <if test="oilPersonnel != null and oilPersonnel != ''"> and p.oil_personnel = #{oilPersonnel}</if>
  255. <if test="oilPersonnelId != null and oilPersonnelId != ''"> and p.oil_personnel_id = #{oilPersonnelId}</if>
  256. <if test="payDate != null "> and p.pay_date = #{payDate}</if>
  257. <if test="createdDate != null "> and p.created_date = #{createdDate}</if>
  258. <if test="orderType != null and orderType != ''"> and p.order_type = #{orderType}</if>
  259. <if test="carNo != null and carNo != ''"> and p.car_no = #{carNo}</if>
  260. <if test="customerPhone != null and customerPhone != ''"> and p.customer_phone = #{customerPhone}</if>
  261. <if test="customerGrade != null and customerGrade != ''"> and p.customer_grade = #{customerGrade}</if>
  262. <if test="refundUser != null and refundUser != ''"> and p.refund_user = #{refundUser}</if>
  263. <if test="refundDate != null and refundDate != ''"> and p.refund_date = #{refundDate}</if>
  264. <if test="thirdPayment != null and thirdPayment != ''"> and p.third_payment = #{thirdPayment}</if>
  265. <if test="examinUser != null and examinUser != ''"> and p.examin_user = #{examinUser}</if>
  266. <if test="examinDate != null and examinDate != ''"> and p.examin_date = #{examinDate}</if>
  267. <if test="examinStatus != null and examinStatus != ''">
  268. <if test="examinStatus == '-1'">
  269. and p.examin_status !=0 and p.examin_status is not NULL
  270. </if>
  271. <if test="examinStatus != '-1'">
  272. and p.examin_status = #{examinStatus}
  273. </if>
  274. </if>
  275. <if test="likeConsumer != null and likeConsumer != ''"> and p.consumer like concat('%',#{likeConsumer}, '%')</if>
  276. <if test="likeCarNo != null and likeCarNo != ''"> and p.car_no like concat('%',#{likeCarNo}, '%') </if>
  277. <if test="likeCustomerPhone != null and likeCustomerPhone != ''"> and p.customer_phone like concat('%',#{likeCustomerPhone}, '%') </if>
  278. <if test="refundSuccessStatus == '1'.toString() ">
  279. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  280. AND date_format(p.refund_success_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  281. </if>
  282. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  283. AND date_format(p.refund_success_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  284. </if>
  285. </if>
  286. <if test="refundSuccessStatus != '1'.toString() ">
  287. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  288. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  289. </if>
  290. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  291. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  292. </if>
  293. </if>
  294. <if test="stationIdList != null ">
  295. and p.station_id in
  296. <foreach item="item" index="index" collection="stationIdList"
  297. open="(" separator="," close=")">
  298. #{item}
  299. </foreach>
  300. </if>
  301. </where>
  302. order by p.created_date desc
  303. </select>
  304. <!--查询导出数据-->
  305. <select id="selectPayOrderExport" parameterType="PayOrder" resultMap="PayOrderResult">
  306. 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,status
  307. from pay_order
  308. <where>
  309. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  310. <if test="stationId != null "> and station_id = #{stationId}</if>
  311. <if test="status != null and status != ''"> and status = #{status}</if>
  312. <if test="status == null or status == ''"> and status != 0 and status != 5</if>
  313. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  314. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  315. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  316. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  317. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  318. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  319. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  320. <if test="amt != null "> and amt = #{amt}</if>
  321. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  322. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  323. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  324. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  325. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  326. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  327. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  328. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  329. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  330. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  331. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  332. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  333. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  334. <if test="score != null "> and score = #{score}</if>
  335. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  336. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  337. <if test="printCount != null "> and print_count = #{printCount}</if>
  338. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  339. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  340. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  341. <if test="payDate != null "> and pay_date = #{payDate}</if>
  342. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  343. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  344. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  345. <if test="refundUser != null and refundUser != ''"> and refund_user = #{refundUser}</if>
  346. <if test="refundDate != null and refundDate != ''"> and refund_date = #{refundDate}</if>
  347. <if test="examinUser != null and examinUser != ''"> and examin_user = #{examinUser}</if>
  348. <if test="examinDate != null and examinDate != ''"> and examin_date = #{examinDate}</if>
  349. <if test="examinStatus != null and examinStatus != ''"> and examin_status = #{examinStatus}</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 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(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(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. <!--用戶信息关联订单查询-->
  369. <select id="selectUserPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
  370. 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
  371. from pay_order p
  372. left join sys_dept d on d.dept_id =p.station_id
  373. join app_user_info a on a.user_id=p.consumer_id
  374. <where>
  375. <if test="orderNo != null and orderNo != ''"> and p.order_no = #{orderNo}</if>
  376. <if test="stationId != null "> and p.station_id = #{stationId}</if>
  377. <if test="status != null and status != ''"> and p.status = #{status}</if>
  378. <if test="status == null or status == ''"> and p.status != 0 and p.status != 5 </if>
  379. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  380. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  381. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  382. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  383. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  384. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  385. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  386. <if test="amt != null "> and amt = #{amt}</if>
  387. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  388. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  389. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  390. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  391. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  392. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  393. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  394. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  395. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  396. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  397. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  398. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  399. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  400. <if test="score != null "> and score = #{score}</if>
  401. <if test="oilPersonnelId != null and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</if>
  402. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  403. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  404. <if test="printCount != null "> and print_count = #{printCount}</if>
  405. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  406. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  407. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  408. <if test="payDate != null "> and pay_date = #{payDate}</if>
  409. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  410. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  411. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  412. <if test="refundUser != null and refundUser != ''"> and refund_user = #{refundUser}</if>
  413. <if test="refundDate != null and refundDate != ''"> and refund_date = #{refundDate}</if>
  414. <if test="examinUser != null and examinUser != ''"> and examin_user = #{examinUser}</if>
  415. <if test="examinDate != null and examinDate != ''"> and examin_date = #{examinDate}</if>
  416. <if test="examinStatus != null and examinStatus != ''"> and examin_status = #{examinStatus}</if>
  417. <if test="customerPhone != null and customerPhone != ''"> and mobile_phone like concat('%',#{customerPhone}, '%') </if>
  418. <if test="customerGrade != null and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if>
  419. <if test="stationIdList != null ">
  420. and p.station_id in
  421. <foreach item="item" index="index" collection="stationIdList"
  422. open="(" separator="," close=")">
  423. #{item}
  424. </foreach>
  425. </if>
  426. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  427. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  428. </if>
  429. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  430. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  431. </if>
  432. </where>
  433. order by order_id desc
  434. </select>
  435. <!--查询LNG导出数据-->
  436. <select id="selectLNGPayOrderExport" parameterType="PayOrder" resultMap="PayOrderResult">
  437. 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,discount_amt,pay_date,mobile_phone,sell_oil_price,driver_oil_price,driver_discount_amt,p.status
  438. from pay_order p
  439. left join sys_dept d on d.dept_id =p.station_id
  440. left join app_user_info a on a.user_id=p.consumer_id
  441. <where>
  442. <if test="orderNo != null and orderNo != ''"> and p.order_no = #{orderNo}</if>
  443. <if test="stationId != null "> and p.station_id = #{stationId}</if>
  444. <if test="status != null and status != ''"> and p.status = #{status} </if>
  445. <if test="status == null or status == ''"> and p.status != 0 and p.status != 5 </if>
  446. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  447. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  448. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  449. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  450. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  451. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  452. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  453. <if test="amt != null "> and amt = #{amt}</if>
  454. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  455. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  456. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  457. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  458. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  459. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  460. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  461. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  462. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  463. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  464. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  465. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  466. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  467. <if test="score != null "> and score = #{score}</if>
  468. <if test="oilPersonnelId != null and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</if>
  469. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  470. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  471. <if test="printCount != null "> and print_count = #{printCount}</if>
  472. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  473. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  474. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  475. <if test="payDate != null "> and pay_date = #{payDate}</if>
  476. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  477. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  478. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  479. <if test="refundUser != null and refundUser != ''"> and refund_user = #{refundUser}</if>
  480. <if test="refundDate != null and refundDate != ''"> and refund_date = #{refundDate}</if>
  481. <if test="examinUser != null and examinUser != ''"> and examin_user = #{examinUser}</if>
  482. <if test="examinDate != null and examinDate != ''"> and examin_date = #{examinDate}</if>
  483. <if test="examinStatus != null and examinStatus != ''"> and examin_status = #{examinStatus}</if>
  484. <if test="customerPhone != null and customerPhone != ''"> and mobile_phone like concat('%',#{customerPhone}, '%') </if>
  485. <if test="customerGrade != null and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if>
  486. <if test="stationIdList != null ">
  487. and p.station_id in
  488. <foreach item="item" index="index" collection="stationIdList"
  489. open="(" separator="," close=")">
  490. #{item}
  491. </foreach>
  492. </if>
  493. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  494. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  495. </if>
  496. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  497. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  498. </if>
  499. </where>
  500. order by order_id desc
  501. </select>
  502. <select id="LNGDeptList" parameterType="PayOrder" resultMap="PayOrderResult">
  503. SELECT dept_name as station_name,order_id,order_no,oil_name,p.oil_pirce,sell_oil_price,order_liters,receivable_amt,sell_amt,sell_discount_amt,pay_date,driver_discount_amt,
  504. concat(LEFT (mobile_phone, 3), '****', RIGHT (mobile_phone, 4)) mobile_phone,p.status
  505. from pay_order p
  506. left join sys_dept d on d.dept_id =p.station_id
  507. left join app_user_info a on a.user_id=p.consumer_id
  508. <where>
  509. <if test="orderNo != null and orderNo != ''"> and p.order_no = #{orderNo}</if>
  510. <if test="stationId != null "> and p.station_id = #{stationId}</if>
  511. <if test="status != null and status != ''"> and p.status = #{status} </if>
  512. <if test="status == null or status == ''"> and p.status != 0 and p.status != 5 </if>
  513. <if test="consumerId != null "> and p.consumer_id = #{consumerId}</if>
  514. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  515. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  516. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  517. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  518. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  519. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  520. <if test="amt != null "> and amt = #{amt}</if>
  521. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  522. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  523. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  524. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  525. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  526. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  527. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  528. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  529. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  530. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  531. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  532. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  533. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  534. <if test="score != null "> and score = #{score}</if>
  535. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  536. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  537. <if test="printCount != null "> and print_count = #{printCount}</if>
  538. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  539. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  540. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  541. <if test="payDate != null "> and pay_date = #{payDate}</if>
  542. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  543. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  544. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  545. <if test="refundUser != null and refundUser != ''"> and refund_user = #{refundUser}</if>
  546. <if test="refundDate != null and refundDate != ''"> and refund_date = #{refundDate}</if>
  547. <if test="examinUser != null and examinUser != ''"> and examin_user = #{examinUser}</if>
  548. <if test="examinDate != null and examinDate != ''"> and examin_date = #{examinDate}</if>
  549. <if test="examinStatus != null and examinStatus != ''"> and examin_status = #{examinStatus}</if>
  550. <if test="customerPhone != null and customerPhone != ''"> and customer_phone like concat('%',#{customerPhone}, '%') </if>
  551. <if test="customerGrade != null and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if>
  552. <if test="stationIdList != null ">
  553. and p.station_id in
  554. <foreach item="item" index="index" collection="stationIdList"
  555. open="(" separator="," close=")">
  556. #{item}
  557. </foreach>
  558. </if>
  559. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  560. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  561. </if>
  562. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  563. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  564. </if>
  565. </where>
  566. order by order_id desc
  567. </select>
  568. <select id="LNGDeptListAll" parameterType="PayOrder" resultMap="PayOrderResult">
  569. SELECT dept_name as station_name,order_id,order_no,oil_name,p.oil_pirce,sell_oil_price,order_liters,receivable_amt,sell_amt,sell_discount_amt,pay_date,driver_discount_amt,
  570. concat(LEFT (mobile_phone, 3), '****', RIGHT (mobile_phone, 4)) mobile_phone,p.status
  571. from pay_order p
  572. left join sys_dept d on d.dept_id =p.station_id
  573. left join app_user_info a on a.user_id=p.consumer_id
  574. <where>
  575. <if test="orderNo != null and orderNo != ''"> and p.order_no = #{orderNo}</if>
  576. <if test="stationId != null "> and p.station_id = #{stationId}</if>
  577. <if test="status != null and status != ''"> and p.status = #{status}</if>
  578. <if test="status == null or status == ''"> and p.status != 0 and p.status != 5 </if>
  579. <if test="consumerId != null "> and p.consumer_id = #{consumerId}</if>
  580. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  581. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  582. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  583. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  584. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  585. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  586. <if test="amt != null "> and amt = #{amt}</if>
  587. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  588. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  589. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  590. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  591. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  592. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  593. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  594. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  595. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  596. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  597. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  598. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  599. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  600. <if test="score != null "> and score = #{score}</if>
  601. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  602. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  603. <if test="printCount != null "> and print_count = #{printCount}</if>
  604. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  605. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  606. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  607. <if test="payDate != null "> and pay_date = #{payDate}</if>
  608. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  609. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  610. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  611. <if test="customerPhone != null and customerPhone != ''"> and customer_phone like concat('%',#{customerPhone}, '%') </if>
  612. <if test="customerGrade != null and customerGrade != ''"> and customer_grade like concat('%',#{customerGrade}, '%') </if>
  613. <if test="stationIdList != null ">
  614. and p.station_id in
  615. <foreach item="item" index="index" collection="stationIdList"
  616. open="(" separator="," close=")">
  617. #{item}
  618. </foreach>
  619. </if>
  620. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  621. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  622. </if>
  623. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  624. AND date_format(p.created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  625. </if>
  626. </where>
  627. order by order_id desc
  628. </select>
  629. <select id="selectPayOrderById" parameterType="Long" resultMap="PayOrderResult">
  630. select order_id, order_no, p.station_id, p.station_name, p.status,consumer_id, consumer, oil_gun,
  631. oil_name, oil_pirce, oil_type, order_liters, amt, receivable_amt, received_amt, discount_amt,sell_oil_price,driver_oil_price,
  632. discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt,
  633. other_amt, dzk_amt, score, member_no, member_amt, print_count, pay_type, pay_way, oil_personnel,oil_personnel_id,
  634. pay_date, created_date, order_type, car_no,customer_grade,sell_amt,sell_discount_amt,
  635. examin_user,examin_date,refund_user,refund_date,examin_status,refund_success_date,p.third_payment
  636. from pay_order p
  637. where order_id = #{orderId}
  638. </select>
  639. <select id="selectDaySources" parameterType="PayOrder" resultMap="PayOrderResult">
  640. SELECT SUM(amt) as amt,sum(order_liters) as order_liters,sum(sell_amt) as sell_amt,count(1) count_num
  641. from pay_order
  642. <where>
  643. <if test="stationId != null "> and station_id = #{stationId}</if>
  644. <if test="status != null "> and (status = #{status} or status=2 )</if>
  645. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  646. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  647. <if test="createdDate != null "> and created_date like concat(#{createdDate}, '%') </if>
  648. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  649. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  650. </if>
  651. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  652. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  653. </if>
  654. <if test="stationIdList != null ">
  655. and station_id in
  656. <foreach item="item" index="index" collection="stationIdList"
  657. open="(" separator="," close=")">
  658. #{item}
  659. </foreach>
  660. </if>
  661. </where>
  662. </select>
  663. <select id="selectAllDaySources" parameterType="PayOrder" resultMap="PayOrderResult">
  664. SELECT SUM(amt) as amt,sum(order_liters) as order_liters,sum(sell_amt) as sell_amt,count(1) count_num
  665. from pay_order
  666. <where>
  667. <if test="stationId != null "> and station_id = #{stationId}</if>
  668. <if test="status != null "> and (status = #{status} or status=2)</if>
  669. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  670. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  671. <if test="createdDate != null "> and created_date like concat(#{createdDate}, '%') </if>
  672. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  673. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  674. </if>
  675. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  676. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  677. </if>
  678. <if test="stationIdList != null ">
  679. and station_id in
  680. <foreach item="item" index="index" collection="stationIdList"
  681. open="(" separator="," close=")">
  682. #{item}
  683. </foreach>
  684. </if>
  685. </where>
  686. </select>
  687. <select id="selectOilTypeSources" parameterType="Long" resultMap="PayOrderResult">
  688. SELECT SUM(amt) as amt,sum(order_liters) as order_liters,sum(sell_amt) sell_amt, oil_type,count(1) count_num
  689. from pay_order
  690. <where>
  691. <if test="stationId != null "> and station_id = #{stationId}</if>
  692. <if test="status != null "> and status = #{status}</if>
  693. <if test="status == null or status == ''"> and status != 0 and status != 5</if>
  694. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  695. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  696. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  697. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  698. </if>
  699. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  700. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  701. </if>
  702. <if test="stationIdList != null ">
  703. and station_id in
  704. <foreach item="item" index="index" collection="stationIdList"
  705. open="(" separator="," close=")">
  706. #{item}
  707. </foreach>
  708. </if>
  709. </where>
  710. GROUP BY oil_type
  711. </select>
  712. <select id="selectAllOilTypeSources" parameterType="Long" resultMap="PayOrderResult">
  713. SELECT SUM(amt) as amt,sum(order_liters) as order_liters,sum(sell_amt) sell_amt, oil_type,count(1) count_num
  714. from pay_order
  715. <where>
  716. <if test="stationId != null "> and station_id = #{stationId}</if>
  717. <if test="status != null "> and (status = #{status} or status=2)</if>
  718. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  719. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  720. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  721. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  722. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  723. </if>
  724. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  725. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  726. </if>
  727. <if test="stationIdList != null ">
  728. and station_id in
  729. <foreach item="item" index="index" collection="stationIdList"
  730. open="(" separator="," close=")">
  731. #{item}
  732. </foreach>
  733. </if>
  734. </where>
  735. GROUP BY oil_type
  736. </select>
  737. <select id="dayOilTypeSources" parameterType="Long" resultMap="PayOrderResult">
  738. SELECT oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,sum(order_liters) as order_liters,SUM(receivable_amt) as receivable_amt,
  739. sum(discount_amt) as discount_amt,sum(discount_coupon_amt) as discount_coupon_amt,sum(amt) as amt,
  740. sum(member_amt) as member_amt,sum(wx_amt) as wx_amt,sum(zfb_amt) as zfb_amt
  741. from pay_order
  742. <where>
  743. <if test="stationId != null "> and station_id = #{stationId}</if>
  744. <if test="status != null "> and status = #{status}</if>
  745. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  746. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  747. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  748. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  749. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  750. </if>
  751. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  752. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  753. </if>
  754. <if test="stationIdList != null ">
  755. and station_id in
  756. <foreach item="item" index="index" collection="stationIdList"
  757. open="(" separator="," close=")">
  758. #{item}
  759. </foreach>
  760. </if>
  761. </where>
  762. GROUP BY oil_name
  763. </select>
  764. <select id="dayAllOilTypeSources" parameterType="Long" resultMap="PayOrderResult">
  765. SELECT oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,sum(order_liters) as order_liters,SUM(receivable_amt) as receivable_amt,
  766. sum(discount_amt) as discount_amt,sum(discount_coupon_amt) as discount_coupon_amt,sum(amt) as amt,
  767. sum(member_amt) as member_amt,sum(wx_amt) as wx_amt,sum(zfb_amt) as zfb_amt
  768. from pay_order
  769. <where>
  770. <if test="stationId != null "> and station_id = #{stationId}</if>
  771. <if test="status != null "> and (status = #{status} or status=2)</if>
  772. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  773. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  774. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  775. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  776. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  777. </if>
  778. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  779. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  780. </if>
  781. <if test="stationIdList != null ">
  782. and station_id in
  783. <foreach item="item" index="index" collection="stationIdList"
  784. open="(" separator="," close=")">
  785. #{item}
  786. </foreach>
  787. </if>
  788. </where>
  789. GROUP BY oil_name
  790. </select>
  791. <select id="selectOverViewData" parameterType="Long" resultMap="PayOrderResult">
  792. 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
  793. from pay_order
  794. <where>
  795. <if test="stationId != null "> and station_id = #{stationId}</if>
  796. <if test="status != null "> and status = #{status}</if>
  797. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  798. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  799. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  800. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  801. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  802. </if>
  803. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  804. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  805. </if>
  806. <if test="stationIdList != null ">
  807. and station_id in
  808. <foreach item="item" index="index" collection="stationIdList"
  809. open="(" separator="," close=")">
  810. #{item}
  811. </foreach>
  812. </if>
  813. </where>
  814. </select>
  815. <select id="selectAllOverViewData" parameterType="Long" resultMap="PayOrderResult">
  816. 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
  817. from pay_order
  818. <where>
  819. <if test="stationId != null "> and station_id = #{stationId}</if>
  820. <if test="status != null "> and (status = #{status} or status=2)</if>
  821. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  822. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  823. <if test="createdDate != null "> and created_date = #{createdDate}</if>
  824. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  825. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  826. </if>
  827. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  828. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  829. </if>
  830. <if test="stationIdList != null ">
  831. and station_id in
  832. <foreach item="item" index="index" collection="stationIdList"
  833. open="(" separator="," close=")">
  834. #{item}
  835. </foreach>
  836. </if>
  837. </where>
  838. </select>
  839. <!--日报数据-->
  840. <select id="selectDayReport" parameterType="Long" resultMap="PayOrderResult">
  841. SELECT
  842. b.created_date,
  843. sum( b.amt ) amt,
  844. sum( b.order_liters ) order_liters,
  845. sum( b.member_amt ) member_amt,
  846. sum( b.receivable_amt ) receivable_amt,
  847. sum( b.received_amt ) received_amt,
  848. MAX(CASE b.oil_type WHEN '1' THEN amt ELSE 0 END) AS qy_amt,
  849. MAX(CASE b.oil_type WHEN '2' THEN amt ELSE 0 END) AS cy_amt,
  850. sum(b.order_no) order_no
  851. from (
  852. SELECT
  853. date_format( a.created_date, '%Y-%m-%d' ) as created_date,
  854. sum( a.amt ) amt,
  855. sum( a.order_liters ) order_liters,
  856. sum( a.member_amt ) member_amt,
  857. sum( a.receivable_amt ) receivable_amt,
  858. sum( a.received_amt ) received_amt,
  859. a.oil_type,
  860. count( 1 ) order_no
  861. FROM
  862. pay_order a
  863. <where>
  864. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  865. <if test="status != null "> and a.status = #{status}</if>
  866. <if test="status == null or status == ''"> and a.status != 0 and a.status != 5</if>
  867. <if test="orderType != null and orderType != ''"> and a.order_type = #{orderType}</if>
  868. <if test="stationIdList != null ">
  869. and a.station_id in
  870. <foreach item="item" index="index" collection="stationIdList"
  871. open="(" separator="," close=")">
  872. #{item}
  873. </foreach>
  874. </if>
  875. </where>
  876. GROUP BY
  877. date_format( a.created_date, '%Y-%m-%d' ),a.oil_type
  878. ) b
  879. GROUP BY b.created_date
  880. ORDER BY b.created_date desc
  881. </select>
  882. <!--日报数据-->
  883. <select id="selectAllDayReport" parameterType="Long" resultMap="PayOrderResult">
  884. SELECT
  885. b.created_date,
  886. sum( b.amt ) amt,
  887. sum( b.order_liters ) order_liters,
  888. sum( b.member_amt ) member_amt,
  889. sum( b.receivable_amt ) receivable_amt,
  890. sum( b.received_amt ) received_amt,
  891. MAX(CASE b.oil_type WHEN '1' THEN amt ELSE 0 END) AS qy_amt,
  892. MAX(CASE b.oil_type WHEN '2' THEN amt ELSE 0 END) AS cy_amt,
  893. sum(b.order_no) order_no
  894. from (
  895. SELECT
  896. date_format( a.created_date, '%Y-%m-%d' ) as created_date,
  897. sum( a.amt ) amt,
  898. sum( a.order_liters ) order_liters,
  899. sum( a.member_amt ) member_amt,
  900. sum( a.receivable_amt ) receivable_amt,
  901. sum( a.received_amt ) received_amt,
  902. a.oil_type,
  903. count( 1 ) order_no
  904. FROM
  905. pay_order a
  906. <where>
  907. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  908. <if test="status != null "> and (a.status = #{status} or a.status=2)</if>
  909. <if test="status == null or status == ''"> and a.status != 0 and a.status != 5 </if>
  910. <if test="orderType != null and orderType != ''"> and a.order_type = #{orderType}</if>
  911. <if test="stationIdList != null ">
  912. and a.station_id in
  913. <foreach item="item" index="index" collection="stationIdList"
  914. open="(" separator="," close=")">
  915. #{item}
  916. </foreach>
  917. </if>
  918. </where>
  919. GROUP BY
  920. date_format( a.created_date, '%Y-%m-%d' ),a.oil_type
  921. ) b
  922. GROUP BY b.created_date
  923. ORDER BY b.created_date desc
  924. </select>
  925. <!-- 日报折线图油品数据-->
  926. <select id="listQydata" parameterType="Long" resultMap="PayOrderResult">
  927. SELECT sum(amt) as amt,date_format(created_date,'%Y-%m-%d') as created_date
  928. from pay_order
  929. <where>
  930. <if test="stationId != null "> and station_id = #{stationId}</if>
  931. <if test="status != null and status != ''"> and status = #{status}</if>
  932. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  933. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  934. <if test="oilName != null "> and oil_name = #{oilName}</if>
  935. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  936. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  937. </if>
  938. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  939. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  940. </if>
  941. <if test="stationIdList != null ">
  942. and station_id in
  943. <foreach item="item" index="index" collection="stationIdList"
  944. open="(" separator="," close=")">
  945. #{item}
  946. </foreach>
  947. </if>
  948. </where>
  949. GROUP BY oil_name ,date_format(created_date,'%Y-%m-%d')
  950. </select>
  951. <!-- 日报折线图X轴数据-->
  952. <select id="listXdata" parameterType="Long" resultMap="PayOrderResult">
  953. SELECT date_format(created_date,'%Y-%m-%d') as created_date
  954. from pay_order
  955. <where>
  956. <if test="stationId != null "> and station_id = #{stationId}</if>
  957. <if test="status != null and status != ''"> and status = #{status}</if>
  958. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  959. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  960. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  961. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  962. </if>
  963. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  964. AND date_format(created_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  965. </if>
  966. <if test="stationIdList != null ">
  967. and station_id in
  968. <foreach item="item" index="index" collection="stationIdList"
  969. open="(" separator="," close=")">
  970. #{item}
  971. </foreach>
  972. </if>
  973. </where>
  974. GROUP BY date_format(created_date,'%Y-%m-%d')
  975. </select>
  976. <!--查询数据,根据员工汇总数据-->
  977. <select id="selectPersonnelPayOrder" parameterType="PayOrder" resultMap="PayOrderResult">
  978. 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
  979. from pay_order a
  980. <where>
  981. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  982. <if test="status != null and status != ''"> and status = #{status}</if>
  983. <if test="status == null or status == ''"> and status != 0 and status != 5 </if>
  984. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  985. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  986. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%Y-%m-%d %H:%i:%s')
  987. </if>
  988. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  989. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%Y-%m-%d %H:%i:%s')
  990. </if>
  991. <if test="stationIdList != null ">
  992. and station_id in
  993. <foreach item="item" index="index" collection="stationIdList"
  994. open="(" separator="," close=")">
  995. #{item}
  996. </foreach>
  997. </if>
  998. </where>
  999. GROUP BY a.oil_personnel
  1000. </select>
  1001. <!--按照人员下统计信息-->
  1002. <select id="listPersonnelPayOrderSum" parameterType="PayOrder" resultMap="PayOrderResult">
  1003. SELECT
  1004. SUM( amt ) AS amt,
  1005. SUM( order_liters ) AS order_liters,
  1006. SUM( order_no ) AS order_no
  1007. FROM
  1008. (
  1009. SELECT
  1010. a.oil_personnel,
  1011. GROUP_CONCAT( DISTINCT a.oil_gun ) AS oil_gun,
  1012. ROUND( SUM( a.amt ), 2 ) AS amt,
  1013. ROUND( SUM( order_liters ), 2 ) AS order_liters,
  1014. COUNT( order_no ) AS order_no
  1015. FROM
  1016. pay_order a
  1017. <where>
  1018. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  1019. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  1020. <if test="status != null and status != ''"> and status = #{status}</if>
  1021. <if test="status == null or status == ''"> and status !=0 and status != 5 </if>
  1022. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  1023. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%Y-%m-%d %H:%i:%s')
  1024. </if>
  1025. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  1026. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%Y-%m-%d %H:%i:%s')
  1027. </if>
  1028. </where>
  1029. GROUP BY a.oil_personnel ) b
  1030. </select>
  1031. <select id="listPersonnelPayOrder" parameterType="PayOrder" resultMap="PayOrderResult">
  1032. SELECT
  1033. a.oil_personnel,
  1034. GROUP_CONCAT( DISTINCT a.oil_gun ) AS oil_gun,
  1035. ROUND( SUM( a.amt ), 2 ) AS amt,
  1036. ROUND( SUM( order_liters ), 2 ) AS order_liters,
  1037. COUNT( order_no ) AS order_no
  1038. FROM
  1039. pay_order a
  1040. <where>
  1041. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  1042. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  1043. <if test="status != null and status != ''"> and status = #{status}</if>
  1044. <if test="status == null or status == ''"> and status !=0 and status != 5 </if>
  1045. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  1046. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%Y-%m-%d %H:%i:%s')
  1047. </if>
  1048. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  1049. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%Y-%m-%d %H:%i:%s')
  1050. </if>
  1051. </where>
  1052. GROUP BY a.oil_personnel
  1053. </select>
  1054. <select id="listPayTypeOrder" parameterType="PayOrder" resultMap="PayOrderResult">
  1055. SELECT
  1056. a.pay_type,
  1057. GROUP_CONCAT( DISTINCT a.oil_gun ) AS oil_gun,
  1058. ROUND( SUM( a.amt ), 2 ) AS amt,
  1059. ROUND( SUM( order_liters ), 2 ) AS order_liters,
  1060. COUNT( order_no ) AS order_no
  1061. FROM
  1062. pay_order a
  1063. <where>
  1064. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  1065. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  1066. <if test="status != null and status != ''"> and status = #{status}</if>
  1067. <if test="status == null or status == ''"> and status !=0 and status != 5 </if>
  1068. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  1069. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%Y-%m-%d %H:%i:%s')
  1070. </if>
  1071. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  1072. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%Y-%m-%d %H:%i:%s')
  1073. </if>
  1074. </where>
  1075. GROUP BY a.pay_type
  1076. </select>
  1077. <!--查询班结的合计数据值-->
  1078. <select id="selectSummyClassPayOrder" parameterType="PayOrder" resultMap="PayOrderResult">
  1079. SELECT
  1080. s.station_id,
  1081. d.dept_name as station_name,
  1082. count( order_no ) AS num,
  1083. sum( order_liters ) AS order_liters,
  1084. sum( receivable_amt ) AS receivable_amt,
  1085. sum( amt ) AS amt,
  1086. sum( print_count ) AS print_num,
  1087. sum( wx_amt ) AS wx_amt,
  1088. sum( zfb_amt ) AS zfb_amt,
  1089. sum( dzk_amt ) AS dzk_amt,
  1090. sum( discount_amt ) AS discount_amt,
  1091. SUM( pos_amt ) AS pos_amt,
  1092. sum( xj_amt ) AS xj_amt
  1093. FROM
  1094. pay_order s left join sys_dept d on s.station_id=d.dept_id
  1095. <where>
  1096. <if test="stationId != null and stationId != ''"> and s.station_id = #{stationId}</if>
  1097. <if test="orderType != null and orderType != ''"> and s.order_type = #{orderType}</if>
  1098. <if test="status != null and status != ''"> and s.status = #{status}</if>
  1099. <if test="status == null or status == ''"> and s.status !=0 and s.status != 5 </if>
  1100. <if test="refundSelectFalg != 1 ">
  1101. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  1102. AND date_format(s.pay_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  1103. </if>
  1104. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  1105. AND date_format(s.pay_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  1106. </if>
  1107. </if>
  1108. <if test="refundSelectFalg == 1 ">
  1109. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  1110. AND date_format(s.refund_success_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
  1111. </if>
  1112. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  1113. AND date_format(s.refund_success_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
  1114. </if>
  1115. </if>
  1116. </where>
  1117. GROUP BY station_id,d.dept_name
  1118. </select>
  1119. <!--按照油品信息获取分类当前班结的订单-->
  1120. <select id="listOilPayOrder" parameterType="PayOrder" resultMap="PayOrderResult">
  1121. SELECT
  1122. a.station_id,
  1123. a.oil_name,
  1124. GROUP_CONCAT( DISTINCT oil_gun ) AS oil_gun,
  1125. ROUND( SUM( a.amt ), 2 ) AS amt,
  1126. ROUND( SUM( a.receivable_amt ), 2 ) AS receivable_amt,
  1127. ROUND( SUM( a.received_amt ), 2 ) AS received_amt,
  1128. ROUND( SUM( order_liters ), 2 ) AS order_liters,
  1129. ROUND( SUM( a.discount_amt ), 2 ) AS discount_amt,
  1130. COUNT( order_no ) AS order_no,
  1131. sum( a.print_count) print_num
  1132. FROM
  1133. pay_order a
  1134. <where>
  1135. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  1136. <if test="status != null and status != ''"> and status = #{status}</if>
  1137. <if test="status == null or status == ''"> and status !=0 and status != 5 </if>
  1138. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  1139. AND date_format(a.pay_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%y-%m-%d %H:%i:%s')
  1140. </if>
  1141. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  1142. AND date_format(a.pay_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%y-%m-%d %H:%i:%s')
  1143. </if>
  1144. </where>
  1145. GROUP BY a.oil_name,a.station_id
  1146. </select>
  1147. <select id="listOilPayOrderSum" parameterType="PayOrder" resultMap="PayOrderResult">
  1148. SELECT SUM(amt) as amt,SUM(amt) as amt,SUM(order_liters) as order_liters,sum(order_no) as order_no
  1149. from
  1150. ( SELECT
  1151. a.station_id,
  1152. a.oil_name,
  1153. GROUP_CONCAT( DISTINCT oil_gun ) AS oil_gun,
  1154. ROUND( SUM( a.amt ), 2 ) AS amt,
  1155. ROUND( SUM( a.receivable_amt ), 2 ) AS receivable_amt,
  1156. ROUND( SUM( a.received_amt ), 2 ) AS received_amt,
  1157. ROUND( SUM( order_liters ), 2 ) AS order_liters,
  1158. ROUND( SUM( a.discount_amt ), 2 ) AS discount_amt,
  1159. COUNT( order_no ) AS order_no,
  1160. sum( a.print_count) print_num
  1161. FROM
  1162. pay_order a
  1163. <where>
  1164. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  1165. <if test="status != null and status != ''"> and status = #{status}</if>
  1166. <if test="status == null or status == ''"> and status !=0 and status != 5 </if>
  1167. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  1168. AND date_format(a.pay_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%y-%m-%d %H:%i:%s')
  1169. </if>
  1170. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  1171. AND date_format(a.pay_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%y-%m-%d %H:%i:%s')
  1172. </if>
  1173. </where>
  1174. GROUP BY a.oil_name,a.station_id)c
  1175. </select>
  1176. <!--初始化数据班结数据,根据油品汇总 -->
  1177. <select id="selectOilStructure" parameterType="Long" resultMap="PayOrderResult">
  1178. 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
  1179. from pay_order a
  1180. <where>
  1181. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  1182. <if test="status != null and status != ''"> and status = #{status}</if>
  1183. <if test="status == null or status == ''"> and status !=0 and status != 5 </if>
  1184. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  1185. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  1186. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
  1187. </if>
  1188. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  1189. AND date_format(pay_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
  1190. </if>
  1191. </where>
  1192. GROUP BY a.oil_name
  1193. </select>
  1194. <!--初始化数据班结数据,根据员工/支付方式汇总 -->
  1195. <select id="selectPersonnelPayStructure" parameterType="Long" resultMap="PayOrderResult">
  1196. SELECT
  1197. oil_personnel,
  1198. GROUP_CONCAT( DISTINCT oil_gun ) oil_gun,
  1199. count( wx_amt ) wx_num,
  1200. count( zfb_amt ) zfb_num,
  1201. count( xj_amt ) xj_num,
  1202. sum( discount_amt ) discount_amt,
  1203. SUM( discount_coupon_amt ) discount_coupon_amt,
  1204. SUM( wx_amt ) wx_amt,
  1205. SUM( zfb_amt ) zfb_amt,
  1206. SUM( xj_amt ) xj_amt,
  1207. sum( member_amt ) member_amt,
  1208. sum( dzk_amt ) dzk_amt,
  1209. count( dzk_amt ) dzk_num ,
  1210. user_name,
  1211. sum(amt) amt
  1212. FROM
  1213. pay_order a left join sys_user b on a.refund_user=b.user_id
  1214. <where>
  1215. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  1216. <if test="status != null and status != ''"> and a.status = #{status}</if>
  1217. <if test="status == null or status == ''"> and a.status !=0 and a.status != 5 </if>
  1218. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  1219. <if test="refundSelectFalg != 1">
  1220. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  1221. AND date_format(a.pay_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%Y-%m-%d %H:%i:%s')
  1222. </if>
  1223. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  1224. AND date_format(a.pay_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%Y-%m-%d %H:%i:%s')
  1225. </if>
  1226. </if>
  1227. <if test="refundSelectFalg == 1">
  1228. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  1229. AND date_format(a.refund_success_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%Y-%m-%d %H:%i:%s')
  1230. </if>
  1231. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  1232. AND date_format(a.refund_success_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%Y-%m-%d %H:%i:%s')
  1233. </if>
  1234. </if>
  1235. </where>
  1236. GROUP BY a.oil_personnel,b.user_name
  1237. </select>
  1238. <!--按照支付方式进行求和操作-->
  1239. <select id="selectPersonnelPayStructureSum" parameterType="Long" resultMap="PayOrderResult">
  1240. SELECT GROUP_CONCAT(DISTINCT oil_gun) oil_gun,
  1241. sum(discount_amt) discount_amt,
  1242. SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,sum(dzk_amt) dzk_amt,
  1243. SUM(xj_amt) xj_amt,sum(dzk_amt) dzk_amt,
  1244. sum(e.xj_num) xj_num,sum(e.zfb_num) zfb_num,sum(e.wx_num) wx_num,sum(e.dzk_num) dzk_num
  1245. from (
  1246. SELECT
  1247. oil_personnel,
  1248. GROUP_CONCAT( DISTINCT oil_gun ) oil_gun,
  1249. count( wx_amt ) wx_num,
  1250. count( zfb_amt ) zfb_num,
  1251. count( xj_amt ) xj_num,
  1252. sum( discount_amt ) discount_amt,
  1253. SUM( discount_coupon_amt ) discount_coupon_amt,
  1254. SUM( wx_amt ) wx_amt,
  1255. SUM( zfb_amt ) zfb_amt,
  1256. SUM( xj_amt ) xj_amt,
  1257. sum( member_amt ) member_amt,
  1258. sum( dzk_amt ) dzk_amt,
  1259. count( dzk_amt ) dzk_num ,
  1260. user_name,
  1261. sum(amt) amt
  1262. FROM
  1263. pay_order a left join sys_user b on a.refund_user=b.user_id
  1264. <where>
  1265. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  1266. <if test="status != null and status != ''"> and a.status = #{status}</if>
  1267. <if test="status == null or status == ''"> and a.status !=0 and a.status != 5 </if>
  1268. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  1269. <if test="refundSelectFalg != 1">
  1270. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  1271. AND date_format(a.pay_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%Y-%m-%d %H:%i:%s')
  1272. </if>
  1273. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  1274. AND date_format(a.pay_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%Y-%m-%d %H:%i:%s')
  1275. </if>
  1276. </if>
  1277. <if test="refundSelectFalg == 1">
  1278. <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
  1279. AND date_format(a.refund_success_date,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{startDate},'%Y-%m-%d %H:%i:%s')
  1280. </if>
  1281. <if test="endDate != null and endDate != ''"><!-- 结束时间检索 -->
  1282. AND date_format(a.refund_success_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endDate},'%Y-%m-%d %H:%i:%s')
  1283. </if>
  1284. </if>
  1285. </where>
  1286. GROUP BY a.oil_personnel,b.user_name) e
  1287. </select>
  1288. <!--查询本站第一笔数据-->
  1289. <select id="getPayOrderInfoMin" parameterType="Long" resultMap="PayOrderResult">
  1290. SELECT * from pay_order where order_id = (
  1291. SELECT min(order_id)
  1292. from pay_order
  1293. <where>
  1294. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  1295. <if test="stationId != null "> and station_id = #{stationId}</if>
  1296. <if test="status != null and status != ''"> and status = #{status}</if>
  1297. <if test="status == null or status == ''"> and status !=0 and status != 5 </if>
  1298. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  1299. </where>
  1300. )
  1301. </select>
  1302. <insert id="insertPayOrder" parameterType="PayOrder" useGeneratedKeys="true" keyProperty="orderId">
  1303. insert into pay_order
  1304. <trim prefix="(" suffix=")" suffixOverrides=",">
  1305. <if test="orderNo != null">order_no,</if>
  1306. <if test="stationId != null">station_id,</if>
  1307. <if test="status != null">status,</if>
  1308. <if test="consumerId != null">consumer_id,</if>
  1309. <if test="consumer != null">consumer,</if>
  1310. <if test="oilGun != null">oil_gun,</if>
  1311. <if test="oilName != null">oil_name,</if>
  1312. <if test="oilPirce != null">oil_pirce,</if>
  1313. <if test="oilType != null">oil_type,</if>
  1314. <if test="orderLiters != null">order_liters,</if>
  1315. <if test="amt != null">amt,</if>
  1316. <if test="receivableAmt != null">receivable_amt,</if>
  1317. <if test="receivedAmt != null">received_amt,</if>
  1318. <if test="discountAmt != null">discount_amt,</if>
  1319. <if test="discountCouponAmt != null">discount_coupon_amt,</if>
  1320. <if test="discountCoupon != null">discount_coupon,</if>
  1321. <if test="wxAmt != null">wx_amt,</if>
  1322. <if test="zfbAmt != null">zfb_amt,</if>
  1323. <if test="posAmt != null">pos_amt,</if>
  1324. <if test="xjAmt != null">xj_amt,</if>
  1325. <if test="didiAppAmt != null">didi_app_amt,</if>
  1326. <if test="tyAppAmt != null">ty_app_amt,</if>
  1327. <if test="otherAmt != null">other_amt,</if>
  1328. <if test="dzkAmt != null">dzk_amt,</if>
  1329. <if test="score != null">score,</if>
  1330. <if test="memberNo != null">member_no,</if>
  1331. <if test="memberAmt != null">member_amt,</if>
  1332. <if test="printCount != null">print_count,</if>
  1333. <if test="payType != null">pay_type,</if>
  1334. <if test="payWay != null">pay_way,</if>
  1335. <if test="oilPersonnel != null">oil_personnel,</if>
  1336. <if test="payDate != null">pay_date,</if>
  1337. <if test="createdDate != null">created_date,</if>
  1338. <if test="orderType != null">order_type,</if>
  1339. <if test="carNo != null">car_no,</if>
  1340. <if test="customerPhone != null">customer_phone,</if>
  1341. <if test="customerGrade != null">customer_grade,</if>
  1342. <if test="refundUser != null">refund_user,</if>
  1343. <if test="refundDate != null">refund_date,</if>
  1344. <if test="examinUser != null">examin_user,</if>
  1345. <if test="examinDate != null">examin_date,</if>
  1346. <if test="examinStatus != null">examin_status,</if>
  1347. <if test="refundSuccessDate != null">refund_success_date,</if>
  1348. </trim>
  1349. <trim prefix="values (" suffix=")" suffixOverrides=",">
  1350. <if test="orderNo != null">#{orderNo},</if>
  1351. <if test="stationId != null">#{stationId},</if>
  1352. <if test="status != null">#{status},</if>
  1353. <if test="consumerId != null">#{consumerId},</if>
  1354. <if test="consumer != null">#{consumer},</if>
  1355. <if test="oilGun != null">#{oilGun},</if>
  1356. <if test="oilName != null">#{oilName},</if>
  1357. <if test="oilPirce != null">#{oilPirce},</if>
  1358. <if test="oilType != null">#{oilType},</if>
  1359. <if test="orderLiters != null">#{orderLiters},</if>
  1360. <if test="amt != null">#{amt},</if>
  1361. <if test="receivableAmt != null">#{receivableAmt},</if>
  1362. <if test="receivedAmt != null">#{receivedAmt},</if>
  1363. <if test="discountAmt != null">#{discountAmt},</if>
  1364. <if test="discountCouponAmt != null">#{discountCouponAmt},</if>
  1365. <if test="discountCoupon != null">#{discountCoupon},</if>
  1366. <if test="wxAmt != null">#{wxAmt},</if>
  1367. <if test="zfbAmt != null">#{zfbAmt},</if>
  1368. <if test="posAmt != null">#{posAmt},</if>
  1369. <if test="xjAmt != null">#{xjAmt},</if>
  1370. <if test="didiAppAmt != null">#{didiAppAmt},</if>
  1371. <if test="tyAppAmt != null">#{tyAppAmt},</if>
  1372. <if test="otherAmt != null">#{otherAmt},</if>
  1373. <if test="dzkAmt != null">#{dzkAmt},</if>
  1374. <if test="score != null">#{score},</if>
  1375. <if test="memberNo != null">#{memberNo},</if>
  1376. <if test="memberAmt != null">#{memberAmt},</if>
  1377. <if test="printCount != null">#{printCount},</if>
  1378. <if test="payType != null">#{payType},</if>
  1379. <if test="payWay != null">#{payWay},</if>
  1380. <if test="oilPersonnel != null">#{oilPersonnel},</if>
  1381. <if test="payDate != null">#{payDate},</if>
  1382. <if test="createdDate != null">#{createdDate},</if>
  1383. <if test="orderType != null">#{orderType},</if>
  1384. <if test="carNo != null">#{carNo},</if>
  1385. <if test="customerPhone != null">#{customerPhone},</if>
  1386. <if test="customerGrade != null">#{customerGrade},</if>
  1387. <if test="refundUser != null">#{refundUser},</if>
  1388. <if test="refundDate != null">#{refundDate},</if>
  1389. <if test="examinUser != null">#{examinUser},</if>
  1390. <if test="examinDate != null">#{examinDate},</if>
  1391. <if test="examinStatus != null">#{examinStatus},</if>
  1392. <if test="refundSuccessDate != null">#{refundSuccessDate},</if>
  1393. </trim>
  1394. </insert>
  1395. <update id="updatePayOrder" parameterType="PayOrder">
  1396. update pay_order
  1397. <trim prefix="SET" suffixOverrides=",">
  1398. <if test="orderNo != null">order_no = #{orderNo},</if>
  1399. <if test="stationId != null">station_id = #{stationId},</if>
  1400. <if test="status != null">status = #{status},</if>
  1401. <if test="consumerId != null">consumer_id = #{consumerId},</if>
  1402. <if test="consumer != null">consumer = #{consumer},</if>
  1403. <if test="oilGun != null">oil_gun = #{oilGun},</if>
  1404. <if test="oilName != null">oil_name = #{oilName},</if>
  1405. <if test="oilPirce != null">oil_pirce = #{oilPirce},</if>
  1406. <if test="oilType != null">oil_type = #{oilType},</if>
  1407. <if test="orderLiters != null">order_liters = #{orderLiters},</if>
  1408. <if test="amt != null">amt = #{amt},</if>
  1409. <if test="receivableAmt != null">receivable_amt = #{receivableAmt},</if>
  1410. <if test="receivedAmt != null">received_amt = #{receivedAmt},</if>
  1411. <if test="discountAmt != null">discount_amt = #{discountAmt},</if>
  1412. <if test="discountCouponAmt != null">discount_coupon_amt = #{discountCouponAmt},</if>
  1413. <if test="discountCoupon != null">discount_coupon = #{discountCoupon},</if>
  1414. <if test="wxAmt != null">wx_amt = #{wxAmt},</if>
  1415. <if test="zfbAmt != null">zfb_amt = #{zfbAmt},</if>
  1416. <if test="posAmt != null">pos_amt = #{posAmt},</if>
  1417. <if test="xjAmt != null">xj_amt = #{xjAmt},</if>
  1418. <if test="didiAppAmt != null">didi_app_amt = #{didiAppAmt},</if>
  1419. <if test="tyAppAmt != null">ty_app_amt = #{tyAppAmt},</if>
  1420. <if test="otherAmt != null">other_amt = #{otherAmt},</if>
  1421. <if test="dzkAmt != null">dzk_amt = #{dzkAmt},</if>
  1422. <if test="score != null">score = #{score},</if>
  1423. <if test="memberNo != null">member_no = #{memberNo},</if>
  1424. <if test="memberAmt != null">member_amt = #{memberAmt},</if>
  1425. <if test="printCount != null">print_count = #{printCount},</if>
  1426. <if test="payType != null">pay_type = #{payType},</if>
  1427. <if test="payWay != null">pay_way = #{payWay},</if>
  1428. <if test="oilPersonnel != null">oil_personnel = #{oilPersonnel},</if>
  1429. <if test="payDate != null">pay_date = #{payDate},</if>
  1430. <if test="createdDate != null">created_date = #{createdDate},</if>
  1431. <if test="orderType != null">order_type = #{orderType},</if>
  1432. <if test="carNo != null">car_no = #{carNo},</if>
  1433. <if test="customerPhone != null">customer_phone = #{customerPhone},</if>
  1434. <if test="customerGrade != null">customer_grade = #{customerGrade},</if>
  1435. <if test="refundUser != null">refund_user = #{refundUser},</if>
  1436. <if test="refundDate != null">refund_date = #{refundDate},</if>
  1437. <if test="examinUser != null">examin_user = #{examinUser},</if>
  1438. <if test="examinDate != null">examin_date = #{examinDate},</if>
  1439. <if test="examinStatus != null">examin_status = #{examinStatus},</if>
  1440. <if test="refundSuccessDate != null">refund_success_date = #{refundSuccessDate},</if>
  1441. </trim>
  1442. where order_id = #{orderId}
  1443. </update>
  1444. <delete id="deletePayOrderById" parameterType="Long">
  1445. delete from pay_order where order_id = #{orderId}
  1446. </delete>
  1447. <delete id="deletePayOrderByIds" parameterType="String">
  1448. delete from pay_order where order_id in
  1449. <foreach item="orderId" collection="array" open="(" separator="," close=")">
  1450. #{orderId}
  1451. </foreach>
  1452. </delete>
  1453. </mapper>