package com.vincent.rsf.server.system.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.vincent.rsf.server.system.entity.AiMcpMount;
|
import com.vincent.rsf.server.system.mapper.AiMcpMountMapper;
|
import com.vincent.rsf.server.system.service.AiMcpMountService;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
@Service("aiMcpMountService")
|
public class AiMcpMountServiceImpl extends ServiceImpl<AiMcpMountMapper, AiMcpMount> implements AiMcpMountService {
|
|
@Override
|
public List<AiMcpMount> listTenantMounts(Long tenantId) {
|
return this.list(new LambdaQueryWrapper<AiMcpMount>()
|
.eq(AiMcpMount::getTenantId, tenantId)
|
.orderByAsc(AiMcpMount::getMountCode, AiMcpMount::getId));
|
}
|
|
@Override
|
public AiMcpMount getTenantMount(Long tenantId, Long id) {
|
if (tenantId == null || id == null) {
|
return null;
|
}
|
return this.getOne(new LambdaQueryWrapper<AiMcpMount>()
|
.eq(AiMcpMount::getTenantId, tenantId)
|
.eq(AiMcpMount::getId, id)
|
.last("limit 1"));
|
}
|
|
@Override
|
public AiMcpMount getTenantMountByCode(Long tenantId, String mountCode) {
|
if (tenantId == null || mountCode == null || mountCode.trim().isEmpty()) {
|
return null;
|
}
|
return this.getOne(new LambdaQueryWrapper<AiMcpMount>()
|
.eq(AiMcpMount::getTenantId, tenantId)
|
.eq(AiMcpMount::getMountCode, mountCode)
|
.last("limit 1"));
|
}
|
}
|