123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?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.CustomerGradeMapper">
- <!-- 查询直降优惠方案 -->
- <select id="getCustomerGradeList" resultType="map" parameterType="map">
- SELECT
- id AS id,
- grade AS grade,
- discount_way AS discountWay,
- gasoil_discount_litre AS gasoilDiscountLitre,
- gasoil_discount_litre AS dieseloilDiscountLitre,
- member_condit AS memberCondit,
- station_id AS stationId,
- station_name AS stationName,
- oil_name AS oilName
- FROM customer_grade_setting
- <where>
- <if test="stationId != null and stationId != ''">
- station_id = #{stationId}
- </if>
- <if test="oilName != null and oilName != ''">
- AND oil_name = #{oilName}
- </if>
- </where>
- </select>
- <!--查询客户等级直降信息-->
- <select id="getCustomerGradeInfo" parameterType="map" resultType="map">
- SELECT
- T2.station_name AS stationName,
- T2.member_grade AS memberGradeId,
- T3.grade AS grade,
- T3.discount_way AS discountWay,
- T3.oil_name AS oilName,
- T3.gasoil_discount_litre AS gasoilDiscountLitre,
- T3.member_condit_start AS memberConditStart,
- T3.member_condit_end AS memberConditEnd,
- T3.member_condit AS memberCondit
- FROM
- app_user_info AS T1
- LEFT JOIN customer_manage AS T2 ON T1.mobile_phone = T2.phone_number
- LEFT JOIN customer_grade_setting AS T3 ON T2.station_id = T3.station_id AND T2.oil_name = T3.oil_name
- <!-- <if test="grade !=null and grade != ''"> AND T3.grade = T2.member_grade </if>-->
- <where>
- <if test="mobilePhone != null and mobilePhone !=''">
- T1.mobile_phone = #{mobilePhone}
- </if>
- <if test="userType != null and userType !=''">
- AND T1.user_type = #{userType}
- </if>
- <if test="oilName != null and oilName !=''">
- AND T2.oil_name = #{oilName}
- </if>
- <if test="stationId != null and stationId != ''">
- AND T2.station_id = #{stationId}
- </if>
- <if test="blogOpenid != null and blogOpenid != ''">
- AND T1.blog_openid = #{blogOpenid}
- </if>
- <if test="minaOpenid != null and minaOpenid != ''">
- AND T1.mina_openid = #{minaOpenid}
- </if>
- </where>
- </select>
- <!--查询客户等级优惠信息-->
- <select id="getCustomerGradeInfoByYouHui" parameterType="map" resultType="map">
- SELECT
- T2.station_name AS stationName,
- T3.oil_name AS oilName,
- T2.member_grade AS memberGradeId,
- T3.grade AS grade,
- T3.discount_term AS discountTerm,
- T3.gasoil_discount_amt AS gasoilDiscountAmt,
- T3.discount_amt AS discountAmt,
- T3.vip_discounty_plus AS vipDiscountyPlus,
- T3.coupon_plus AS couponPlus,
- T3.discount_plan_type AS discountPlanType
- FROM
- app_user_info AS T1
- LEFT JOIN customer_manage AS T2 ON T1.mobile_phone = T2.phone_number
- LEFT JOIN markert_plan AS T3 ON T3.station_id = T2.station_id AND T3.oil_name = T2.oil_name
- <!-- <if test="grade !=null and grade != ''"> AND T3.grade = T2.member_grade </if>-->
- <where>
- <if test="mobilePhone != null and mobilePhone !=''">
- T1.mobile_phone = #{mobilePhone}
- </if>
- <if test="userType != null and userType !=''">
- AND T1.user_type = #{userType}
- </if>
- <if test="oilName != null and oilName !=''">
- AND T2.oil_name = #{oilName}
- </if>
- <if test="discountPlanType != null and discountPlanType !=''">
- AND T3.discount_plan_type = #{discountPlanType}
- </if>
- <if test="stationId != null and stationId != ''">
- AND T2.station_id = #{stationId}
- </if>
- <if test="blogOpenid != null and blogOpenid != ''">
- AND T1.blog_openid = #{blogOpenid}
- </if>
- <if test="minaOpenid != null and minaOpenid != ''">
- AND T1.mina_openid = #{minaOpenid}
- </if>
- </where>
- </select>
- <!-- 营销立减-->
- <select id="getMarkertPlanListByDiscountPlanType" resultType="map">
- SELECT
- id AS id,
- grade AS grade,
- discount_term AS discountWay,
- discount_amt AS discountAmt,
- gasoil_discount_amt AS gasoilDiscountAmt,
- dieseloil_discount_amt AS dieseloilDiscountAmt,
- vip_discounty_plus AS vipDiscountyPlus,
- coupon_plus AS couponPlus,
- discount_plan_type AS discountPlanType
- FROM
- markert_plan
- <where>
- discount_plan_type = "2"
- </where>
- </select>
- </mapper>
|