|
@@ -28,7 +28,8 @@ public class IdUtils {
|
|
StandardlyMapper mapper = SpringUtils.getBean(StandardlyMapper.class);
|
|
StandardlyMapper mapper = SpringUtils.getBean(StandardlyMapper.class);
|
|
Long maxId = mapper.selectMaxId(tableName, pkName);
|
|
Long maxId = mapper.selectMaxId(tableName, pkName);
|
|
if (null == maxId || maxId <= 0) {
|
|
if (null == maxId || maxId <= 0) {
|
|
- redisService.setCacheObject(sequencesKey, 1L);
|
|
|
|
|
|
+ maxId = 1L;
|
|
|
|
+ redisService.setCacheObject(sequencesKey, maxId);
|
|
} else {
|
|
} else {
|
|
redisService.increment(sequencesKey, ++maxId);
|
|
redisService.increment(sequencesKey, ++maxId);
|
|
}
|
|
}
|