<?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.AssoAvoidDesignWholeLittleDirectionMapper">
    <!--批量插入回避设计总体方向和回避设计方向关联表数据-->
    <!--int insertBatch(List<AssoAvoidDesignWholeLittleDirection> assoAvoidDesignWholeLittleDirections);-->
    <insert id="insertBatch" useGeneratedKeys="true" keyProperty="id">
        insert into ASSO_AVOIDDESIGN_WHOLE_LITTLE_DIRECTION (REPORT_ID, AVOIDDESIGN_WHOLE_DIRECTION_ID,
        AVOIDDESIGN_LITTLE_DIRECTION_ID)
        VALUES
        <foreach collection="list" item="n" separator=",">
            (#{n.reportId}, #{n.avoidDesignWholeDirectionId}, #{n.avoidDesignLittleDirectionId})
        </foreach>
    </insert>

    <!--根据报告id删除回避设计总体方向和方向关联表数据-->
    <!--int deleteByReportId(Integer reportId);-->
    <delete id="deleteByReportId">
        delete
        from ASSO_AVOIDDESIGN_WHOLE_LITTLE_DIRECTION
        where REPORT_ID = #{reportId}
    </delete>

</mapper>
