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

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

licc's avatar
licc committed
7
import java.util.List;
licc's avatar
licc committed
8
import java.util.Map;
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
    int edit(TeamPerformance teamPerformance);

24 25 26 27 28
    /**
     * 删除
     * @param id 主键ID
     * @return 1
     */
licc's avatar
licc committed
29 30
    int delById(@Param("id") Integer id);

licc's avatar
licc committed
31 32 33 34 35 36 37
    /**
     * 用户id和时间获取用户月业绩
     *
     * @param userId    用户id
     * @param yearMonth 时间
     * @return 用户月业绩
     */
licc's avatar
licc committed
38
    TeamPerformance getByUserIdAndTime(@Param("userId") String userId, @Param("yearMonth") String yearMonth);
licc's avatar
licc committed
39 40

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

    /**
     * 获取时间前的 月业绩列表
     *
     * @param yearMonth 时间
     * @return 月业绩列表
     */
licc's avatar
licc committed
55
    List<TeamPerformance> getByBeforeTime(@Param("yearMonth") String yearMonth);
licc's avatar
licc committed
56 57 58 59 60 61 62

    /**
     * 根据时间统计 所有用户业绩和
     *
     * @param yearMonth 时间
     * @return 所有用户业绩和
     */
licc's avatar
licc committed
63
    Double countByTime(@Param("yearMonth") String yearMonth);
licc's avatar
licc committed
64 65 66 67 68 69

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

licc's avatar
licc committed
72
    List<TeamPerformance> userTwenty(@Param("yearMonth") String yearMonth);
codezwjava's avatar
codezwjava committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

    /**
     * 当前用户的团队总业绩
     * @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
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
    /**
     * 统计团队业绩总记录数
     *
     * @param map 入参
     * @return 结果
     */
    int count( Map<String, Object> map);

    /**
     * 获取团队业绩流水列表
     * @param map 入参
     * @return 结果集
     */
    List<TeamPerformance> getList(Map<String, Object> map);

103 104 105 106 107 108
    /**
     *
     * @param userId
     * @return
     */
    TeamPerformance getByUserId(String userId);
licc's avatar
licc committed
109
}