935090232@qq.com
2021-01-15 e971ea090aa1f320f3c3f78c3a2a8d50f16dd4d0
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
@@ -38,6 +38,7 @@
        <result property="province" column="province"/>
        <result property="city" column="city"/>
        <result property="area" column="area"/>
        <result property="recommendId" column="recommend_id"/>
        <result property="statu" column="statu"/>
        <result property="birthdayType" column="birthdayType"/>
@@ -107,6 +108,10 @@
        <!-- 扩展属性 -->
        <result property="staffName" column="STAFF_NAME"/>
        <result property="shopName" column="SHOP_NAME"/>
        <association property="vipLevel" javaType="com.matrix.system.hive.bean.SysVipLevel" >
            <result property="levelName" column="levelName"/>
            <result property="vipLevel" column="vipLevel"/>
        </association>
    </resultMap>
    <!-- 查询几天内过生日的会员 -->
@@ -532,6 +537,8 @@
        <include refid="from"></include>
        where a.ID=#{id}
    </select>
    <!-- 根据手机和密码查询 -->
    <select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap">
@@ -964,12 +971,15 @@
      a.province,
      a.city,
      a.area,
      a.recommend_id
      a.recommend_id,
      e.level_name levelName,
      e.vip_level vipLevel
   </sql>
    <sql id="from">
      from sys_vip_info a
      left join sys_users c on c.su_id =a.STAFF_ID
      left join sys_shop_info d ON d.ID=a.SHOP_ID
      left join sys_vip_level e on a.level_id=e.id
      
   </sql>
@@ -1254,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 (
@@ -1272,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 (