<?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="io.renren.modules.sys.dao.SysDeptDao">

	<select id="queryList" resultType="io.renren.modules.sys.entity.SysDeptEntity">
		select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1 where 
			t1.del_flag = 0
		<if test="sql_filter != null">
			and ${sql_filter}
		</if>
	</select>
	
	<select id="queryDetpIdList" resultType="long">
		select dept_id from sys_dept where parent_id = #{value} and del_flag = 0
	</select>

</mapper>