PayOrderMapper.xml 89 KB

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