PayOrderMapper.xml 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.platform.yijia.dao.PayOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.PayOrder">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. -->
  9. <id column="order_id" jdbcType="INTEGER" property="orderId" />
  10. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  11. <result column="oil_gun" jdbcType="VARCHAR" property="oilGun" />
  12. <result column="oil_name" jdbcType="VARCHAR" property="oilName" />
  13. <result column="oil_pirce" jdbcType="VARCHAR" property="oilPirce" />
  14. <result column="consumer_id" jdbcType="INTEGER" property="consumerId" />
  15. <result column="consumer" jdbcType="VARCHAR" property="consumer" />
  16. <result column="amt" jdbcType="DOUBLE" property="amt" />
  17. <result column="station_id" jdbcType="INTEGER" property="stationId" />
  18. <result column="status" jdbcType="VARCHAR" property="status" />
  19. <result column="order_liters" jdbcType="VARCHAR" property="orderLiters" />
  20. <result column="pay_type" jdbcType="VARCHAR" property="payType" />
  21. <result column="pay_way" jdbcType="VARCHAR" property="payWay" />
  22. <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" />
  23. <result column="oil_personnel" jdbcType="VARCHAR" property="oilPersonnel" />
  24. <result column="created_date" jdbcType="TIMESTAMP" property="createdDate" />
  25. <result column="order_type" jdbcType="CHAR" property="orderType" />
  26. <result column="station_name" jdbcType="CHAR" property="stationName" />
  27. <result column="receivable_amt" jdbcType="DOUBLE" property="receivableAmt" />
  28. <result column="received_amt" jdbcType="DOUBLE" property="receivedAmt" />
  29. <result column="discount_coupon" jdbcType="VARCHAR" property="discountCoupon" />
  30. <result column="discount_amt" jdbcType="DOUBLE" property="discountAmt" />
  31. <result column="discount_coupon_amt" jdbcType="DOUBLE" property="discountCouponAmt" />
  32. <result column="wx_amt" jdbcType="DOUBLE" property="wxAmt" />
  33. <result column="zfb_amt" jdbcType="DOUBLE" property="zfbAmt" />
  34. <result column="pos_amt" jdbcType="DOUBLE" property="posAmt" />
  35. <result column="xj_amt" jdbcType="DOUBLE" property="xjAmt" />
  36. <result column="didi_app_amt" jdbcType="DOUBLE" property="didiAppAmt" />
  37. <result column="ty_app_amt" jdbcType="DOUBLE" property="tyAppAmt" />
  38. <result column="other_amt" jdbcType="DOUBLE" property="otherAmt" />
  39. <result column="dzk_amt" jdbcType="TIMESTAMP" property="dzkAmt" />
  40. <result column="score" jdbcType="INTEGER" property="score" />
  41. <result column="member_no" jdbcType="VARCHAR" property="memberNo" />
  42. <result column="member_amt" jdbcType="DOUBLE" property="memberAmt" />
  43. <result column="print_count" jdbcType="INTEGER" property="printCount" />
  44. <result column="car_no" jdbcType="VARCHAR" property="carNo" />
  45. <result column="customer_phone" jdbcType="VARCHAR" property="customerPhone" />
  46. <result column="customer_grade" jdbcType="VARCHAR" property="customerGrade" />
  47. <result column="oil_type" jdbcType="VARCHAR" property="oilType" />
  48. </resultMap>
  49. <sql id="Example_Where_Clause">
  50. <!--
  51. WARNING - @mbg.generated
  52. This element is automatically generated by MyBatis Generator, do not modify.
  53. -->
  54. <where>
  55. <foreach collection="oredCriteria" item="criteria" separator="or">
  56. <if test="criteria.valid">
  57. <trim prefix="(" prefixOverrides="and" suffix=")">
  58. <foreach collection="criteria.criteria" item="criterion">
  59. <choose>
  60. <when test="criterion.noValue">
  61. and ${criterion.condition}
  62. </when>
  63. <when test="criterion.singleValue">
  64. and ${criterion.condition} #{criterion.value}
  65. </when>
  66. <when test="criterion.betweenValue">
  67. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  68. </when>
  69. <when test="criterion.listValue">
  70. and ${criterion.condition}
  71. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  72. #{listItem}
  73. </foreach>
  74. </when>
  75. </choose>
  76. </foreach>
  77. </trim>
  78. </if>
  79. </foreach>
  80. </where>
  81. </sql>
  82. <sql id="Update_By_Example_Where_Clause">
  83. <!--
  84. WARNING - @mbg.generated
  85. This element is automatically generated by MyBatis Generator, do not modify.
  86. -->
  87. <where>
  88. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  89. <if test="criteria.valid">
  90. <trim prefix="(" prefixOverrides="and" suffix=")">
  91. <foreach collection="criteria.criteria" item="criterion">
  92. <choose>
  93. <when test="criterion.noValue">
  94. and ${criterion.condition}
  95. </when>
  96. <when test="criterion.singleValue">
  97. and ${criterion.condition} #{criterion.value}
  98. </when>
  99. <when test="criterion.betweenValue">
  100. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  101. </when>
  102. <when test="criterion.listValue">
  103. and ${criterion.condition}
  104. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  105. #{listItem}
  106. </foreach>
  107. </when>
  108. </choose>
  109. </foreach>
  110. </trim>
  111. </if>
  112. </foreach>
  113. </where>
  114. </sql>
  115. <sql id="Base_Column_List">
  116. <!--
  117. WARNING - @mbg.generated
  118. This element is automatically generated by MyBatis Generator, do not modify.
  119. -->
  120. order_id, order_no, oil_gun, oil_name, oil_pirce, consumer_id, consumer, amt, station_id, status,
  121. order_liters, pay_type, pay_way, pay_date, oil_personnel, created_date, order_type, station_name,
  122. receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt,
  123. zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_no, member_amt,
  124. print_count, car_no, customer_phone, customer_grade, oil_type
  125. </sql>
  126. <!-- 根据油品名称和油站查询油枪编号和价格 -->
  127. <select id="selectOilGunNoAndOilPrice" parameterType="map" resultType="map">
  128. SELECT
  129. A.oil_gun_no AS oliGunNo,
  130. A.oil_name AS oilName,
  131. A.station_name AS stationName,
  132. B.oil_price AS oilPrice,
  133. C.personnel_name AS personelName
  134. FROM station_oil_gun AS A
  135. LEFT JOIN station_oil_price AS B ON A.oil_name = B.oil_name AND A.station_id = B.station_id
  136. LEFT JOIN station_personnel AS C ON A.oil_gun_no = C.gun_no AND A.station_id = C.station_id
  137. <where>
  138. <if test="oliGunNo != null and oliGunNo !=''">
  139. A.oil_gun_no = #{oliGunNo}
  140. </if>
  141. <if test="stationId !=null and stationId !=''">
  142. AND A.station_id = #{stationId}
  143. </if>
  144. </where>
  145. </select>
  146. <!-- 根据油品名称和油站id获取当前油品调价信息 -->
  147. <select id="selectOilPriceAdjust" parameterType="map" resultType="map">
  148. SELECT
  149. adjust_price_id AS adjustPriceId,
  150. oil_name AS oilName,
  151. oil_adjust_price AS oilAdjustPrice,
  152. take_effect_status AS takeEffectStatus,
  153. take_effect_date AS takeEffectDate,
  154. adjust_date AS adjustDate,
  155. station_id AS stationId,
  156. operator AS operator,
  157. status AS status
  158. FROM
  159. station_oil_price_adjust
  160. <where>
  161. <if test="oilName !=null and oilName !=''">
  162. oil_name = #{oilName}
  163. </if>
  164. <if test="stationId !=null and stationId !=''">
  165. AND station_id = #{stationId}
  166. </if>
  167. ORDER BY take_effect_date DESC
  168. </where>
  169. </select>
  170. <select id="selectByExample" parameterType="com.platform.yijia.pojo.PayOrderExample" resultMap="BaseResultMap">
  171. <!--
  172. WARNING - @mbg.generated
  173. This element is automatically generated by MyBatis Generator, do not modify.
  174. -->
  175. select
  176. <if test="distinct">
  177. distinct
  178. </if>
  179. <include refid="Base_Column_List" />
  180. from pay_order
  181. <if test="_parameter != null">
  182. <include refid="Example_Where_Clause" />
  183. </if>
  184. <if test="orderByClause != null">
  185. order by ${orderByClause}
  186. </if>
  187. </select>
  188. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  189. <!--
  190. WARNING - @mbg.generated
  191. This element is automatically generated by MyBatis Generator, do not modify.
  192. -->
  193. select
  194. <include refid="Base_Column_List" />
  195. from pay_order
  196. where order_id = #{orderId,jdbcType=INTEGER}
  197. </select>
  198. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  199. <!--
  200. WARNING - @mbg.generated
  201. This element is automatically generated by MyBatis Generator, do not modify.
  202. -->
  203. delete from pay_order
  204. where order_id = #{orderId,jdbcType=INTEGER}
  205. </delete>
  206. <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.PayOrderExample">
  207. <!--
  208. WARNING - @mbg.generated
  209. This element is automatically generated by MyBatis Generator, do not modify.
  210. -->
  211. delete from pay_order
  212. <if test="_parameter != null">
  213. <include refid="Example_Where_Clause" />
  214. </if>
  215. </delete>
  216. <insert id="insert" parameterType="com.platform.yijia.pojo.PayOrder">
  217. <!--
  218. WARNING - @mbg.generated
  219. This element is automatically generated by MyBatis Generator, do not modify.
  220. -->
  221. INSERT into
  222. pay_order (order_id, order_no, oil_gun,
  223. oil_name, oli_price, consumer_id, consumer,
  224. amt, station_id, status,
  225. order_liters, pay_type, pay_way,
  226. pay_date, oil_personnel, created_date,
  227. order_type, station_name, receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt,
  228. zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score,
  229. member_no, member_amt, print_count, car_no, customer_phone, customer_grade, oil_type)
  230. VALUES (
  231. #{orderId,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{oilGun,jdbcType=VARCHAR},
  232. #{oilName,jdbcType=VARCHAR}, #{oilPirce,jdbcType=VARCHAR}, #{consumerId,jdbcType=INTEGER}, #{consumer,jdbcType=VARCHAR},
  233. #{amt,jdbcType=DOUBLE}, #{stationId,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR},
  234. #{orderLiters,jdbcType=VARCHAR}, #{payType,jdbcType=VARCHAR}, #{payWay,jdbcType=VARCHAR},
  235. #{payDate,jdbcType=TIMESTAMP}, #{oilPersonnel,jdbcType=VARCHAR}, #{createdDate,jdbcType=TIMESTAMP},
  236. #{orderType,jdbcType=CHAR}, #{stationName,jdbcType=VARCHAR},
  237. #{receivableAmt,jdbcType=DOUBLE}, #{receivedAmt,jdbcType=DOUBLE},#{discountAmt,jdbcType=DOUBLE}, #{discountCouponAmt,jdbcType=DOUBLE},
  238. #{discountCoupon,jdbcType=INTEGER}, #{wxAmt,jdbcType=DOUBLE}, #{zfbAmt,jdbcType=DOUBLE},#{posAmt,jdbcType=DOUBLE},
  239. #{xjAmt,jdbcType=DOUBLE}, #{didiAppAmt,jdbcType=DOUBLE}, #{tyAppAmt,jdbcType=DOUBLE}, #{otherAmt,jdbcType=DOUBLE},
  240. #{dzkAmt,jdbcType=DOUBLE}, #{score,jdbcType=INTEGER}, #{memberNo,jdbcType=VARCHAR}, #{memberAmt,jdbcType=DOUBLE},
  241. #{printCount,jdbcType=INTEGER}, #{carNo,jdbcType=VARCHAR}, #{customerPhone,jdbcType=VARCHAR}, #{customerGrade,jdbcType=VARCHAR}, #{oilType,jdbcType=VARCHAR}
  242. )
  243. </insert>
  244. <insert id="insertSelective" parameterType="com.platform.yijia.pojo.PayOrder">
  245. <!--
  246. WARNING - @mbg.generated
  247. This element is automatically generated by MyBatis Generator, do not modify.
  248. -->
  249. insert into pay_order
  250. <trim prefix="(" suffix=")" suffixOverrides=",">
  251. <if test="orderId != null">
  252. order_id,
  253. </if>
  254. <if test="orderNo != null">
  255. order_no,
  256. </if>
  257. <if test="oilGun != null">
  258. oil_gun,
  259. </if>
  260. <if test="oilName != null">
  261. oil_name,
  262. </if>
  263. <if test="oilPirce != null">
  264. oil_pirce,
  265. </if>
  266. <if test="consumerId != null">
  267. consumer_id,
  268. </if>
  269. <if test="consumer != null">
  270. consumer,
  271. </if>
  272. <if test="amt != null">
  273. amt,
  274. </if>
  275. <if test="stationId != null">
  276. station_id,
  277. </if>
  278. <if test="status != null">
  279. status,
  280. </if>
  281. <if test="orderLiters != null">
  282. order_liters,
  283. </if>
  284. <if test="payType != null">
  285. pay_type,
  286. </if>
  287. <if test="payWay != null">
  288. pay_way,
  289. </if>
  290. <if test="payDate != null">
  291. pay_date,
  292. </if>
  293. <if test="oilPersonnel != null">
  294. oil_personnel,
  295. </if>
  296. <if test="createdDate != null">
  297. created_date,
  298. </if>
  299. <if test="orderType != null">
  300. order_type,
  301. </if>
  302. <if test="stationName != null">
  303. station_name,
  304. </if>
  305. <if test="receivableAmt != null">
  306. receivable_amt,
  307. </if>
  308. <if test="receivedAmt != null">
  309. received_amt,
  310. </if>
  311. <if test="discountAmt != null">
  312. discount_amt,
  313. </if>
  314. <if test="discountCouponAmt != null">
  315. discount_coupon_amt,
  316. </if>
  317. <if test="discountCoupon != null">
  318. discount_coupon,
  319. </if>
  320. <if test="wxAmt != null">
  321. wx_amt,
  322. </if>
  323. <if test="zfbAmt != null">
  324. zfb_amt,
  325. </if>
  326. <if test="posAmt != null">
  327. pos_amt,
  328. </if>
  329. <if test="didiAppAmt != null">
  330. didi_app_amt,
  331. </if>
  332. <if test="tyAppAmt != null">
  333. ty_app_amt,
  334. </if>
  335. <if test="otherAmt != null">
  336. other_amt,
  337. </if>
  338. <if test="dzkAmt != null">
  339. dzk_amt,
  340. </if>
  341. <if test="score != null">
  342. score,
  343. </if>
  344. <if test="memberNo != null">
  345. member_no,
  346. </if>
  347. <if test="memberAmt != null">
  348. member_amt,
  349. </if>
  350. <if test="printCount != null">
  351. print_count,
  352. </if>
  353. <if test="carNo != null">
  354. car_no,
  355. </if>
  356. <if test="customerPhone != null">
  357. customer_phone,
  358. </if>
  359. <if test="customerGrade != null">
  360. customer_grade,
  361. </if>
  362. <if test="oilType != null">
  363. oil_type
  364. </if>
  365. </trim>
  366. <trim prefix="values (" suffix=")" suffixOverrides=",">
  367. <if test="orderId != null">
  368. #{orderId,jdbcType=INTEGER},
  369. </if>
  370. <if test="orderNo != null">
  371. #{orderNo,jdbcType=VARCHAR},
  372. </if>
  373. <if test="oilGun != null">
  374. #{oilGun,jdbcType=VARCHAR},
  375. </if>
  376. <if test="oilName != null">
  377. #{oilName,jdbcType=VARCHAR},
  378. </if>
  379. <if test="oilPirce != null">
  380. #{oilPirce,jdbcType=VARCHAR},
  381. </if>
  382. <if test="consumerId != null">
  383. #{consumerId,jdbcType=INTEGER},
  384. </if>
  385. <if test="consumer != null">
  386. #{consumer,jdbcType=VARCHAR},
  387. </if>
  388. <if test="amt != null">
  389. #{amt,jdbcType=DOUBLE},
  390. </if>
  391. <if test="stationId != null">
  392. #{stationId,jdbcType=INTEGER},
  393. </if>
  394. <if test="status != null">
  395. #{status,jdbcType=VARCHAR},
  396. </if>
  397. <if test="orderLiters != null">
  398. #{orderLiters,jdbcType=VARCHAR},
  399. </if>
  400. <if test="payType != null">
  401. #{payType,jdbcType=VARCHAR},
  402. </if>
  403. <if test="payWay != null">
  404. #{payWay,jdbcType=VARCHAR},
  405. </if>
  406. <if test="payDate != null">
  407. #{payDate,jdbcType=TIMESTAMP},
  408. </if>
  409. <if test="oilPersonnel != null">
  410. #{oilPersonnel,jdbcType=VARCHAR},
  411. </if>
  412. <if test="createdDate != null">
  413. #{createdDate,jdbcType=TIMESTAMP},
  414. </if>
  415. <if test="orderType != null">
  416. #{orderType,jdbcType=CHAR},
  417. </if>
  418. <if test="stationName != null">
  419. #{stationName,jdbcType=VARCHAR},
  420. </if>
  421. <if test="receivableAmt != null">
  422. #{receivable_amt,jdbcType=DOUBLE},
  423. </if>
  424. <if test="receivedAmt != null">
  425. #{received_amt,jdbcType=DOUBLE},
  426. </if>
  427. <if test="discountAmt != null">
  428. #{discount_amt,jdbcType=DOUBLE},
  429. </if>
  430. <if test="discountCouponAmt != null">
  431. #{discount_coupon_amt,jdbcType=DOUBLE},
  432. </if>
  433. <if test="discountCoupon != null">
  434. #{discount_coupon,jdbcType=VARCHAR},
  435. </if>
  436. <if test="wxAmt != null">
  437. #{wx_amt,jdbcType=DOUBLE},
  438. </if>
  439. <if test="zfbAmt != null">
  440. #{zfb_amt,jdbcType=DOUBLE},
  441. </if>
  442. <if test="posAmt != null">
  443. #{pos_amt,jdbcType=DOUBLE},
  444. </if>
  445. <if test="xjAmt != null">
  446. #{xj_amt,jdbcType=DOUBLE},
  447. </if>
  448. <if test="didiAppAmt != null">
  449. #{didi_app_amt,jdbcType=DOUBLE},
  450. </if>
  451. <if test="tyAppAmt != null">
  452. #{ty_app_amt,jdbcType=DOUBLE},
  453. </if>
  454. <if test="otherAmt != null">
  455. #{other_amt,jdbcType=DOUBLE},
  456. </if>
  457. <if test="dzkAmt != null">
  458. #{dzk_amt,jdbcType=DOUBLE},
  459. </if>
  460. <if test="score != null">
  461. #{score,jdbcType=INTEGER},
  462. </if>
  463. <if test="memberNo != null">
  464. #{member_no,jdbcType=VARCHAR},
  465. </if>
  466. <if test="memberAmt != null">
  467. #{member_amt,jdbcType=DOUBLE},
  468. </if>
  469. <if test="printCount != null">
  470. #{print_count,jdbcType=INTEGER},
  471. </if>
  472. <if test="carNo != null">
  473. #{car_no,jdbcType=VARCHAR},
  474. </if>
  475. <if test="customerPhone != null">
  476. #{customer_phone,jdbcType=VARCHAR},
  477. </if>
  478. <if test="customerGrade != null">
  479. #{customer_grade,jdbcType=VARCHAR},
  480. </if>
  481. <if test="oilType != null">
  482. #{oilType,jdbcType=VARCHAR}
  483. </if>
  484. </trim>
  485. </insert>
  486. <select id="countByExample" parameterType="com.platform.yijia.pojo.PayOrderExample" resultType="java.lang.Long">
  487. <!--
  488. WARNING - @mbg.generated
  489. This element is automatically generated by MyBatis Generator, do not modify.
  490. -->
  491. select count(*) from pay_order
  492. <if test="_parameter != null">
  493. <include refid="Example_Where_Clause" />
  494. </if>
  495. </select>
  496. <update id="updateByExampleSelective" parameterType="map">
  497. <!--
  498. WARNING - @mbg.generated
  499. This element is automatically generated by MyBatis Generator, do not modify.
  500. -->
  501. update pay_order
  502. <set>
  503. <if test="record.orderId != null">
  504. order_id = #{record.orderId,jdbcType=INTEGER},
  505. </if>
  506. <if test="record.orderNo != null">
  507. order_no = #{record.orderNo,jdbcType=VARCHAR},
  508. </if>
  509. <if test="record.oilGun != null">
  510. oil_gun = #{record.oilGun,jdbcType=VARCHAR},
  511. </if>
  512. <if test="record.oilName != null">
  513. oil_name = #{record.oilName,jdbcType=VARCHAR},
  514. </if>
  515. <if test="record.oilPirce != null">
  516. oil_pirce = #{record.oilPirce,jdbcType=VARCHAR},
  517. </if>
  518. <if test="record.consumerId != null">
  519. consumer_id = #{record.consumerId,jdbcType=INTEGER},
  520. </if>
  521. <if test="record.consumer != null">
  522. consumer = #{record.consumer,jdbcType=VARCHAR},
  523. </if>
  524. <if test="record.amt != null">
  525. amt = #{record.amt,jdbcType=DOUBLE},
  526. </if>
  527. <if test="record.stationId != null">
  528. station_id = #{record.stationId,jdbcType=INTEGER},
  529. </if>
  530. <if test="record.status != null">
  531. status = #{record.status,jdbcType=VARCHAR},
  532. </if>
  533. <if test="record.orderLiters != null">
  534. order_liters = #{record.orderLiters,jdbcType=VARCHAR},
  535. </if>
  536. <if test="record.payType != null">
  537. pay_type = #{record.payType,jdbcType=VARCHAR},
  538. </if>
  539. <if test="record.payWay != null">
  540. pay_way = #{record.payWay,jdbcType=VARCHAR},
  541. </if>
  542. <if test="record.payDate != null">
  543. pay_date = #{record.payDate,jdbcType=TIMESTAMP},
  544. </if>
  545. <if test="record.oilPersonnel != null">
  546. oil_personnel = #{record.oilPersonnel,jdbcType=VARCHAR},
  547. </if>
  548. <if test="record.createdDate != null">
  549. created_date = #{record.createdDate,jdbcType=TIMESTAMP},
  550. </if>
  551. <if test="record.orderType != null">
  552. order_type = #{record.orderType,jdbcType=CHAR},
  553. </if>
  554. <if test="record.stationName != null">
  555. station_name = #{record.stationName,jdbcType=VARCHAR},
  556. </if>
  557. <if test="record.receivableAmt != null">
  558. receivable_amt = #{record.receivableAmt,jdbcType=DOUBLE},
  559. </if>
  560. <if test="record.receivedAmt != null">
  561. received_amt = #{record.receivedAmt,jdbcType=DOUBLE},
  562. </if>
  563. <if test="record.discountAmt != null">
  564. discount_amt = #{record.discountAmt,jdbcType=DOUBLE},
  565. </if>
  566. <if test="record.discountCouponAmt != null">
  567. discount_coupon_amt = #{record.discountCouponAmt,jdbcType=DOUBLE},
  568. </if>
  569. <if test="record.discountCoupon != null">
  570. discount_coupon = #{record.discountCoupon,jdbcType=VARCHAR},
  571. </if>
  572. <if test="record.wxAmt != null">
  573. wx_amt = #{record.wxAmt,jdbcType=DOUBLE},
  574. </if>
  575. <if test="record.zfbAmt != null">
  576. zfb_amt = #{record.zfbAmt,jdbcType=DOUBLE},
  577. </if>
  578. <if test="record.posAmt != null">
  579. pos_amt = #{record.posAmt,jdbcType=DOUBLE},
  580. </if>
  581. <if test="record.xjAmt != null">
  582. xj_amt = #{record.xjAmt,jdbcType=DOUBLE},
  583. </if>
  584. <if test="record.didiAppAmt != null">
  585. didi_app_amt = #{record.didiAppAmt,jdbcType=DOUBLE},
  586. </if>
  587. <if test="record.tyAppAmt != null">
  588. ty_app_amt = #{record.tyAppAmt,jdbcType=DOUBLE},
  589. </if>
  590. <if test="record.otherAmt != null">
  591. other_amt = #{record.otherAmt,jdbcType=DOUBLE},
  592. </if>
  593. <if test="record.dzkAmt != null">
  594. dzk_amt = #{record.dzkAmt,jdbcType=DOUBLE},
  595. </if>
  596. <if test="record.score != null">
  597. score = #{record.score,jdbcType=INTEGER},
  598. </if>
  599. <if test="record.memberNo != null">
  600. member_no = #{record.memberNo,jdbcType=VARCHAR},
  601. </if>
  602. <if test="record.memberAmt != null">
  603. member_amt = #{record.memberAmt,jdbcType=DOUBLE},
  604. </if>
  605. <if test="record.printCount != null">
  606. print_count = #{record.printCount,jdbcType=INTEGER},
  607. </if>
  608. <if test="record.carNo != null">
  609. car_no = #{record.carNo,jdbcType=VARCHAR},
  610. </if>
  611. <if test="record.customerPhone != null">
  612. customer_phone = #{record.customerPhone,jdbcType=VARCHAR},
  613. </if>
  614. <if test="record.customerGrade != null">
  615. customer_grade = #{record.customerGrade,jdbcType=VARCHAR},
  616. </if>
  617. <if test="oilType != null">
  618. oil_type = #{record.oilType,jdbcType=VARCHAR}
  619. </if>
  620. </set>
  621. <if test="_parameter != null">
  622. <include refid="Update_By_Example_Where_Clause" />
  623. </if>
  624. </update>
  625. <!-- 更新订单状态-->
  626. <update id="updateOrderStatus" parameterType="com.platform.yijia.pojo.PayOrder">
  627. UPDATE
  628. pay_order
  629. SET
  630. status = #{status,jdbcType=VARCHAR},
  631. received_amt = #{receivedAmt,jdbcType=DOUBLE},
  632. pay_date = #{payDate,jdbcType=TIMESTAMP}
  633. <where>
  634. order_no = #{orderNo,jdbcType=VARCHAR}
  635. </where>
  636. </update>
  637. <!-- 判断客户表是否已存在-->
  638. <select id="isExistCustomer" parameterType="com.platform.yijia.pojo.CustomerManage" resultType="com.platform.yijia.pojo.CustomerManage">
  639. SELECT
  640. id AS id,
  641. member_id AS memberId,
  642. member_grade AS memberGrade,
  643. phone_number AS phoneNumber,
  644. regtime AS regtime,
  645. station_name AS stationName,
  646. cy_liters AS cyLiters,
  647. qy_liters AS qyLiters,
  648. cy_amt AS cyAmt,
  649. qy_amt AS qyAmt
  650. FROM
  651. customer_manage
  652. <where>
  653. <if test="blogOpenid !=null and blogOpenid !='' ">
  654. blog_openid = #{blogOpenid}
  655. </if>
  656. <if test="minaOpenid !=null and minaOpenid !='' ">
  657. AND mina_openid = #{minaOpenid}
  658. </if>
  659. <if test="stationId !=null and stationId !='' ">
  660. AND station_id = #{stationId}
  661. </if>
  662. </where>
  663. </select>
  664. <!-- 更新客户表 -->
  665. <update id="updateCustomer" parameterType="com.platform.yijia.pojo.CustomerManage">
  666. UPDATE
  667. customer_manage
  668. <set>
  669. <if test="memberGrade !=null ">
  670. member_grade = #{memberGrade},
  671. </if>
  672. <if test="phoneNumber !=null ">
  673. phone_number = #{phoneNumber},
  674. </if>
  675. <if test="regtime !=null ">
  676. regtime = #{regtime},
  677. </if>
  678. <if test="stationName !=null ">
  679. station_name = #{stationName},
  680. </if>
  681. <if test="cyLiters !=null ">
  682. cy_liters = #{cyLiters},
  683. </if>
  684. <if test="qyLiters !=null ">
  685. qy_liters = #{qyLiters},
  686. </if>
  687. </set>
  688. <where>
  689. <if test="blogOpenid !=null and blogOpenid !='' ">
  690. blog_openid = #{blogOpenid}
  691. </if>
  692. <if test="minaOpenid !=null and minaOpenid !='' ">
  693. AND mina_openid = #{minaOpenid}
  694. </if>
  695. <if test="stationId !=null and stationId !='' ">
  696. AND station_id = #{stationId}
  697. </if>
  698. </where>
  699. </update>
  700. <!-- 插入客户表 -->
  701. <insert id="insertCustomer" parameterType="com.platform.yijia.pojo.CustomerManage">
  702. INSERT INTO
  703. <trim prefix="values (" suffix=")" suffixOverrides=",">
  704. <if test="memberId !=null ">
  705. member_id,
  706. </if>
  707. <if test="customerName !=null ">
  708. customer_name,
  709. </if>
  710. <if test="commendMan !=null ">
  711. commend_man,
  712. </if>
  713. <if test="memberGrade !=null ">
  714. member_grade,
  715. </if>
  716. <if test="phoneNumber !=null ">
  717. phone_number,
  718. </if>
  719. <if test="carNumber !=null ">
  720. car_number,
  721. </if>
  722. <if test="balance !=null ">
  723. balance,
  724. </if>
  725. <if test="integral !=null ">
  726. integral,
  727. </if>
  728. <if test="specialCarType !=null ">
  729. specialCarType,
  730. </if>
  731. <if test="regtime !=null ">
  732. regtime,
  733. </if>
  734. <if test="stationId !=null ">
  735. station_id,
  736. </if>
  737. <if test="stationName !=null ">
  738. station_name,
  739. </if>
  740. <if test="cyGrade !=null ">
  741. cy_grade,
  742. </if>
  743. <if test="qyGrade !=null ">
  744. qy_grade,
  745. </if>
  746. <if test="cyLiters !=null ">
  747. cy_liters,
  748. </if>
  749. <if test="qyLiters !=null ">
  750. qy_liters
  751. </if>
  752. <if test="cyAmt !=null ">
  753. cy_amt,
  754. </if>
  755. <if test="qyAmt !=null ">
  756. qy_amt,
  757. </if>
  758. <if test="blogOpenid !=null ">
  759. blog_openid,
  760. </if>
  761. <if test="minaOpenid !=null ">
  762. mina_openid,
  763. </if>
  764. <if test="blogUserId !=null ">
  765. blog_user_id,
  766. </if>
  767. <if test="minaUserId !=null ">
  768. mina_user_id
  769. </if>
  770. </trim>
  771. <trim prefix="values (" suffix=")" suffixOverrides=",">
  772. <if test="memberId !=null ">
  773. #{memberId},
  774. </if>
  775. <if test="customerName !=null ">
  776. #{customerName},
  777. </if>
  778. <if test="commendMan !=null ">
  779. #{commendMan},
  780. </if>
  781. <if test="memberGrade !=null ">
  782. #{memberGrade},
  783. </if>
  784. <if test="phoneNumber !=null ">
  785. #{phoneNumber},
  786. </if>
  787. <if test="carNumber !=null ">
  788. #{carNumber},
  789. </if>
  790. <if test="balance !=null ">
  791. #{balance},
  792. </if>
  793. <if test="integral !=null ">
  794. #{integral},
  795. </if>
  796. <if test="specialCarType !=null ">
  797. #{specialCarType},
  798. </if>
  799. <if test="regtime !=null ">
  800. #{regtime},
  801. </if>
  802. <if test="stationId !=null ">
  803. #{stationId},
  804. </if>
  805. <if test="stationName !=null ">
  806. #{stationName},
  807. </if>
  808. <if test="cyGrade !=null ">
  809. #{cyGrade},
  810. </if>
  811. <if test="qyGrade !=null ">
  812. #{qyGrade},
  813. </if>
  814. <if test="cyLiters !=null ">
  815. #{cyLiters},
  816. </if>
  817. <if test="qyLiters !=null ">
  818. #{qyLiters},
  819. </if>
  820. <if test="cyAmt !=null ">
  821. #{cyAmt},
  822. </if>
  823. <if test="qyAmt !=null ">
  824. #{qyAmt},
  825. </if>
  826. <if test="blogOpenid !=null ">
  827. #{blogOpenid},
  828. </if>
  829. <if test="minaOpenid !=null ">
  830. #{minaOpenid},
  831. </if>
  832. <if test="blogUserId !=null ">
  833. #{blogUserId},
  834. </if>
  835. <if test="minaUserId !=null ">
  836. #{minaUserId}
  837. </if>
  838. </trim>
  839. </insert>
  840. <update id="updateByExample" parameterType="map">
  841. <!--
  842. WARNING - @mbg.generated
  843. This element is automatically generated by MyBatis Generator, do not modify.
  844. -->
  845. update pay_order
  846. set order_id = #{record.orderId,jdbcType=INTEGER},
  847. order_no = #{record.orderNo,jdbcType=VARCHAR},
  848. oil_gun = #{record.oilGun,jdbcType=VARCHAR},
  849. oil_name = #{record.oilName,jdbcType=VARCHAR},
  850. oil_pirce = #{record.oilPirce,jdbcType=VARCHAR},
  851. consumer_id = #{record.consumerId,jdbcType=INTEGER},
  852. consumer = #{record.consumer,jdbcType=VARCHAR},
  853. amt = #{record.amt,jdbcType=DOUBLE},
  854. station_id = #{record.stationId,jdbcType=INTEGER},
  855. status = #{record.status,jdbcType=VARCHAR},
  856. order_liters = #{record.orderLiters,jdbcType=VARCHAR},
  857. pay_type = #{record.payType,jdbcType=VARCHAR},
  858. pay_way = #{record.payWay,jdbcType=VARCHAR},
  859. pay_date = #{record.payDate,jdbcType=TIMESTAMP},
  860. oil_personnel = #{record.oilPersonnel,jdbcType=VARCHAR},
  861. created_date = #{record.createdDate,jdbcType=TIMESTAMP},
  862. order_type = #{record.orderType,jdbcType=CHAR},
  863. station_name = #{record.stationName,jdbcType=VARCHAR},
  864. receivable_amt = #{record.receivableAmt,jdbcType=DOUBLE},
  865. received_amt = #{record.receivedAmt,jdbcType=DOUBLE},
  866. discount_amt = #{record.discountAmt,jdbcType=DOUBLE},
  867. discount_coupon_amt = #{record.discountCouponAmt,jdbcType=DOUBLE},
  868. discount_coupon = #{record.discountCoupon,jdbcType=DOUBLE},
  869. wx_amt = #{record.wxAmt,jdbcType=DOUBLE},
  870. zfb_amt = #{record.zfbAmt,jdbcType=DOUBLE},
  871. pos_amt = #{record.posAmt,jdbcType=DOUBLE},
  872. xj_amt = #{record.xjAmt,jdbcType=DOUBLE},
  873. didi_app_amt = #{record.didiAppAmt,jdbcType=DOUBLE},
  874. ty_app_amt = #{record.tyAppAmt,jdbcType=DOUBLE},
  875. other_amt = #{record.otherAmt,jdbcType=DOUBLE},
  876. dzk_amt = #{record.dzkAmt,jdbcType=DOUBLE},
  877. score = #{record.score,jdbcType=INTEGER},
  878. member_no = #{record.memberNo,jdbcType=VARCHAR},
  879. member_amt = #{record.memberAmt,jdbcType=DOUBLE},
  880. print_count = #{record.printCount,jdbcType=INTEGER},
  881. car_no = #{record.carNo,jdbcType=VARCHAR},
  882. customer_phone = #{record.customerPhone,jdbcType=VARCHAR},
  883. customer_grade = #{record.customerGrade,jdbcType=VARCHAR},
  884. oil_type = #{record.oilType,jdbcType=VARCHAR}
  885. <if test="_parameter != null">
  886. <include refid="Update_By_Example_Where_Clause" />
  887. </if>
  888. </update>
  889. <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.PayOrder">
  890. <!--
  891. WARNING - @mbg.generated
  892. This element is automatically generated by MyBatis Generator, do not modify.
  893. -->
  894. update pay_order
  895. <set>
  896. <if test="orderNo != null">
  897. order_no = #{orderNo,jdbcType=VARCHAR},
  898. </if>
  899. <if test="oilGun != null">
  900. oil_gun = #{oilGun,jdbcType=VARCHAR},
  901. </if>
  902. <if test="oilName != null">
  903. oil_name = #{oilName,jdbcType=VARCHAR},
  904. </if>
  905. <if test="oilPirce != null">
  906. oil_pirce = #{oilPirce,jdbcType=VARCHAR},
  907. </if>
  908. <if test="consumerId != null">
  909. consumer_id = #{consumerId,jdbcType=INTEGER},
  910. </if>
  911. <if test="consumer != null">
  912. consumer = #{consumer,jdbcType=VARCHAR},
  913. </if>
  914. <if test="amt != null">
  915. amt = #{amt,jdbcType=DOUBLE},
  916. </if>
  917. <if test="stationId != null">
  918. station_id = #{stationId,jdbcType=INTEGER},
  919. </if>
  920. <if test="status != null">
  921. status = #{status,jdbcType=VARCHAR},
  922. </if>
  923. <if test="orderLiters != null">
  924. order_liters = #{orderLiters,jdbcType=VARCHAR},
  925. </if>
  926. <if test="payType != null">
  927. pay_type = #{payType,jdbcType=VARCHAR},
  928. </if>
  929. <if test="payWay != null">
  930. pay_way = #{payWay,jdbcType=VARCHAR},
  931. </if>
  932. <if test="payDate != null">
  933. pay_date = #{payDate,jdbcType=TIMESTAMP},
  934. </if>
  935. <if test="oilPersonnel != null">
  936. oil_personnel = #{oilPersonnel,jdbcType=VARCHAR},
  937. </if>
  938. <if test="createdDate != null">
  939. created_date = #{createdDate,jdbcType=TIMESTAMP},
  940. </if>
  941. <if test="orderType != null">
  942. order_type = #{orderType,jdbcType=CHAR},
  943. </if>
  944. <if test="stationName != null">
  945. station_name = #{stationName,jdbcType=CHAR},
  946. </if>
  947. <if test="receivableAmt != null">
  948. receivable_amt = #{receivableAmt,jdbcType=DOUBLE},
  949. </if>
  950. <if test="receivedAmt != null">
  951. received_amt = #{receivedAmt,jdbcType=DOUBLE},
  952. </if>
  953. <if test="discountAmt != null">
  954. discount_amt = #{discountAmt,jdbcType=DOUBLE},
  955. </if>
  956. <if test="discountCouponAmt != null">
  957. discount_coupon_amt = #{discountCouponAmt,jdbcType=DOUBLE},
  958. </if>
  959. <if test="discountCoupon != null">
  960. discount_coupon = #{discountCoupon,jdbcType=VARCHAR},
  961. </if>
  962. <if test="wxAmt != null">
  963. wx_amt = #{wxAmt,jdbcType=DOUBLE},
  964. </if>
  965. <if test="zfbAmt != null">
  966. zfb_amt = #{zfbAmt,jdbcType=DOUBLE},
  967. </if>
  968. <if test="posAmt != null">
  969. pos_amt = #{posAmt,jdbcType=DOUBLE},
  970. </if>
  971. <if test="xjAmt != null">
  972. xj_amt = #{xjAmt,jdbcType=DOUBLE},
  973. </if>
  974. <if test="didiAppAmt != null">
  975. didi_app_amt = #{didiAppAmt,jdbcType=DOUBLE},
  976. </if>
  977. <if test="tyAppAmt != null">
  978. ty_app_amt = #{tyAppAmt,jdbcType=DOUBLE},
  979. </if>
  980. <if test="otherAmt != null">
  981. other_amt = #{otherAmt,jdbcType=DOUBLE},
  982. </if>
  983. <if test="dzkAmt != null">
  984. dzk_amt = #{dzkAmt,jdbcType=DOUBLE},
  985. </if>
  986. <if test="score != null">
  987. score = #{score,jdbcType=INTEGER},
  988. </if>
  989. <if test="memberNo != null">
  990. member_no = #{memberNo,jdbcType=VARCHAR},
  991. </if>
  992. <if test="memberAmt != null">
  993. member_amt = #{memberAmt,jdbcType=DOUBLE},
  994. </if>
  995. <if test="printCount != null">
  996. print_count = #{printCount,jdbcType=INTEGER},
  997. </if>
  998. <if test="carNo != null">
  999. car_no = #{carNo,jdbcType=VARCHAR},
  1000. </if>
  1001. <if test="customerPhone != null">
  1002. customer_phone = #{customerPhone,jdbcType=VARCHAR},
  1003. </if>
  1004. <if test="oilType != null">
  1005. oil_type = #{oilType,jdbcType=VARCHAR}
  1006. </if>
  1007. </set>
  1008. where order_id = #{orderId,jdbcType=INTEGER}
  1009. </update>
  1010. <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.PayOrder">
  1011. <!--
  1012. WARNING - @mbg.generated
  1013. This element is automatically generated by MyBatis Generator, do not modify.
  1014. -->
  1015. update pay_order
  1016. set order_no = #{orderNo,jdbcType=VARCHAR},
  1017. oil_gun = #{oilGun,jdbcType=VARCHAR},
  1018. oil_name = #{oilName,jdbcType=VARCHAR},
  1019. oil_pirce = #{oilPirce,jdbcType=VARCHAR},
  1020. consumer_id = #{consumerId,jdbcType=INTEGER},
  1021. consumer = #{consumer,jdbcType=VARCHAR},
  1022. amt = #{amt,jdbcType=VARCHAR},
  1023. station_id = #{stationId,jdbcType=INTEGER},
  1024. status = #{status,jdbcType=VARCHAR},
  1025. order_liters = #{orderLiters,jdbcType=VARCHAR},
  1026. pay_type = #{payType,jdbcType=VARCHAR},
  1027. pay_way = #{payWay,jdbcType=VARCHAR},
  1028. pay_date = #{payDate,jdbcType=TIMESTAMP},
  1029. oil_personnel = #{oilPersonnel,jdbcType=VARCHAR},
  1030. created_date = #{createdDate,jdbcType=TIMESTAMP},
  1031. order_type = #{orderType,jdbcType=CHAR}
  1032. station_name = #{stationName,jdbcType=VARCHAR},
  1033. receivable_amt = #{receivableAmt,jdbcType=DOUBLE},
  1034. received_amt = #{receivedAmt,jdbcType=DOUBLE},
  1035. discount_amt = #{discountAmt,jdbcType=DOUBLE},
  1036. discount_coupon_amt = #{discountCouponAmt,jdbcType=DOUBLE},
  1037. discount_coupon = #{discountCoupon,jdbcType=DOUBLE},
  1038. wx_amt = #{wxAmt,jdbcType=DOUBLE},
  1039. zfb_amt = #{zfbAmt,jdbcType=DOUBLE},
  1040. pos_amt = #{posAmt,jdbcType=DOUBLE},
  1041. xj_amt = #{xjAmt,jdbcType=DOUBLE},
  1042. didi_app_amt = #{didiAppAmt,jdbcType=DOUBLE},
  1043. ty_app_amt = #{tyAppAmt,jdbcType=DOUBLE},
  1044. other_amt = #{otherAmt,jdbcType=DOUBLE},
  1045. dzk_amt = #{dzkAmt,jdbcType=DOUBLE},
  1046. score = #{score,jdbcType=INTEGER},
  1047. member_no = #{memberNo,jdbcType=VARCHAR},
  1048. member_amt = #{memberAmt,jdbcType=DOUBLE},
  1049. print_count = #{printCount,jdbcType=INTEGER},
  1050. car_no = #{carNo,jdbcType=VARCHAR},
  1051. customer_phone = #{customerPhone,jdbcType=VARCHAR},
  1052. customer_grade = #{customerGrade,jdbcType=VARCHAR},
  1053. oil_type = #{oilType,jdbcType=VARCHAR}
  1054. where order_id = #{orderId,jdbcType=INTEGER}
  1055. </update>
  1056. </mapper>