浏览代码

电子卡,充值消费查询增加条件

zangguocen 3 年之前
父节点
当前提交
5e3958f91a

+ 6 - 0
yijia-customer/src/main/resources/mapper/customer/CustomerCardUseRecordMapper.xml

@@ -51,6 +51,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{item}
                 </foreach>
             </if>
+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+                AND date_format(c.create_time,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
+            </if>
+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+                AND date_format(c.create_time,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
+            </if>
             <if test="status != null  and status != ''"> and c.status = #{status}</if>
         </where>
         order by id desc

+ 22 - 0
yijia-customer/src/main/resources/mapper/customer/CustomerManageMapper.xml

@@ -169,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="stationId != null ">
                 and po.station_id  = #{stationId}
             </if>
+            <if test="oilName != null  and oilName != ''"> and po.oil_name like concat('%', #{oilName}, '%')</if>
             and status ="1"
         </where>
 		GROUP BY po.consumer_id order by created_date  desc ) p
@@ -184,6 +185,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="stationId != null ">
                 and m.station_id  = #{stationId}
             </if>
+            <if test="customerName != null  and customerName != ''">
+                and m.customer_name like concat('%', #{customerName}, '%')
+            </if>
+            <if test="commendMan != null  and commendMan != ''">
+                and m.commend_man = #{commendMan}
+             </if>
+            <if test="phoneNumber != null  and phoneNumber != ''">
+                and m.phone_number like concat('%', #{phoneNumber}, '%')
+             </if>
+            <if test="oilName != null  and oilName != ''"> and m.oil_name like concat('%', #{oilName}, '%')</if>
         </where>
         GROUP BY member_id,customer_name, phone_number,car_number,  mina_user_id, station_id, union_id,created_date
         order by max( created_date )  desc
@@ -239,6 +250,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="stationId != null ">
                 and po.station_id  = #{stationId}
             </if>
+            <if test="oilName != null  and oilName != ''"> and po.oil_name like concat('%', #{oilName}, '%')</if>
             and status ="1"
         </where>
          GROUP BY po.consumer_id order by created_date desc ) p
@@ -254,6 +266,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="stationId != null ">
                 and m.station_id  = #{stationId}
             </if>
+            <if test="customerName != null  and customerName != ''">
+                and m.customer_name like concat('%', #{customerName}, '%')
+            </if>
+            <if test="commendMan != null  and commendMan != ''">
+                and m.commend_man = #{commendMan}
+            </if>
+            <if test="phoneNumber != null  and phoneNumber != ''">
+                and m.phone_number like concat('%', #{phoneNumber}, '%')
+            </if>
+            <if test="oilName != null  and oilName != ''"> and m.oil_name like concat('%', #{oilName}, '%')</if>
         </where>
         GROUP BY customer_name, mina_user_id, phone_number, member_id
     </select>