PayOrderMapper.xml 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428
  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. <!--订单对象实体类-->
  5. <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.PayOrder">
  6. <id column="order_id" jdbcType="INTEGER" property="orderId" />
  7. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  8. <result column="oil_gun" jdbcType="VARCHAR" property="oilGun" />
  9. <result column="oil_name" jdbcType="VARCHAR" property="oilName" />
  10. <result column="oil_pirce" jdbcType="VARCHAR" property="oilPirce" />
  11. <result column="consumer_id" jdbcType="INTEGER" property="consumerId" />
  12. <result column="consumer" jdbcType="VARCHAR" property="consumer" />
  13. <result column="amt" jdbcType="DOUBLE" property="amt" />
  14. <result column="station_id" jdbcType="INTEGER" property="stationId" />
  15. <result column="status" jdbcType="VARCHAR" property="status" />
  16. <result column="order_liters" jdbcType="VARCHAR" property="orderLiters" />
  17. <result column="pay_type" jdbcType="VARCHAR" property="payType" />
  18. <result column="pay_way" jdbcType="VARCHAR" property="payWay" />
  19. <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" />
  20. <result column="oil_personnel" jdbcType="VARCHAR" property="oilPersonnel" />
  21. <result column="created_date" jdbcType="TIMESTAMP" property="createdDate" />
  22. <result column="order_type" jdbcType="CHAR" property="orderType" />
  23. <result column="station_name" jdbcType="CHAR" property="stationName" />
  24. <result column="receivable_amt" jdbcType="DOUBLE" property="receivableAmt" />
  25. <result column="received_amt" jdbcType="DOUBLE" property="receivedAmt" />
  26. <result column="discount_coupon" jdbcType="VARCHAR" property="discountCoupon" />
  27. <result column="discount_amt" jdbcType="DOUBLE" property="discountAmt" />
  28. <result column="discount_coupon_amt" jdbcType="DOUBLE" property="discountCouponAmt" />
  29. <result column="wx_amt" jdbcType="DOUBLE" property="wxAmt" />
  30. <result column="zfb_amt" jdbcType="DOUBLE" property="zfbAmt" />
  31. <result column="pos_amt" jdbcType="DOUBLE" property="posAmt" />
  32. <result column="xj_amt" jdbcType="DOUBLE" property="xjAmt" />
  33. <result column="didi_app_amt" jdbcType="DOUBLE" property="didiAppAmt" />
  34. <result column="ty_app_amt" jdbcType="DOUBLE" property="tyAppAmt" />
  35. <result column="other_amt" jdbcType="DOUBLE" property="otherAmt" />
  36. <result column="dzk_amt" jdbcType="TIMESTAMP" property="dzkAmt" />
  37. <result column="score" jdbcType="INTEGER" property="score" />
  38. <result column="member_no" jdbcType="VARCHAR" property="memberNo" />
  39. <result column="member_amt" jdbcType="DOUBLE" property="memberAmt" />
  40. <result column="print_count" jdbcType="INTEGER" property="printCount" />
  41. <result column="car_no" jdbcType="VARCHAR" property="carNo" />
  42. <result column="customer_phone" jdbcType="VARCHAR" property="customerPhone" />
  43. <result column="customer_grade" jdbcType="VARCHAR" property="customerGrade" />
  44. <result column="oil_type" jdbcType="VARCHAR" property="oilType" />
  45. </resultMap>
  46. <sql id="Example_Where_Clause">
  47. <where>
  48. <foreach collection="oredCriteria" item="criteria" separator="or">
  49. <if test="criteria.valid">
  50. <trim prefix="(" prefixOverrides="and" suffix=")">
  51. <foreach collection="criteria.criteria" item="criterion">
  52. <choose>
  53. <when test="criterion.noValue">
  54. and ${criterion.condition}
  55. </when>
  56. <when test="criterion.singleValue">
  57. and ${criterion.condition} #{criterion.value}
  58. </when>
  59. <when test="criterion.betweenValue">
  60. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  61. </when>
  62. <when test="criterion.listValue">
  63. and ${criterion.condition}
  64. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  65. #{listItem}
  66. </foreach>
  67. </when>
  68. </choose>
  69. </foreach>
  70. </trim>
  71. </if>
  72. </foreach>
  73. </where>
  74. </sql>
  75. <sql id="Update_By_Example_Where_Clause">
  76. <!--
  77. WARNING - @mbg.generated
  78. This element is automatically generated by MyBatis Generator, do not modify.
  79. -->
  80. <where>
  81. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  82. <if test="criteria.valid">
  83. <trim prefix="(" prefixOverrides="and" suffix=")">
  84. <foreach collection="criteria.criteria" item="criterion">
  85. <choose>
  86. <when test="criterion.noValue">
  87. and ${criterion.condition}
  88. </when>
  89. <when test="criterion.singleValue">
  90. and ${criterion.condition} #{criterion.value}
  91. </when>
  92. <when test="criterion.betweenValue">
  93. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  94. </when>
  95. <when test="criterion.listValue">
  96. and ${criterion.condition}
  97. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  98. #{listItem}
  99. </foreach>
  100. </when>
  101. </choose>
  102. </foreach>
  103. </trim>
  104. </if>
  105. </foreach>
  106. </where>
  107. </sql>
  108. <sql id="Base_Column_List">
  109. order_id, order_no, oil_gun, oil_name, oil_pirce, consumer_id, consumer, amt, station_id, status,
  110. order_liters, pay_type, pay_way, pay_date, oil_personnel, created_date, order_type, station_name,
  111. receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt,
  112. zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_no, member_amt,
  113. print_count, car_no, customer_phone, customer_grade, oil_type
  114. </sql>
  115. <sql id="Base_Column_List_oilName">
  116. SELECT
  117. T1.dict_label AS oilName,
  118. COUNT(T2.order_no) AS orderSum,
  119. SUM(IFNULL(T2.order_liters,0)) AS orderLitersSum,
  120. SUM(IFNULL(T2.receivable_amt,0)) AS receivableAmtSum,
  121. SUM(IFNULL(T2.discount_amt,0)) AS discountAmtSum,
  122. SUM(IFNULL(T2.amt,0)) AS amtSum
  123. FROM sys_dict_data AS T1
  124. LEFT JOIN pay_order AS T2 ON T1.dict_label = T2.oil_name
  125. <if test="stationId !=null">
  126. AND T2.station_id= #{stationId}
  127. </if>
  128. <if test="status !=null">
  129. AND T2.status= #{status}
  130. </if>
  131. <if test="beginTime !=null">
  132. AND T2.pay_date &gt;= #{beginTime}
  133. </if>
  134. <if test="endTime !=null">
  135. AND T2.pay_date &lt; #{endTime}
  136. </if>
  137. WHERE
  138. T1.dict_type ="oil_name"
  139. GROUP BY T1.dict_label
  140. ORDER BY amtSum DESC
  141. </sql>
  142. <sql id="Base_Column_List_payType">
  143. SELECT
  144. T1.dict_label AS payType,
  145. COUNT(T2.order_no) AS orderSum,
  146. SUM(IFNULL(T2.order_liters,0)) AS orderLitersSum,
  147. SUM(IFNULL(T2.receivable_amt,0)) AS receivableAmtSum,
  148. SUM(IFNULL(T2.discount_amt,0)) AS discountAmtSum,
  149. SUM(IFNULL(T2.amt,0)) AS amtSum
  150. FROM sys_dict_data AS T1
  151. LEFT JOIN pay_order AS T2 ON T1.dict_value = T2.pay_type
  152. <if test="stationId !=null">
  153. AND T2.station_id= #{stationId}
  154. </if>
  155. <if test="status !=null">
  156. AND T2.status= #{status}
  157. </if>
  158. <if test="beginTime !=null">
  159. AND T2.pay_date &gt;= #{beginTime}
  160. </if>
  161. <if test="endTime !=null">
  162. AND T2.pay_date &lt; #{endTime}
  163. </if>
  164. WHERE
  165. T1.dict_type ="pay_type"
  166. GROUP BY T1.dict_label
  167. ORDER BY amtSum DESC
  168. </sql>
  169. <sql id="Base_Column_List_NoGroupBy">
  170. SELECT
  171. COUNT(T2.order_no) AS orderSum,
  172. SUM(IFNULL(T2.order_liters,0)) AS orderLitersSum,
  173. SUM(IFNULL(T2.receivable_amt,0)) AS receivableAmtSum,
  174. SUM(IFNULL(T2.discount_amt,0)) AS discountAmtSum,
  175. SUM(IFNULL(T2.amt,0)) AS amtSum,
  176. SUM(IFNULL(T2.received_amt,0)) AS receivedAmtSum,
  177. SUM(IFNULL(T2.print_count,0)) AS printCountSum
  178. FROM
  179. pay_order AS T2
  180. <where>
  181. <if test="stationId !=null">
  182. T2.station_id= #{stationId}
  183. </if>
  184. <if test="status !=null">
  185. AND T2.status= #{status}
  186. </if>
  187. <if test="beginTime !=null">
  188. AND T2.pay_date &gt;= #{beginTime}
  189. </if>
  190. <if test="endTime !=null">
  191. AND T2.pay_date &lt; #{endTime}
  192. </if>
  193. </where>
  194. </sql>
  195. <!--查询油品总和-->
  196. <select id="selectSum" parameterType="com.platform.yijia.pojo.PayOrder" resultType="Map">
  197. <if test="groupBy !=null and groupBy =='oilName'">
  198. <include refid="Base_Column_List_oilName"/>
  199. </if>
  200. <if test="groupBy !=null and groupBy =='payType'">
  201. <include refid="Base_Column_List_payType"/>
  202. </if>
  203. <if test="groupBy ==''">
  204. <include refid="Base_Column_List_NoGroupBy"/>
  205. </if>
  206. </select>
  207. <!--查询班结时间内订单-->
  208. <select id="selectPayOrderList" parameterType="com.platform.yijia.pojo.PayOrder" resultMap="BaseResultMap">
  209. SELECT
  210. <include refid="Base_Column_List"/>
  211. FROM
  212. pay_order
  213. <where>
  214. <if test="stationId !=null">
  215. station_id= #{stationId}
  216. </if>
  217. <if test="status !=null">
  218. AND status= #{status}
  219. </if>
  220. <if test="beginTime !=null">
  221. AND pay_date &gt;= #{beginTime}
  222. </if>
  223. <if test="endTime !=null">
  224. AND pay_date &lt; #{endTime}
  225. </if>
  226. </where>
  227. </select>
  228. <!--初次班结 班结时间默认为当前时间订单信息-->
  229. <select id="getPayOrderInfoMin" parameterType="com.platform.yijia.pojo.PayOrder" resultMap="BaseResultMap">
  230. SELECT
  231. <include refid="Base_Column_List"/>
  232. FROM
  233. pay_order
  234. <where>
  235. <if test="stationId !=null">
  236. station_id= #{stationId}
  237. </if>
  238. <if test="status !=null">
  239. AND status= #{status}
  240. </if>
  241. </where>
  242. </select>
  243. <!--根据用户openId和用户类型userType查询用户订单-->
  244. <select id="getOrderListByOpenIdAndUserType" parameterType="com.platform.yijia.pojo.AppUserInfo" resultType="com.platform.yijia.pojo.PayOrder">
  245. SELECT
  246. B.order_no AS orderNo,
  247. B.oil_gun AS oilGun,
  248. B.oil_name AS oilName,
  249. B.consumer AS consumer,
  250. B.order_liters AS orderLiters,
  251. B.pay_date AS payDate,
  252. B.amt AS amt,
  253. B.created_date AS createdDate,
  254. B.oil_pirce AS oilPirce,
  255. B.station_name AS stationName,
  256. B.receivable_amt AS receivableAmt,
  257. B.discount_amt AS discountAmt,
  258. B.score AS score,
  259. B.status AS status,
  260. B.discount_coupon_amt AS discountCouponAmt
  261. FROM
  262. app_user_info AS A LEFT JOIN pay_order AS B ON A.user_id = B.consumer_id
  263. <where>
  264. <if test="userType != null and userType !=''">
  265. A.user_type = #{userType}
  266. </if>
  267. <if test="blogOpenid != null and blogOpenid !=''">
  268. AND A.blog_openid = #{blogOpenid}
  269. </if>
  270. <if test="minaOpenid != null and minaOpenid !=''">
  271. AND A.mina_openid = #{minaOpenid}
  272. </if>
  273. </where>
  274. ORDER BY B.created_date DESC
  275. </select>
  276. <!-- 查询加油员-->
  277. <select id="selectPersonelName" parameterType="map" resultType="map">
  278. SELECT
  279. A.personnel_id AS personnelId,
  280. A.personnel_name AS personelName,
  281. A.station_name AS stationName
  282. FROM
  283. station_personnel AS A
  284. <where>
  285. <if test="oliGunNo != null and oliGunNo !=''">
  286. FIND_IN_SET(#{oliGunNo}, A.gun_no)
  287. </if>
  288. <if test="stationId !=null and stationId !=''">
  289. AND A.station_id = #{stationId}
  290. </if>
  291. </where>
  292. </select>
  293. <!-- 根据油品名称和油站查询油枪编号和价格 -->
  294. <select id="selectOilGunNoAndOilPrice" parameterType="map" resultType="map">
  295. SELECT
  296. A.oil_gun_no AS oliGunNo,
  297. A.oil_name AS oilName,
  298. A.station_name AS stationName,
  299. B.oil_price AS oilPrice,
  300. C.personnel_name AS personelName
  301. FROM station_oil_gun AS A
  302. LEFT JOIN station_oil_price AS B ON A.oil_name = B.oil_name AND A.station_id = B.station_id
  303. LEFT JOIN station_personnel AS C ON A.oil_gun_no = C.gun_no AND A.station_id = C.station_id
  304. <where>
  305. <if test="oliGunNo != null and oliGunNo !=''">
  306. A.oil_gun_no = #{oliGunNo}
  307. </if>
  308. <if test="stationId !=null and stationId !=''">
  309. AND A.station_id = #{stationId}
  310. </if>
  311. </where>
  312. </select>
  313. <!-- 根据油品名称和油站id获取当前油品调价信息 -->
  314. <select id="selectOilPriceAdjust" parameterType="map" resultType="map">
  315. SELECT
  316. adjust_price_id AS adjustPriceId,
  317. oil_name AS oilName,
  318. oil_adjust_price AS oilAdjustPrice,
  319. take_effect_status AS takeEffectStatus,
  320. take_effect_date AS takeEffectDate,
  321. adjust_date AS adjustDate,
  322. station_id AS stationId,
  323. operator AS operator,
  324. status AS status
  325. FROM
  326. station_oil_price_adjust
  327. <where>
  328. <if test="oilName !=null and oilName !=''">
  329. oil_name = #{oilName}
  330. </if>
  331. <if test="stationId !=null and stationId !=''">
  332. AND station_id = #{stationId}
  333. </if>
  334. ORDER BY take_effect_date DESC
  335. </where>
  336. </select>
  337. <select id="selectByExample" parameterType="com.platform.yijia.pojo.PayOrderExample" resultMap="BaseResultMap">
  338. <!--
  339. WARNING - @mbg.generated
  340. This element is automatically generated by MyBatis Generator, do not modify.
  341. -->
  342. select
  343. <if test="distinct">
  344. distinct
  345. </if>
  346. <include refid="Base_Column_List" />
  347. from pay_order
  348. <if test="_parameter != null">
  349. <include refid="Example_Where_Clause" />
  350. </if>
  351. <if test="orderByClause != null">
  352. order by ${orderByClause}
  353. </if>
  354. </select>
  355. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  356. <!--
  357. WARNING - @mbg.generated
  358. This element is automatically generated by MyBatis Generator, do not modify.
  359. -->
  360. select
  361. <include refid="Base_Column_List" />
  362. from pay_order
  363. where order_id = #{orderId,jdbcType=INTEGER}
  364. </select>
  365. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  366. <!--
  367. WARNING - @mbg.generated
  368. This element is automatically generated by MyBatis Generator, do not modify.
  369. -->
  370. delete from pay_order
  371. where order_id = #{orderId,jdbcType=INTEGER}
  372. </delete>
  373. <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.PayOrderExample">
  374. <!--
  375. WARNING - @mbg.generated
  376. This element is automatically generated by MyBatis Generator, do not modify.
  377. -->
  378. delete from pay_order
  379. <if test="_parameter != null">
  380. <include refid="Example_Where_Clause" />
  381. </if>
  382. </delete>
  383. <insert id="insert" parameterType="com.platform.yijia.pojo.PayOrder">
  384. <!--
  385. WARNING - @mbg.generated
  386. This element is automatically generated by MyBatis Generator, do not modify.
  387. -->
  388. INSERT into
  389. pay_order (order_id, order_no, oil_gun,
  390. oil_name, oil_pirce, consumer_id, consumer,
  391. amt, station_id, status,
  392. order_liters, pay_type, pay_way,
  393. pay_date, oil_personnel, created_date,
  394. order_type, station_name, receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt,
  395. zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score,
  396. member_no, member_amt, print_count, car_no, customer_phone, customer_grade, oil_type)
  397. VALUES (
  398. #{orderId,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{oilGun,jdbcType=VARCHAR},
  399. #{oilName,jdbcType=VARCHAR}, #{oilPirce,jdbcType=DOUBLE}, #{consumerId,jdbcType=INTEGER}, #{consumer,jdbcType=VARCHAR},
  400. #{amt,jdbcType=DOUBLE}, #{stationId,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR},
  401. #{orderLiters,jdbcType=VARCHAR}, #{payType,jdbcType=VARCHAR}, #{payWay,jdbcType=VARCHAR},
  402. #{payDate,jdbcType=TIMESTAMP}, #{oilPersonnel,jdbcType=VARCHAR}, #{createdDate,jdbcType=TIMESTAMP},
  403. #{orderType,jdbcType=CHAR}, #{stationName,jdbcType=VARCHAR},
  404. #{receivableAmt,jdbcType=DOUBLE}, #{receivedAmt,jdbcType=DOUBLE},#{discountAmt,jdbcType=DOUBLE}, #{discountCouponAmt,jdbcType=DOUBLE},
  405. #{discountCoupon,jdbcType=INTEGER}, #{wxAmt,jdbcType=DOUBLE}, #{zfbAmt,jdbcType=DOUBLE},#{posAmt,jdbcType=DOUBLE},
  406. #{xjAmt,jdbcType=DOUBLE}, #{didiAppAmt,jdbcType=DOUBLE}, #{tyAppAmt,jdbcType=DOUBLE}, #{otherAmt,jdbcType=DOUBLE},
  407. #{dzkAmt,jdbcType=DOUBLE}, #{score,jdbcType=INTEGER}, #{memberNo,jdbcType=VARCHAR}, #{memberAmt,jdbcType=DOUBLE},
  408. #{printCount,jdbcType=INTEGER}, #{carNo,jdbcType=VARCHAR}, #{customerPhone,jdbcType=VARCHAR}, #{customerGrade,jdbcType=VARCHAR}, #{oilType,jdbcType=VARCHAR}
  409. )
  410. </insert>
  411. <insert id="insertSelective" parameterType="com.platform.yijia.pojo.PayOrder">
  412. <!--
  413. WARNING - @mbg.generated
  414. This element is automatically generated by MyBatis Generator, do not modify.
  415. -->
  416. insert into pay_order
  417. <trim prefix="(" suffix=")" suffixOverrides=",">
  418. <if test="orderId != null">
  419. order_id,
  420. </if>
  421. <if test="orderNo != null">
  422. order_no,
  423. </if>
  424. <if test="oilGun != null">
  425. oil_gun,
  426. </if>
  427. <if test="oilName != null">
  428. oil_name,
  429. </if>
  430. <if test="oilPirce != null">
  431. oil_pirce,
  432. </if>
  433. <if test="consumerId != null">
  434. consumer_id,
  435. </if>
  436. <if test="consumer != null">
  437. consumer,
  438. </if>
  439. <if test="amt != null">
  440. amt,
  441. </if>
  442. <if test="stationId != null">
  443. station_id,
  444. </if>
  445. <if test="status != null">
  446. status,
  447. </if>
  448. <if test="orderLiters != null">
  449. order_liters,
  450. </if>
  451. <if test="payType != null">
  452. pay_type,
  453. </if>
  454. <if test="payWay != null">
  455. pay_way,
  456. </if>
  457. <if test="payDate != null">
  458. pay_date,
  459. </if>
  460. <if test="oilPersonnel != null">
  461. oil_personnel,
  462. </if>
  463. <if test="createdDate != null">
  464. created_date,
  465. </if>
  466. <if test="orderType != null">
  467. order_type,
  468. </if>
  469. <if test="stationName != null">
  470. station_name,
  471. </if>
  472. <if test="receivableAmt != null">
  473. receivable_amt,
  474. </if>
  475. <if test="receivedAmt != null">
  476. received_amt,
  477. </if>
  478. <if test="discountAmt != null">
  479. discount_amt,
  480. </if>
  481. <if test="discountCouponAmt != null">
  482. discount_coupon_amt,
  483. </if>
  484. <if test="discountCoupon != null">
  485. discount_coupon,
  486. </if>
  487. <if test="wxAmt != null">
  488. wx_amt,
  489. </if>
  490. <if test="zfbAmt != null">
  491. zfb_amt,
  492. </if>
  493. <if test="posAmt != null">
  494. pos_amt,
  495. </if>
  496. <if test="didiAppAmt != null">
  497. didi_app_amt,
  498. </if>
  499. <if test="tyAppAmt != null">
  500. ty_app_amt,
  501. </if>
  502. <if test="otherAmt != null">
  503. other_amt,
  504. </if>
  505. <if test="dzkAmt != null">
  506. dzk_amt,
  507. </if>
  508. <if test="score != null">
  509. score,
  510. </if>
  511. <if test="memberNo != null">
  512. member_no,
  513. </if>
  514. <if test="memberAmt != null">
  515. member_amt,
  516. </if>
  517. <if test="printCount != null">
  518. print_count,
  519. </if>
  520. <if test="carNo != null">
  521. car_no,
  522. </if>
  523. <if test="customerPhone != null">
  524. customer_phone,
  525. </if>
  526. <if test="customerGrade != null">
  527. customer_grade,
  528. </if>
  529. <if test="oilType != null">
  530. oil_type
  531. </if>
  532. </trim>
  533. <trim prefix="values (" suffix=")" suffixOverrides=",">
  534. <if test="orderId != null">
  535. #{orderId,jdbcType=INTEGER},
  536. </if>
  537. <if test="orderNo != null">
  538. #{orderNo,jdbcType=VARCHAR},
  539. </if>
  540. <if test="oilGun != null">
  541. #{oilGun,jdbcType=VARCHAR},
  542. </if>
  543. <if test="oilName != null">
  544. #{oilName,jdbcType=VARCHAR},
  545. </if>
  546. <if test="oilPirce != null">
  547. #{oilPirce,jdbcType=DOUBLE},
  548. </if>
  549. <if test="consumerId != null">
  550. #{consumerId,jdbcType=INTEGER},
  551. </if>
  552. <if test="consumer != null">
  553. #{consumer,jdbcType=VARCHAR},
  554. </if>
  555. <if test="amt != null">
  556. #{amt,jdbcType=DOUBLE},
  557. </if>
  558. <if test="stationId != null">
  559. #{stationId,jdbcType=INTEGER},
  560. </if>
  561. <if test="status != null">
  562. #{status,jdbcType=VARCHAR},
  563. </if>
  564. <if test="orderLiters != null">
  565. #{orderLiters,jdbcType=VARCHAR},
  566. </if>
  567. <if test="payType != null">
  568. #{payType,jdbcType=VARCHAR},
  569. </if>
  570. <if test="payWay != null">
  571. #{payWay,jdbcType=VARCHAR},
  572. </if>
  573. <if test="payDate != null">
  574. #{payDate,jdbcType=TIMESTAMP},
  575. </if>
  576. <if test="oilPersonnel != null">
  577. #{oilPersonnel,jdbcType=VARCHAR},
  578. </if>
  579. <if test="createdDate != null">
  580. #{createdDate,jdbcType=TIMESTAMP},
  581. </if>
  582. <if test="orderType != null">
  583. #{orderType,jdbcType=CHAR},
  584. </if>
  585. <if test="stationName != null">
  586. #{stationName,jdbcType=VARCHAR},
  587. </if>
  588. <if test="receivableAmt != null">
  589. #{receivableAmt,jdbcType=DOUBLE},
  590. </if>
  591. <if test="receivedAmt != null">
  592. #{receivedAmt,jdbcType=DOUBLE},
  593. </if>
  594. <if test="discountAmt != null">
  595. #{discountAmt,jdbcType=DOUBLE},
  596. </if>
  597. <if test="discountCouponAmt != null">
  598. #{discountCouponAmt,jdbcType=DOUBLE},
  599. </if>
  600. <if test="discountCoupon != null">
  601. #{discountCoupon,jdbcType=VARCHAR},
  602. </if>
  603. <if test="wxAmt != null">
  604. #{wxAmt,jdbcType=DOUBLE},
  605. </if>
  606. <if test="zfbAmt != null">
  607. #{zfbAmt,jdbcType=DOUBLE},
  608. </if>
  609. <if test="posAmt != null">
  610. #{posAmt,jdbcType=DOUBLE},
  611. </if>
  612. <if test="xjAmt != null">
  613. #{xjAmt,jdbcType=DOUBLE},
  614. </if>
  615. <if test="didiAppAmt != null">
  616. #{didiAppAmt,jdbcType=DOUBLE},
  617. </if>
  618. <if test="tyAppAmt != null">
  619. #{tyAppAmt,jdbcType=DOUBLE},
  620. </if>
  621. <if test="otherAmt != null">
  622. #{otherAmt,jdbcType=DOUBLE},
  623. </if>
  624. <if test="dzkAmt != null">
  625. #{dzkAmt,jdbcType=DOUBLE},
  626. </if>
  627. <if test="score != null">
  628. #{score,jdbcType=INTEGER},
  629. </if>
  630. <if test="memberNo != null">
  631. #{memberNo,jdbcType=VARCHAR},
  632. </if>
  633. <if test="memberAmt != null">
  634. #{memberAmt,jdbcType=DOUBLE},
  635. </if>
  636. <if test="printCount != null">
  637. #{printCount,jdbcType=INTEGER},
  638. </if>
  639. <if test="carNo != null">
  640. #{carNo,jdbcType=VARCHAR},
  641. </if>
  642. <if test="customerPhone != null">
  643. #{customerPhone,jdbcType=VARCHAR},
  644. </if>
  645. <if test="customerGrade != null">
  646. #{customerGrade,jdbcType=VARCHAR},
  647. </if>
  648. <if test="oilType != null">
  649. #{oilType,jdbcType=VARCHAR}
  650. </if>
  651. </trim>
  652. </insert>
  653. <select id="countByExample" parameterType="com.platform.yijia.pojo.PayOrderExample" resultType="java.lang.Long">
  654. <!--
  655. WARNING - @mbg.generated
  656. This element is automatically generated by MyBatis Generator, do not modify.
  657. -->
  658. select count(*) from pay_order
  659. <if test="_parameter != null">
  660. <include refid="Example_Where_Clause" />
  661. </if>
  662. </select>
  663. <update id="updateByExampleSelective" parameterType="map">
  664. <!--
  665. WARNING - @mbg.generated
  666. This element is automatically generated by MyBatis Generator, do not modify.
  667. -->
  668. update pay_order
  669. <set>
  670. <if test="record.orderId != null">
  671. order_id = #{record.orderId,jdbcType=INTEGER},
  672. </if>
  673. <if test="record.orderNo != null">
  674. order_no = #{record.orderNo,jdbcType=VARCHAR},
  675. </if>
  676. <if test="record.oilGun != null">
  677. oil_gun = #{record.oilGun,jdbcType=VARCHAR},
  678. </if>
  679. <if test="record.oilName != null">
  680. oil_name = #{record.oilName,jdbcType=VARCHAR},
  681. </if>
  682. <if test="record.oilPirce != null">
  683. oil_pirce = #{record.oilPirce,jdbcType=VARCHAR},
  684. </if>
  685. <if test="record.consumerId != null">
  686. consumer_id = #{record.consumerId,jdbcType=INTEGER},
  687. </if>
  688. <if test="record.consumer != null">
  689. consumer = #{record.consumer,jdbcType=VARCHAR},
  690. </if>
  691. <if test="record.amt != null">
  692. amt = #{record.amt,jdbcType=DOUBLE},
  693. </if>
  694. <if test="record.stationId != null">
  695. station_id = #{record.stationId,jdbcType=INTEGER},
  696. </if>
  697. <if test="record.status != null">
  698. status = #{record.status,jdbcType=VARCHAR},
  699. </if>
  700. <if test="record.orderLiters != null">
  701. order_liters = #{record.orderLiters,jdbcType=VARCHAR},
  702. </if>
  703. <if test="record.payType != null">
  704. pay_type = #{record.payType,jdbcType=VARCHAR},
  705. </if>
  706. <if test="record.payWay != null">
  707. pay_way = #{record.payWay,jdbcType=VARCHAR},
  708. </if>
  709. <if test="record.payDate != null">
  710. pay_date = #{record.payDate,jdbcType=TIMESTAMP},
  711. </if>
  712. <if test="record.oilPersonnel != null">
  713. oil_personnel = #{record.oilPersonnel,jdbcType=VARCHAR},
  714. </if>
  715. <if test="record.createdDate != null">
  716. created_date = #{record.createdDate,jdbcType=TIMESTAMP},
  717. </if>
  718. <if test="record.orderType != null">
  719. order_type = #{record.orderType,jdbcType=CHAR},
  720. </if>
  721. <if test="record.stationName != null">
  722. station_name = #{record.stationName,jdbcType=VARCHAR},
  723. </if>
  724. <if test="record.receivableAmt != null">
  725. receivable_amt = #{record.receivableAmt,jdbcType=DOUBLE},
  726. </if>
  727. <if test="record.receivedAmt != null">
  728. received_amt = #{record.receivedAmt,jdbcType=DOUBLE},
  729. </if>
  730. <if test="record.discountAmt != null">
  731. discount_amt = #{record.discountAmt,jdbcType=DOUBLE},
  732. </if>
  733. <if test="record.discountCouponAmt != null">
  734. discount_coupon_amt = #{record.discountCouponAmt,jdbcType=DOUBLE},
  735. </if>
  736. <if test="record.discountCoupon != null">
  737. discount_coupon = #{record.discountCoupon,jdbcType=VARCHAR},
  738. </if>
  739. <if test="record.wxAmt != null">
  740. wx_amt = #{record.wxAmt,jdbcType=DOUBLE},
  741. </if>
  742. <if test="record.zfbAmt != null">
  743. zfb_amt = #{record.zfbAmt,jdbcType=DOUBLE},
  744. </if>
  745. <if test="record.posAmt != null">
  746. pos_amt = #{record.posAmt,jdbcType=DOUBLE},
  747. </if>
  748. <if test="record.xjAmt != null">
  749. xj_amt = #{record.xjAmt,jdbcType=DOUBLE},
  750. </if>
  751. <if test="record.didiAppAmt != null">
  752. didi_app_amt = #{record.didiAppAmt,jdbcType=DOUBLE},
  753. </if>
  754. <if test="record.tyAppAmt != null">
  755. ty_app_amt = #{record.tyAppAmt,jdbcType=DOUBLE},
  756. </if>
  757. <if test="record.otherAmt != null">
  758. other_amt = #{record.otherAmt,jdbcType=DOUBLE},
  759. </if>
  760. <if test="record.dzkAmt != null">
  761. dzk_amt = #{record.dzkAmt,jdbcType=DOUBLE},
  762. </if>
  763. <if test="record.score != null">
  764. score = #{record.score,jdbcType=INTEGER},
  765. </if>
  766. <if test="record.memberNo != null">
  767. member_no = #{record.memberNo,jdbcType=VARCHAR},
  768. </if>
  769. <if test="record.memberAmt != null">
  770. member_amt = #{record.memberAmt,jdbcType=DOUBLE},
  771. </if>
  772. <if test="record.printCount != null">
  773. print_count = #{record.printCount,jdbcType=INTEGER},
  774. </if>
  775. <if test="record.carNo != null">
  776. car_no = #{record.carNo,jdbcType=VARCHAR},
  777. </if>
  778. <if test="record.customerPhone != null">
  779. customer_phone = #{record.customerPhone,jdbcType=VARCHAR},
  780. </if>
  781. <if test="record.customerGrade != null">
  782. customer_grade = #{record.customerGrade,jdbcType=VARCHAR},
  783. </if>
  784. <if test="oilType != null">
  785. oil_type = #{record.oilType,jdbcType=VARCHAR},
  786. </if>
  787. </set>
  788. <if test="_parameter != null">
  789. <include refid="Update_By_Example_Where_Clause" />
  790. </if>
  791. </update>
  792. <!--根据订单号查询订单信息和用户信息 此方法在随行付回调之后修改状态完成后-->
  793. <select id="getOrderInfoAndUserInfoByOrderNo" parameterType="com.platform.yijia.pojo.PayOrder" resultType="map">
  794. SELECT
  795. A.order_no AS orderNo,
  796. A.consumer AS consumer,
  797. A.station_name AS stationName,
  798. A.station_id AS stationId,
  799. A.status AS status,
  800. A.pay_way AS payWay,
  801. A.oil_name AS oilName,
  802. A.oil_gun AS oilGun,
  803. A.order_liters AS orderLiters,
  804. A.amt AS amt,
  805. A.order_type AS orderType,
  806. A.oil_pirce AS oilPirce,
  807. A.receivable_amt AS receivableAmt,
  808. A.discount_amt AS discountAmt,
  809. A.created_date AS createdDate,
  810. A.consumer_id AS consumerId,
  811. B.user_type AS userType,
  812. B.registe_date AS registeDate,
  813. B.blog_openid AS blogOpenid,
  814. B.mina_openid AS minaOpenid,
  815. B.union_id AS unionId,
  816. B.mobile_phone AS mobilePhone
  817. FROM
  818. pay_order AS A
  819. LEFT JOIN app_user_info AS B ON A.consumer_id = B.user_id
  820. WHERE
  821. A.order_no = #{orderNo}
  822. </select>
  823. <!-- 更新订单-->
  824. <update id="updateOrderStatus" parameterType="com.platform.yijia.pojo.PayOrder">
  825. UPDATE
  826. pay_order
  827. <set>
  828. <if test="status != null">
  829. status = #{status,jdbcType=VARCHAR},
  830. </if>
  831. <if test="receivedAmt != null">
  832. received_amt = #{receivedAmt,jdbcType=DOUBLE},
  833. </if>
  834. <if test="payType != null">
  835. pay_type = #{payType,jdbcType=VARCHAR},
  836. </if>
  837. <if test="payDate != null">
  838. pay_date = #{payDate,jdbcType=TIMESTAMP},
  839. </if>
  840. <if test="printCount != null">
  841. print_count = #{printCount,jdbcType=INTEGER},
  842. </if>
  843. </set>
  844. <where>
  845. order_no = #{orderNo,jdbcType=VARCHAR}
  846. </where>
  847. </update>
  848. <!--根据用户登录openId 获取用户信息用于插入客户表-->
  849. <select id="getUserInfoByOpenId" parameterType="com.platform.yijia.pojo.AppUserInfo" resultType="com.platform.yijia.pojo.AppUserInfo">
  850. SELECT
  851. user_id AS userId,
  852. blog_nick_name AS blogNickName,
  853. mina_openid AS minaOpenid,
  854. blog_openid AS blogOpenid,
  855. registe_date AS registeDate,
  856. mobile_phone AS mobilePhone,
  857. user_type AS userType,
  858. union_id AS unionId,
  859. station_id AS stationId
  860. FROM
  861. app_user_info
  862. <where>
  863. <if test="mobilePhone !=null and mobilePhone !='' ">
  864. mobile_phone = #{mobilePhone}
  865. </if>
  866. <if test="stationId !=null and stationId !='' ">
  867. AND station_id = #{stationId}
  868. </if>
  869. </where>
  870. </select>
  871. <!-- 判断客户表是否已存在-->
  872. <select id="isExistCustomer" parameterType="com.platform.yijia.pojo.CustomerManage" resultType="com.platform.yijia.pojo.CustomerManage">
  873. SELECT
  874. id AS id,
  875. member_id AS memberId,
  876. member_grade AS memberGrade,
  877. phone_number AS phoneNumber,
  878. regtime AS regtime,
  879. station_name AS stationName,
  880. oil_name AS oilName,
  881. liters AS liters,
  882. amt AS amt
  883. FROM
  884. customer_manage
  885. <where>
  886. <if test="phoneNumber !=null and phoneNumber !='' ">
  887. phone_number = #{phoneNumber}
  888. </if>
  889. <if test="stationId !=null and stationId !='' ">
  890. AND station_id = #{stationId}
  891. </if>
  892. <if test="oilName !=null and oilName !='' ">
  893. AND oil_name = #{oilName}
  894. </if>
  895. </where>
  896. </select>
  897. <!-- 根据手机号更新客户表 -->
  898. <update id="updateCustomerByPhoneNumber" parameterType="com.platform.yijia.pojo.CustomerManage">
  899. UPDATE
  900. customer_manage
  901. <set>
  902. <if test="customerName !=null ">
  903. customer_name = #{customerName},
  904. </if>
  905. <if test="phoneNumber !=null ">
  906. phone_number = #{phoneNumber},
  907. </if>
  908. <if test="regtime !=null ">
  909. regtime = #{regtime},
  910. </if>
  911. <if test="stationName !=null ">
  912. station_name = #{stationName},
  913. </if>
  914. <if test="stationId !=null ">
  915. station_id = #{stationId},
  916. </if>
  917. <if test="blogUserId !=null ">
  918. blog_user_id = #{blogUserId},
  919. </if>
  920. <if test="minaUserId !=null ">
  921. mina_user_id = #{minaUserId},
  922. </if>
  923. <if test="oilName !=null ">
  924. oil_name = #{oilName},
  925. </if>
  926. <if test="liters !=null ">
  927. liters = #{liters},
  928. </if>
  929. <if test="amt !=null ">
  930. amt = #{amt},
  931. </if>
  932. <if test="unionId !=null and unionId !=null">
  933. union_id = #{unionId},
  934. </if>
  935. </set>
  936. <where>
  937. <if test="phoneNumber !=null and phoneNumber !='' ">
  938. phone_number = #{phoneNumber}
  939. </if>
  940. </where>
  941. </update>
  942. <!-- 更新客户表 -->
  943. <update id="updateCustomer" parameterType="com.platform.yijia.pojo.CustomerManage">
  944. UPDATE
  945. customer_manage
  946. <set>
  947. <if test="memberGrade !=null ">
  948. member_grade = #{memberGrade},
  949. </if>
  950. <if test="customerName !=null ">
  951. customer_name = #{customerName},
  952. </if>
  953. <if test="phoneNumber !=null ">
  954. phone_number = #{phoneNumber},
  955. </if>
  956. <if test="regtime !=null ">
  957. regtime = #{regtime},
  958. </if>
  959. <if test="stationName !=null ">
  960. station_name = #{stationName},
  961. </if>
  962. <if test="oilName !=null ">
  963. oil_name = #{oilName},
  964. </if>
  965. <if test="liters !=null ">
  966. liters = #{liters},
  967. </if>
  968. <if test="amt !=null ">
  969. amt = #{amt},
  970. </if>
  971. <if test="grade !=null ">
  972. grade = #{grade},
  973. </if>
  974. </set>
  975. <where>
  976. <if test="stationId != null and stationId !='' ">
  977. station_id = #{stationId}
  978. </if>
  979. <if test="phoneNumber !=null and phoneNumber !='' ">
  980. AND phone_number = #{phoneNumber}
  981. </if>
  982. <if test="oilName !=null and oilName !='' ">
  983. AND oil_name = #{oilName}
  984. </if>
  985. </where>
  986. </update>
  987. <!-- 插入客户表 -->
  988. <insert id="insertCustomer" parameterType="com.platform.yijia.pojo.CustomerManage">
  989. INSERT INTO customer_manage
  990. <trim prefix="(" suffix=")" suffixOverrides=",">
  991. <if test="memberId !=null ">
  992. member_id,
  993. </if>
  994. <if test="customerName !=null ">
  995. customer_name,
  996. </if>
  997. <if test="commendMan !=null ">
  998. commend_man,
  999. </if>
  1000. <if test="memberGrade !=null ">
  1001. member_grade,
  1002. </if>
  1003. <if test="phoneNumber !=null ">
  1004. phone_number,
  1005. </if>
  1006. <if test="carNumber !=null ">
  1007. car_number,
  1008. </if>
  1009. <if test="balance !=null ">
  1010. balance,
  1011. </if>
  1012. <if test="integral !=null ">
  1013. integral,
  1014. </if>
  1015. <if test="specialCarType !=null ">
  1016. specialCarType,
  1017. </if>
  1018. <if test="regtime !=null ">
  1019. regtime,
  1020. </if>
  1021. <if test="stationId !=null ">
  1022. station_id,
  1023. </if>
  1024. <if test="stationName !=null ">
  1025. station_name,
  1026. </if>
  1027. <if test="oilName !=null ">
  1028. oil_name,
  1029. </if>
  1030. <if test="liters !=null ">
  1031. liters,
  1032. </if>
  1033. <if test="amt !=null ">
  1034. amt,
  1035. </if>
  1036. <if test="cyGrade !=null ">
  1037. cy_grade,
  1038. </if>
  1039. <if test="qyGrade !=null ">
  1040. qy_grade,
  1041. </if>
  1042. <if test="blogOpenid !=null ">
  1043. blog_openid,
  1044. </if>
  1045. <if test="minaOpenid !=null ">
  1046. mina_openid,
  1047. </if>
  1048. <if test="blogUserId !=null ">
  1049. blog_user_id,
  1050. </if>
  1051. <if test="minaUserId !=null ">
  1052. mina_user_id,
  1053. </if>
  1054. <if test="grade !=null ">
  1055. grade,
  1056. </if>
  1057. <if test="unionId !=null and unionId !=''">
  1058. union_id
  1059. </if>
  1060. </trim>
  1061. <trim prefix="values (" suffix=")" suffixOverrides=",">
  1062. <if test="memberId !=null ">
  1063. #{memberId},
  1064. </if>
  1065. <if test="customerName !=null ">
  1066. #{customerName},
  1067. </if>
  1068. <if test="commendMan !=null ">
  1069. #{commendMan},
  1070. </if>
  1071. <if test="memberGrade !=null ">
  1072. #{memberGrade},
  1073. </if>
  1074. <if test="phoneNumber !=null ">
  1075. #{phoneNumber},
  1076. </if>
  1077. <if test="carNumber !=null ">
  1078. #{carNumber},
  1079. </if>
  1080. <if test="balance !=null ">
  1081. #{balance},
  1082. </if>
  1083. <if test="integral !=null ">
  1084. #{integral},
  1085. </if>
  1086. <if test="specialCarType !=null ">
  1087. #{specialCarType},
  1088. </if>
  1089. <if test="regtime !=null ">
  1090. #{regtime},
  1091. </if>
  1092. <if test="stationId !=null ">
  1093. #{stationId, jdbcType=INTEGER},
  1094. </if>
  1095. <if test="stationName !=null ">
  1096. #{stationName, jdbcType=VARCHAR},
  1097. </if>
  1098. <if test="oilName !=null ">
  1099. #{oilName},
  1100. </if>
  1101. <if test="liters !=null ">
  1102. #{liters},
  1103. </if>
  1104. <if test="amt !=null ">
  1105. #{amt},
  1106. </if>
  1107. <if test="cyGrade !=null ">
  1108. #{cyGrade},
  1109. </if>
  1110. <if test="qyGrade !=null ">
  1111. #{qyGrade},
  1112. </if>
  1113. <if test="blogOpenid !=null ">
  1114. #{blogOpenid},
  1115. </if>
  1116. <if test="minaOpenid !=null ">
  1117. #{minaOpenid, jdbcType=VARCHAR},
  1118. </if>
  1119. <if test="blogUserId !=null ">
  1120. #{blogUserId, jdbcType=INTEGER},
  1121. </if>
  1122. <if test="minaUserId !=null ">
  1123. #{minaUserId, jdbcType=INTEGER},
  1124. </if>
  1125. <if test="grade !=null ">
  1126. #{grade, jdbcType=VARCHAR},
  1127. </if>
  1128. <if test="unionId !=null and unionId !=''">
  1129. #{unionId, jdbcType=VARCHAR}
  1130. </if>
  1131. </trim>
  1132. </insert>
  1133. <update id="updateByExample" parameterType="map">
  1134. <!--
  1135. WARNING - @mbg.generated
  1136. This element is automatically generated by MyBatis Generator, do not modify.
  1137. -->
  1138. update pay_order
  1139. set order_id = #{record.orderId,jdbcType=INTEGER},
  1140. order_no = #{record.orderNo,jdbcType=VARCHAR},
  1141. oil_gun = #{record.oilGun,jdbcType=VARCHAR},
  1142. oil_name = #{record.oilName,jdbcType=VARCHAR},
  1143. oil_pirce = #{record.oilPirce,jdbcType=VARCHAR},
  1144. consumer_id = #{record.consumerId,jdbcType=INTEGER},
  1145. consumer = #{record.consumer,jdbcType=VARCHAR},
  1146. amt = #{record.amt,jdbcType=DOUBLE},
  1147. station_id = #{record.stationId,jdbcType=INTEGER},
  1148. status = #{record.status,jdbcType=VARCHAR},
  1149. order_liters = #{record.orderLiters,jdbcType=VARCHAR},
  1150. pay_type = #{record.payType,jdbcType=VARCHAR},
  1151. pay_way = #{record.payWay,jdbcType=VARCHAR},
  1152. pay_date = #{record.payDate,jdbcType=TIMESTAMP},
  1153. oil_personnel = #{record.oilPersonnel,jdbcType=VARCHAR},
  1154. created_date = #{record.createdDate,jdbcType=TIMESTAMP},
  1155. order_type = #{record.orderType,jdbcType=CHAR},
  1156. station_name = #{record.stationName,jdbcType=VARCHAR},
  1157. receivable_amt = #{record.receivableAmt,jdbcType=DOUBLE},
  1158. received_amt = #{record.receivedAmt,jdbcType=DOUBLE},
  1159. discount_amt = #{record.discountAmt,jdbcType=DOUBLE},
  1160. discount_coupon_amt = #{record.discountCouponAmt,jdbcType=DOUBLE},
  1161. discount_coupon = #{record.discountCoupon,jdbcType=DOUBLE},
  1162. wx_amt = #{record.wxAmt,jdbcType=DOUBLE},
  1163. zfb_amt = #{record.zfbAmt,jdbcType=DOUBLE},
  1164. pos_amt = #{record.posAmt,jdbcType=DOUBLE},
  1165. xj_amt = #{record.xjAmt,jdbcType=DOUBLE},
  1166. didi_app_amt = #{record.didiAppAmt,jdbcType=DOUBLE},
  1167. ty_app_amt = #{record.tyAppAmt,jdbcType=DOUBLE},
  1168. other_amt = #{record.otherAmt,jdbcType=DOUBLE},
  1169. dzk_amt = #{record.dzkAmt,jdbcType=DOUBLE},
  1170. score = #{record.score,jdbcType=INTEGER},
  1171. member_no = #{record.memberNo,jdbcType=VARCHAR},
  1172. member_amt = #{record.memberAmt,jdbcType=DOUBLE},
  1173. print_count = #{record.printCount,jdbcType=INTEGER},
  1174. car_no = #{record.carNo,jdbcType=VARCHAR},
  1175. customer_phone = #{record.customerPhone,jdbcType=VARCHAR},
  1176. customer_grade = #{record.customerGrade,jdbcType=VARCHAR},
  1177. oil_type = #{record.oilType,jdbcType=VARCHAR}
  1178. <if test="_parameter != null">
  1179. <include refid="Update_By_Example_Where_Clause" />
  1180. </if>
  1181. </update>
  1182. <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.PayOrder">
  1183. <!--
  1184. WARNING - @mbg.generated
  1185. This element is automatically generated by MyBatis Generator, do not modify.
  1186. -->
  1187. update pay_order
  1188. <set>
  1189. <if test="orderNo != null">
  1190. order_no = #{orderNo,jdbcType=VARCHAR},
  1191. </if>
  1192. <if test="oilGun != null">
  1193. oil_gun = #{oilGun,jdbcType=VARCHAR},
  1194. </if>
  1195. <if test="oilName != null">
  1196. oil_name = #{oilName,jdbcType=VARCHAR},
  1197. </if>
  1198. <if test="oilPirce != null">
  1199. oil_pirce = #{oilPirce,jdbcType=DOUBLE},
  1200. </if>
  1201. <if test="consumerId != null">
  1202. consumer_id = #{consumerId,jdbcType=INTEGER},
  1203. </if>
  1204. <if test="consumer != null">
  1205. consumer = #{consumer,jdbcType=VARCHAR},
  1206. </if>
  1207. <if test="amt != null">
  1208. amt = #{amt,jdbcType=DOUBLE},
  1209. </if>
  1210. <if test="stationId != null">
  1211. station_id = #{stationId,jdbcType=INTEGER},
  1212. </if>
  1213. <if test="status != null">
  1214. status = #{status,jdbcType=VARCHAR},
  1215. </if>
  1216. <if test="orderLiters != null">
  1217. order_liters = #{orderLiters,jdbcType=VARCHAR},
  1218. </if>
  1219. <if test="payType != null">
  1220. pay_type = #{payType,jdbcType=VARCHAR},
  1221. </if>
  1222. <if test="payWay != null">
  1223. pay_way = #{payWay,jdbcType=VARCHAR},
  1224. </if>
  1225. <if test="payDate != null">
  1226. pay_date = #{payDate,jdbcType=TIMESTAMP},
  1227. </if>
  1228. <if test="oilPersonnel != null">
  1229. oil_personnel = #{oilPersonnel,jdbcType=VARCHAR},
  1230. </if>
  1231. <if test="createdDate != null">
  1232. created_date = #{createdDate,jdbcType=TIMESTAMP},
  1233. </if>
  1234. <if test="orderType != null">
  1235. order_type = #{orderType,jdbcType=CHAR},
  1236. </if>
  1237. <if test="stationName != null">
  1238. station_name = #{stationName,jdbcType=CHAR},
  1239. </if>
  1240. <if test="receivableAmt != null">
  1241. receivable_amt = #{receivableAmt,jdbcType=DOUBLE},
  1242. </if>
  1243. <if test="receivedAmt != null">
  1244. received_amt = #{receivedAmt,jdbcType=DOUBLE},
  1245. </if>
  1246. <if test="discountAmt != null">
  1247. discount_amt = #{discountAmt,jdbcType=DOUBLE},
  1248. </if>
  1249. <if test="discountCouponAmt != null">
  1250. discount_coupon_amt = #{discountCouponAmt,jdbcType=DOUBLE},
  1251. </if>
  1252. <if test="discountCoupon != null">
  1253. discount_coupon = #{discountCoupon,jdbcType=VARCHAR},
  1254. </if>
  1255. <if test="wxAmt != null">
  1256. wx_amt = #{wxAmt,jdbcType=DOUBLE},
  1257. </if>
  1258. <if test="zfbAmt != null">
  1259. zfb_amt = #{zfbAmt,jdbcType=DOUBLE},
  1260. </if>
  1261. <if test="posAmt != null">
  1262. pos_amt = #{posAmt,jdbcType=DOUBLE},
  1263. </if>
  1264. <if test="xjAmt != null">
  1265. xj_amt = #{xjAmt,jdbcType=DOUBLE},
  1266. </if>
  1267. <if test="didiAppAmt != null">
  1268. didi_app_amt = #{didiAppAmt,jdbcType=DOUBLE},
  1269. </if>
  1270. <if test="tyAppAmt != null">
  1271. ty_app_amt = #{tyAppAmt,jdbcType=DOUBLE},
  1272. </if>
  1273. <if test="otherAmt != null">
  1274. other_amt = #{otherAmt,jdbcType=DOUBLE},
  1275. </if>
  1276. <if test="dzkAmt != null">
  1277. dzk_amt = #{dzkAmt,jdbcType=DOUBLE},
  1278. </if>
  1279. <if test="score != null">
  1280. score = #{score,jdbcType=INTEGER},
  1281. </if>
  1282. <if test="memberNo != null">
  1283. member_no = #{memberNo,jdbcType=VARCHAR},
  1284. </if>
  1285. <if test="memberAmt != null">
  1286. member_amt = #{memberAmt,jdbcType=DOUBLE},
  1287. </if>
  1288. <if test="printCount != null">
  1289. print_count = #{printCount,jdbcType=INTEGER},
  1290. </if>
  1291. <if test="carNo != null">
  1292. car_no = #{carNo,jdbcType=VARCHAR},
  1293. </if>
  1294. <if test="customerPhone != null">
  1295. customer_phone = #{customerPhone,jdbcType=VARCHAR},
  1296. </if>
  1297. <if test="oilType != null">
  1298. oil_type = #{oilType,jdbcType=VARCHAR}
  1299. </if>
  1300. </set>
  1301. where order_id = #{orderId,jdbcType=INTEGER}
  1302. </update>
  1303. <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.PayOrder">
  1304. <!--
  1305. WARNING - @mbg.generated
  1306. This element is automatically generated by MyBatis Generator, do not modify.
  1307. -->
  1308. update pay_order
  1309. set order_no = #{orderNo,jdbcType=VARCHAR},
  1310. oil_gun = #{oilGun,jdbcType=VARCHAR},
  1311. oil_name = #{oilName,jdbcType=VARCHAR},
  1312. oil_pirce = #{oilPirce,jdbcType=DOUBLE},
  1313. consumer_id = #{consumerId,jdbcType=INTEGER},
  1314. consumer = #{consumer,jdbcType=VARCHAR},
  1315. amt = #{amt,jdbcType=VARCHAR},
  1316. station_id = #{stationId,jdbcType=INTEGER},
  1317. status = #{status,jdbcType=VARCHAR},
  1318. order_liters = #{orderLiters,jdbcType=VARCHAR},
  1319. pay_type = #{payType,jdbcType=VARCHAR},
  1320. pay_way = #{payWay,jdbcType=VARCHAR},
  1321. pay_date = #{payDate,jdbcType=TIMESTAMP},
  1322. oil_personnel = #{oilPersonnel,jdbcType=VARCHAR},
  1323. created_date = #{createdDate,jdbcType=TIMESTAMP},
  1324. order_type = #{orderType,jdbcType=CHAR}
  1325. station_name = #{stationName,jdbcType=VARCHAR},
  1326. receivable_amt = #{receivableAmt,jdbcType=DOUBLE},
  1327. received_amt = #{receivedAmt,jdbcType=DOUBLE},
  1328. discount_amt = #{discountAmt,jdbcType=DOUBLE},
  1329. discount_coupon_amt = #{discountCouponAmt,jdbcType=DOUBLE},
  1330. discount_coupon = #{discountCoupon,jdbcType=DOUBLE},
  1331. wx_amt = #{wxAmt,jdbcType=DOUBLE},
  1332. zfb_amt = #{zfbAmt,jdbcType=DOUBLE},
  1333. pos_amt = #{posAmt,jdbcType=DOUBLE},
  1334. xj_amt = #{xjAmt,jdbcType=DOUBLE},
  1335. didi_app_amt = #{didiAppAmt,jdbcType=DOUBLE},
  1336. ty_app_amt = #{tyAppAmt,jdbcType=DOUBLE},
  1337. other_amt = #{otherAmt,jdbcType=DOUBLE},
  1338. dzk_amt = #{dzkAmt,jdbcType=DOUBLE},
  1339. score = #{score,jdbcType=INTEGER},
  1340. member_no = #{memberNo,jdbcType=VARCHAR},
  1341. member_amt = #{memberAmt,jdbcType=DOUBLE},
  1342. print_count = #{printCount,jdbcType=INTEGER},
  1343. car_no = #{carNo,jdbcType=VARCHAR},
  1344. customer_phone = #{customerPhone,jdbcType=VARCHAR},
  1345. customer_grade = #{customerGrade,jdbcType=VARCHAR},
  1346. oil_type = #{oilType,jdbcType=VARCHAR}
  1347. where order_id = #{orderId,jdbcType=INTEGER}
  1348. </update>
  1349. </mapper>