| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | import org.springblade.modules.house.vo.HouseLabelVO; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | import org.springblade.modules.house.mapper.HouseLabelMapper; |
| | | import org.springblade.modules.house.service.IHouseLabelService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.modules.label.entity.LabelEntity; |
| | | import org.springblade.modules.label.service.ILabelService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private ILabelService labelService; |
| | | |
| | | @Override |
| | | public IPage<HouseLabelVO> selectHouseLabelPage(IPage<HouseLabelVO> page, HouseLabelVO houseLabel) { |
| | | public IPage<UserHouseLabelVO> selectHouseLabelPage(IPage<UserHouseLabelVO> page, UserHouseLabelVO houseLabel) { |
| | | return page.setRecords(baseMapper.selectHouseLabelPage(page, houseLabel)); |
| | | } |
| | | |
| | |
| | | // 判断同一个房屋同一个标签是否已存在,已存在则更新,不存在则新增 |
| | | QueryWrapper<HouseLabelEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("house_code",houseLabel.getHouseCode()) |
| | | .eq("label_id",houseLabel.getLabelId()); |
| | | .eq("label_id",houseLabel.getLabelId()); |
| | | HouseLabelEntity one = getOne(queryWrapper); |
| | | if (null != one){ |
| | | houseLabel.setId(one.getId()); |
| | | // 更新 |
| | | return updateById(houseLabel); |
| | | } |