DeptMapper.java 821 B

12345678910111213141516171819202122232425262728293031
  1. package easydo.technology.system.mapper;
  2. import easydo.technology.base.CommonMapper;
  3. import easydo.technology.system.domain.Dept;
  4. import org.apache.ibatis.annotations.Select;
  5. import org.springframework.stereotype.Repository;
  6. import java.util.Set;
  7. /**
  8. * @author jinjin
  9. * @date 2020-09-25
  10. */
  11. @Repository
  12. public interface DeptMapper extends CommonMapper<Dept> {
  13. @Select("select d.dept_id as id, d.* from sys_dept d where dept_id = #{id}")
  14. Dept selectLink(Long id);
  15. @Select("SELECT " +
  16. " d.dept_id as id, " +
  17. " d.* " +
  18. "FROM " +
  19. " sys_dept d " +
  20. "LEFT OUTER JOIN " +
  21. " sys_roles_depts rd ON d.dept_id = rd.dept_id " +
  22. "WHERE " +
  23. " rd.role_id = #{roleId}")
  24. Set<Dept> selectByRoleId(Long roleId);
  25. }