| | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | |
| | | Page<AiProductRole> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | LambdaQueryWrapper<AiProductRole> query = Wrappers.lambdaQuery(AiProductRole.class); |
| | | if (StrUtil.isNotEmpty(dto.getCompanyId())){ |
| | | query.eq(AiProductRole::getCompanyId, dto.getCompanyId()); |
| | | } |
| | | Page<AiProductRole> pages = aiProductRoleMapper.selectPage(page, query); |
| | | return pages; |
| | | } |
| | |
| | | if (ObjectUtil.isNotNull( entity)){ |
| | | this.update(null, |
| | | Wrappers.lambdaUpdate(AiProductRole.class) |
| | | .set(AiProductRole::getCompanyId, dto.getCompanyId()) |
| | | .set(AiProductRole::getName, dto.getName()) |
| | | .set(AiProductRole::getDescription, dto.getDescription()) |
| | | .set(AiProductRole::getPromptHead, dto.getPromptHead()) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<AiProductRole> productRoleTree() { |
| | | return aiProductRoleMapper.selectList(null); |
| | | public List<AiProductRole> productRoleTree(String companyId) { |
| | | |
| | | LambdaQueryWrapper<AiProductRole> query = Wrappers.lambdaQuery(AiProductRole.class); |
| | | if (StrUtil.isNotEmpty(companyId)){ |
| | | query.eq(AiProductRole::getCompanyId, companyId); |
| | | } |
| | | return aiProductRoleMapper.selectList(query); |
| | | } |
| | | |
| | | } |