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

import com.ningdatech.carapi.car.datascreen.model.dto.DataScreenParam;
import com.ningdatech.carapi.common.aop.BuildChildrenRegionEntity;
import com.ningdatech.carapi.common.util.CodeUtil;
import com.ningdatech.carapi.datascope.aop.XmlDataScope;
import com.ningdatech.carapi.industry.mapper.DataScreenMapper;
import com.ningdatech.carapi.industry.model.po.CeriticatePO;
import com.ningdatech.carapi.industry.service.DataScreenService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author PoffyZhang
 * @Classname DataScreenServiceImpl
 * @Description
 * @Date 2022/12/15 19:09
 */
@Service
@RequiredArgsConstructor
public class DataScreenServiceImpl implements DataScreenService {

    private final DataScreenMapper mapper;

    @Override
    @XmlDataScope
    @BuildChildrenRegionEntity
    public List<CeriticatePO> tainCertificate(DataScreenParam param) {
        CodeUtil.buildRegionLevel(param);
        return mapper.tainCertificate(param);
    }

    @Override
    @XmlDataScope
    @BuildChildrenRegionEntity
    public List<CeriticatePO> laboratoryQualificationCertificate(DataScreenParam param) {
        CodeUtil.buildRegionLevel(param);
        return mapper.laboratoryQualificationCertificate(param);
    }

    @Override
    @XmlDataScope
    @BuildChildrenRegionEntity
    public List<CeriticatePO> laboratoryAcceptanceCertificate(DataScreenParam param) {
        CodeUtil.buildRegionLevel(param);
        return mapper.laboratoryAcceptanceCertificate(param);
    }

    @Override
    @XmlDataScope
    @BuildChildrenRegionEntity
    public List<CeriticatePO> recordCertificateMortarEnterprise(DataScreenParam param) {
        CodeUtil.buildRegionLevel(param);
        return mapper.recordCertificateMortarEnterprise(param);
    }
}
