From dc1a4670261bc852f643d19a83ffc53eeac1b902 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Mon, 25 Jan 2021 16:16:45 +0800
Subject: [PATCH] Merge branch 'hive2.0' into api

---
 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
index dc70747..b2b7892 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
@@ -538,6 +538,8 @@
         where a.ID=#{id}
     </select>
 
+
+
     <!-- 根据手机和密码查询 -->
     <select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap">
         <include refid="select"></include>
@@ -1262,7 +1264,8 @@
                a.PHONE phone,
                a.photo photo,
                b.arriveCnt arriveCnt,
-               g.shop_short_name shopName
+               g.shop_short_name shopName,
+               z.level_name vipLevel
         from sys_vip_info a
         left join (
             select x.vip_id, count(1) arriveCnt from (
@@ -1280,6 +1283,7 @@
                                                  group by date_format(datatime, '%Y-%m-%d'), vip_id
                                              ) x group by x.vip_id
             ) b on a.ID=b.vip_id
+        left join sys_vip_level z on a.level_id=z.id
         <!-- 本月消费 -->
         <if test="record.sort == 'used'">
             left join (
@@ -1316,6 +1320,9 @@
         <if test="record.shopId != null">
             and a.shop_id=#{record.shopId}
         </if>
+        <if test="record.companyId != null">
+            and a.company_id=#{record.companyId}
+        </if>
         <if test='record.birthType=="1"'>
             and a.BIRTHDAY1 between curdate() and DATE_ADD(CURDATE(), INTERVAL 3 DAY)
         </if>
@@ -1338,6 +1345,9 @@
         <if test="record.sort != 'monthArrived' and record.sort != 'yearArrived'">
             order by ${record.sort} ${record.order}
         </if>
+        <if test="record.offset >=0  and record.limit >0">
+            limit #{record.offset},#{record.limit}
+        </if>
     </select>
 
     <select id="selectVipInfoById" resultType="com.matrix.system.app.vo.VipInfoVo">

--
Gitblit v1.9.1