<?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.tofly.xrtymis.mapper.GddepartmentMapper">

    <resultMap id="gddepartmentMap" type="com.tofly.xrtymis.entity.Gddepartment">
        <id property="id" column="ID"/>
        <result property="configId" column="CONFIG_ID"/>
        <result property="departId" column="DEPART_ID"/>
        <result property="departName" column="DEPART_NAME"/>
    </resultMap>


    <select id="departMaxId" resultType="java.lang.Long">
        select nvl(max(id), 0) + 1
        from TF_YWPN_GDDEPARTMENT_W
    </select>

    <insert id="insertBatchDepart">
        insert into TF_YWPN_GDDEPARTMENT_W (ID , CONFIG_ID , DEPART_ID , DEPART_NAME)
        <foreach collection="list" item="info" separator="union all">
            SELECT
            #{info.id},
            #{info.configId},
            #{info.departId},
            #{info.departName}
            FROM DUAL
        </foreach>
    </insert>


</mapper>
