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

import cn.com.countrygarden.bi.main.dao.performance.AssessmentMonthlyTargetMapper;
import cn.com.countrygarden.bi.main.model.performance.monthly.AssessmentMonthlyTarget;
import cn.com.countrygarden.bi.main.service.performance.AssessmentMonthlyTargetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 月度考核相关状态
 * @author Max Date:2018/09/19
 * @version 1.0
 * @since 1.8
 */
@Service
public class AssessmentMonthlyTargetServiceImpl implements AssessmentMonthlyTargetService {

    @Autowired
    private AssessmentMonthlyTargetMapper dao;

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

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

    @Override
    public AssessmentMonthlyTarget selectByPrimaryKey(Integer amtId) {
        return dao.selectByPrimaryKey(amtId);
    }

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

    //查询状态
    @Override
    public AssessmentMonthlyTarget selectJudgeLock(long elementId, int year, int month) {
        return dao.selectJudgeLock(elementId,year,month);
    }

    @Override
    public List<AssessmentMonthlyTarget> getUnLockOrgans(Integer year, Integer month) {
        return dao.selectUnLockOrganList(year,month);
    }

    @Override
    public List<AssessmentMonthlyTarget> getUnLockCompanys(Integer year, Integer month) {
        return dao.selectUnLockCompanyList(year,month);
    }

    @Override
    public void updateOrganMonthlyPublicStatus(Integer year, Integer month) {
        dao.updateOrganMonthlyPublicStatus(year,month);
    }

    @Override
    public void updateCompanyMonthlyPublicStatus(Integer year, Integer month) {
        dao.updateCompanyMonthlyPublicStatus(year,month);
    }

    @Override
    public List<AssessmentMonthlyTarget> getOgranLastMonthPublic(Integer year, Integer month) {
        return dao.selectMonthlyLastPublicOrgan(year,month);
    }

    @Override
    public List<AssessmentMonthlyTarget> getCompanyLastMonthPublic(Integer year, Integer month) {
        return dao.selectMonthlyLastPublicCompany(year,month);
    }
}
