package org.jeecg.modules.database.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.database.entity.HistoricalDatabase;
import org.jeecg.modules.database.mapper.HistoricalDatabaseMapper;
import org.jeecg.modules.database.service.IHistoricalDatabaseService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

/**
 * @Description: 历史一期记录
 * @Author: jeecg-boot
 * @Date: 2025-02-24
 * @Version: V1.0
 */
@Service
public class HistoricalDatabaseServiceImpl extends ServiceImpl<HistoricalDatabaseMapper, HistoricalDatabase>
        implements IHistoricalDatabaseService {

    @Override
    public Long sumLhs() {
        return Optional.ofNullable(baseMapper.sumLhs()).orElse(0L);
    }

    @Override
    public Long sumXhy() {
        return Optional.ofNullable(baseMapper.sumXhy()).orElse(0L);
    }

    @Override
    public List<HistoricalDatabase> search(String keyWord) {
        return baseMapper.search(keyWord);
    }
}
