<?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">
<!--mybatis-3-mapper.dtd:约束文件的名称，限制和检查在当前文件中出现的标签和属性符合mybatis的要求-->
<!--namespace：命名空间，要有唯一的值，要求使用dao接口的权限定名称（一个dao接口对应一个mapper，namespace指明对应哪个dao接口）-->
<mapper namespace="com.cool.store.mapper.TallyBookDetailMapper">
    <resultMap id="BaseResultMap" type="com.cool.store.entity.TallyBookDetailDO">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="tally_book_id" property="tallyBookId" jdbcType="BIGINT"/>
        <result column="field_name" property="fieldName" jdbcType="VARCHAR"/>
        <result column="field_value" property="fieldValue" jdbcType="DECIMAL"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    </resultMap>
    <insert id="batchInsert">
        insert into xfsg_tally_book_detail (tally_book_id, field_name, field_value, create_time, update_time)
        values
        <foreach collection="list" item="item" separator=",">
            (#{item.tallyBookId,jdbcType=BIGINT},
            #{item.fieldName,jdbcType=VARCHAR},
            #{item.fieldValue,jdbcType=DECIMAL},
            #{item.createTime,jdbcType=TIMESTAMP},
            #{item.updateTime,jdbcType=TIMESTAMP})
        </foreach>
    </insert>
</mapper>