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
package com.ruoyi.manage.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.manage.mapper.DpShipDeviceMapper;
import com.ruoyi.manage.domain.DpShipDevice;
import com.ruoyi.manage.service.DpShipDeviceService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * <p>
 * 舰艇设备表 服务实现类
 * </p>
 *
 * @author sunjiawei
 * @since 2025-03-12
 */
@Service
@Component
public class DpShipDeviceServiceImpl extends ServiceImpl<DpShipDeviceMapper, DpShipDevice> implements DpShipDeviceService {
 
    @Resource
    private DpShipDeviceMapper dpShipDeviceMapper;
 
    //新增舰船设备数据
    @Override
    public int insertDpShipDevice(DpShipDevice dpShipDevice){
        return dpShipDeviceMapper.insertDpShipDevice(dpShipDevice);
    }
    //更新舰船设备数据
    @Override
    public int updateDpShipDevice(DpShipDevice dpShipDevice){
        return dpShipDeviceMapper.updateDpShipDevice(dpShipDevice);
    }
    //删除舰船设备数据
    @Override
    public int deleteDpShipDevice(String id){
        return dpShipDeviceMapper.deleteDpShipDevice(id);
    }
    //获取舰船设备数据列表
    @Override
    public List<DpShipDevice> getDpShipDevices(){
        return dpShipDeviceMapper.getDpShipDevices();
    }
    //根据舰船编号查询设备列表
    @Override
    public List<DpShipDevice> selectDpShipDeviceByShipId(String deviceShipId){
        return dpShipDeviceMapper.selectDpShipDeviceByShipId(deviceShipId);
    }
 
    //根据ID获取舰船设备数据
    @Override
    public DpShipDevice selectDpShipDevice(String id){
        return dpShipDeviceMapper.selectDpShipDevice(id);
    }
 
    //根据name获取舰船设备数据
    @Override
    public DpShipDevice selectDpShipDeviceByName(String name){
        return dpShipDeviceMapper.selectDpShipDeviceByName(name);
    }
 
    @Override
    public TableDataInfo getDpShipDevicesPage(DpShipDevice shipDevice) {
        if(shipDevice.getPageNum()!=null && shipDevice.getPageSize()!=null){
            Integer offset = (shipDevice.getPageNum()-1)*shipDevice.getPageSize();
            shipDevice.setOffset(offset);
            List<DpShipDevice> records = dpShipDeviceMapper.getPageList(shipDevice);
            long total = dpShipDeviceMapper.getTotal(shipDevice);
            return new TableDataInfo(records,Integer.parseInt(String.valueOf(total)));
        }else {
            return null;
        }
    }
}