<?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="org.jeecg.modules.system.mapper.SysAreaMapper">

	<update id="updateTreeNodeStatus" parameterType="java.lang.String">
		update sys_area
		set has_child = #{status}
		where id = #{id}
	</update>
	<select id="queryCidByPid" resultType="java.lang.String">
		SELECT id FROM sys_area WHERE 1 = 1
		<if test="id != null and id != ''">
			and parent_id = #{id}
		</if>
	</select>
	<select id="quickGetChild" resultType="java.lang.String">
		select id
		from (select t1.id,
					 if(find_in_set(parent_id, @pids) > 0, @pids := concat(@pids, ',', id), 0) as ischild
			  from (select id, parent_id, area_level
					from sys_area
					ORDER BY if(isnull(area_level), 1, 0), area_level) t1,
				   (select @pids := #{id}) t2) t3
		where ischild != 0
	</select>
	<select id="querySysCementListByUserId" resultType="org.jeecg.modules.system.entity.SysArea">

	</select>

</mapper>