|
@@ -9,7 +9,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="memberId" column="member_id" />
|
|
|
<result property="customerName" column="customer_name" />
|
|
|
<result property="commendMan" column="commend_man" />
|
|
|
- <result property="memberGrade" column="member_grade" />
|
|
|
<result property="phoneNumber" column="phone_number" />
|
|
|
<result property="carNumber" column="car_number" />
|
|
|
<result property="balance" column="balance" />
|
|
@@ -18,15 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="regtime" column="regtime" />
|
|
|
<result property="stationId" column="station_id" />
|
|
|
<result property="stationName" column="station_name" />
|
|
|
- <result property="cyGrade" column="cy_grade" />
|
|
|
- <result property="qyGrade" column="qy_grade" />
|
|
|
- <result property="cyLiters" column="cy_liters" />
|
|
|
- <result property="qyLiters" column="qy_liters" />
|
|
|
<result property="cyAmt" column="cy_amt" />
|
|
|
<result property="qyAmt" column="qy_amt" />
|
|
|
- <result property="blogOpenid" column="blog_openid" />
|
|
|
- <result property="minaOpenid" column="mina_openid" />
|
|
|
- <result property="blogUserId" column="blog_user_id" />
|
|
|
<result property="minaUserId" column="mina_user_id" />
|
|
|
<result property="oilName" column="oil_name" />
|
|
|
<result property="grade" column="grade" />
|
|
@@ -40,7 +32,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCustomerManageVo">
|
|
|
- select id, member_id, customer_name, commend_man, member_grade, phone_number, car_number, balance, integral, special_car_type, regtime, station_id, station_name, cy_grade, qy_grade, cy_liters, qy_liters, cy_amt, qy_amt, blog_openid, mina_openid, blog_user_id, mina_user_id, oil_name, grade, liters, amt, union_id from customer_manage
|
|
|
+ select id, member_id, customer_name, commend_man, phone_number, car_number, balance,
|
|
|
+ integral, special_car_type, regtime, station_id, mina_user_id, oil_name, grade,
|
|
|
+ liters, amt, union_id ,d.dept_name as station_name
|
|
|
+ from customer_manage m join sys_dept d on m.station_id = d.dept_id
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectCustomerManageList" parameterType="CustomerManage" resultMap="CustomerManageResult">
|
|
@@ -49,7 +44,6 @@ 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 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>
|
|
@@ -57,16 +51,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="specialCarType != null and specialCarType != ''"> and special_car_type = #{specialCarType}</if>
|
|
|
<if test="regtime != null "> and regtime = #{regtime}</if>
|
|
|
<if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
- <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
|
|
|
- <if test="cyGrade != null and cyGrade != ''"> and cy_grade = #{cyGrade}</if>
|
|
|
- <if test="qyGrade != null and qyGrade != ''"> and qy_grade = #{qyGrade}</if>
|
|
|
- <if test="cyLiters != null "> and cy_liters = #{cyLiters}</if>
|
|
|
- <if test="qyLiters != null "> and qy_liters = #{qyLiters}</if>
|
|
|
- <if test="cyAmt != null "> and cy_amt = #{cyAmt}</if>
|
|
|
- <if test="qyAmt != null "> and qy_amt = #{qyAmt}</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="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 like concat('%', #{grade},'%')</if>
|
|
@@ -95,7 +79,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="memberId != null">member_id,</if>
|
|
|
<if test="customerName != null">customer_name,</if>
|
|
|
<if test="commendMan != null">commend_man,</if>
|
|
|
- <if test="memberGrade != null">member_grade,</if>
|
|
|
<if test="phoneNumber != null">phone_number,</if>
|
|
|
<if test="carNumber != null">car_number,</if>
|
|
|
<if test="balance != null">balance,</if>
|
|
@@ -103,16 +86,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="specialCarType != null">special_car_type,</if>
|
|
|
<if test="regtime != null">regtime,</if>
|
|
|
<if test="stationId != null">station_id,</if>
|
|
|
- <if test="stationName != null">station_name,</if>
|
|
|
- <if test="cyGrade != null">cy_grade,</if>
|
|
|
- <if test="qyGrade != null">qy_grade,</if>
|
|
|
- <if test="cyLiters != null">cy_liters,</if>
|
|
|
- <if test="qyLiters != null">qy_liters,</if>
|
|
|
- <if test="cyAmt != null">cy_amt,</if>
|
|
|
- <if test="qyAmt != null">qy_amt,</if>
|
|
|
- <if test="blogOpenid != null">blog_openid,</if>
|
|
|
- <if test="minaOpenid != null">mina_openid,</if>
|
|
|
- <if test="blogUserId != null">blog_user_id,</if>
|
|
|
<if test="minaUserId != null">mina_user_id,</if>
|
|
|
<if test="oilName != null">oil_name,</if>
|
|
|
<if test="grade != null">grade,</if>
|
|
@@ -124,7 +97,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="memberId != null">#{memberId},</if>
|
|
|
<if test="customerName != null">#{customerName},</if>
|
|
|
<if test="commendMan != null">#{commendMan},</if>
|
|
|
- <if test="memberGrade != null">#{memberGrade},</if>
|
|
|
<if test="phoneNumber != null">#{phoneNumber},</if>
|
|
|
<if test="carNumber != null">#{carNumber},</if>
|
|
|
<if test="balance != null">#{balance},</if>
|
|
@@ -132,15 +104,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="specialCarType != null">#{specialCarType},</if>
|
|
|
<if test="regtime != null">#{regtime},</if>
|
|
|
<if test="stationId != null">#{stationId},</if>
|
|
|
- <if test="stationName != null">#{stationName},</if>
|
|
|
- <if test="cyGrade != null">#{cyGrade},</if>
|
|
|
- <if test="qyGrade != null">#{qyGrade},</if>
|
|
|
- <if test="cyLiters != null">#{cyLiters},</if>
|
|
|
- <if test="qyLiters != null">#{qyLiters},</if>
|
|
|
- <if test="cyAmt != null">#{cyAmt},</if>
|
|
|
- <if test="qyAmt != null">#{qyAmt},</if>
|
|
|
- <if test="blogOpenid != null">#{blogOpenid},</if>
|
|
|
- <if test="minaOpenid != null">#{minaOpenid},</if>
|
|
|
<if test="blogUserId != null">#{blogUserId},</if>
|
|
|
<if test="minaUserId != null">#{minaUserId},</if>
|
|
|
<if test="oilName != null">#{oilName},</if>
|
|
@@ -157,7 +120,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="memberId != null">member_id = #{memberId},</if>
|
|
|
<if test="customerName != null">customer_name = #{customerName},</if>
|
|
|
<if test="commendMan != null">commend_man = #{commendMan},</if>
|
|
|
- <if test="memberGrade != null">member_grade = #{memberGrade},</if>
|
|
|
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
|
|
|
<if test="carNumber != null">car_number = #{carNumber},</if>
|
|
|
<if test="balance != null">balance = #{balance},</if>
|
|
@@ -165,16 +127,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="specialCarType != null">special_car_type = #{specialCarType},</if>
|
|
|
<if test="regtime != null">regtime = #{regtime},</if>
|
|
|
<if test="stationId != null">station_id = #{stationId},</if>
|
|
|
- <if test="stationName != null">station_name = #{stationName},</if>
|
|
|
- <if test="cyGrade != null">cy_grade = #{cyGrade},</if>
|
|
|
- <if test="qyGrade != null">qy_grade = #{qyGrade},</if>
|
|
|
- <if test="cyLiters != null">cy_liters = #{cyLiters},</if>
|
|
|
- <if test="qyLiters != null">qy_liters = #{qyLiters},</if>
|
|
|
- <if test="cyAmt != null">cy_amt = #{cyAmt},</if>
|
|
|
- <if test="qyAmt != null">qy_amt = #{qyAmt},</if>
|
|
|
- <if test="blogOpenid != null">blog_openid = #{blogOpenid},</if>
|
|
|
- <if test="minaOpenid != null">mina_openid = #{minaOpenid},</if>
|
|
|
- <if test="blogUserId != null">blog_user_id = #{blogUserId},</if>
|
|
|
<if test="minaUserId != null">mina_user_id = #{minaUserId},</if>
|
|
|
<if test="oilName != null">oil_name = #{oilName},</if>
|
|
|
<if test="grade != null">grade = #{grade},</if>
|
|
@@ -195,27 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-<!-- <select id="selectCustomerManage" parameterType="CustomerManage" resultMap="CustomerManageResult">-->
|
|
|
-<!-- 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-->
|
|
|
-<!-- 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-->
|
|
|
-<!-- <where>-->
|
|
|
-<!-- <if test="stationIdList != null ">-->
|
|
|
-<!-- and m.station_id in-->
|
|
|
-<!-- <foreach item="item" index="index" collection="stationIdList"-->
|
|
|
-<!-- open="(" separator="," close=")">-->
|
|
|
-<!-- #{item}-->
|
|
|
-<!-- </foreach>-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="carNumber != null and carNumber != ''"> and car_number = #{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>-->
|
|
|
-<!-- </where>-->
|
|
|
-<!-- GROUP BY m.union_id,m.member_id,m.customer_name,m.phone_number, m.car_number,p.points,c.union_id,c.station_id-->
|
|
|
-<!-- </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,
|
|
@@ -239,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</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 like concat('%', #{memberGrade}, '%')</if>
|
|
|
+ <if test="grade != null and grade != ''"> and grade like concat('%', #{grade}, '%')</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>
|