package com.hzs.bonus.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.bonus.base.service.ICuMemberAchieveLogService;
import com.hzs.common.core.enums.*;
import com.hzs.common.domain.member.detail.CuMemberAchieveLog;
import com.hzs.bonus.base.mapper.CuMemberAchieveLogMapper;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * 注水业绩记录表 服务实现类
 *
 * @author zhangjing
 * @since 2023-02-03
 */
@Service
public class CuMemberAchieveLogServiceImpl extends ServiceImpl<CuMemberAchieveLogMapper, CuMemberAchieveLog> implements ICuMemberAchieveLogService {

    @Override
    public List<CuMemberAchieveLog> queryMemberAchieveLogByPeriod(Integer period) {
        LambdaQueryWrapper<CuMemberAchieveLog> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CuMemberAchieveLog::getPeriod, period);
        queryWrapper.in(CuMemberAchieveLog::getApproveStatus, EApproveStatus.FINISH.getValue());
        queryWrapper.orderByAsc(CuMemberAchieveLog::getPkMember, CuMemberAchieveLog::getCreationTime);
        return baseMapper.selectList(queryWrapper);
    }

}
