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

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.database.entity.LocalDatabase;
import org.jeecg.modules.database.mapper.LocalDatabaseMapper;
import org.jeecg.modules.database.service.ILocalDatabaseService;
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 LocalDatabaseServiceImpl extends ServiceImpl<LocalDatabaseMapper, LocalDatabase> implements ILocalDatabaseService {

    @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<LocalDatabase> search(String keyWord) {
        return baseMapper.search(keyWord);
    }
}
