package com.sptg.ad.biz.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.sptg.ad.api.entity.ThresholdConfig;
import com.sptg.ad.biz.mapper.ThresholdConfigMapper;
import com.sptg.ad.biz.service.ThresholdConfigService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 *            
 *               
 * description:
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class ThresholdConfigServiceImpl extends ServiceImpl<ThresholdConfigMapper, ThresholdConfig>
        implements ThresholdConfigService {
    @Override
    public ThresholdConfig selectByRegionCode(Long orgId, Integer type, String code) {
        Wrapper<ThresholdConfig> wrapper = new EntityWrapper<>();
        wrapper.eq("org_id",orgId);
        wrapper.eq("type",type);
        wrapper.eq("region_code",code);
        return this.selectOne(wrapper);
    }
}
