package com.wzj.soopin.statistics.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wzj.soopin.statistics.mapper.StoreStatisticsMapper;
import com.wzj.soopin.statistics.service.StoreStatisticsService;
import org.dromara.system.domain.SysTenant;
import org.springframework.stereotype.Service;

/**
 * 商品统计业务层实现
 *
 * @author Bulbasaur
 * @since 2020/12/9 11:30
 */
@Service
public class StoreStatisticsServiceImpl extends ServiceImpl<StoreStatisticsMapper, SysTenant> implements StoreStatisticsService {


    @Override
    public long auditNum() {
        LambdaQueryWrapper<SysTenant> queryWrapper = Wrappers.lambdaQuery();
//        queryWrapper.eq(Store::getStoreDisable, StoreStatusEnum.APPLYING.name());
        return this.count(queryWrapper);
    }

    @Override
    public long storeNum() {
        LambdaQueryWrapper<SysTenant> queryWrapper = Wrappers.lambdaQuery();
//        queryWrapper.eq(Store::getStoreDisable, StoreStatusEnum.OPEN.name());
        return this.count(queryWrapper);
    }

    @Override
    public long todayStoreNum() {
        LambdaQueryWrapper<SysTenant> queryWrapper = Wrappers.lambdaQuery();
//        queryWrapper.eq(Store::getStoreDisable, StoreStatusEnum.OPEN.name());
//        queryWrapper.ge(Store::getCreateTime, DateUtil.beginOfDay(new DateTime()));
        return this.count(queryWrapper);
    }

}
