<?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.huatek.busi.mapper.BusiGisSubTreeMapper">
	
	<select id="findByEquipmentIdAndType" resultType="com.huatek.busi.entity.BusiGisSubTree">
		SELECT
			t.id AS id ,
			t.parent_id AS parentId ,
			t.name AS name ,
			t.status AS status ,
			t.equipment_id AS equipmentId ,
			t.equipment_type AS equipmentType ,
			t.system_code AS systemCode ,
			t.site_id AS siteId ,
			t.create_time AS createTime 
		FROM
			`busi_gis_sub_tree` t
		WHERE
			t.equipment_id = #{equipmentId}
		AND t.equipment_type = #{equipmentType};

	</select>

	<select id="findListByEquipmentIdAndType" resultType="com.huatek.busi.entity.BusiGisSubTree">
		SELECT
		t.id AS id ,
		t.parent_id AS parentId ,
		t.name AS name ,
		t.status AS status ,
		t.equipment_id AS equipmentId ,
		t.equipment_type AS equipmentType ,
		t.system_code AS systemCode ,
		t.site_id AS siteId ,
		t.create_time AS createTime
		FROM
		`busi_gis_sub_tree` t
		WHERE
		t.status = '1'
		AND t.equipment_id = #{equipmentId}
		AND t.equipment_type = #{equipmentType};

	</select>

	<select id="findByEquipmentId" parameterType="java.lang.String" resultType="com.huatek.busi.entity.BusiGisSubTree">
		SELECT
			t.id AS id ,
			t.parent_id AS parentId ,
			t.name AS name ,
			t.status AS status ,
			t.equipment_id AS equipmentId ,
			t.equipment_type AS equipmentType ,
			t.system_code AS systemCode ,
			t.site_id AS siteId ,
			t.create_time AS createTime 
		FROM
			`busi_gis_sub_tree` t
		WHERE
			t.equipment_id = #{equipmentId};

	</select>
	
</mapper>