123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.platform.yijia.dao.ElectronicMembershipCardMapper">
- <!--储蓄卡返回结果-->
- <resultMap id="CardBaseResultMap" type="com.platform.yijia.pojo.CustomerElectronicCard">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="union_id" jdbcType="VARCHAR" property="unionId" />
- <result column="blog_openid" jdbcType="VARCHAR" property="blogOpenid" />
- <result column="mina_openid" jdbcType="VARCHAR" property="minaOpenid" />
- <result column="customer_no" jdbcType="VARCHAR" property="customerNo" />
- <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
- <result column="mobile_phone" jdbcType="VARCHAR" property="mobilePhone" />
- <result column="amt" jdbcType="DECIMAL" property="amt" />
- <result column="card_oils_type" jdbcType="VARCHAR" property="cardOilsType" />
- <result column="station_id" jdbcType="INTEGER" property="stationId" />
- <result column="station_name" jdbcType="VARCHAR" property="stationName" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="recently_time" jdbcType="TIMESTAMP" property="recentlyTime" />
- </resultMap>
- <!--储蓄卡使用记录返回结果-->
- <resultMap id="CardRecordBaseResultMap" type="com.platform.yijia.pojo.CustomerCardUseRecord">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
- <result column="blog_openid" jdbcType="VARCHAR" property="blogOpenid" />
- <result column="mina_openid" jdbcType="VARCHAR" property="minaOpenid" />
- <result column="union_id" jdbcType="VARCHAR" property="unionId" />
- <result column="ali_id" jdbcType="VARCHAR" property="aliId" />
- <result column="customer_no" jdbcType="VARCHAR" property="customerNo" />
- <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
- <result column="mobile_phone" jdbcType="VARCHAR" property="mobilePhone" />
- <result column="usage_type" jdbcType="VARCHAR" property="usageType" />
- <result column="pay_type" jdbcType="VARCHAR" property="payType" />
- <result column="card_oils_type" jdbcType="VARCHAR" property="cardOilsType" />
- <result column="amt" jdbcType="DECIMAL" property="amt" />
- <result column="present_amt" jdbcType="DECIMAL" property="presentAmt" />
- <result column="balance" jdbcType="DECIMAL" property="balance" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="station_id" jdbcType="INTEGER" property="stationId" />
- <result column="station_name" jdbcType="INTEGER" property="stationName" />
- <result column="status" jdbcType="VARCHAR" property="status" />
- <result column="oilsCardName" jdbcType="VARCHAR" property="oilsCardName" />
- </resultMap>
- <!--储蓄卡充值规则返回结果-->
- <resultMap id="CardSettingBaseResultMap" type="com.platform.yijia.pojo.CustomerCardSetting">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="card_oils_type" jdbcType="VARCHAR" property="cardOilsType" />
- <result column="discount_time_setting" jdbcType="VARCHAR" property="discountTimeSetting" />
- <result column="discount_time_type" jdbcType="VARCHAR" property="discountTimeType" />
- <result column="discount_time" jdbcType="VARCHAR" property="discountTime" />
- <result column="present_scale" jdbcType="VARCHAR" property="presentScale" />
- <result column="is_discount_coupon" jdbcType="VARCHAR" property="isDiscountCoupon" />
- <result column="enjoy_integral_multiple" jdbcType="DATE" property="enjoyIntegralMultiple" />
- <result column="station_id" jdbcType="INTEGER" property="stationId" />
- <result column="create_time" jdbcType="VARCHAR" property="createTime" />
- <result column="is_market" jdbcType="VARCHAR" property="isMarket" />
- <result column="is_grade_setting" jdbcType="VARCHAR" property="isGradeSetting" />
- <collection property="customerCardSettingDetailList" resultMap="CardSettingDetailResultMap"/>
- </resultMap>
- <!--储蓄卡充值规则明细表-->
- <resultMap id="CardSettingDetailResultMap" type="com.platform.yijia.pojo.CustomerCardSettingDetail">
- <id column="cardSettingDetailId" jdbcType="INTEGER" property="cardSettingDetailId" />
- <result column="parent_id" jdbcType="INTEGER" property="parentId"/>
- <result column="setting_rule_type" jdbcType="VARCHAR" property="settingRuleType" />
- <result column="discount_amt_start" jdbcType="DECIMAL" property="discountAmtStart" />
- <result column="discount_amt_end" jdbcType="DECIMAL" property="discountAmtEnd" />
- <result column="present_amt" jdbcType="DECIMAL" property="presentAmt"/>
- <result column="card_type" jdbcType="VARCHAR" property="cardType"/>
- <result column="status" jdbcType="VARCHAR" property="status" />
- </resultMap>
- <!--查询油站电子会员卡(储蓄卡)充值设置规则-->
- <select id="getCardRechargeSettingList" parameterType="com.platform.yijia.pojo.CustomerCardSetting" resultMap="CardSettingBaseResultMap">
- SELECT
- T1.id,
- T1.card_oils_type,
- T1.discount_time_setting,
- T1.discount_time_type,
- T1.discount_time,
- T1.present_scale,
- T1.is_discount_coupon,
- T1.enjoy_integral_multiple,
- T1.station_id,
- T1.create_time,
- T1.is_market,
- T1.is_grade_setting,
- T2.id AS cardSettingDetailId,
- T2.parent_id,
- T2.setting_rule_type,
- T2.discount_amt_start,
- T2.discount_amt_end,
- T2.present_amt,
- T2.card_type,
- T2.status
- FROM
- customer_card_setting AS T1 LEFT JOIN customer_card_setting_detail AS T2 ON T1.id = T2.parent_id
- <where>
- T2.del_flag ="0"
- <if test="stationId !=null">
- AND T1.station_id = #{stationId}
- </if>
- <if test="cardOilsType !=null">
- AND FIND_IN_SET(#{cardOilsType}, T1.card_oils_type)
- </if>
- <if test="cardOilsType !=null">
- AND T2.card_type = #{cardOilsType}
- </if>
- </where>
- <if test="orderBy !=null and orderBy !=''">
- ORDER BY T2.discount_amt_start ${orderBy}
- </if>
- </select>
- <!--查询客户充值的订单信息-->
- <select id="getCardRecordByOrderNo" parameterType="com.platform.yijia.pojo.CustomerCardUseRecord" resultMap="CardRecordBaseResultMap">
- SELECT
- T1.id,
- T1.order_no,
- T1.union_id,
- T1.ali_id,
- T2.blog_nick_name AS customer_name,
- T2.blog_openid,
- T2.mina_openid,
- T2.mobile_phone,
- T1.usage_type,
- T1.pay_type,
- T1.card_oils_type,
- T1.amt,
- T1.balance,
- T1.present_amt,
- T1.create_time,
- T1.station_id,
- T1.status,
- T3.dept_name AS station_name,
- T4.dict_label AS oilsCardName
- FROM
- customer_card_use_record AS T1
- LEFT JOIN app_user_info AS T2 ON T1.station_id = T2.station_id AND T1.union_id =T2.union_id
- LEFT JOIN sys_dept AS T3 ON T1.station_id = T3.dept_id
- LEFT JOIN sys_dict_data AS T4 ON T1.card_oils_type = T4.dict_value
- <where>
- T4.dict_type ="oil"
- <if test=" orderNo !=null and orderNo !=''">
- AND T1.order_no = #{orderNo}
- </if>
- </where>
- </select>
- <!--根据订单号更新用户充值记录的状态-->
- <update id="updateCardRecordStatusByOrderNo" parameterType="com.platform.yijia.pojo.CustomerCardUseRecord">
- UPDATE
- customer_card_use_record
- <set>
- <if test="status !=null">
- status = #{status},
- </if>
- <if test="payType !=null">
- pay_type = #{payType},
- </if>
- <if test="balance !=null">
- balance = #{balance}
- </if>
- </set>
- <where>
- <if test=" orderNo !=null and orderNo !=''">
- order_no = #{orderNo}
- </if>
- </where>
- </update>
- <!--插入用户电子会员卡的充值使用记录-->
- <insert id="insetCardUseRecordRecharge" parameterType="com.platform.yijia.pojo.CustomerCardUseRecord">
- INSERT INTO customer_card_use_record
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="orderNo !=null">
- order_no,
- </if>
- <if test="unionId !=null">
- union_id,
- </if>
- <if test="aliId !=null">
- ali_id,
- </if>
- <if test="customerNo !=null">
- customer_no,
- </if>
- <if test="customerName !=null">
- customer_name,
- </if>
- <if test="usageType !=null">
- usage_type,
- </if>
- <if test="payType !=null">
- pay_type,
- </if>
- <if test="cardOilsType !=null">
- card_oils_type,
- </if>
- <if test="amt !=null">
- amt,
- </if>
- <if test="presentAmt !=null">
- present_amt,
- </if>
- <if test="balance !=null">
- balance,
- </if>
- <if test="createTime !=null">
- create_time,
- </if>
- <if test="stationId !=null">
- station_id,
- </if>
- <if test="status !=null">
- status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="orderNo !=null">
- #{orderNo},
- </if>
- <if test="unionId !=null">
- #{unionId},
- </if>
- <if test="aliId !=null">
- #{aliId},
- </if>
- <if test="customerNo !=null">
- #{customerNo},
- </if>
- <if test="customerName !=null">
- #{customerName},
- </if>
- <if test="usageType !=null">
- #{usageType},
- </if>
- <if test="payType !=null">
- #{payType},
- </if>
- <if test="cardOilsType !=null">
- #{cardOilsType},
- </if>
- <if test="amt !=null">
- #{amt},
- </if>
- <if test="presentAmt !=null">
- #{presentAmt},
- </if>
- <if test="balance !=null">
- #{balance},
- </if>
- <if test="createTime !=null">
- #{createTime},
- </if>
- <if test="stationId !=null">
- #{stationId},
- </if>
- <if test="status !=null">
- #{status},
- </if>
- </trim>
- </insert>
- <!--插入用户电子会员卡的消费使用记录-->
- <insert id="insetCardUseRecordConsumption" parameterType="com.platform.yijia.pojo.CustomerCardUseRecord">
- INSERT INTO customer_card_use_record
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="orderNo !=null">
- order_no,
- </if>
- <if test="unionId !=null">
- union_id,
- </if>
- <if test="customerNo !=null">
- customer_no,
- </if>
- <if test="customerName !=null">
- customer_name,
- </if>
- <if test="usageType !=null">
- usage_type,
- </if>
- <if test="payType !=null">
- pay_type,
- </if>
- <if test="cardOilsType !=null">
- card_oils_type,
- </if>
- <if test="amt !=null">
- amt,
- </if>
- <if test="balance !=null">
- balance,
- </if>
- <if test="createTime !=null">
- create_time,
- </if>
- <if test="stationId !=null">
- station_id,
- </if>
- <if test="status !=null">
- status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="orderNo !=null">
- #{orderNo},
- </if>
- <if test="unionId !=null">
- #{unionId},
- </if>
- <if test="customerNo !=null">
- #{customerNo},
- </if>
- <if test="customerName !=null">
- #{customerName},
- </if>
- <if test="usageType !=null">
- #{usageType},
- </if>
- <if test="payType !=null">
- #{payType},
- </if>
- <if test="cardOilsType !=null">
- #{cardOilsType},
- </if>
- <if test="amt !=null">
- #{amt},
- </if>
- <if test="balance !=null">
- #{balance},
- </if>
- <if test="createTime !=null">
- #{createTime},
- </if>
- <if test="stationId !=null">
- #{stationId},
- </if>
- <if test="status !=null">
- #{status},
- </if>
- </trim>
- </insert>
- <!--充值-->
- <sql id="Base_Column_List_recharge">
- SELECT
- id,
- order_no,
- union_id,
- customer_no,
- customer_name,
- usage_type,
- pay_type,
- card_oils_type,
- amt,
- present_amt,
- balance,
- create_time,
- station_id,
- status
- FROM
- customer_card_record_recharge
- <where>
- status ="1"
- <if test="stationId !=null and stationId !=''">
- AND station_id = #{stationId}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- </where>
- ORDER BY create_time DESC
- </sql>
- <!--消费-->
- <sql id="Base_Column_List_consumption">
- SELECT
- id,
- order_no,
- union_id,
- customer_no,
- customer_name,
- usage_type,
- pay_type,
- card_oils_type,
- amt,
- balance,
- create_time,
- station_id,
- status
- FROM
- customer_card_record_consumption
- <where>
- <if test="stationId !=null and stationId !=''">
- AND station_id = #{stationId}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- </where>
- ORDER BY create_time DESC
- </sql>
- <!--全部-->
- <sql id="Base_Column_List">
- SELECT
- union_id, station_id, amt, present_amt, balance, card_oils_type, usage_type, create_time, `status`
- FROM customer_card_record_recharge
- <where>
- status ="1"
- <if test="stationId !=null and stationId !=''">
- AND station_id = #{stationId}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- </where>
- UNION ALL
- SELECT
- union_id, station_id, amt, "0" AS present_amt, balance, card_oils_type, usage_type,create_time, `status`
- FROM customer_card_record_consumption
- <where>
- status ="1"
- <if test="stationId !=null and stationId !=''">
- AND station_id = #{stationId}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- </where>
- ORDER BY create_time DESC
- </sql>
- <!--查询客户电子会员卡的使用记录-->
- <select id="getCardUseRecordList" resultMap="CardRecordBaseResultMap" parameterType="com.platform.yijia.pojo.CustomerCardUseRecord">
- SELECT
- union_id, station_id, amt, present_amt, usage_type, balance, card_oils_type, usage_type, create_time, `status`
- FROM customer_card_use_record
- <where>
- status ="1"
- <if test="stationId !=null and stationId !=''">
- AND station_id = #{stationId}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- <if test="usageType !=null and usageType !=''">
- AND usage_type = #{usageType}
- </if>
- </where>
- ORDER BY create_time DESC
- </select>
- <!-- 根据设置的卡规则来查询用户所拥有的储蓄卡 -->
- <select id="getElectronicCardListBycardOilsTypeArray" resultMap="CardBaseResultMap" parameterType="com.platform.yijia.pojo.CustomerElectronicCard">
- SELECT
- id,
- union_id,
- customer_no,
- customer_name,
- amt,
- card_oils_type,
- station_id,
- create_time,
- recently_time
- FROM customer_electronic_card
- <where>
- <if test="stationId !=null and stationId !=''">
- station_id = #{stationId}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- <if test="cardOilsTypeArray !=null and cardOilsTypeArray !=''">
- AND card_oils_type IN
- <foreach collection="cardOilsTypeArray" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </where>
- ORDER BY (CASE WHEN card_oils_type = 3 THEN 100 ELSE 0 END), card_oils_type
- </select>
- <!--查询用户所拥有的储蓄卡-->
- <select id="getElectronicCardList" resultMap="CardBaseResultMap" parameterType="com.platform.yijia.pojo.CustomerElectronicCard">
- SELECT
- id,
- union_id,
- customer_no,
- customer_name,
- amt,
- card_oils_type,
- station_id,
- create_time,
- recently_time
- FROM
- customer_electronic_card
- <where>
- <if test="stationId !=null and stationId !=''">
- station_id = #{stationId}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- <if test="cardOilsType !=null and cardOilsType !=''">
- AND card_oils_type = #{cardOilsType}
- </if>
- </where>
- </select>
- <!--插入用户电子会员卡-->
- <insert id="insetElectronicCard" parameterType="com.platform.yijia.pojo.CustomerElectronicCard">
- INSERT INTO
- customer_electronic_card
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="unionId !=null">
- union_id,
- </if>
- <if test="customerNo !=null">
- customer_no,
- </if>
- <if test="customerName !=null">
- customer_name,
- </if>
- <if test="mobilePhone !=null">
- mobile_phone,
- </if>
- <if test="amt !=null">
- amt,
- </if>
- <if test="cardOilsType !=null">
- card_oils_type,
- </if>
- <if test="stationId !=null">
- station_id,
- </if>
- <if test="createTime !=null">
- create_time,
- </if>
- <if test="recentlyTime !=null">
- recently_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="unionId !=null">
- #{unionId},
- </if>
- <if test="customerNo !=null">
- #{customerNo},
- </if>
- <if test="customerName !=null">
- #{customerName},
- </if>
- <if test="mobilePhone !=null">
- #{mobilePhone},
- </if>
- <if test="amt !=null">
- #{amt},
- </if>
- <if test="cardOilsType !=null">
- #{cardOilsType},
- </if>
- <if test="stationId !=null">
- #{stationId},
- </if>
- <if test="createTime !=null">
- #{createTime},
- </if>
- <if test="recentlyTime !=null">
- #{recentlyTime},
- </if>
- </trim>
- </insert>
- <!--根据unionId获取用户用要充值电子会员卡(储蓄卡)信息-->
- <select id="getElectronicCardInfoByUnionId" resultMap="CardBaseResultMap" parameterType="com.platform.yijia.pojo.CustomerElectronicCard">
- SELECT
- id,
- union_id,
- customer_no,
- customer_name,
- amt,
- card_oils_type,
- station_id,
- create_time,
- recently_time
- FROM
- customer_electronic_card
- <where>
- <if test="stationId != null" >
- station_id = #{stationId}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- <!-- <if test="blogOpenid !=null and blogOpenid !=''">-->
- <!-- AND blog_openid = #{blogOpenid}-->
- <!-- </if>-->
- <!-- <if test="minaOpenid !=null and minaOpenid !=''">-->
- <!-- AND mina_openid = #{minaOpenid}-->
- <!-- </if>-->
- <if test="cardOilsType !=null and cardOilsType !=''">
- AND card_oils_type = #{cardOilsType}
- </if>
- </where>
- </select>
- <!--获取用户用要充值电子会员卡(储蓄卡)信息-->
- <select id="getElectronicCardInfo" resultMap="CardBaseResultMap" parameterType="com.platform.yijia.pojo.CustomerElectronicCard">
- SELECT
- id,
- union_id,
- customer_no,
- customer_name,
- amt,
- card_oils_type,
- station_id,
- create_time,
- recently_time
- FROM
- customer_electronic_card
- <where>
- <if test="id !=null and id !=''">
- id = #{id}
- </if>
- </where>
- </select>
- <!--更新用户的电子会员卡的信息-->
- <update id="updateElectronicCardInfo" parameterType="com.platform.yijia.pojo.CustomerElectronicCard">
- UPDATE
- customer_electronic_card
- <set>
- <if test="amt !=null">
- amt = #{amt},
- </if>
- <if test="recentlyTime !=null">
- recently_time = #{recentlyTime}
- </if>
- </set>
- <where>
- <if test="id !=null and id != ''">
- id = #{id}
- </if>
- </where>
- </update>
- <!--根据unionId更新用户的电子会员卡的信息-->
- <update id="updateElectronicCardInfoByUnionId" parameterType="com.platform.yijia.pojo.CustomerElectronicCard">
- UPDATE customer_electronic_card
- <set>
- <if test="unionId !=null">
- union_id = #{unionId},
- </if>
- <if test="customerNo !=null">
- customer_no = #{customerNo},
- </if>
- <if test="customerName !=null">
- customer_name = #{customerName},
- </if>
- <if test="mobilePhone !=null">
- mobile_phone = #{mobilePhone},
- </if>
- <if test="amt !=null">
- amt = #{amt},
- </if>
- <if test="cardOilsType !=null">
- card_oils_type = #{cardOilsType},
- </if>
- <if test="stationId !=null">
- station_id = #{stationId},
- </if>
- <if test="createTime !=null">
- create_time = #{createTime},
- </if>
- <if test="recentlyTime !=null">
- recently_time = #{recentlyTime}
- </if>
- </set>
- <where>
- <if test="stationId !='' and stationId != null" >
- station_id = #{stationId}
- </if>
- <!-- <if test="blogOpenid !=null and blogOpenid !=''">-->
- <!-- AND blog_openid = #{blogOpenid}-->
- <!-- </if>-->
- <!-- <if test="minaOpenid !=null and minaOpenid !=''">-->
- <!-- AND mina_openid = #{minaOpenid}-->
- <!-- </if>-->
- <if test="unionId !=null and unionId != ''">
- AND union_id = #{unionId}
- </if>
- <if test="cardOilsType !='' and cardOilsType != null" >
- AND card_oils_type = #{cardOilsType}
- </if>
- </where>
- </update>
- <!--查询油站的会员卡启用标识 (1、启动 2,停用)-->
- <select id="getStationCardEnabledFlag" parameterType="Integer" resultType="String">
- SELECT
- card_enabled_flag AS cardEnabledFlag
- FROM
- sys_dept
- <where>
- <if test="stationId !='' and stationId != null" >
- dept_id = #{stationId}
- </if>
- </where>
- </select>
- <!--根据小程序用户openId查询客户电子会员卡信息-->
- <select id="getElectronicCardInfoByMinaOpenId" resultMap="CardBaseResultMap" parameterType="com.platform.yijia.pojo.CustomerElectronicCard">
- SELECT
- id,
- union_id,
- customer_no,
- customer_name,
- amt,
- card_oils_type,
- station_id,
- create_time,
- recently_time
- FROM
- customer_electronic_card
- <where>
- <if test="stationId !='' and stationId != null" >
- station_id = #{stationId}
- </if>
- <if test="minaOpenid !='' and minaOpenid != null" >
- AND mina_openid = #{minaOpenid}
- </if>
- <if test="cardOilsType !='' and cardOilsType != null" >
- AND card_oils_type = #{cardOilsType}
- </if>
- </where>
- </select>
- </mapper>
|