package com.zd.laboratory.mapper;

import com.zd.laboratory.domain.vo.LabManageWorkChartVo;
import com.zd.system.api.laboratory.domain.LabGradeManageRecord;
import com.zd.system.api.laboratory.domain.vo.LabGradeManageWorkDetailVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 管控执行记录Mapper接口
 *
 * @author liubo
 * @date 2022-02-10
 */
public interface LabGradeManageRecordMapper
{
    /**
     * 查询管控执行记录
     *
     * @param id 管控执行记录主键
     * @return 管控执行记录
     */
    public LabGradeManageRecord selectLabGradeManageRecordById(Long id);

    /**
     * 查询管控执行记录列表
     *
     * @param labGradeManageRecord 管控执行记录
     * @return 管控执行记录集合
     */
    public List<LabGradeManageRecord> selectLabGradeManageRecordList(LabGradeManageRecord labGradeManageRecord);

    /**
     * 新增管控执行记录
     *
     * @param labGradeManageRecord 管控执行记录
     * @return 结果
     */
    public int insertLabGradeManageRecord(LabGradeManageRecord labGradeManageRecord);

    /**
     * 修改管控执行记录
     *
     * @param labGradeManageRecord 管控执行记录
     * @return 结果
     */
    public int updateLabGradeManageRecord(LabGradeManageRecord labGradeManageRecord);

    /**
     * 删除管控执行记录
     *
     * @param id 管控执行记录主键
     * @return 结果
     */
    public int deleteLabGradeManageRecordById(Long id);

    /**
     * 批量删除管控执行记录
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteLabGradeManageRecordByIds(Long[] ids);

    List<LabGradeManageRecord> selectByRuleIds(List<Long> ruleIds);

    int insertBatch(@Param("entities") List<LabGradeManageRecord> insertRecordList);

    List<LabGradeManageRecord> selectExpired();

    List<LabGradeManageWorkDetailVO> selectExpiredByUserId(@Param("userId") Long userId, @Param("status") Integer status);

    int selectPlanNum(LabManageWorkChartVo workChartVo);

    int selectFinishedNum(Long deptId);

    List<LabManageWorkChartVo> queryManageWorkChartDetailsType2(LabManageWorkChartVo labManageWorkChartVo);

    Integer selectPlanNumByDeptId(Long deptId);

    Integer selectFinishedNumBySubId(LabManageWorkChartVo workChartVo);

    List<LabManageWorkChartVo> queryManageWorkCharts(LabManageWorkChartVo labManageWorkChartVo);

    Integer selectFinishedByDate(LabManageWorkChartVo labManageWorkChartVo);

    Integer selectAllWorkCountByDate(LabManageWorkChartVo chart);

    @Deprecated
    int updateStatusById(Long id);

    int selectExecutionsByUserId(@Param("userId") Long userId, @Param("status") Integer status,
                                 @Param("subId") Long subId, @Param("ruleUserId") Long ruleUserId);

    int selectCountByUserRecord(LabGradeManageRecord queryRecord);
}
