PayOrderMapper.xml 89 KB

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