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.List;

public interface CsoSysUserMapper extends BaseMapper<CsoSysUser> {
    Page<CsoSysUserSearchDto> selectPageByParams(Page<CsoSysUserSearchDto> page,
                                                 @Param("searchParams") CsoSysUserSearchParams searchParams);

    CsoSysUserDetailDto selectDetailById(@Param("userId") Integer userId);

    @Select("select dept_id,name from sys_dept where dept_id in (select dept_id from sys_user)")
    List<CsoSysDeptSummary> selectDeptSummary();

    @Select("select id,entname from wm_da_drug_ent where id in (select drug_ent_id from sys_user)")
    List<WmDaDrugEnt> selectDrugEnt();
}
