| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | AiProductQuestionLabel entity = new AiProductQuestionLabel(); |
| | | entity.setId(UUID.getSimpleUUIDString()); |
| | | entity.setName(dto.getName()); |
| | | entity.setCode(dto.getCode()); |
| | | if (StrUtil.isNotEmpty(dto.getCompanyId())){ |
| | | entity.setCompanyId(dto.getCompanyId()); |
| | | } |
| | |
| | | if(ObjectUtil.isNotNull( entity)){ |
| | | this.update(null, |
| | | Wrappers.lambdaUpdate(AiProductQuestionLabel.class) |
| | | .set(AiProductQuestionLabel::getCode, dto.getCode()) |
| | | .set(AiProductQuestionLabel::getName, dto.getName()) |
| | | .set(AiProductQuestionLabel::getUpdatedTime, new Date()) |
| | | .eq(AiProductQuestionLabel::getId, id)); |
| | |
| | | } |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public List<AiProductQuestionLabel> listAllByCompanyId(String companyId) { |
| | | LambdaQueryWrapper<AiProductQuestionLabel> query = Wrappers.lambdaQuery(AiProductQuestionLabel.class); |
| | | if (StrUtil.isNotEmpty(companyId)){ |
| | | query.eq(AiProductQuestionLabel::getCompanyId, companyId); |
| | | } |
| | | query.orderByDesc(AiProductQuestionLabel::getCreatedTime); |
| | | return aiProductQuestionLabelMapper.selectList(query); |
| | | } |
| | | } |