| | |
| | | @Resource
|
| | | private IntegralDetailMapper integralDetailMapper;
|
| | |
|
| | | @Override
|
| | | public void insertSelective(IntegralDetail record) {
|
| | | integralDetailMapper.insertSelective(record);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<IntegralDetailVO> listDetailForClient(Long uid, Long detailId, Date maxTime) {
|
| | | public List<IntegralDetailVO> listDetailForClient(Long uid, Long detailId, Date maxTime, Integer type) {
|
| | | List<IntegralDetailVO> finalList = new ArrayList<>();
|
| | | List<IntegralDetail> list = null;
|
| | | if (detailId == null) {// 首次请求
|
| | | if (maxTime == null)// 没有筛选时间
|
| | | {
|
| | | list = integralDetailMapper.selectByMaxCreateTime(uid,
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60L), 20);
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60L), 20, type);
|
| | | } else {// 筛选了时间
|
| | | list = integralDetailMapper.selectByMaxCreateTime(uid, maxTime, 20);
|
| | | list = integralDetailMapper.selectByMaxCreateTime(uid, maxTime, 20, type);
|
| | | }
|
| | | if (list != null && list.size() > 0) {
|
| | | Calendar calendar = Calendar.getInstance();
|
| | |
| | | } else {// 二次请求
|
| | |
|
| | | int size = 21;
|
| | | List<IntegralDetail> tempList = integralDetailMapper.selectByUidWithIndexId(uid, detailId, size);
|
| | | List<IntegralDetail> tempList = integralDetailMapper.selectByUidWithIndexId(uid, detailId, size, type);
|
| | | Set<Date> dateSet = new HashSet<>();// 用于储存是否在同一时间上面(精确到秒)
|
| | | if (tempList.size() > 0) {
|
| | | for (IntegralDetail umd : tempList) {
|
| | |
| | | while (dateSet.size() == 1 && tempList2.size() != tempList.size() && size < 40) {// 只有一个时间点的数据
|
| | | tempList = tempList2;
|
| | | size += 10;
|
| | | tempList2 = integralDetailMapper.selectByUidWithIndexId(uid, detailId, size);
|
| | | tempList2 = integralDetailMapper.selectByUidWithIndexId(uid, detailId, size, type);
|
| | | dateSet.clear();
|
| | | for (IntegralDetail umd : tempList2) {
|
| | | dateSet.add(umd.getCreateTime());
|
| | |
| | | ? "0" + monthMap.get(key).getMonth().getMonth() : monthMap.get(key).getMonth().getMonth();
|
| | | dateFormat.add(date);
|
| | | }
|
| | | List<IntegralMonthVO> voList = integralDetailMapper.selectMonthMoneyByUid(uid, dateFormat);
|
| | | List<IntegralMonthVO> voList = integralDetailMapper.selectMonthMoneyByUid(uid, dateFormat, type);
|
| | |
|
| | | int p = 0;
|
| | | keys = monthMap.keySet().iterator();
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public long countDetailForClient(Long uid, Long detailId, Date maxTime) {
|
| | | public long countDetailForClient(Long uid, Long detailId, Date maxTime, Integer type) {
|
| | | long monthCount = 0L;
|
| | | long detailCount = 0L;
|
| | | // 未通过时间筛选,查询所有
|
| | | if (maxTime == null) {
|
| | | detailCount = integralDetailMapper.selectCountByUid(uid);
|
| | | detailCount = integralDetailMapper.selectCountByUid(uid, type);
|
| | | // 用于表示当前所有
|
| | | monthCount = integralDetailMapper.selectMonthCountByUid(uid, new Date(System.currentTimeMillis() + 1000 * 60 * 60L));
|
| | | monthCount = integralDetailMapper.selectMonthCountByUid(uid, new Date(System.currentTimeMillis() + 1000 * 60 * 60L), type);
|
| | | } else {// 通过时间筛选了的,需要查询所有
|
| | | detailCount = integralDetailMapper.selectCountByUidAndMaxCreateTime(uid, maxTime);
|
| | | monthCount = integralDetailMapper.selectMonthCountByUid(uid, maxTime);
|
| | | detailCount = integralDetailMapper.selectCountByUidAndMaxCreateTime(uid, maxTime, type);
|
| | | monthCount = integralDetailMapper.selectMonthCountByUid(uid, maxTime, type);
|
| | | }
|
| | |
|
| | | return monthCount + detailCount;
|