package com.jpsoft.shinestar.modules.base.service.impl;

import com.github.pagehelper.Page;
import com.jpsoft.shinestar.modules.base.dao.CheckNumCompanyDAO;
import com.jpsoft.shinestar.modules.base.entity.CheckNumCompany;
import com.jpsoft.shinestar.modules.base.entity.CompanyInfo;
import com.jpsoft.shinestar.modules.base.service.CheckNumCompanyService;
import com.jpsoft.shinestar.modules.common.dto.Sort;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author 墨鱼_mo
 * @date 2020-3-27 10:32
 */
@Transactional
@Component(value="checkNumCompanyService")
public class CheckNumCompanyServiceImpl implements CheckNumCompanyService {

    @Resource(name="checkNumCompanyDAO")
    private CheckNumCompanyDAO checkNumCompanyDAO;


    @Override
    public CheckNumCompany get(Long id) {
        return checkNumCompanyDAO.get(id);
    }


    @Override
    public int insert(CheckNumCompany model) {
        return checkNumCompanyDAO.insert(model);
    }

    @Override
    public int update(CheckNumCompany model) {
        return checkNumCompanyDAO.update(model);
    }

    @Override
    public int delete(Long id) {
        return checkNumCompanyDAO.delete(id);
    }

    @Override
    public List<CheckNumCompany> list() {
        return checkNumCompanyDAO.list();
    }

    @Override
    public Page<CheckNumCompany> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList) {
        return null;
    }

    @Override
    public CheckNumCompany findByCompanyIdAndRecordTime(String companyId, String recordTime) {
        return checkNumCompanyDAO.findByCompanyIdAndRecordTime(companyId,recordTime);
    }

    @Override
    public Integer getDayCheckNum(String recordTime) {
        return checkNumCompanyDAO.getDayCheckNum(recordTime);
    }

    @Override
    public Integer getDayCheckNumByCompanyList(String recordTime, List<CompanyInfo> list) {
        return checkNumCompanyDAO.getDayCheckNumByCompanyList(recordTime,list);
    }

    @Override
    public List<CheckNumCompany> findByRecordTime(String recordTime) {
        return checkNumCompanyDAO.findByRecordTime(recordTime);
    }

    @Override
    public Integer getDayNormalNumByCompanyList(String day, List<CompanyInfo> list) {
        return checkNumCompanyDAO.getDayNormalNumByCompanyList(day,list);
    }

    @Override
    public Integer getDayAbnormalNumByCompanyList(String day, List<CompanyInfo> list) {
        return checkNumCompanyDAO.getDayAbnormalNumByCompanyList(day,list);
    }
}
