<?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="placeClassInformationSqlMapper">
	
	<select id="findById" parameterType="long" resultType="PlaceClassInformation">
		select id, name from t_place_class_info
		where id = #{id}
	</select>
	
	<select id="findPlaceClassByOperatorId" parameterType="long" resultType="PlaceClassInformation">
		select DISTINCT(i.id) as id, i.name as name from t_place_operator o, t_place_class c, t_place_class_info i
		where o.place_id = c.place_id and c.class_id = i.id
		<if test="_parameter!=null">
			and o.operator_id = #{_parameter}
		</if>
	</select>
	
	<select id="findAll" resultType="PlaceClassInformation">
		select * from t_place_class_info
	</select>
</mapper>