AI智能
改变未来

Oracle集成Mybatis


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>

亲测有效,一点毛病都没有

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » Oracle集成Mybatis