package com.hdkj.lt.bf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdkj.lt.bf.entity.IndicatorResult;
import com.hdkj.lt.bf.mapper.IndicatorResultMapper;
import com.hdkj.lt.bf.service.IndicatorResultService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 指标计算结果 Service 实现
 */
@Slf4j
@Service
public class IndicatorResultServiceImpl extends ServiceImpl<IndicatorResultMapper, IndicatorResult> implements IndicatorResultService {

    @Override
    public IndicatorResult getByBatchAndCounty(String batchId, Integer countyId) {
        LambdaQueryWrapper<IndicatorResult> queryWrapper = new LambdaQueryWrapper<IndicatorResult>()
                .eq(IndicatorResult::getBatchId, batchId)
                .eq(IndicatorResult::getCountyId, countyId);
        return baseMapper.selectOne(queryWrapper);
    }
}
