<?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.persagy.calendar.mapper.WorkCalendarDictMapper">

	<resultMap id="BaseResultMap" type="com.persagy.calendar.pojo.dto.WorkCalendarDict">
		<result column="ID" property="id" jdbcType="VARCHAR" />
		<result column="GROUP_CODE" property="groupCode" jdbcType="VARCHAR" />
		<result column="PROJECT_ID" property="projectId" jdbcType="VARCHAR" />
		<result column="CALENDAR_ID" property="calendarId" jdbcType="VARCHAR" />
		<result column="DICT_TYPE" property="dictType" jdbcType="VARCHAR" />
		<result column="DICT_CODE" property="dictCode" jdbcType="VARCHAR" />
		<result column="DICT_DESC" property="dictDesc" jdbcType="VARCHAR" />
	</resultMap>

	<insert id="batchCreateCalendarDict">
		INSERT INTO work_calendar_dict
		(
			ID, GROUP_CODE, PROJECT_ID, CALENDAR_ID, DICT_CODE, DICT_DESC, DICT_TYPE
		) VALUES
		<foreach collection="calendarDicts" index="index" item="calendarDict" separator="," >
			(
				#{calendarDict.id}, #{calendarDict.groupCode}, #{calendarDict.projectId}, #{calendarDict.calendarId}, 
				#{calendarDict.dictCode}, #{calendarDict.dictDesc}, #{calendarDict.dictType}
			)
		</foreach>
	</insert>
			
</mapper>