<?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.BusiGeneratorSubTreeMapper">
	
	
	<select id="findByEquipmentIdAndType" resultType="com.huatek.busi.entity.BusiGeneratorSubTree">
		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_generator_sub_tree` t
		WHERE
			t.equipment_id = #{equipmentId}
		AND t.equipment_type = #{equipmentType};

	</select>

	<select id="findByEquipmentId" parameterType="java.lang.String" resultType="com.huatek.busi.entity.BusiGeneratorSubTree">
		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_generator_sub_tree` t
		WHERE
			t.equipment_id = #{equipmentId};
	</select>
</mapper>