mysql数据库采用一下写法即可执行,但是数据库连接必须配置:&allowMultiQueries=true
例如:jdbc:mysql://192.168.1.236:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
@Update({"<script>" +
"<foreach item='totalPvuv' collection='totalPvuvs' index='index' open='' close='' separator=';'>" +
" UPDATE total_pvuv " +
"SET update_time = NOW()," +
"<if test='#{totalPvuv.countPv} != null'>count_pv = #{totalPvuv.countPv},</if>" +
"<if test='#{totalPvuv.sumAuv} != null'>sum_auv = #{totalPvuv.sumAuv},</if>" +
"<if test='#{totalPvuv.sumSuv} != null'>sum_suv = #{totalPvuv.sumSuv}</if>" +
" WHERE app_id = #{totalPvuv.appId} " +
"</foreach>" +
"</script>"})
int updateList(@Param("totalPvuvs") Collection<TotalPvuv> totalPvuvs);