| | |
| | | package com.yeshi.fanli.dao.mybatis.money; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail; |
| | | import com.yeshi.fanli.vo.money.UserMonthMoneyVO; |
| | | |
| | | public interface UserMoneyDetailMapper extends BaseMapper<UserMoneyDetail> { |
| | | /** |
| | | * 通过用户ID和返回的最大时间的详情ID来获取下一页的数据 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<UserMoneyDetail> selectByUidWithIndexId(@Param("uid") Long uid, @Param("id") Long id, |
| | | @Param("count") int count); |
| | | |
| | | /** |
| | | * 获取用户总共有多少记录数据 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Long selectCountByUid(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 按最大的创建时间和用户ID检索列表 |
| | | * |
| | | * @param uid |
| | | * @param date |
| | | * @return |
| | | */ |
| | | List<UserMoneyDetail> selectByMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date, |
| | | @Param("count") int count); |
| | | |
| | | /** |
| | | * 按最大的创建时间和用户ID检索数量 |
| | | * |
| | | * @param uid |
| | | * @param date |
| | | * @return |
| | | */ |
| | | Long selectCountByUidAndMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date); |
| | | |
| | | /** |
| | | * 按用户ID和最大时间检索月份的数量 |
| | | * |
| | | * @param uid |
| | | * @param maxDate |
| | | * @return |
| | | */ |
| | | int selectMonthCountByUid(@Param("uid") Long uid, @Param("date") Date maxDate); |
| | | |
| | | /** |
| | | * 统计某个月份的收入与支出 |
| | | * |
| | | * @param uid |
| | | * @param dateFormat |
| | | * @return |
| | | */ |
| | | List<UserMonthMoneyVO> selectMonthMoneyByUid(@Param("uid") Long uid, @Param("dateFormat") List<String> dateFormat); |
| | | |
| | | /** |
| | | * 根据用户ID获取资金明细(老版) |
| | | * @param uid |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | |
| | | List<UserMoneyDetail> selectByUidWithState(@Param("uid")Long uid,@Param("start") long start, @Param("count")int count); |
| | | |
| | | Long selectCountByUidWithState(@Param("uid")Long uid); |
| | | |
| | | package com.yeshi.fanli.dao.mybatis.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.vo.money.UserMonthMoneyVO;
|
| | |
|
| | | public interface UserMoneyDetailMapper extends BaseMapper<UserMoneyDetail> {
|
| | | /**
|
| | | * 通过用户ID和返回的最大时间的详情ID来获取下一页的数据
|
| | | * |
| | | * @param uid
|
| | | * @param id
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<UserMoneyDetail> selectByUidWithIndexId(@Param("uid") Long uid, @Param("id") Long id,
|
| | | @Param("count") int count, @Param("type") Integer type);
|
| | |
|
| | | /**
|
| | | * 获取用户总共有多少记录数据
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | Long selectCountByUid(@Param("uid") Long uid, @Param("type") Integer type);
|
| | |
|
| | | /**
|
| | | * 按最大的创建时间和用户ID检索列表
|
| | | * |
| | | * @param uid
|
| | | * @param date
|
| | | * @return
|
| | | */
|
| | | List<UserMoneyDetail> selectByMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date,
|
| | | @Param("count") int count, @Param("type") Integer type);
|
| | |
|
| | | /**
|
| | | * 按最大的创建时间和用户ID检索数量
|
| | | * |
| | | * @param uid
|
| | | * @param date
|
| | | * @return
|
| | | */
|
| | | Long selectCountByUidAndMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date, @Param("type") Integer type);
|
| | |
|
| | | /**
|
| | | * 按用户ID和最大时间检索月份的数量
|
| | | * |
| | | * @param uid
|
| | | * @param maxDate
|
| | | * @return
|
| | | */
|
| | | int selectMonthCountByUid(@Param("uid") Long uid, @Param("date") Date maxDate, @Param("type") Integer type);
|
| | |
|
| | | /**
|
| | | * 统计某个月份的收入与支出
|
| | | * |
| | | * @param uid
|
| | | * @param dateFormat
|
| | | * @return
|
| | | */
|
| | | List<UserMonthMoneyVO> selectMonthMoneyByUid(@Param("uid") Long uid, @Param("dateFormat") List<String> dateFormat);
|
| | |
|
| | | /**
|
| | | * 根据用户ID获取资金明细(老版)
|
| | | * |
| | | * @param uid
|
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | |
|
| | | List<UserMoneyDetail> selectByUidWithState(@Param("uid") Long uid, @Param("start") long start,
|
| | | @Param("count") int count);
|
| | |
|
| | | Long selectCountByUidWithState(@Param("uid") Long uid);
|
| | |
|
| | | /**
|
| | | * 统计某个用户某段时间内产生的明细之和
|
| | | * |
| | | * @param uid
|
| | | * @param typeList
|
| | | * @param minDate
|
| | | * @param maxDate
|
| | | * @return
|
| | | */
|
| | | BigDecimal getTotalMoneyByTypeAndUidWithDate(@Param("uid") Long uid, @Param("typeList") List<String> typeList,
|
| | | @Param("minDate") Date minDate, @Param("maxDate") Date maxDate);
|
| | |
|
| | | /**
|
| | | * 根据类型,用户ID,唯一标识查询
|
| | | * @param type
|
| | | * @param uid
|
| | | * @param sourceIdentifyId
|
| | | * @return
|
| | | */
|
| | | UserMoneyDetail selectByTypeAndUidAndIdentifyCode(@Param("type") UserMoneyDetailTypeEnum type,
|
| | | @Param("uid") Long uid, @Param("sourceIdentifyId") Long sourceIdentifyId);
|
| | |
|
| | | } |