|
@@ -49,30 +49,21 @@ public class LisConfigFacade{
|
|
|
*/
|
|
|
public Boolean isExistRecord(LisConfig lisConfig) {
|
|
|
QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
|
|
|
- LisConfig oldRecord = new LisConfig();
|
|
|
- if (lisConfig.getId() != null) {
|
|
|
- oldRecord = lisConfigService.getById(lisConfig.getId());
|
|
|
- if (oldRecord != null && oldRecord.getIsDeleted().equals(IsDeleteEnum.N.getKey())) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if (StringUtil.isNotBlank(lisConfig.getHisName())) {
|
|
|
- queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("hospital_id", lisConfig.getHospitalId())
|
|
|
- .eq("his_name", lisConfig.getHisName())
|
|
|
- .eq("unique_name", lisConfig.getUniqueName());
|
|
|
- if (StringUtil.isBlank(lisConfig.getHisDetailName())) {
|
|
|
- queryWrapper
|
|
|
- .isNull("his_detail_name")
|
|
|
- .or()
|
|
|
- .eq("his_detail_name", "");
|
|
|
- } else {
|
|
|
- queryWrapper
|
|
|
- .eq("his_detail_name", lisConfig.getHisDetailName());
|
|
|
- }
|
|
|
- oldRecord = lisConfigService.getOne(queryWrapper);
|
|
|
- if (oldRecord != null) {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("hospital_id", lisConfig.getHospitalId())
|
|
|
+ .eq("his_name", lisConfig.getHisName())
|
|
|
+ .eq("unique_name", lisConfig.getUniqueName());
|
|
|
+ if (StringUtil.isBlank(lisConfig.getHisDetailName())) {
|
|
|
+ queryWrapper.and(i -> i.isNull("his_detail_name")
|
|
|
+ .or()
|
|
|
+ .eq("his_detail_name", ""));
|
|
|
+ } else {
|
|
|
+ queryWrapper
|
|
|
+ .eq("his_detail_name", lisConfig.getHisDetailName());
|
|
|
+ }
|
|
|
+ LisConfig oldRecord = lisConfigService.getOne(queryWrapper, false);
|
|
|
+ if (oldRecord != null) {
|
|
|
+ return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|