jyy
2021-01-22 f6d898060ce3ab0bbca1924fad724858d4adc296
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
@@ -108,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>
    <!-- 查询几天内过生日的会员 -->
@@ -533,6 +537,8 @@
        <include refid="from"></include>
        where a.ID=#{id}
    </select>
    <!-- 根据手机和密码查询 -->
    <select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap">
@@ -965,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>
@@ -1255,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 (
@@ -1273,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 (
@@ -1309,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>
@@ -1331,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">