package com.zsc.edu.gateway.modules.system.repo;

import com.zsc.edu.gateway.modules.system.entity.Dept;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zsc.edu.gateway.modules.system.entity.User;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 部门 Mapper 接口
 * </p>
 *
 * @author Yao
 * @since 2023-04-06
 */
public interface DeptRepository extends BaseMapper<Dept> {
    @Select("SELECT d.*, u.* FROM sys_dept d LEFT JOIN sys_user u ON d.id = u.dept_id")
    List<Dept> selectAllWithMembers();
}
