<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.base.system.resource.dao.ibatis.ResourceDaoImpl">
    
	<!-- 获取列表 -->
	<select id="getListByUserId" parameterType="paramDto" resultMap="ResourceEntity-Map">
		select <include refid="_columns"/>
		from mortals_xhx_resource as a
	   where a.authType in(0,1,2) or a.id IN
	   (select resourceId
		  from mortals_xhx_role_auth as b
		  left join mortals_xhx_role_user as c
		 on b.roleId=c.roleId
		 where c.userId=#{condition.userId})
	</select>

    <select id="getAllByUserType" parameterType="java.util.HashMap" resultMap="ResourceEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_resource as a
        where a.userType=#{userType}

    </select>
</mapper>