mybatis实现oracle批量操作和使用序列号

1.批量插入


	insert into ZX_APP_PD_PANDIAN(GOODSID,LOTNO,REALQTY,CUTID)  
		
		(select    
	     #{item.goodsid}, #{item.lotno,jdbcType=VARCHAR}, #{item.realqty,jdbcType=NUMERIC},#{item.cutid}   
	     from dual)  
		

    INSERT INTO T_CITY_INDEX( id,city_code )
    select SEQ_CITY_INDEX.NEXTVAL,cd.* from(
    
        select
        #{item.cityCode,jdbcType=VARCHAR},
        #{item.cityName,jdbcType=VARCHAR}
        from dual
    
    ) cd

2.批量更新


	    
	    update zx_app_checkqty_tmp t 
	    set t.checkqty=#{item.checkqty},t.LASTUPDATETIME=sysdate,t.flag=1 	    
	    where t.placesupplyno=#{item.supplyno} and t.placepointid=#{item.deptid}   
	    and t.goodsdid=#{item.goodsid} and t.lotno=#{item.lotno,jdbcType=VARCHAR}
	    	


3.使用oracle的序列号

  
      
      
        SELECT seq_changez_user.nextval id from dual  
      
    insert into temp_changez_user (id, username) values(#{id}, #{username})  
  




你可能感兴趣的:(mybatis实现oracle批量操作和使用序列号)