| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.house.dto.UserHouseLabelDTO; |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| | |
| | | @Override |
| | | public boolean saveOrUpdateHouseholdLabel(UserHouseLabelEntity householdLabel) { |
| | | // 查询标签名称 |
| | | LabelEntity labelEntity = labelService.getById(householdLabel.getLabelId()); |
| | | householdLabel.setLabelName(labelEntity.getLabelName()); |
| | | if (!Strings.isBlank(householdLabel.getLabelName())) { |
| | | LabelEntity labelEntity = labelService.getById(householdLabel.getLabelId()); |
| | | householdLabel.setLabelName(labelEntity.getLabelName()); |
| | | } |
| | | // 判断同一个住户同一个标签是否已存在,已存在则更新,不存在则新增 |
| | | QueryWrapper<UserHouseLabelEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("household_id", householdLabel.getHouseholdId()) |
| | |
| | | // 插入 |
| | | return save(userHouseLabelEntity); |
| | | } |
| | | |
| | | /** |
| | | * 查询对应的label集合信息 |
| | | * @param labelName |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<UserHouseLabelEntity> getLabelList(String labelName) { |
| | | return baseMapper.getLabelList(labelName); |
| | | } |
| | | } |