<?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="org.springblade.imports.mapper.ImpUnicomArpuDouMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="org.springblade.imports.entity.ImpUnicomArpuDou">
        <id column="ID" property="id" />
        <result column="ACCOUNT_TIME" property="accountTime" />
        <result column="PROVINCES" property="provinces" />
        <result column="ACCOUNT_USER_NUM" property="accountUserNum" />
        <result column="ARPU" property="arpu" />
        <result column="DOU" property="dou" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, account_time, provinces, account_user_num, arpu, dou
    </sql>


    <insert id="insertBatch" parameterType="java.util.List">
        INSERT INTO IMP_UNICOM_ARPU_DOU
        (
        ID,
        ACCOUNT_TIME,
        PROVINCES,
        ACCOUNT_USER_NUM,
        ARPU,
        DOU
        )
        SELECT SEQ_DEFAULT.nextval,a.*
        FROM(
        <foreach item="item" index="index" collection="list" separator="union all">
            SELECT
            #{item.accountTime,jdbcType=VARCHAR} as ACCOUNT_TIME,
            #{item.provinces,jdbcType=VARCHAR} as PROVINCES,
            #{item.accountUserNum,jdbcType=VARCHAR} as ACCOUNT_USER_NUM,
            #{item.arpu,jdbcType=VARCHAR} as ARPU,
            #{item.dou,jdbcType=VARCHAR} as DOU
            from dual
        </foreach>
        ) a
    </insert>

</mapper>
