Oracle集成Mybatis
批量添加
<insert id=\"insertHobby\" >insert into t_test_hobby select seq_hobbyid.nextval,t.* from (<foreach collection=\"list\" separator=\"union all\" item=\"hobbies\">select #{hobbies.hobbyName},#{hobbies.userId} from dual</foreach>) t</insert>
批量修改
<update id=\"updateHobby\" parameterType=\"java.util.List\"><foreach collection=\"list\" item=\"hobbies\" open=\"begin\" close=\";end;\" separator=\";\">update t_test_hobby<set>name=#{hobbies.hobbyName}</set>where id=#{hobbies.hobbyId}</foreach></update>
亲测有效,一点毛病都没有