TeamPerformanceMapper.java 2.16 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

    int add(TeamPerformance teamPerformance);

licc's avatar
licc committed
17 18 19 20 21
    /**
     * 编辑
     * @param teamPerformance 团队业绩
     * @return 1
     */
licc's avatar
licc committed
22 23 24 25
    int edit(TeamPerformance teamPerformance);

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

licc's avatar
licc committed
26 27 28 29 30 31 32
    /**
     * 用户id和时间获取用户月业绩
     *
     * @param userId    用户id
     * @param yearMonth 时间
     * @return 用户月业绩
     */
licc's avatar
licc committed
33
    TeamPerformance getByUserIdAndTime(@Param("userId") String userId, @Param("yearMonth") String yearMonth);
licc's avatar
licc committed
34 35

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

    /**
     * 获取时间前的 月业绩列表
     *
     * @param yearMonth 时间
     * @return 月业绩列表
     */
licc's avatar
licc committed
50
    List<TeamPerformance> getByBeforeTime(@Param("yearMonth") String yearMonth);
licc's avatar
licc committed
51 52 53 54 55 56 57

    /**
     * 根据时间统计 所有用户业绩和
     *
     * @param yearMonth 时间
     * @return 所有用户业绩和
     */
licc's avatar
licc committed
58
    Double countByTime(@Param("yearMonth") String yearMonth);
licc's avatar
licc committed
59 60 61 62 63 64

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

licc's avatar
licc committed
67
    List<TeamPerformance> userTwenty(@Param("yearMonth") String yearMonth);
codezwjava's avatar
codezwjava committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82

    /**
     * 当前用户的团队总业绩
     * @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
83
}