mybatis 批量添加(oracle)

        
        insert into ad_warn_detail
        <trim prefix="(" suffix=")" suffixOverrides=",">
            id,content,cr_time,
            cr_date,
            rule_type,merch_no,merchant_name,newest_time,ip,
        </trim>
        
         select S_AD_WARN_DETAIL.NEXTVAL,cd.* from(  
        <foreach collection="list" item="detail"
                    index="index" separator="union all">              
            <if test="detail != null">
                select
                    <trim suffixOverrides=",">
                        #{detail.content,jdbcType=VARCHAR},
                        #{detail.crTime,jdbcType=VARCHAR},#{detail.crDate,jdbcType=VARCHAR},
                        #{detail.ruleType,jdbcType=VARCHAR},
                        #{detail.merchNo,jdbcType=VARCHAR},#{detail.merchantName,jdbcType=VARCHAR},
                        #{detail.newestTime,jdbcType=VARCHAR},#{detail.ip,jdbcType=VARCHAR},
                    </trim>
                from dual
            </if>
        </foreach>
        )cd
    </insert>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章