zhujie
9 天以前 8240ad4079ecb4562451c92a4d436a91a9dcf0ca
src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java
@@ -49,9 +49,41 @@
    @Select("select count(1) from t_customer_info where reintervialcode = #{code}")
    Integer getInvitatCountByCode(@Param("code") String code);
    @Select("select user_id as userId,name as userName,t1.reward from t_customer_info c" +
            "inner join (select reintervialcode,count(DISTINCT id) as reward from t_customer_info where reintervialcode is not null and reintervialcode <> '' group by reintervialcode) t1 on c.intervialcode=t1.reintervialcode")
    @Select("SELECT " +
            "    c.user_id as userId," +
            "    c.name as userName," +
            "    CASE " +
            "        WHEN t1.reward < 3 THEN '获得了3天会员' " +
            "        WHEN t1.reward >= 3 AND t1.reward < 5 THEN '获得了15天会员' " +
            "        WHEN t1.reward >=5 THEN '获得了30天会员' " +
            "        ELSE '' " +
            "    END AS reward ," +
            "    '已注册' as status " +
            "FROM " +
            "    t_customer_info c " +
            "    INNER JOIN (" +
            "        SELECT " +
            "            reintervialcode, " +
            "            COUNT(DISTINCT id) AS reward" +
            "        FROM " +
            "            t_customer_info " +
            "        WHERE " +
            "            reintervialcode IS NOT NULL " +
            "            AND reintervialcode <> '' " +
            "        GROUP BY " +
            "            reintervialcode " +
            "    ) t1 ON c.intervialcode = t1.reintervialcode")
    List<InviteDTO> getReward();
    @Select("SELECT " +
            "c.user_id AS userId, " +
            "c.NAME AS userName, " +
            "'' AS reward, " +
            "'已注册' AS STATUS  " +
            "FROM " +
            "t_customer_info c " +
            "WHERE " +
            "reintervialcode IN ( SELECT intervialcode FROM t_customer_info WHERE user_id = #{userid} )")
    List<InviteDTO> getMyReward(String userid);
    void checkVipExpireTime();
}