<?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="cn.cslg.report.mapper.AvoidFeatureMapper">
    <!--批量插入特征数据-->
    <!--int insertBatch(List<AvoidFeatures> features);-->
    <insert id="insertBatch" useGeneratedKeys="true" keyProperty="id">
        insert into FEATURES (SIGN_PATENT_NO, CONTENT_OUT, RIGHT_ID, PARTNER_ID, IS_FINAL, REPORT_ID, CONTENT,
        EXPLAIN_TEXT, SPLIT_BY, RIGHT_NAME, RIGHT_TYPE, FEATURES_ORDER, SPLIT_TYPE, TASK_ID)
        values
        <foreach collection="list" item="n" separator=",">
            (#{n.signPatentNo}, #{n.contentOut}, #{n.rightId}, #{n.partnerId}, #{n.isFinal}, #{n.reportId},
            #{n.content}, #{n.explainText}, #{n.splitBy}, #{n.rightName}, #{n.rightType}, #{n.featuresOrder},
            #{n.splitType}, #{n.taskId})
        </foreach>
    </insert>

    <!--根据报告id删除权要特征-->
    <!--int deleteByReportId(Integer reportId);-->
    <delete id="deleteByReportId">
        delete
        from FEATURES
        where REPORT_ID = #{reportId}
    </delete>

</mapper>
