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

	<insert id="add" parameterType="PlaceClass">
		insert into t_place_class(place_id, class_id) values(#{placeId}, #{classId})
	</insert>
	
	
	<delete id="deletePlaceClass" parameterType="long">
		delete from t_place_class where place_id = #{placeId}
	</delete>
	
	
	<select id="selectPlaceIdByClassId" parameterType="java.lang.Long" resultType="java.lang.Long">
		select place_id as placeId from t_place_class where class_id = #{classId} 
	</select>
	
	<select id="findAll" resultType="PlaceClass">
		select class_id as classId, place_id as placeId from t_place_class
	</select>
	
	<select id="queryPlaceIdByCondition" parameterType="java.util.Map" resultType="java.lang.Long">
		select place_id as placeId from t_place_class where class_id in (#{placeId})
	</select>
</mapper>