|
@@ -25,24 +25,64 @@
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <!--查询客户等级信息-->
|
|
|
|
|
|
+ <!--查询客户等级直降信息-->
|
|
<select id="getCustomerGradeInfo" parameterType="map" resultType="map">
|
|
<select id="getCustomerGradeInfo" parameterType="map" resultType="map">
|
|
SELECT
|
|
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,
|
|
T2.station_name AS stationName,
|
|
- T2.liters AS liters,
|
|
|
|
- T2.amt AS amt,
|
|
|
|
|
|
+ T3.oil_name AS oilName,
|
|
T2.member_grade AS memberGradeId,
|
|
T2.member_grade AS memberGradeId,
|
|
T3.grade AS grade,
|
|
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
|
|
|
|
|
|
+ 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
|
|
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.member_grade = T3.id
|
|
|
|
|
|
+ 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>
|
|
<where>
|
|
<if test="mobilePhone != null and mobilePhone !=''">
|
|
<if test="mobilePhone != null and mobilePhone !=''">
|
|
T1.mobile_phone = #{mobilePhone}
|
|
T1.mobile_phone = #{mobilePhone}
|
|
@@ -50,6 +90,12 @@
|
|
<if test="userType != null and userType !=''">
|
|
<if test="userType != null and userType !=''">
|
|
AND T1.user_type = #{userType}
|
|
AND T1.user_type = #{userType}
|
|
</if>
|
|
</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 != ''">
|
|
<if test="stationId != null and stationId != ''">
|
|
AND T2.station_id = #{stationId}
|
|
AND T2.station_id = #{stationId}
|
|
</if>
|
|
</if>
|