package org.jeecg.modules.checkData.dynamicStaticGeometricData.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.dto.RailInspectionEquipmentDTO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipment;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.mapper.RailInspectionEquipmentMapper;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.service.IRailInspectionEquipmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 检查数据-动静态几何尺寸数据-轨检仪静态检查数据 服务实现类
 * </p>
 *
 * @author hkl
 * @since 2023-07-16
 */
@Service
public class RailInspectionEquipmentServiceImpl extends ServiceImpl<RailInspectionEquipmentMapper, RailInspectionEquipment> implements IRailInspectionEquipmentService {

    @Override
    public Page<RailInspectionEquipmentVO> queryPageList(Page<RailInspectionEquipmentVO> pageData, RailInspectionEquipmentDTO dto) {
        return this.baseMapper.queryPageList(pageData, dto);
    }

    @Override
    public void edit(RailInspectionEquipment railInspectionEquipment) {
        if (ObjectUtil.isEmpty(railInspectionEquipment.getId())) {
            this.save(railInspectionEquipment);
        } else {
            this.updateById(railInspectionEquipment);
        }
    }
}
