使用mybats经常要用到批量修改或者删除,贴出批量修改的代码.如果是批量删除,可将update换成delete. <update id="changestatus" parameterType="String"> update apply_for_maintenance set status= 1 where afmid in <foreach item="afmid" index=&
摘自: http://blog.csdn.net/myjlvzlp/article/details/8434376 1.批量添加元素session.insert(String string,Object o) public void batchInsertStudent(){ List<Student> ls = new ArrayList<Student>(); for(int i = 5;i < 8;i++){ Student student = new Student(
1.批量添加元素session.insert(String string,object O) public void batchInsertStudent(){ List<Student> ls = new ArrayList<Student>(); for(int i = 5;i < 8;i++){ Student student = new Student(); student.setId(i); student.setName("maoyuanjun"
修改表名 ALTER TABLE 原表名 RENAME TO 新表名; 一句SQL语句只能修改一张表 show tables; 1. SELECT CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO db_', substring(table_name, ), ';' ) FROM information_schema. TABLES WHERE table_name LIKE 'ct%'; 批量复制一下到Notepad++中,只保留sql语句,再复制