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; /** *

* 泊位停船信息表 服务实现类 *

* * @author sunjiawei * @since 2025-03-22 */ @Service public class DpShipParkingServiceImpl extends ServiceImpl 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 records = dpShipParkingMapper.getPageList(dpShipParking); Integer total = dpShipParkingMapper.getTotal(dpShipParking); return new TableDataInfo(records,total); } @Override public List getByWhBeId(Integer whId,Integer beId,Integer id){ QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("WH_ID",whId) .eq("BE_ID",beId) .le("ID",id); List list = dpShipParkingMapper.selectList(queryWrapper); List 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; } }