<?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="industrySqlMapper">

<sql id="base_column">
	id,
	name
</sql>

	<select id="findAllIndustry"  resultType="com.cloudcross.ssp.model.Industry">
		    select
	    <include refid="base_column" />
	    from t_industry
	</select>
	
	<select id="findByIndustryId" parameterType="int" resultType="com.cloudcross.ssp.model.Industry">
		select 
		 <include refid="base_column" />
		from t_industry
		<where>
			id = #{id}
		</where>
	</select>
	
	<select id="findAllIndustryByZoneIdOperator"  resultType="com.cloudcross.ssp.model.Industry">
	    select
	    <include refid="base_column" />
	    from t_industry 
	    <where>
		id not in( select industry_id from t_zone_industry where zone_id = #{zoneId} and
		 t_zone_industry.status != -1)
		</where>
	</select>
	
</mapper>