m
This commit is contained in:
@@ -109,14 +109,14 @@ public class ScenesController {
|
||||
ScenesDTO entity = scenesService.get(dto.getId());
|
||||
QueryWrapper<Scenes> wrapper1 = new QueryWrapper<>();
|
||||
wrapper1.eq(Scenes.CODE, dto.getCode());
|
||||
if(entity.getCode()!=dto.getCode() && scenesMapper.selectCount(wrapper1)!= 0){
|
||||
if(!entity.getCode().equals(dto.getCode()) && scenesMapper.selectCount(wrapper1)!= 0){
|
||||
return new Result().error(1,"编码重复");
|
||||
}
|
||||
//验证名称是否重名
|
||||
QueryWrapper<Scenes> wrapper2 = new QueryWrapper<>();
|
||||
wrapper2.eq(Scenes.SCENES_NAME, dto.getScenesName());
|
||||
System.out.println(scenesMapper.selectCount(wrapper2));
|
||||
if(entity.getScenesName()!=dto.getScenesName() && scenesMapper.selectCount(wrapper2)!= 0){
|
||||
if(!entity.getScenesName().equals(dto.getScenesName()) && scenesMapper.selectCount(wrapper2)!= 0){
|
||||
return new Result().error(1,"名称重复");
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user