package com.ningdatech.carapi.company.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.common.aop.BuildChildrenRegionWrapper;
import com.ningdatech.carapi.company.entity.CompanySecurityCommitment;
import com.ningdatech.carapi.company.entity.dto.CompanySecurityCommitmentParam;
import com.ningdatech.carapi.company.mapper.NdCompanySecurityCommitmentMapper;
import com.ningdatech.carapi.company.service.ICompanySecurityCommitmentService;
import com.ningdatech.carapi.datascope.aop.LambdaDataScope;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 安全生产责任体系 安全承诺书
 * </p>
 *
 * @author zpf
 * @since 2023-05-23
 */
@Service
@RequiredArgsConstructor
public class NdCompanySecurityCommitmentServiceImpl extends ServiceImpl<NdCompanySecurityCommitmentMapper, CompanySecurityCommitment> implements ICompanySecurityCommitmentService {

    @Override
    @BuildChildrenRegionWrapper(wrapperIndex = 1,entityIndex = 2)
    @LambdaDataScope(wrapperIndex = 1)
    public Page<CompanySecurityCommitment> pageDataScope(Page<CompanySecurityCommitment> page, LambdaQueryWrapper<CompanySecurityCommitment> wrapper, CompanySecurityCommitmentParam param) {
        return page(page,wrapper);
    }

    @Override
    public void deleteById(Long id) {
        baseMapper.deleteById(id);
    }
}
