package com.ruoyi.project.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.time.LocalDateTime;
import java.util.List;

import com.ruoyi.project.business.domain.TcProject;
import com.ruoyi.project.business.domain.TcProjectForRelated;
import com.ruoyi.project.business.domain.vo.board.*;
import com.ruoyi.project.business.domain.vo.selectParam.ProjectParam;
import org.apache.ibatis.annotations.Param;

/**
 * 项目管理Mapper接口
 *
 * @author ruoyi
 * @date 2024-04-10
 */
public interface TcProjectMapper extends BaseMapper<TcProject> {

    /**
     * 查询项目管理
     *
     * @param projectId 项目管理主键
     * @return 项目管理
     */
    public TcProject selectTcProjectByProjectId(Long projectId);
    public TcProject selectTcProjectByProjectIdandChar(@Param("projectId") Long projectId,@Param("permissionChar") String permissionChar);
    /**
     * 查询关联项目
     *
     * @param loginId  用户ID
     * @return 项目集合
     */
    public List<TcProjectForRelated> selectProjectListByLoginId(Long loginId);
    public List<TcProjectForRelated> selectProjectListByProjectId(TcProject tcProject);
    public List<TcProjectForRelated> selectProjectListByQuery(TcProject tcProject);

    /**
     * 查询需要提醒的项目
     *
     * @param cycle 项目跟踪周期
     * @return 项目集合
     */
    public List<TcProject> selectProjectListByCycle(Long cycle);

    /**
     * 查询项目管理列表
     * 
     * @param tcProject 项目管理
     * @return 项目管理集合
     */
    public List<TcProject> selectTcProjectList(ProjectParam tcProject);

    public List<TcProject> selectTcProjectListExport(ProjectParam tcProject);

    /**
     * 新增项目管理
     * 
     * @param tcProject 项目管理
     * @return 结果
     */
    public int insertTcProject(TcProject tcProject);

    /**
     * 修改项目管理(非空才修改)
     * 
     * @param tcProject 项目管理
     * @return 结果
     */
    public int updateTcProject(TcProject tcProject);

    /**
     * 修改项目管理(全部修改)
     *
     * @param tcProject 项目管理
     * @return 结果
     */
    public int updateTcProjectAll(TcProject tcProject);

    /**
     * 删除项目管理
     * 
     * @param projectId 项目管理主键
     * @return 结果
     */
    public int deleteTcProjectByProjectId(Long projectId);

    /**
     * 批量删除项目管理
     * 
     * @param projectIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTcProjectByProjectIds(Long[] projectIds);

    /**
     * 查询客户关联项目
     *
     * @param tcProject 项目
     * @return 结果
     */
    List<TcProjectForRelated> selectProjectListByAccount(TcProject tcProject);

    List<TcProject> selectUnFollowedList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate, @Param("permissionChar") String permissionCharSea);

    /**
     * 根据项目名称查询项目个数
     */
    int selectCountByProjectName(String projectName, String permissionChar, Long projectId);

    int selectCountByAccountId(Long accountId);

    List<TcProject> selectTcProjectListApp(String permissionChar, Long userId);

    Integer existProjectByAgentIds(Long[] agentIds);

    List<TcProject> selectQuotationInfo(List<Long> projectIds);

    List<Long> selectAreasByCurUser(String permissionCharIns);

    List<Long> selectCountriesByCurUser(String permissionCharIns);

    List<String> getProjectName(@Param("ownerAgent") Long ownerAgent);

    List<TcProject> selectTcProjectListNew(ProjectParam tcProject);

    Long getNewVersion(@Param("projectId") Long projectId);

    List<TcProject> selectProjectListJDRQ();

    List<TcProject> selectTcProjectListNewWeb(ProjectParam tcProject);

    List<AgentProjectStatisticsVo> getAgentProjectStatisticsList(AgentProjectStatistics agentProjectStatistics);

    List<AgentCompleteOrderVo> getAgentCompleteOrderList(AgentCompleteOrder agentCompleteOrder);
    List<AccountCompleteOrderVo> getAccountCompleteOrderList(AgentCompleteOrder agentCompleteOrder);

    List<AgentTargetProgressVo> getAgentTargetProgressList(AgentCompleteOrder agentCompleteOrder);
    List<AgentTargetProgressVo> getAgentTargetProgressListSub(AgentTargetProgressVo agentTargetProgressVo);
}
