package com.hzs.system.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.system.sys.SysApprovalBusinessDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 审批业务明细表 Mapper 接口
 *
 * @author hzs
 * @since 2022-09-21
 */
public interface SysApprovalBusinessDetailMapper extends BaseMapper<SysApprovalBusinessDetail> {

    /**
     * 批量插入数据
     *
     * @param list
     * @return
     */
    int insertBatch(List<SysApprovalBusinessDetail> list);

    /**
     * 非当前用户指定部门是否存在进行中的审核
     *
     * @param userId
     * @param deptId
     * @return
     */
    Integer detailExistByUserAndDept(@Param("userId") Long userId, @Param("deptId") Long deptId);

    /**
     * 根据审批业务ID查询审批业务明细
     *
     * @param pkIdList
     * @return
     */
    List<SysApprovalBusinessDetail> approvalDetailList(@Param("pkIdList") List<Long> pkIdList);

    /**
     * 查询终审信息
     *
     * @param pkApprovalBusiness
     * @return
     */
    SysApprovalBusinessDetail selectByMaxApprovalBusinessDetailInfo(@Param("pkApprovalBusiness") Long pkApprovalBusiness);
}
