tuqin
2026-10-29 0a3129cb06fcea6677245097715dcc6fa3de65e5
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
41
42
43
44
package com.ruoyi.lims.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.lims.mapper.InterfaceFieldMapper;
import com.ruoyi.lims.pojo.InterfaceField;
import com.ruoyi.lims.service.InterfaceFieldService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
@Service
@Transactional(rollbackFor = Exception.class)
public class InterfaceFieldServiceImpl extends ServiceImpl<InterfaceFieldMapper, InterfaceField> implements InterfaceFieldService {
 
    @Override
    public IPage<InterfaceField> listPage(Page<InterfaceField> page, InterfaceField query) {
        QueryWrapper<InterfaceField> wrapper = new QueryWrapper<>();
        if (query != null) {
            // ID filters
            if (query.getInterfaceId() != null) { wrapper.eq("interface_id", query.getInterfaceId()); }
            wrapper.like(StringUtils.isNotEmpty(query.getInterfaceCode()), "interface_code", query.getInterfaceCode());
            wrapper.like(StringUtils.isNotEmpty(query.getSourceField()), "source_field", query.getSourceField());
            wrapper.like(StringUtils.isNotEmpty(query.getSourcePath()), "source_path", query.getSourcePath());
            wrapper.like(StringUtils.isNotEmpty(query.getTargetField()), "target_field", query.getTargetField());
            wrapper.like(StringUtils.isNotEmpty(query.getTransformType()), "transform_type", query.getTransformType());
            wrapper.like(StringUtils.isNotEmpty(query.getTransformValue()), "transform_value", query.getTransformValue());
            wrapper.like(StringUtils.isNotEmpty(query.getDefaultValue()), "default_value", query.getDefaultValue());
            wrapper.like(StringUtils.isNotEmpty(query.getRemark()), "remark", query.getRemark());
        }
        wrapper.orderByDesc("id");
        return baseMapper.selectPage(page, wrapper);
    }
 
    @Override
    public java.util.List<InterfaceField> listByExperimentOrSample(InterfaceField query) {
        QueryWrapper<InterfaceField> w = new QueryWrapper<>();
        w.orderByDesc("id");
        w.last("limit 200");
        return baseMapper.selectList(w);
    }
}