<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.community.huiju.dao.TpSysRoleMapper">

    <select id="selectByUserIdAndRoleId" parameterType="map" resultType="com.community.huiju.model.TpSysRole">
      SELECT tsr.* from
      tp_sys_user_role tsur
      LEFT JOIN tp_sys_role tsr
      on tsur.role_id = tsr.id
      WHERE tsur.user_id = #{userId}
    </select>
    <select id="allUserRole" parameterType="int" resultType="com.community.huiju.model.TpSysRole">
    SELECT
    role_name,
    id
    FROM
    tp_sys_role
    WHERE community_id=#{communityId,jdbcType=INTEGER}
    </select>
</mapper>
