package com.retdata.yaoyibi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.retdata.yaoyibi.domain.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;
import java.util.List;

public interface SysImplPlanMapper extends BaseMapper<SysImplPlan> {

    Page<SysImplPlanSearchDto> selectPageByParams(Page<SysImplPlanSearchDto> page,
                                                  @Param("searchParams") SysImplPlanSearchParams searchParams);

    @Select("select dept_id,name from sys_dept where dept_id in (select distinct consignor_id from sys_impl_plan)")
    List<CsoSysDeptSummary> selectConsignors();

    @Select("select dept_id,name from sys_dept where dept_id in (select distinct consignee_id from sys_impl_plan)")
    List<CsoSysDeptSummary> selectConsignees();

    List<SysImplPlanExportDto> selectExportData(@Param("searchParams") SysImplPlanSearchParams searchParams);

    List<SysImplPlanExportDto> selectExportDtoByPlanIds(@Param("planIds") Collection<Long> planIds);
}
