package com.ningdatech.carapi.analysis.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.carapi.analysis.entity.WarnAnalysisCar;
import com.ningdatech.carapi.analysis.entity.req.WarnAnalysisListReq;
import com.ningdatech.carapi.analysis.mapper.WarnAnalysisCarMapper;
import com.ningdatech.carapi.analysis.service.IWarnAnalysisCarService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.carapi.common.aop.BuildChildrenRegionEntity;
import com.ningdatech.carapi.datascope.aop.XmlDataScope;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 车辆综合预警分析 服务实现类
 * </p>
 *
 * @author WendyYang
 * @since 2022-10-14
 */
@Service
@RequiredArgsConstructor
public class WarnAnalysisCarServiceImpl extends ServiceImpl<WarnAnalysisCarMapper, WarnAnalysisCar> implements IWarnAnalysisCarService {

    private final WarnAnalysisCarMapper mapper;

    @Override
    @XmlDataScope(entityIndex = 1)
    @BuildChildrenRegionEntity(entityIndex = 1)
    public Page<WarnAnalysisCar> pageCarAnalysis(Page<WarnAnalysisCar> page, WarnAnalysisListReq req) {
        return mapper.pageCarAnalysis(page,req);
    }

    @Override
    public List<WarnAnalysisCar> listCarAnalysis(WarnAnalysisListReq req) {
        return mapper.listCarAnalysis(req);
    }

    @Override
    public Integer saveBatchXml(List<WarnAnalysisCar> singleList) {
        return mapper.saveBatchXml(singleList);
    }
}
