StationClassStructureMapper.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  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.StationClassStructureMapper">
  6. <resultMap type="StationClassStructure" id="StationClassStructureResult">
  7. <result property="id" column="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="oilGun" column="oil_gun" />
  12. <result property="oilName" column="oil_name" />
  13. <result property="oilPirce" column="oil_pirce" />
  14. <result property="oilType" column="oil_type" />
  15. <result property="consumerId" column="consumer_id" />
  16. <result property="consumer" column="consumer" />
  17. <result property="amt" column="amt" />
  18. <result property="orderLiters" column="order_liters" />
  19. <result property="payType" column="pay_type" />
  20. <result property="payWay" column="pay_way" />
  21. <result property="payDate" column="pay_date" />
  22. <result property="oilPersonnel" column="oil_personnel" />
  23. <result property="orderType" column="order_type" />
  24. <result property="printNum" column="print_num" />
  25. <result property="classStructureNo" column="class_structure_no" />
  26. <result property="classStartDate" column="class_start_date" />
  27. <result property="classStructureDate" column="class_structure_date" />
  28. <result property="classStructureMan" column="class_structure_man" />
  29. <result property="oils" column="oils" />
  30. <result property="receivableAmt" column="receivable_amt" />
  31. <result property="receivedAmt" column="received_amt" />
  32. <result property="discountAmt" column="discount_amt" />
  33. <result property="discountCouponAmt" column="discount_coupon_amt" />
  34. <result property="discountCoupon" column="discount_coupon" />
  35. <result property="wxAmt" column="wx_amt" />
  36. <result property="zfbAmt" column="zfb_amt" />
  37. <result property="posAmt" column="pos_amt" />
  38. <result property="xjAmt" column="xj_amt" />
  39. <result property="didiAppAmt" column="didi_app_amt" />
  40. <result property="tyAppAmt" column="ty_app_amt" />
  41. <result property="otherAmt" column="other_amt" />
  42. <result property="dzkAmt" column="dzk_amt" />
  43. <result property="score" column="score" />
  44. <result property="memberNo" column="member_no" />
  45. <result property="memberAmt" column="member_amt" />
  46. <result property="carNo" column="car_no" />
  47. <result property="customerPhone" column="customer_phone" />
  48. <result property="customerGrade" column="customer_grade" />
  49. <result property="num" column="num" />
  50. <result property="wxNum" column="wx_num" />
  51. <result property="zfbNum" column="zfb_num" />
  52. <result property="xjNum" column="xj_num" />
  53. </resultMap>
  54. <sql id="selectStationClassStructureVo">
  55. select id, order_no, station_id, station_name, oil_gun, oil_name, oil_pirce, oil_type, consumer_id, consumer, amt, order_liters, pay_type, pay_way, pay_date, oil_personnel, order_type, print_num, class_structure_no, class_start_date, class_structure_date, class_structure_man, oils, receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_no, member_amt, car_no, customer_phone, customer_grade from station_class_structure
  56. </sql>
  57. <select id="selectStationClassStructureList" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  58. <include refid="selectStationClassStructureVo"/>
  59. <where>
  60. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  61. <if test="stationId != null "> and station_id = #{stationId}</if>
  62. <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
  63. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  64. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  65. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  66. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  67. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  68. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  69. <if test="amt != null "> and amt = #{amt}</if>
  70. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  71. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  72. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  73. <if test="payDate != null "> and pay_date = #{payDate}</if>
  74. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  75. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  76. <if test="printNum != null "> and print_num = #{printNum}</if>
  77. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  78. <if test="classStartDate != null "> and class_start_date = #{classStartDate}</if>
  79. <if test="classStructureDate != null "> and class_structure_date = #{classStructureDate}</if>
  80. <if test="classStructureMan != null and classStructureMan != ''"> and class_structure_man = #{classStructureMan}</if>
  81. <if test="oils != null and oils != ''"> and oils = #{oils}</if>
  82. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  83. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  84. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  85. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  86. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  87. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  88. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  89. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  90. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  91. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  92. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  93. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  94. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  95. <if test="score != null "> and score = #{score}</if>
  96. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  97. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  98. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  99. <if test="customerPhone != null and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
  100. <if test="customerGrade != null and customerGrade != ''"> and customer_grade = #{customerGrade}</if>
  101. </where>
  102. order by id desc
  103. </select>
  104. <select id="listPersonnelStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  105. 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
  106. from station_class_structure a
  107. <where>
  108. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  109. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  110. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  111. </where>
  112. GROUP BY a.oil_personnel
  113. </select>
  114. <select id="listOilStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  115. SELECT a.station_id, a.oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(a.receivable_amt),2) as receivable_amt,ROUND(SUM(a.received_amt),2) as received_amt,ROUND(SUM(order_liters),2) as order_liters,ROUND(SUM(a.discount_amt),2) as discount_amt ,COUNT(order_no) as order_no,a.class_start_date,a.class_structure_date,a.class_structure_man,sum(a.print_num) print_num
  116. from station_class_structure a
  117. <where>
  118. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  119. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  120. </where>
  121. GROUP BY a.oil_name,a.station_id,a.class_start_date,a.class_structure_date,a.class_structure_man
  122. </select>
  123. <select id="selectStationClassStructureMax" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  124. select id, station_id, order_no, oil_gun, oil_name, consumer_id, consumer, amt, station_name, order_liters, pay_type, pay_way, pay_date, oil_personnel, order_type, oil_type, print_num, class_structure_no, class_structure_date, class_structure_man, oils
  125. from station_class_structure
  126. where id = (
  127. SELECT MAX(id) from station_class_structure
  128. <where>
  129. <if test="stationId != null "> and station_id = #{stationId}</if>
  130. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  131. </where>
  132. )
  133. </select>
  134. <select id="selectStationClassStructureById" parameterType="Long" resultMap="StationClassStructureResult">
  135. <include refid="selectStationClassStructureVo"/>
  136. where id = #{id}
  137. </select>
  138. <select id="selectDistnctClassStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  139. select count(DISTINCT class_structure_no) as num
  140. from station_class_structure
  141. <where>
  142. <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
  143. <if test="likeClassStructureNo != null and likeClassStructureNo != ''"> and class_structure_no like concat( #{likeClassStructureNo}, '%') </if>
  144. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  145. </where>
  146. </select>
  147. <!--根据班次号汇总班结数据-->
  148. <select id="selectSummyClassStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  149. select class_structure_no,class_start_date,class_structure_date,station_id,station_name,count(order_no) as num,
  150. sum(order_liters) as order_liters,sum(receivable_amt) as receivable_amt,sum(amt) as amt,class_structure_man,
  151. sum(print_num) as print_num,sum(wx_amt) as wx_amt,sum(zfb_amt) as zfb_amt,
  152. sum(dzk_amt) as dzk_amt,sum(discount_amt) as discount_amt,SUM(pos_amt) as pos_amt,sum(xj_amt) as xj_amt
  153. from station_class_structure
  154. <where>
  155. <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
  156. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  157. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  158. </where>
  159. GROUP BY class_structure_no,class_start_date,station_id,station_name,class_structure_date,class_structure_man
  160. </select>
  161. <!--按员工/支付方式汇总数据-->
  162. <!-- SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,count(wx_amt) wx_num,count(zfb_amt) zfb_num,count(xj_amt) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt-->
  163. <!-- from station_class_structure-->
  164. <!-- <where>-->
  165. <!-- <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>-->
  166. <!-- <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>-->
  167. <!-- <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>-->
  168. <!-- </where>-->
  169. <!-- GROUP BY oil_personnel-->
  170. <select id="listPersonnelPayStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  171. SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,
  172. sum(discount_amt) discount_amt,
  173. SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,
  174. SUM(xj_amt) xj_amt,sum(member_amt) member_amt,
  175. (SELECT COUNT(b.order_no) from station_class_structure b
  176. <where>
  177. and b.pay_type="xj"
  178. <if test="classStructureNo != null and classStructureNo != ''"> and b.class_structure_no = #{classStructureNo}</if>
  179. </where>
  180. ) xj_num,
  181. (SELECT COUNT(c.order_no) from station_class_structure c
  182. <where>
  183. and c.pay_type="zfb"
  184. <if test="classStructureNo != null and classStructureNo != ''"> and c.class_structure_no = #{classStructureNo}</if>
  185. </where>
  186. ) zfb_num,
  187. (SELECT COUNT(d.order_no) from station_class_structure d
  188. <where>
  189. and d.pay_type="wx"
  190. <if test="classStructureNo != null and classStructureNo != ''"> and d.class_structure_no = #{classStructureNo}</if>
  191. </where>
  192. ) wx_num
  193. from station_class_structure a
  194. <where>
  195. <if test="classStructureNo != null and classStructureNo != ''"> and a.class_structure_no = #{classStructureNo}</if>
  196. </where>
  197. GROUP BY a.oil_personnel
  198. </select>
  199. <select id="listClass" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  200. SELECT * from
  201. station_class_structure
  202. where id =(SELECT max(id) from station_class_structure
  203. <where>
  204. <if test="classStructureMan != null and classStructureMan != ''"> and class_structure_man = #{classStructureMan}</if>
  205. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  206. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  207. </where>
  208. )
  209. </select>
  210. <!--根据支付方式汇总数据-->
  211. <select id="listPayStructure" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  212. SELECT dict_label as pay_type,sum(order_liters) as order_liters,sum(discount_amt) as discount_amt,count(order_no) order_no,sum(amt) as amt,sum(receivable_amt) as receivable_amt,sum(received_amt) as received_amt
  213. from station_class_structure left JOIN sys_dict_data on dict_value = pay_type and dict_type ='pay_type'
  214. <where>
  215. <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
  216. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  217. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  218. </where>
  219. GROUP BY pay_type,dict_label
  220. </select>
  221. <!-- 根据支付方式汇总数据-->
  222. <select id="listOilStructureSum" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  223. SELECT SUM(amt) as amt,SUM(amt) as amt,SUM(order_liters) as order_liters,sum(order_no) as order_no
  224. from (SELECT a.station_id, a.oil_name,GROUP_CONCAT(DISTINCT oil_gun) as oil_gun,ROUND(SUM(a.amt),2) as amt,ROUND(SUM(a.receivable_amt),2) as receivable_amt,ROUND(SUM(a.received_amt),2) as received_amt,ROUND(SUM(order_liters),2) as order_liters,ROUND(SUM(a.discount_amt),2) as discount_amt ,COUNT(order_no) as order_no,a.class_start_date,a.class_structure_date,a.class_structure_man,sum(a.print_num) print_num
  225. from station_class_structure a
  226. <where>
  227. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  228. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  229. </where>
  230. GROUP BY a.oil_name,a.station_id,a.class_start_date,a.class_structure_date,a.class_structure_man) c
  231. </select>
  232. <!--按员工/支付方式汇总数据-->
  233. <select id="listPersonnelPayStructureSum" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  234. SELECT sum(wx_num) wx_num,sum(zfb_num) zfb_num,sum(xj_num) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt
  235. from (SELECT oil_personnel,GROUP_CONCAT(DISTINCT oil_gun) oil_gun,count(wx_amt) wx_num,count(zfb_amt) zfb_num,count(xj_amt) xj_num,sum(discount_amt) discount_amt,SUM(discount_coupon_amt) discount_coupon_amt,SUM(wx_amt) wx_amt,SUM(zfb_amt) zfb_amt,SUM(xj_amt) xj_amt,sum(member_amt) member_amt
  236. from station_class_structure
  237. <where>
  238. <if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
  239. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  240. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  241. </where>
  242. GROUP BY oil_personnel) a
  243. </select>
  244. <select id="listPersonnelStructureSum" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  245. SELECT SUM(amt) as amt,SUM(order_liters) as order_liters,SUM(order_no) as order_no
  246. from ( 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
  247. from station_class_structure a
  248. <where>
  249. <if test="stationId != null "> and a.station_id = #{stationId}</if>
  250. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  251. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  252. </where>
  253. GROUP BY a.oil_personnel ) b
  254. </select>
  255. <select id="selectStationClassStructureExport" parameterType="StationClassStructure" resultMap="StationClassStructureResult">
  256. <include refid="selectStationClassStructureVo"/>
  257. <where>
  258. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  259. <if test="stationId != null "> and station_id = #{stationId}</if>
  260. <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
  261. <if test="oilGun != null and oilGun != ''"> and oil_gun = #{oilGun}</if>
  262. <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
  263. <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
  264. <if test="oilType != null and oilType != ''"> and oil_type = #{oilType}</if>
  265. <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
  266. <if test="consumer != null and consumer != ''"> and consumer = #{consumer}</if>
  267. <if test="amt != null "> and amt = #{amt}</if>
  268. <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
  269. <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
  270. <if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
  271. <if test="payDate != null "> and pay_date = #{payDate}</if>
  272. <if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
  273. <if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
  274. <if test="printNum != null "> and print_num = #{printNum}</if>
  275. <if test="classStructureNo != null and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
  276. <if test="classStartDate != null "> and class_start_date = #{classStartDate}</if>
  277. <if test="classStructureDate != null "> and class_structure_date = #{classStructureDate}</if>
  278. <if test="classStructureMan != null and classStructureMan != ''"> and class_structure_man = #{classStructureMan}</if>
  279. <if test="oils != null and oils != ''"> and oils = #{oils}</if>
  280. <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
  281. <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
  282. <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
  283. <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
  284. <if test="discountCoupon != null and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
  285. <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
  286. <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
  287. <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
  288. <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
  289. <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
  290. <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
  291. <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
  292. <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
  293. <if test="score != null "> and score = #{score}</if>
  294. <if test="memberNo != null and memberNo != ''"> and member_no = #{memberNo}</if>
  295. <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
  296. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  297. <if test="customerPhone != null and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
  298. </where>
  299. order by id desc
  300. </select>
  301. <insert id="insertStationClassStructure" parameterType="StationClassStructure" useGeneratedKeys="true" keyProperty="id">
  302. insert into station_class_structure
  303. <trim prefix="(" suffix=")" suffixOverrides=",">
  304. <if test="orderNo != null">order_no,</if>
  305. <if test="stationId != null">station_id,</if>
  306. <if test="stationName != null">station_name,</if>
  307. <if test="oilGun != null">oil_gun,</if>
  308. <if test="oilName != null">oil_name,</if>
  309. <if test="oilPirce != null">oil_pirce,</if>
  310. <if test="oilType != null">oil_type,</if>
  311. <if test="consumerId != null">consumer_id,</if>
  312. <if test="consumer != null">consumer,</if>
  313. <if test="amt != null">amt,</if>
  314. <if test="orderLiters != null">order_liters,</if>
  315. <if test="payType != null">pay_type,</if>
  316. <if test="payWay != null">pay_way,</if>
  317. <if test="payDate != null">pay_date,</if>
  318. <if test="oilPersonnel != null">oil_personnel,</if>
  319. <if test="orderType != null">order_type,</if>
  320. <if test="printNum != null">print_num,</if>
  321. <if test="classStructureNo != null">class_structure_no,</if>
  322. <if test="classStartDate != null">class_start_date,</if>
  323. <if test="classStructureDate != null">class_structure_date,</if>
  324. <if test="classStructureMan != null">class_structure_man,</if>
  325. <if test="oils != null">oils,</if>
  326. <if test="receivableAmt != null">receivable_amt,</if>
  327. <if test="receivedAmt != null">received_amt,</if>
  328. <if test="discountAmt != null">discount_amt,</if>
  329. <if test="discountCouponAmt != null">discount_coupon_amt,</if>
  330. <if test="discountCoupon != null">discount_coupon,</if>
  331. <if test="wxAmt != null">wx_amt,</if>
  332. <if test="zfbAmt != null">zfb_amt,</if>
  333. <if test="posAmt != null">pos_amt,</if>
  334. <if test="xjAmt != null">xj_amt,</if>
  335. <if test="didiAppAmt != null">didi_app_amt,</if>
  336. <if test="tyAppAmt != null">ty_app_amt,</if>
  337. <if test="otherAmt != null">other_amt,</if>
  338. <if test="dzkAmt != null">dzk_amt,</if>
  339. <if test="score != null">score,</if>
  340. <if test="memberNo != null">member_no,</if>
  341. <if test="memberAmt != null">member_amt,</if>
  342. <if test="carNo != null">car_no,</if>
  343. <if test="customerPhone != null">customer_phone,</if>
  344. <if test="customerGrade != null">customer_grade,</if>
  345. </trim>
  346. <trim prefix="values (" suffix=")" suffixOverrides=",">
  347. <if test="orderNo != null">#{orderNo},</if>
  348. <if test="stationId != null">#{stationId},</if>
  349. <if test="stationName != null">#{stationName},</if>
  350. <if test="oilGun != null">#{oilGun},</if>
  351. <if test="oilName != null">#{oilName},</if>
  352. <if test="oilPirce != null">#{oilPirce},</if>
  353. <if test="oilType != null">#{oilType},</if>
  354. <if test="consumerId != null">#{consumerId},</if>
  355. <if test="consumer != null">#{consumer},</if>
  356. <if test="amt != null">#{amt},</if>
  357. <if test="orderLiters != null">#{orderLiters},</if>
  358. <if test="payType != null">#{payType},</if>
  359. <if test="payWay != null">#{payWay},</if>
  360. <if test="payDate != null">#{payDate},</if>
  361. <if test="oilPersonnel != null">#{oilPersonnel},</if>
  362. <if test="orderType != null">#{orderType},</if>
  363. <if test="printNum != null">#{printNum},</if>
  364. <if test="classStructureNo != null">#{classStructureNo},</if>
  365. <if test="classStartDate != null">#{classStartDate},</if>
  366. <if test="classStructureDate != null">#{classStructureDate},</if>
  367. <if test="classStructureMan != null">#{classStructureMan},</if>
  368. <if test="oils != null">#{oils},</if>
  369. <if test="receivableAmt != null">#{receivableAmt},</if>
  370. <if test="receivedAmt != null">#{receivedAmt},</if>
  371. <if test="discountAmt != null">#{discountAmt},</if>
  372. <if test="discountCouponAmt != null">#{discountCouponAmt},</if>
  373. <if test="discountCoupon != null">#{discountCoupon},</if>
  374. <if test="wxAmt != null">#{wxAmt},</if>
  375. <if test="zfbAmt != null">#{zfbAmt},</if>
  376. <if test="posAmt != null">#{posAmt},</if>
  377. <if test="xjAmt != null">#{xjAmt},</if>
  378. <if test="didiAppAmt != null">#{didiAppAmt},</if>
  379. <if test="tyAppAmt != null">#{tyAppAmt},</if>
  380. <if test="otherAmt != null">#{otherAmt},</if>
  381. <if test="dzkAmt != null">#{dzkAmt},</if>
  382. <if test="score != null">#{score},</if>
  383. <if test="memberNo != null">#{memberNo},</if>
  384. <if test="memberAmt != null">#{memberAmt},</if>
  385. <if test="carNo != null">#{carNo},</if>
  386. <if test="customerPhone != null">#{customerPhone},</if>
  387. <if test="customerGrade != null">#{customerGrade},</if>
  388. </trim>
  389. </insert>
  390. <update id="updateStationClassStructure" parameterType="StationClassStructure">
  391. update station_class_structure
  392. <trim prefix="SET" suffixOverrides=",">
  393. <if test="orderNo != null">order_no = #{orderNo},</if>
  394. <if test="stationId != null">station_id = #{stationId},</if>
  395. <if test="stationName != null">station_name = #{stationName},</if>
  396. <if test="oilGun != null">oil_gun = #{oilGun},</if>
  397. <if test="oilName != null">oil_name = #{oilName},</if>
  398. <if test="oilPirce != null">oil_pirce = #{oilPirce},</if>
  399. <if test="oilType != null">oil_type = #{oilType},</if>
  400. <if test="consumerId != null">consumer_id = #{consumerId},</if>
  401. <if test="consumer != null">consumer = #{consumer},</if>
  402. <if test="amt != null">amt = #{amt},</if>
  403. <if test="orderLiters != null">order_liters = #{orderLiters},</if>
  404. <if test="payType != null">pay_type = #{payType},</if>
  405. <if test="payWay != null">pay_way = #{payWay},</if>
  406. <if test="payDate != null">pay_date = #{payDate},</if>
  407. <if test="oilPersonnel != null">oil_personnel = #{oilPersonnel},</if>
  408. <if test="orderType != null">order_type = #{orderType},</if>
  409. <if test="printNum != null">print_num = #{printNum},</if>
  410. <if test="classStructureNo != null">class_structure_no = #{classStructureNo},</if>
  411. <if test="classStartDate != null">class_start_date = #{classStartDate},</if>
  412. <if test="classStructureDate != null">class_structure_date = #{classStructureDate},</if>
  413. <if test="classStructureMan != null">class_structure_man = #{classStructureMan},</if>
  414. <if test="oils != null">oils = #{oils},</if>
  415. <if test="receivableAmt != null">receivable_amt = #{receivableAmt},</if>
  416. <if test="receivedAmt != null">received_amt = #{receivedAmt},</if>
  417. <if test="discountAmt != null">discount_amt = #{discountAmt},</if>
  418. <if test="discountCouponAmt != null">discount_coupon_amt = #{discountCouponAmt},</if>
  419. <if test="discountCoupon != null">discount_coupon = #{discountCoupon},</if>
  420. <if test="wxAmt != null">wx_amt = #{wxAmt},</if>
  421. <if test="zfbAmt != null">zfb_amt = #{zfbAmt},</if>
  422. <if test="posAmt != null">pos_amt = #{posAmt},</if>
  423. <if test="xjAmt != null">xj_amt = #{xjAmt},</if>
  424. <if test="didiAppAmt != null">didi_app_amt = #{didiAppAmt},</if>
  425. <if test="tyAppAmt != null">ty_app_amt = #{tyAppAmt},</if>
  426. <if test="otherAmt != null">other_amt = #{otherAmt},</if>
  427. <if test="dzkAmt != null">dzk_amt = #{dzkAmt},</if>
  428. <if test="score != null">score = #{score},</if>
  429. <if test="memberNo != null">member_no = #{memberNo},</if>
  430. <if test="memberAmt != null">member_amt = #{memberAmt},</if>
  431. <if test="carNo != null">car_no = #{carNo},</if>
  432. <if test="customerPhone != null">customer_phone = #{customerPhone},</if>
  433. <if test="customerGrade != null">customer_grade = #{customerGrade},</if>
  434. </trim>
  435. where id = #{id}
  436. </update>
  437. <delete id="deleteStationClassStructureById" parameterType="Long">
  438. delete from station_class_structure where id = #{id}
  439. </delete>
  440. <delete id="deleteStationClassStructureByIds" parameterType="String">
  441. delete from station_class_structure where id in
  442. <foreach item="id" collection="array" open="(" separator="," close=")">
  443. #{id}
  444. </foreach>
  445. </delete>
  446. </mapper>