mybatis+oracle批量新增带序列List对象


mybatis中写法:

序列一定要放在外面,不然会报 此处不允许序号

<insert id="addInvestorFileupload" parameterType="java.util.List">
         insert into investor_file_info
                              (id,
                               userid, 
                               url, 
                               type, 
                               uploaddate, 
                               path, 
                               approve_id
                              )
         select SEQ_INVESTOR_FILE_INFO.NEXTVAL , A.* from(
      <foreach collection="list" index="index" item="item"  separator=" union " >
               select  #{item.userId},
                       #{item.investorUrl}, 
                       #{item.investorType},
                       sysdate,
                       #{item.investorPath}, 
                       #{item.investorApproveId} 
               from dual
      </foreach>
          )A
    </insert>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM