Parcourir la source

修改客户信息

MS-QJVSRANLTYEO\Administrator il y a 4 ans
Parent
commit
673a72f99b

+ 11 - 9
yijia-customer/src/main/resources/mapper/customer/CustomerManageMapper.xml

@@ -46,8 +46,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="memberId != null  and memberId != ''"> and member_id = #{memberId}</if>
             <if test="customerName != null  and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
             <if test="commendMan != null  and commendMan != ''"> and commend_man = #{commendMan}</if>
-            <if test="memberGrade != null  and memberGrade != ''"> and member_grade = #{memberGrade}</if>
-            <if test="phoneNumber != null  and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
+            <if test="memberGrade != null  and memberGrade != ''"> and member_grade like concat('%', #{memberGrade}, '%')</if>
+            <if test="phoneNumber != null  and phoneNumber != ''"> and phone_number like concat('%', #{phoneNumber}, '%')</if>
             <if test="carNumber != null  and carNumber != ''"> and car_number = #{carNumber}</if>
             <if test="balance != null "> and balance = #{balance}</if>
             <if test="integral != null "> and integral = #{integral}</if>
@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="blogUserId != null "> and blog_user_id = #{blogUserId}</if>
             <if test="minaUserId != null "> and mina_user_id = #{minaUserId}</if>
             <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
-            <if test="grade != null  and grade != ''"> and grade = #{grade}</if>
+            <if test="grade != null  and grade != ''"> and grade like concat('%', #{grade},'%')</if>
             <if test="liters != null "> and liters = #{liters}</if>
             <if test="amt != null "> and amt = #{amt}</if>
             <if test="unionId != null  and unionId != ''"> and union_id = #{unionId}</if>
@@ -215,7 +215,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <!--    </select>-->
     <select id="selectCustomerManage" parameterType="CustomerManage" resultMap="CustomerManageResult">
         SELECT sy.*,px.pay_date from (
-        SELECT m.member_id,m.customer_name,m.phone_number,m.car_number,GROUP_CONCAT(DISTINCT(m.oil_name)) oil_name,GROUP_CONCAT(DISTINCT(m.grade)) as grade,m.union_id,p.points as integral,sum(CASE c.card_oils_type  WHEN '1' THEN  c.amt ELSE 0 END ) qy_amt,sum(CASE c.card_oils_type  WHEN '2' THEN  c.amt ELSE 0 END ) cy_amt
+        SELECT m.member_id,m.customer_name,m.phone_number,m.car_number,GROUP_CONCAT(DISTINCT(m.oil_name)) oil_name,
+        GROUP_CONCAT(DISTINCT(m.grade)) as grade,m.union_id,p.points as integral,sum(CASE c.card_oils_type  WHEN '1' THEN  c.amt ELSE 0 END ) qy_amt,
+        sum(CASE c.card_oils_type  WHEN '2' THEN  c.amt ELSE 0 END ) cy_amt,m.mina_user_id
             from customer_manage m
             left join customer_points p on m.union_id = p.union_id and m.station_id = p.station_id
             left join customer_electronic_card c on c.union_id =m.union_id and c.station_id = m.station_id
@@ -227,13 +229,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                         #{item}
                     </foreach>
                 </if>
-                <if test="carNumber != null  and carNumber != ''"> and car_number = #{carNumber}</if>
+                <if test="carNumber != null  and carNumber != ''"> and car_number like concat('%', #{carNumber}, '%')</if>
                 <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
-                <if test="memberGrade != null  and memberGrade != ''"> and member_grade = #{memberGrade}</if>
-                <if test="phoneNumber != null  and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
-                <if test="customerName != null  and customerName != ''"> and m.customer_name like concat('%', #{customerName}, '%')</if>
+                <if test="memberGrade != null  and memberGrade != ''"> and member_grade like concat('%', #{memberGrade}, '%')</if>
+                <if test="phoneNumber != null  and phoneNumber != ''"> and phone_number like concat('%', #{phoneNumber}, '%')</if>
+                <if test="customerName != null  and customerName != ''"> and m.customer_name  like concat('%', #{customerName}, '%')</if>
             </where>
-            GROUP BY m.union_id,m.member_id,m.customer_name,m.phone_number, m.car_number,p.points,c.station_id
+            GROUP BY m.union_id,m.member_id,m.customer_name,m.phone_number,m.mina_user_id, m.car_number,p.points,c.station_id
         ) sy
         LEFT JOIN (SELECT max(pay_date) pay_date ,po.consumer
         from pay_order po