package cn.com.countrygarden.bi.main.service.performance.impl;

import cn.com.countrygarden.bi.main.dao.performance.AssessmentTargetMapper;
import cn.com.countrygarden.bi.main.model.performance.AssessmentTarget;
import cn.com.countrygarden.bi.main.service.performance.AssessmentTargetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AssessmentTargetServiceImpl implements AssessmentTargetService {

    @Autowired
    private AssessmentTargetMapper dao;

    @Override
    public int deleteByPrimaryKey(Integer atid) {
        return dao.deleteByPrimaryKey(atid);
    }

    @Override
    public int insertSelective(AssessmentTarget record) {
        return dao.insertSelective(record);
    }

    @Override
    public AssessmentTarget selectByPrimaryKey(Integer atid) {
        return dao.selectByPrimaryKey(atid);
    }

    @Override
    public int updateByPrimaryKeySelective(AssessmentTarget record) {
        return dao.updateByPrimaryKeySelective(record);
    }

    @Override
    public AssessmentTarget selectJudgeLock(AssessmentTarget record) {
        return dao.selectJudgeLock(record);
    }

    /**
     * 查询最后的季度是否有发布
     *
     * @param year      年
     * @param quarterly 季度
     * @return AssessmentTarget实例化
     * @author Max
     */
    @Override
    public AssessmentTarget selectLastPublic(Integer year, String quarterly) {
        return dao.selectLastPublic(year, quarterly);
    }

    /**
     * 得到当前季度未锁定的数据
     *
     * @param year      年
     * @param quarterly 季度
     * @return 未锁定条数
     */
    @Override
    public List<AssessmentTarget> selectUnLock(Integer year, String quarterly) {
        return dao.selectUnLock(year, quarterly);
    }

    /**
     * 得到当前季度未锁定的数据—区域
     *
     * @param year      年
     * @param quarterly 季度
     * @return 未锁定条数
     */
    @Override
    public List<AssessmentTarget> selectUnLockOrgan(Integer year, String quarterly) {
        return dao.selectUnLockOrgan(year, quarterly);
    }

    /**
     * 得到当前季度未锁定的数据-城市公司
     *
     * @param year      年
     * @param quarterly 季度
     * @return 未锁定条数
     */
    @Override
    public List<AssessmentTarget> selectUnLockCompany(Integer year, String quarterly) {
        return dao.selectUnLockCompany(year, quarterly);
    }

    @Override
    public int updatePublicStatusOrgan(Integer year, String quarterly) {
        return dao.updatePublicStatusOrgan(year,quarterly);
    }

    @Override
    public int updatePublicStatusCompany(Integer year, String quarterly) {
        return dao.updatePublicStatusCompany(year,quarterly);
    }

    @Override
    public List<AssessmentTarget> selectLastPublicOrgan(Integer year, String quarterly) {
        return dao.selectLastPublicOrgan(year,quarterly);
    }

    @Override
    public List<AssessmentTarget> selectLastPublicCompany(Integer year, String quarterly) {
        return dao.selectLastPublicCompany(year,quarterly);
    }
}
