<?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.yonge.cooleshow.biz.dal.dao.CourseScheduleTeacherSalaryDao">
    <resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.CourseScheduleTeacherSalary">
        <id column="id_" jdbcType="INTEGER" property="id"/>
        <result column="teacher_id_" jdbcType="INTEGER" property="teacherId"/>
        <result column="student_id_" jdbcType="INTEGER" property="studentId"/>
        <result column="course_schedule_id_" jdbcType="INTEGER" property="courseScheduleId"/>
        <result column="course_group_type_" jdbcType="VARCHAR" property="courseGroupType"/>
        <result column="course_group_id_" jdbcType="INTEGER" property="courseGroupId"/>
        <result column="class_num_" jdbcType="INTEGER" property="classNum"/>
        <result column="expect_salary_" jdbcType="VARCHAR" property="expectSalary"/>
        <result column="actual_salary_" jdbcType="VARCHAR" property="actualSalary"/>
        <result column="reduce_salary_" jdbcType="VARCHAR" property="reduceSalary"/>
        <result column="reduce_salary_remark_" jdbcType="VARCHAR" property="reduceSalaryRemark"/>
        <result column="settlement_time_" jdbcType="TIMESTAMP" property="settlementTime"/>
        <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
        <result column="status_" jdbcType="VARCHAR" property="status"/>
    </resultMap>

    <sql id="Base_Column_List">
        id_
        , teacher_id_, student_id_, course_schedule_id_, course_group_type_, course_group_id_, class_num_, expect_salary_, actual_salary_, reduce_salary_, reduce_salary_remark_, settlement_time_, create_time_, update_time_, status_
    </sql>

    <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
            parameterType="com.yonge.cooleshow.biz.dal.entity.CourseScheduleTeacherSalary">
        insert into course_schedule_teacher_salary(teacher_id_, student_id_, course_schedule_id_, course_group_type_,
        course_group_id_, class_num_, expect_salary_, actual_salary_, reduce_salary_, reduce_salary_remark_,
        settlement_time_, create_time_, update_time_, status_)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.teacherId}, #{entity.studentId}, #{entity.courseScheduleId}, #{entity.courseGroupType},
            #{entity.courseGroupId},#{entity.classNum} ,#{entity.expectSalary}, #{entity.actualSalary},
            #{entity.reduceSalary}, #{entity.reduceSalaryRemark}, #{entity.settlementTime}, #{entity.createTime},
            #{entity.updateTime}, #{entity.status})
        </foreach>
    </insert>

</mapper>
