package com.dsk.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.common.core.domain.entity.BusinessInfo;
import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto;
import com.dsk.system.domain.customer.vo.CustomerBusinessListVo;
import com.dsk.system.domain.vo.BusinessBrowseVo;
import com.dsk.system.domain.vo.BusinessListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 项目详情Mapper接口
 * 
 * @author lxl
 * @date 2023-05-17
 */
@Mapper
public interface BusinessInfoMapper extends BaseMapper<BusinessInfo>
{
    /**
     * 查询项目详情
     * 
     * @param id 项目详情主键
     * @return 项目详情
     */
    public BusinessInfo selectBusinessInfoById(Integer id);

    /**
     * 查询项目建设内容
     *
     * @param id 项目详情主键
     * @return
     */
    BusinessInfo getConstruction(Integer id);

    /**
     * 查询所有项目名称(支持模糊查询)
     * @return
     */
    List<String> selectProjectName(BusinessListDto dto);

    /**
     * 查询项目详情列表
     * 
     * @param dto 项目详情
     * @return 项目详情集合
     */
    public List<BusinessListVo> selectBusinessInfoList(BusinessListDto dto);

    /**
     * 新增项目详情
     * 
     * @param businessInfo 项目详情
     * @return 结果
     */
    public int insertBusinessInfo(BusinessInfo businessInfo);

    /**
     * 修改项目详情
     *
     * @param businessInfo 项目详情
     * @return 结果
     */
    public int updateBusinessInfo(BusinessInfo businessInfo);

    /**
     * 删除项目详情
     *
     * @param id 项目详情主键
     * @return 结果
     */
    public int deleteBusinessInfoById(Long id);

    /**
     * 批量删除项目详情
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBusinessInfoByIds(Long[] ids);

    /**
     * 统计项目相关的信息数量
     * @param business
     * @return
     */
    BusinessBrowseVo selectTotal(Integer business);



    int selectCountByStatusAndCustomerId(@Param("status") Integer status,@Param("customerId") String customerId);

    List<CustomerBusinessListVo> selectCustomerBusinessList(CustomerBusinessSearchDto dto);

}
