<?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.ym.mec.biz.dal.dao.TenantConfigDao">
    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.TenantConfig">
        <id column="id_" jdbcType="INTEGER" property="id"/>
        <result column="tenant_id_" jdbcType="INTEGER" property="tenantId"/>
        <result column="charge_rate_" jdbcType="VARCHAR" property="chargeRate"/>
        <result column="teaching_material_id_" jdbcType="VARCHAR" property="teachingMaterialId"/>
        <result column="theme_" jdbcType="VARCHAR" property="theme"/>
        <result column="theme_color_" jdbcType="VARCHAR" property="themeColor"/>
        <result column="config_" jdbcType="VARCHAR" property="config"/>
        <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
        <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
        <result column="corporate_chops_" jdbcType="VARCHAR" property="corporateChops"/>
        <result column="corporate_finance_chops_" jdbcType="VARCHAR" property="corporateFinanceChops"/>
    </resultMap>

    <sql id="Base_Column_List">
        id_
        , tenant_id_, charge_rate_, teaching_material_id_, theme_, theme_color_, config_, updated_by_, updated_time_, corporate_chops_, corporate_finance_chops_
    </sql>

    <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
            parameterType="com.ym.mec.biz.dal.entity.TenantConfig">
        insert into tenant_config(tenant_id_, charge_rate_, teaching_material_id_, theme_, theme_color_, config_,
        updated_by_, updated_time_, corporate_chops_, corporate_finance_chops_)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.tenantId}, #{entity.chargeRate}, #{entity.teachingMaterialId}, #{entity.theme},
            #{entity.themeColor}, #{entity.config}, #{entity.updatedBy}, #{entity.updatedTime},
            #{entity.corporateChops}, #{entity.corporateFinanceChops})
        </foreach>
    </insert>

</mapper>