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