SysRoleMapper.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.gxzc.zen.api.sys.mapper.SysRoleMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.gxzc.zen.api.sys.model.SysRole">
  6. <result column="id" property="id" />
  7. <result column="enable" property="enable" />
  8. <result column="remark" property="remark" />
  9. <result column="create_time" property="createTime" />
  10. <result column="create_by" property="createBy" />
  11. <result column="update_time" property="updateTime" />
  12. <result column="update_by" property="updateBy" />
  13. <result column="parent_id" property="parentId" />
  14. <result column="name" property="name" />
  15. <result column="path" property="path" />
  16. <result column="code" property="code" />
  17. <result column="ext1" property="ext1" />
  18. <result column="ext2" property="ext2" />
  19. <result column="ext3" property="ext3" />
  20. <result column="ext4" property="ext4" />
  21. <result column="ext5" property="ext5" />
  22. </resultMap>
  23. <select id="selectByUserId" resultType="com.gxzc.zen.api.sys.model.SysRole">
  24. SELECT A.*
  25. FROM sys_role AS A
  26. INNER JOIN sys_user_role AS B ON A.id = B.role_id
  27. WHERE B.user_id = #{userId}
  28. AND A.enable = 1
  29. </select>
  30. </mapper>