<?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.yida.data.user.mapper.EduFaceGroupStrategySpecialDateMapper">
	
	<resultMap id="specialMap" type="com.yida.data.user.vo.StrategySpecialDateVO">
		<id column="id" property="specialId"/>
		<result column="face_group_id" property="faceGroupId"/>
		<result column="face_group_strategy_id" property="faceGroupStrategyId"/>
		<result column="special_start_date" property="specialStartDate"/>
		<result column="special_end_date" property="specialEndDate"/>
		
		<collection property="specialTimeList" ofType="com.yida.data.user.vo.StrategySpecialTimeVO"
				select="listStrategySpecialTime"
				column="{specialDateId=id}">
		</collection>
	</resultMap>
	
	<!-- 查询特殊日期 -->
	<select id="listStrategySpecialDate" resultMap="specialMap">
		SELECT
			id,
			face_group_id,
			face_group_strategy_id,
			special_start_date,
			special_end_date
		FROM
			edu_face_group_strategy_special_date
		WHERE
			face_group_strategy_id = #{strategyId}
		  AND del_flag = 0
	</select>
	
	<!-- 查询特殊时间 -->
	<select id="listStrategySpecialTime" resultType="com.yida.data.user.vo.StrategySpecialTimeVO">
		SELECT
			special_start_time,
			special_end_time
		FROM
			edu_face_group_strategy_special_time
		WHERE
			face_group_strategy_special_date_id = #{specialDateId}
		  AND del_flag = 0
	</select>
	
</mapper>
