liding
9 天以前 b3f5792c1778c919e6f839992b3a112208f9a22c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.ruoyi.lims.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.lims.pojo.DataInterface;
import com.ruoyi.lims.service.DataInterfaceService;
import com.ruoyi.lims.mapper.DataInterfaceMapper;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 
import java.util.List;
 
@Service
@RequiredArgsConstructor
@Transactional(rollbackFor = Exception.class)
public class DataInterfaceServiceImpl extends ServiceImpl<DataInterfaceMapper, DataInterface> implements DataInterfaceService {
 
    private final DataInterfaceMapper dataInterfacemapper;
 
    @Override
    public IPage<DataInterface> listPage(Page<DataInterface> page, DataInterface dataInterface) {
        LambdaQueryWrapper<DataInterface> queryWrapper = new LambdaQueryWrapper<>();
 
        if (StringUtils.isNotBlank(dataInterface.getInterfaceName())) {
            queryWrapper.like(DataInterface::getInterfaceName, dataInterface.getInterfaceName());
        }
 
        if (StringUtils.isNotBlank(dataInterface.getDeviceType())) {
            queryWrapper.like(DataInterface::getDeviceType, dataInterface.getDeviceType());
        }
 
        queryWrapper.orderByDesc(DataInterface::getUpdateTime);
 
        return dataInterfacemapper.selectPage(page, queryWrapper);
    }
}