TeamPerformanceMapper.java 2.07 KB
Newer Older
licc's avatar
licc committed
1 2 3 4 5 6 7
package cn.wisenergy.mapper;

import cn.wisenergy.model.app.TeamPerformance;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
licc's avatar
licc committed
8
import java.util.List;
licc's avatar
licc committed
9 10 11 12

/**
 * @author 86187
 */
licc's avatar
licc committed
13
public interface TeamPerformanceMapper extends BaseMapper<TeamPerformance> {
licc's avatar
licc committed
14 15 16 17 18 19 20

    int add(TeamPerformance teamPerformance);

    int edit(TeamPerformance teamPerformance);

    int delById(@Param("id") Integer id);

licc's avatar
licc committed
21 22 23 24 25 26 27
    /**
     * 用户id和时间获取用户月业绩
     *
     * @param userId    用户id
     * @param yearMonth 时间
     * @return 用户月业绩
     */
licc's avatar
licc committed
28
    TeamPerformance getByUserIdAndTime(@Param("userId") String userId, @Param("yearMonth") String yearMonth);
licc's avatar
licc committed
29 30

    /**
licc's avatar
licc committed
31 32
     * 统计 等级月业绩和
     *
licc's avatar
licc committed
33 34
     * @param userLevel 等级
     * @param yearMonth 年月
licc's avatar
licc committed
35
     * @return 等级总金额
licc's avatar
licc committed
36
     */
licc's avatar
licc committed
37
    Double countTeamMoney(@Param("userLevel") Integer userLevel, @Param("yearMonth") String yearMonth);
licc's avatar
licc committed
38 39 40 41 42 43 44

    /**
     * 获取时间前的 月业绩列表
     *
     * @param yearMonth 时间
     * @return 月业绩列表
     */
licc's avatar
licc committed
45
    List<TeamPerformance> getByBeforeTime(@Param("yearMonth") String yearMonth);
licc's avatar
licc committed
46 47 48 49 50 51 52

    /**
     * 根据时间统计 所有用户业绩和
     *
     * @param yearMonth 时间
     * @return 所有用户业绩和
     */
licc's avatar
licc committed
53
    Double countByTime(@Param("yearMonth") String yearMonth);
licc's avatar
licc committed
54 55 56 57 58 59

    /**
     * 月业绩排名前20人 业绩和
     * @param yearMonth 时间
     * @return 业绩和
     */
licc's avatar
licc committed
60
    Double countTwenty(@Param("yearMonth") String yearMonth);
licc's avatar
licc committed
61

licc's avatar
licc committed
62
    List<TeamPerformance> userTwenty(@Param("yearMonth") String yearMonth);
codezwjava's avatar
codezwjava committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77

    /**
     * 当前用户的团队总业绩
     * @param userId 当前用户id
     * @return 当前用户的团队累计总业绩金额
     */
    Double countUserTeamByUserId(@Param("userId") String userId);

    /**
     * 当前用户本月团队新增业绩
     * @param userId 用户Id
     * @return 当前用户本月团队新增业绩
     */
    Double monthUserTeamByuserId(@Param("userid") String userId,@Param("yearMonth") String yearMonth);

licc's avatar
licc committed
78
}