mybatis批量操作






  
    insert into user_contact (device_id,vin,user_id,contact_name,create_time) values
    
      (#{item.deviceId},#{item.vin},#{item.userId},#{item.contactName},#{item.createTime})
    
  

  

  
    update user_contact
    set dflag = case
    
      when
      device_id = #{item.deviceId} and user_id = #{item.userId} and contact_name = #{item.contactName}
      
        and vin = #{item.vin}
      
       then #{item.dflag}
    
    end
    
      
        device_id = #{item.deviceId} and user_id = #{item.userId} and contact_name = #{item.contactName}
        
          and vin = #{item.vin}
        
      
    
  

  
    update user_contact
    set dflag = case
    
      when device_id = #{item.deviceId} and contact_name = #{item.contactName} then #{item.dflag}
    
    end
    
      
        device_id = #{item.deviceId} and contact_name = #{item.contactName}
      
    
  


 

你可能感兴趣的:(java,mybatis)