<?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.sunxung.factoring.mapper.sys.AuthorityMapper">

	<select id="hasPermission" resultType="java.lang.Integer" >
		select 
			count(*) 
		from 
			sys_user_role_rel a, sys_role_permission_rel b, t_permission c
		where 
			a.role_id = b.role_id and b.permission_id = c.id and a.user_id = #{userId} and c.ename = #{ename} 
	</select>
	
</mapper>