?useUnicode=true//语序编码反射光hi
&characterEncoding=UTF-8//字符
&autoReconnect=true//自动连接
&useAffectedRows=true
&zeroDateTimeBehavior=convertToNull//时区转换
&autoReconnect=true//自动连接
&failOverReadOnly=false
&allowMultiQueries=true 批量处理多条sql语句
根据列的选择进行批量插入,列需要就插入值,列不需要就不插入值,allowMultiQueries=true
List<OrderInfoProduct> orderInfoProducts= (List<OrderInfoProduct>) orderRequestAddParam.getOrderInfoProducts();
<foreach collection="list" item="item" index="index" separator =";"> //分号分隔,符合mysql语法特点
insert into ORDER_INFO_PRODUCT
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.customerId != null">
CUSTOMER_ID,
</if>
<if test="item.customerName != null">
CUSTOMER_NAME,
</if>