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;
|
}
|
}
|