<?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.BusiOfflineArresterBrandMapper">
	<sql id="Base_Column_List">
		id as id,
		site_id as siteId,
		main_equipment_id as mainEquipmentId,
		arrester_name as arresterName,
		arrester_model as arresterModel,
		equipment_code as equipmentCode,
		site_code as siteCode,
		discharge_current as dischargeCurrent,
		running_voltage as runningVoltage,
		executive_standard as executiveStandard,
		nominal_voltage as nominalVoltage,
		transport_time as transportTime,
		insulation_resistance as insulationResistance,
		batch_number as batchNumber,
		create_user as createUser,
		create_time as createTime,
		status as status
	</sql>
	<select id="getBusiOfflineArresterBrandInfo"
		parameterType="java.lang.String"
		resultType="com.huatek.busi.vo.BusiOfflineArresterBrandVo">
		select
		<include refid="Base_Column_List" />
		from busi_offline_arrester_brand t
		WHERE 
		t.main_equipment_id = #{mainEquipmentId}
        <if test="siteId != null and siteId != ''">
        	and t.site_id = #{siteId}
        </if>
	</select>
	<select id="getBusiOfflineArresterBrand"
		parameterType="java.lang.String"
		resultType="com.huatek.busi.entity.BusiOfflineArresterBrand">
		select
		<include refid="Base_Column_List" />
		from busi_offline_arrester_brand t
		WHERE t.main_equipment_id = #{mainEquipmentId}
        <if test="siteId != null and siteId != ''">
        	and t.site_id = #{siteId}
        </if>
	</select>

	<!-- -->
	<select id="findAll" resultType="com.huatek.busi.entity.BusiOfflineArresterBrand">
		select
		<include refid="Base_Column_List" />
		from busi_offline_arrester_brand

		where status = '1'
	</select>
</mapper>