package com.yuchen.saas.park.service.service.pldoor.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuchen.saas.park.api.entity.pldoor.PlPsRobotEquipment;
import com.yuchen.saas.park.service.mapper.pldoor.PlPsRobotEquipmentMapper;
import com.yuchen.saas.park.service.service.pldoor.PlPsRobotEquipmentService;
import org.nest.springwrap.core.mp.base.BaseServiceImpl;
import org.nest.springwrap.core.mp.support.Condition;
import org.nest.springwrap.core.mp.support.Query;
import org.nest.springwrap.core.tool.utils.Func;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 机器人配送终端 服务实现类
 * </p>
 *
 * @author miaoqs
 * @since 2024-11-01
 */
@Service
public class PlPsRobotEquipmentServiceImpl extends BaseServiceImpl<PlPsRobotEquipmentMapper, PlPsRobotEquipment> implements PlPsRobotEquipmentService {

    @Override
    public IPage<PlPsRobotEquipment> pageByparam(PlPsRobotEquipment plPsRobotEquipment, Query query) {
        IPage<PlPsRobotEquipment> pages = page(Condition.getPage(query),
                new LambdaQueryWrapper<PlPsRobotEquipment>()
                        .eq(Func.isNotEmpty(plPsRobotEquipment.getParkId()), PlPsRobotEquipment::getParkId,
                                plPsRobotEquipment.getParkId())
                        .orderByDesc(PlPsRobotEquipment::getCreateTime));
        return pages;
    }
}
