mybatis之(Oracle,MySql)批量更新

Oracle和MySql批量更新配置文件不太一样。
Oracle:


	
		
			update interface_hotel_account
			
				hotel_account = #{hotelCusRel.hotelAccount},
				hotel_name = #{hotelCusRel.hotelName},
				customer_code = #{hotelCusRel.customerCode},
				business_partner_code = #{hotelCusRel.businessPartnerCode}
			
			where rel_id = #{hotelCusRel.relId}
		
	

MySql:
MySql和Oracle在Mybatis中操作同上,但是配置文件中需要加上&allowMultiQueries=true,例如:

spring.datasource.url=jdbc:mysql://localhost:3306/ifp_base?useUnicode=true&characterEncoding=UTF-8
&allowMultiQueries=true

你可能感兴趣的:(笔记)