|
@@ -64,6 +64,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="stationId != null ">
|
|
|
|
+ and station_id = #{stationId}
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
order by id desc
|
|
order by id desc
|
|
</select>
|
|
</select>
|
|
@@ -157,10 +160,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
sum(CASE c.card_oils_type WHEN '3' THEN c.amt ELSE 0 END ) fy_amt,
|
|
sum(CASE c.card_oils_type WHEN '3' THEN c.amt ELSE 0 END ) fy_amt,
|
|
sum(CASE c.card_oils_type WHEN '4' THEN c.amt ELSE 0 END ) lng_amt,
|
|
sum(CASE c.card_oils_type WHEN '4' THEN c.amt ELSE 0 END ) lng_amt,
|
|
sum(CASE c.card_oils_type WHEN '5' THEN c.amt ELSE 0 END ) cng_amt,
|
|
sum(CASE c.card_oils_type WHEN '5' THEN c.amt ELSE 0 END ) cng_amt,
|
|
- m.mina_user_id
|
|
|
|
|
|
+ m.mina_user_id,m.station_id,d.dept_name as station_name
|
|
from customer_manage m
|
|
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_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
|
|
left join customer_electronic_card c on c.union_id =m.union_id and c.station_id = m.station_id
|
|
|
|
+ left join sys_dept d on m.station_id = d.dept_id
|
|
<where>
|
|
<where>
|
|
<if test="stationIdList != null ">
|
|
<if test="stationIdList != null ">
|
|
and m.station_id in
|
|
and m.station_id in
|
|
@@ -169,13 +173,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="stationId != null ">
|
|
|
|
+ and m.station_id = #{stationId}
|
|
|
|
+ </if>
|
|
<if test="carNumber != null and carNumber != ''"> and car_number like concat('%', #{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="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
|
|
<if test="grade != null and grade != ''"> and grade like concat('%', #{grade}, '%')</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="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>
|
|
<if test="customerName != null and customerName != ''"> and m.customer_name like concat('%', #{customerName}, '%')</if>
|
|
</where>
|
|
</where>
|
|
- 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
|
|
|
|
|
|
+ GROUP BY m.union_id,m.member_id,m.customer_name,m.phone_number,m.mina_user_id, m.car_number,p.points,m.station_id
|
|
) sy
|
|
) sy
|
|
LEFT JOIN (SELECT max(pay_date) pay_date ,po.consumer_id
|
|
LEFT JOIN (SELECT max(pay_date) pay_date ,po.consumer_id
|
|
from pay_order po
|
|
from pay_order po
|
|
@@ -187,6 +194,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="stationId != null ">
|
|
|
|
+ and po.station_id = #{stationId}
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
GROUP BY po.consumer_id) px on sy.mina_user_id = px.consumer_id
|
|
GROUP BY po.consumer_id) px on sy.mina_user_id = px.consumer_id
|
|
order by px.pay_date desc
|
|
order by px.pay_date desc
|