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
package com.ruoyi.manage.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.manage.domain.DpShips;
import com.ruoyi.manage.mapper.DpShipParkingMapper;
import com.ruoyi.manage.domain.DpShipParking;
import com.ruoyi.manage.service.DpShipParkingService;
import com.ruoyi.manage.service.DpShipsService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * <p>
 * 泊位停船信息表 服务实现类
 * </p>
 *
 * @author sunjiawei
 * @since 2025-03-22
 */
@Service
public class DpShipParkingServiceImpl extends ServiceImpl<DpShipParkingMapper, DpShipParking> implements DpShipParkingService {
    @Resource
    private DpShipParkingMapper dpShipParkingMapper;
    @Resource
    private DpShipsService dpShipsService;
 
    @Override
    public TableDataInfo getPageList(DpShipParking dpShipParking) {
        Integer offset = (dpShipParking.getPageNum()-1)*dpShipParking.getPageSize();
        dpShipParking.setOffset(offset);
        List<DpShipParking> records = dpShipParkingMapper.getPageList(dpShipParking);
        Integer total = dpShipParkingMapper.getTotal(dpShipParking);
        return new TableDataInfo(records,total);
    }
 
    @Override
    public List<DpShipParking> getByWhBeId(Integer whId,Integer beId,Integer id){
        QueryWrapper<DpShipParking> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("WH_ID",whId)
                .eq("BE_ID",beId)
                .le("ID",id);
        List<DpShipParking> list = dpShipParkingMapper.selectList(queryWrapper);
        List<DpShipParking> parkingList = new ArrayList<>();
        for (DpShipParking dpShipParking : list){
            DpShips dpShips = dpShipsService.getDpShipsById(dpShipParking.getShipPkid());
            dpShipParking.setShipModel(dpShips.getShipModel());
            dpShipParking.setShipId(dpShips.getShipId());
            parkingList.add(dpShipParking);
        }
        return parkingList;
    }
}