package cn.com.countrygarden.bi.main.dao.performance;

import cn.com.countrygarden.bi.main.model.performance.AssessmentTarget;
import cn.com.countrygarden.bi.main.model.performance.monthly.AssessmentMonthlyTarget;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 月度考核相关状态
 *
 * @author Max Date:2018/09/19
 * @version 1.0
 * @since 1.8
 */
public interface AssessmentMonthlyTargetMapper {
    int deleteByPrimaryKey(Integer amtId);

    int insertSelective(AssessmentMonthlyTarget record);

    AssessmentMonthlyTarget selectByPrimaryKey(Integer amtId);

    int updateByPrimaryKeySelective(AssessmentMonthlyTarget record);

    //查询状态
    AssessmentMonthlyTarget selectJudgeLock(@Param(value = "elementId") long elementId, @Param(value = "year") int year, @Param(value = "month") int month);

    //查询lock_status值为0的区域对象
    List<AssessmentMonthlyTarget> selectUnLockOrganList(@Param(value = "year") Integer year,@Param(value = "month") Integer month);

    //查询lock_status值为0的城市公司对象
    List<AssessmentMonthlyTarget> selectUnLockCompanyList(@Param(value = "year") Integer year,@Param(value = "month") Integer month);

    //修改月度发布的值--区域
    void updateOrganMonthlyPublicStatus(@Param(value = "year") Integer year, @Param(value = "month") Integer month);

    //修改月度发布的值--城市公司
    void updateCompanyMonthlyPublicStatus(@Param(value = "year") Integer year, @Param(value = "month") Integer month);

    //查询最新月份是否发布了--区域
    List<AssessmentMonthlyTarget> selectMonthlyLastPublicOrgan(@Param(value = "year") Integer year, @Param(value = "month") Integer month);


    //查询最新月份是否发布了--城市公司
    List<AssessmentMonthlyTarget> selectMonthlyLastPublicCompany(@Param(value = "year") Integer year, @Param(value = "month") Integer month);

}