<?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.TenantContractRecordDao">
    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.TenantContractRecord">
        <id column="id_" jdbcType="INTEGER" property="id"/>
        <result column="tenant_id_" jdbcType="INTEGER" property="tenantId"/>
        <result column="contract_name_" jdbcType="VARCHAR" property="contractName"/>
        <result column="url_" jdbcType="VARCHAR" property="url"/>
        <result column="type_" jdbcType="INTEGER" property="type"/>
        <result column="biz_date_" jdbcType="TIMESTAMP" property="bizDate"/>
        <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
    </resultMap>

    <sql id="Base_Column_List">
        id_
        , tenant_id_, contract_name_, url_, type_, biz_date_, create_time_
    </sql>

    <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
            parameterType="com.ym.mec.biz.dal.entity.TenantContractRecord">
        insert into tenant_contract_record(tenant_id_, contract_name_, url_, type_, biz_date_, create_time_)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.tenantId}, #{entity.contractName}, #{entity.url}, #{entity.type}, #{entity.bizDate},
            #{entity.createTime})
        </foreach>
    </insert>

</mapper>
