<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.rightsSetting.dao.impl.RightsReadPlanDaoImpl">

    <resultMap  id="BaseResultMap" type="com.pcloud.book.rightsSetting.entity.RightsReadPlan">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="rightsSettingItemId" column="rights_setting_item_id" jdbcType="BIGINT"/>
        <result property="isOpen" column="is_open" jdbcType="INTEGER"/>
        <result property="serviceDesc" column="service_desc" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>

    <sql id="Base_Column_List">
        id, rights_setting_item_id, is_open, service_desc, create_time, update_time
    </sql>

    <!--批量新增-->
    <insert id="batchInsert" useGeneratedKeys="true" parameterType="java.util.List">
        insert into book.rights_read_plan (
        rights_setting_item_id, is_open, service_desc, create_time, update_time
        )
        values
        <foreach collection="list" item="item" index="index" separator="," >
            (
            #{item.rightsSettingItemId},
            #{item.isOpen},
            #{item.serviceDesc},
            NOW(),
            NOW()
            )
        </foreach>
    </insert>


</mapper>