| | |
| | | |
| | | /** |
| | | * 房屋-标签 房屋自定义新增或修改 |
| | | * @param householdLabel |
| | | * |
| | | * @param userHouseLabelEntity |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveOrUpdateHouseLabel(UserHouseLabelEntity householdLabel) { |
| | | public boolean saveOrUpdateHouseLabel(UserHouseLabelEntity userHouseLabelEntity) { |
| | | // 查询标签名称 |
| | | LabelEntity labelEntity = labelService.getById(householdLabel.getLabelId()); |
| | | householdLabel.setLabelName(labelEntity.getLabelName()); |
| | | LabelEntity labelEntity = labelService.getById(userHouseLabelEntity.getLabelId()); |
| | | if (labelEntity != null) { |
| | | userHouseLabelEntity.setLabelName(labelEntity.getLabelName()); |
| | | } |
| | | // 先删除之前的房屋绑定的标签 |
| | | QueryWrapper<UserHouseLabelEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("house_code",householdLabel.getHouseCode()) |
| | | .eq("lable_type",2); |
| | | queryWrapper.eq("house_code", userHouseLabelEntity.getHouseCode()) |
| | | .eq("lable_type", 2); |
| | | // 删除 |
| | | remove(queryWrapper); |
| | | // 插入 |
| | | return save(householdLabel); |
| | | return save(userHouseLabelEntity); |
| | | } |
| | | } |