package org.jeecg.ctop.finance.policy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.ctop.finance.policy.entity.CwjsCompanyApprovalUser;

/**
 * 政策审核人员配置
 * @author jeecg-boot
 * 2021-08-09
 * @version V1.0
 */
public interface CwjsCompanyApprovalUserMapper extends BaseMapper<CwjsCompanyApprovalUser> {
    CwjsCompanyApprovalUser queryByCompanySubjectIdAndUserId(Integer companySubjectId, String userId);

    List<CwjsCompanyApprovalUser> queryByUserId(String userId);

    List<CwjsCompanyApprovalUser> queryByCompanySubjectId(Integer companySubjectId);

    CwjsCompanyApprovalUser queryByCompanySubjectIdAndLevel(Integer companySubjectId, Integer level);


    /**
     * 根据主体查询 最后一个审核人员
     * @param companySubjectId
     * @return
     */
    CwjsCompanyApprovalUser getEndApprovalUserBySub(Integer companySubjectId);
}
