设备管理-设备资质
parent
a77d2ca199
commit
ceb2ac74a8
@ -1,10 +1,17 @@
|
||||
package com.glxp.api.service.inv;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.glxp.api.req.inv.FilterInvCertRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.glxp.api.entity.inv.DeviceAssetCertEntity;
|
||||
import com.glxp.api.dao.inv.DeviceAssetCertMapper;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DeviceAssetCertService extends ServiceImpl<DeviceAssetCertMapper, DeviceAssetCertEntity> {
|
||||
public interface DeviceAssetCertService extends IService<DeviceAssetCertEntity> {
|
||||
List<DeviceAssetCertEntity> filterDeviceCert(FilterInvCertRequest filterInvCertRequest);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
package com.glxp.api.service.inv.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.inv.DeviceAssetCertMapper;
|
||||
import com.glxp.api.entity.inv.DeviceAssetCertEntity;
|
||||
import com.glxp.api.req.inv.FilterInvCertRequest;
|
||||
import com.glxp.api.service.inv.DeviceAssetCertService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class DeviceAssetCertServiceImpl extends ServiceImpl<DeviceAssetCertMapper, DeviceAssetCertEntity> implements DeviceAssetCertService {
|
||||
@Resource
|
||||
DeviceAssetCertMapper deviceAssetCertMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<DeviceAssetCertEntity> filterDeviceCert(FilterInvCertRequest filterInvCertRequest) {
|
||||
if (filterInvCertRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterInvCertRequest.getPage() != null) {
|
||||
int offset = (filterInvCertRequest.getPage() - 1) * filterInvCertRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterInvCertRequest.getLimit());
|
||||
}
|
||||
return deviceAssetCertMapper.filterCompanyCert(filterInvCertRequest);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue