Sys_userMapper.xml
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
SELECT * FROM sys_right,(
SELECT *FROM sys_role_right,
(
SELECT *
FROM sys_user,sys_role
WHERE sys_user.user_name=#{user_name}
AND sys_user.user_password=#{user_password}
AND sys_user.user_role_id=sys_role.role_id
) a
WHERE a.role_id=sys_role_right.rf_role_id)b
WHERE b.rf_right_code=sys_right.right_code
</select>
<resultMap type="Sys_user" id="resultSys_userMap">
<id property="user_id" column="user_id" />
<result property="user_name" column="user_name" />
<result property="user_password" column="user_password" />
<result property="user_role_id" column="user_role_id" />
<result property="user_flag" column="user_flag" />
<association property="sys_right" javaType="Sys_right">
<id property="right_code" column="right_code" />
<result property="right_parent_code" column="right_parent_code" />
<result property="right_type" column="right_type" />
<result property="right_text" column="right_text" />
<result property="right_url" column="right_url" />
<result property="right_tip" column="right_tip" />
</association >
<association property="sys_role_right" javaType="Sys_role_right">
<id property="rf_id" column="rf_id" />
<result property="rf_role_id" column="rf_role_id" />
<result property="rf_right_code" column="rf_right_code" />
</association >
<association property="sys_role" javaType="Sys_role">
<id property="role_id" column="role_id" />
<result property="role_name" column="role_name" />
<result property="role_desc" column="role_desc" />
<result property="role_flag" column="role_flag" />
</association >
</resultMap>
mybatisConfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">