13693261870
2025-07-02 6708810c4de34dfb9513061432d656f91d56ee3a
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.ruoyi.fuzhou.service.impl;
 
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.fuzhou.domain.DpEquipment;
import com.ruoyi.fuzhou.domain.ReceiveModuleInfo;
import com.ruoyi.fuzhou.domain.vo.DpEquipmentVO;
import com.ruoyi.fuzhou.mapper.EquipmentMapper;
import com.ruoyi.fuzhou.service.EquipmentService;
import com.ruoyi.fuzhou.service.ReceiveModuleInfoService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhangyy
 * @since 2025-03-14
 */
@Service
public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, DpEquipment> implements EquipmentService {
    @Resource
    private EquipmentMapper dpEquipmentMapper;
 
    @Resource
    ReceiveModuleInfoServiceImpl receiveModuleInfoService;
 
    public DpEquipment getEpByField(String field) {
        List<DpEquipment> list = list(new LambdaQueryWrapper<DpEquipment>() {{
            or().eq(DpEquipment::getFieldName, field);
        }});
 
        return null == list || list.isEmpty() ? null : list.get(0);
    }
 
    public List<DpEquipment> getListByType(Integer typeId) {
        List<DpEquipment> list = list(new LambdaQueryWrapper<DpEquipment>() {{
            or().eq(DpEquipment::getEquipmentTypeId, typeId);
        }});
 
        return list;
    }
 
    @Override
    public TableDataInfo getPageList(DpEquipment equipment) {
        if (equipment.getPageNum() != null && equipment.getPageSize() != null) {
            Integer offset = (equipment.getPageNum() - 1) * equipment.getPageSize();
            equipment.setOffset(offset);
            List<DpEquipmentVO> records = dpEquipmentMapper.getPageList(equipment);
            long total = dpEquipmentMapper.getTotal(equipment);
            return new TableDataInfo(records, Integer.parseInt(String.valueOf(total)));
        } else {
            return null;
        }
    }
 
    @Override
    public DpEquipmentVO selectById(Integer id) {
        return dpEquipmentMapper.queryById(id);
    }
 
    @Override
    public List<DpEquipmentVO> getListByBeId(Integer beId){
        return dpEquipmentMapper.getListByBeId(beId);
    }
 
    @Override
    public List<DpEquipmentVO> getListByWhId(Integer whId){
        return dpEquipmentMapper.getListByWhId(whId);
    }
 
    @Override
    public List<DpEquipmentVO> getListByBeIdTypeId(Integer beId,List<Integer> typeIds){return dpEquipmentMapper.getListByBeIdTypeId(beId,typeIds);}
 
}