package com.fs.statis.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.statis.domain.FsStatsMemberDaily;
import com.fs.statis.mapper.FsStatsMemberDailyMapper;
import com.fs.statis.service.IFsStatsMemberDailyService;
import com.fs.statis.vo.FsStatsMemberDailyVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@Service
public class FsStatsMemberDailyServiceImpl extends ServiceImpl<FsStatsMemberDailyMapper, FsStatsMemberDaily> implements IFsStatsMemberDailyService {

    /**
     * 查询会员统计数据
     * @param params    参数
     * @return  list
     */
    @Override
    public List<FsStatsMemberDailyVO> selectDailyData(Map<String, Object> params) {
        return baseMapper.selectDailyData(params);
    }

    /**
     * 更新统计数据
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void refreshMemberDailyData() {
        baseMapper.refreshMemberDailyData(LocalDate.now());
    }
}
