| | |
| | | int count = patMedOuthospMapper.countPatMedOuthosp(); |
| | | if (count > 3000000) { |
| | | // 2. 冷藏表并新建 |
| | | String timeSuffix = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); |
| | | String timeSuffix = new SimpleDateFormat("yyyyMM").format(new Date()); |
| | | String oldName = "pat_med_outhosp"; |
| | | String newName = oldName + "_" + timeSuffix; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // 4. 新建 |
| | | patMedOuthospMapper.createPatMedOuthosp(oldName, newName); |
| | | |
| | | // 4. 新建(此时只剩冷表,PatMedOuthosp没了,需要新建一个) |
| | | patMedOuthospMapper.createPatMedOuthosp(newName, oldName); |
| | | //设置新表自增主键 |
| | | patMedOuthospMapper.createPatMedOuthospAutoAdd(oldName); |
| | | // 5. 设置新表自增起始值 |
| | | patMedOuthospMapper.setAutoIncrement(oldName, maxId + 1); |
| | | |