package com.dsk.cscec.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.cscec.domain.AdvisoryBody;
import com.dsk.cscec.domain.bo.AdvisoryBodyBo;
import com.dsk.cscec.domain.vo.AdvisoryBodySearchVo;
import com.dsk.cscec.domain.vo.AdvisoryBodyVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 咨询机构(SysAdvisoryBody)表数据库访问层
 *
 * @author sxk
 * @since 2023-12-12 10:12:04
 */
public interface AdvisoryBodyMapper extends BaseMapper<AdvisoryBody> {
    /**
     * 获取所有企业列表(咨询机构)数据
     */
    Page<AdvisoryBodySearchVo> selectPageAdvisoryBodyList(@Param("page") Page<AdvisoryBodySearchVo> page, @Param(Constants.WRAPPER) Wrapper<AdvisoryBody> queryWrapper);

    /**
     * 咨询机构合作记录
     * @param build
     * @param bo
     * @return
     */
    Page<AdvisoryBodyVo> queryListByBo(IPage<AdvisoryBodyBo> build, @Param("bo") AdvisoryBodyBo bo);

    /**
     * 咨询机构合作记录数量
     * @param bo
     * @return
     */
    int countByBo(@Param("bo") AdvisoryBodyBo bo);

    /**
     * 根据咨询机构名称查询咨询机构Cids
     * @param advisoryBodyName 咨询机构名称
     * @return 项目IDs
     */
    List<Long> selectAdvisoryBodyCidsByName(@Param("advisoryBodyName") String advisoryBodyName);

    /**
     * 根据项目主键查询咨询机构
     *
     * @param projectKey 项目主键
     * @return 咨询机构
     */
    AdvisoryBody queryAdvisoryBodyByProjectKey(@Param("projectKey") Long projectKey);
}

