package com.ningdatech.carapi.car.vehicle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.carapi.car.vehicle.model.NdVehicleBaseInfoJoin;
import com.ningdatech.carapi.car.vehicle.mapper.VehicleBaseInfoJoinMapper;
import com.ningdatech.carapi.car.vehicle.service.IVehicleBaseInfoJoinService;
import com.ningdatech.carapi.datascope.aop.LambdaDataScope;
import com.ningdatech.carapi.datascope.contants.LambdaDataScopeTypeEnum;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-10-09
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class VehicleBaseInfoJoinServiceImpl extends ServiceImpl<VehicleBaseInfoJoinMapper, NdVehicleBaseInfoJoin>
        implements IVehicleBaseInfoJoinService {

    private final VehicleBaseInfoJoinMapper vehicleBaseInfoJoinMapper;

    @Override
    @LambdaDataScope(type = LambdaDataScopeTypeEnum.ALL,wrapperIndex = 1)
    public Page<NdVehicleBaseInfoJoin> pageJoin(Page<NdVehicleBaseInfoJoin> page, LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.pageJoin(page,wrapper);
    }

    @Override
    public Page<NdVehicleBaseInfoJoin> pageJoinWithUseCompany(Page<NdVehicleBaseInfoJoin> page, LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.pageJoin(page,wrapper);
    }

    @Override
    public Page<NdVehicleBaseInfoJoin> pageOpenJoin(Page<NdVehicleBaseInfoJoin> page, LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.pageJoin(page,wrapper);
    }

    @Override
    @LambdaDataScope(type = LambdaDataScopeTypeEnum.ALL)
    public NdVehicleBaseInfoJoin oneJoin(LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.oneJoin(wrapper);
    }

    @Override
    @LambdaDataScope(type = LambdaDataScopeTypeEnum.ALL,wrapperIndex = 1)
    public Page<NdVehicleBaseInfoJoin> pageJoinWithEquipment(Page<NdVehicleBaseInfoJoin> page, LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.pageJoinWithEquipment(page,wrapper);
    }

    @Override
    public Page<NdVehicleBaseInfoJoin> pageJoinWithEquipmentAndUseCompany(Page<NdVehicleBaseInfoJoin> page, LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.pageJoinWithEquipment(page,wrapper);
    }

    @Override
    public Page<NdVehicleBaseInfoJoin> pageJoinWithEquipmentOpen(Page<NdVehicleBaseInfoJoin> page, LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.pageJoinWithEquipment(page,wrapper);
    }

    @Override
    @LambdaDataScope(type = LambdaDataScopeTypeEnum.ALL)
    public NdVehicleBaseInfoJoin oneJoinWithEquipment(LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.oneJoinWithEquipment(wrapper);
    }

    @Override
    public List<NdVehicleBaseInfoJoin> listJoin(LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.listJoin(wrapper);
    }

    @Override
    @LambdaDataScope(type = LambdaDataScopeTypeEnum.ALL,wrapperIndex = 1)
    public Page<NdVehicleBaseInfoJoin> pageJoinWithNotEquipment(Page<NdVehicleBaseInfoJoin> page, LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.pageJoinWithNotEquipment(page,wrapper);
    }

    @Override
    public Page<NdVehicleBaseInfoJoin> pageJoinWithNotEquipmentAndUseCompany(Page<NdVehicleBaseInfoJoin> page, LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.pageJoinWithNotEquipment(page,wrapper);
    }

    @Override
    @LambdaDataScope
    public List<NdVehicleBaseInfoJoin> listCarJoin(LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.listCarJoin(wrapper);
    }

    @Override
    public List<NdVehicleBaseInfoJoin> listCarJoinWithUseCompany(LambdaQueryWrapper<NdVehicleBaseInfoJoin> wrapper) {
        return vehicleBaseInfoJoinMapper.listCarJoin(wrapper);
    }

}
