package com.ruoyi.bst.area.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.bst.area.domain.AreaQuery;
import com.ruoyi.bst.area.domain.vo.AreaStatVO;
import com.ruoyi.bst.area.mapper.AreaMapper;
import com.ruoyi.bst.area.service.AreaDashboard;
import com.ruoyi.common.utils.MathUtils;
import com.ruoyi.dashboard.constants.StatKeys;

@Service
public class AreaDashboardImpl implements AreaDashboard {

    @Autowired
    private AreaMapper areaMapper;

    @Override
    public AreaStatVO selectStat(AreaQuery query, List<String> keys) {
        AreaStatVO vo = new AreaStatVO();
        if (keys.contains(StatKeys.AREA_COUNT)) {
            vo.setCount(MathUtils.dv(areaMapper.selectCount(query)));
        }
        return vo;
    }
    
}
