feat: 行政区划相关接口提交
This commit is contained in:
@ -30,13 +30,13 @@ public class DictionaryServiceImpl implements DictionaryService {
|
||||
public PageResponse<DictionaryVO> paginate(PageRequest<DictionaryDTO> pageRequest) {
|
||||
Page<Dictionary> paginate = Pages.paginate(pageRequest, dictionaryMapper, (dto, wrapper) -> {
|
||||
if (Strings.isNotBlank(dto.getName())) {
|
||||
wrapper.like("name", dto.getName());
|
||||
wrapper.like(Dictionary::getName, dto.getName());
|
||||
}
|
||||
if (Strings.isNotBlank(dto.getCode())) {
|
||||
wrapper.eq("code", dto.getCode());
|
||||
wrapper.eq(Dictionary::getCode, dto.getCode());
|
||||
}
|
||||
if (Strings.isNotBlank(dto.getType())) {
|
||||
wrapper.eq("type", dto.getType());
|
||||
wrapper.eq(Dictionary::getType, dto.getType());
|
||||
}
|
||||
|
||||
return wrapper;
|
||||
@ -53,16 +53,16 @@ public class DictionaryServiceImpl implements DictionaryService {
|
||||
public boolean update(DictionaryDTO record) {
|
||||
Dictionary dictionary = dictionaryMapper.selectById(record.getId());
|
||||
if (dictionary != null) {
|
||||
if (Strings.isNotBlank(dictionary.getName())) {
|
||||
if (Strings.isNotBlank(record.getName())) {
|
||||
dictionary.setName(dictionary.getName());
|
||||
}
|
||||
if (Strings.isNotBlank(dictionary.getCode())) {
|
||||
if (Strings.isNotBlank(record.getCode())) {
|
||||
dictionary.setCode(dictionary.getCode());
|
||||
}
|
||||
if (Strings.isNotBlank(dictionary.getType())) {
|
||||
if (Strings.isNotBlank(record.getType())) {
|
||||
dictionary.setType(dictionary.getType());
|
||||
}
|
||||
dictionary.setDescription(dictionary.getDescription());
|
||||
dictionary.setDescription(record.getDescription());
|
||||
dictionary.setUpdateTime(Timestamp.from(Instant.now()));
|
||||
return dictionaryMapper.updateById(dictionary) == 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user