AccountMapper.java 1.72 KB
Newer Older
licc's avatar
licc committed
1 2
package cn.wisenergy.mapper;

licc's avatar
licc committed
3

licc's avatar
licc committed
4 5
import cn.wisenergy.model.app.AccountInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6
import org.apache.ibatis.annotations.Param;
licc's avatar
licc committed
7

licc's avatar
licc committed
8 9 10
import java.util.List;
import java.util.Map;

11 12 13
/**
 * @author 86187
 */
licc's avatar
licc committed
14
public interface AccountMapper extends BaseMapper<AccountInfo> {
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

    /**
     * 添加
     *
     * @param accountInfo 账户信息
     * @return 1
     */
    int add(AccountInfo accountInfo);

    /**
     * 编辑
     *
     * @param accountInfo 账户信息
     * @return 1
     */
    int edit(AccountInfo accountInfo);

licc's avatar
licc committed
32
    /**
33 34 35 36
     * 删除
     *
     * @param id 主键id
     * @return 1
licc's avatar
licc committed
37
     */
38
    int delById(@Param("id") Integer id);
licc's avatar
licc committed
39

licc's avatar
licc committed
40 41
    /**
     * 通过userId获取账户信息
42
     *
licc's avatar
licc committed
43 44 45
     * @param userId 用户id
     * @return 账户信息
     */
licc's avatar
licc committed
46 47
    AccountInfo getByUserId(@Param("userId") String userId);

48 49 50 51 52 53 54 55
    /**
     * 通过userId 和 yearMonth获取账户信息
     *
     * @param userId    用户id
     * @param yearMonth 年月
     * @return 账户信息
     */
    AccountInfo getByUserIdAndTime(@Param("userId") String userId, @Param("yearMonth") String yearMonth);
56 57 58 59 60 61 62

    /**
     * 修改用户的当月收益个累计收益
     * @param accountInfo
     * @return
     */
    int updateEarningsMonthAndEarningsTotalByid(AccountInfo accountInfo);
licc's avatar
licc committed
63 64 65 66 67 68 69 70 71 72 73 74 75

    /**
     * 统计
     * @return 数量
     */
    int count();

    /**
     * 获取账户列表
     * @param map 条件
     * @return 账户列表
     */
    List<AccountInfo> getList(Map<String,Object> map);
licc's avatar
licc committed
76 77 78 79 80 81 82

    /**
     * 更新账户表时间为当前月,月收益为0
     * @param yearMonth 时间
     * @return >1
     */
    int updateMoneyAndEarningsMonth(@Param("yearMonth") String yearMonth);
licc's avatar
licc committed
83
}