@Insert("<script>" + 
            "INSERT INTO sys_user_role(user_id, role_id) values"+
            " <foreach collection=\"list\" item=\"item\" index=\"index\" separator=\",\" >  " + 
            " (#{item.userId},#{item.roleId})" + 
            " </foreach>"+ 
            "</script>")
    int batchSave(List<UserRoleDO> list);

使用注解的方式,没搞懂<script>标记,留着以后项目参考!