package com.usky.iot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usky.iot.domain.ReportResourceTotal;
import com.usky.iot.mapper.ReportResourceTotalMapper;
import com.usky.iot.service.ReportResourceTotalService;
import com.usky.common.mybatis.core.AbstractCrudService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 能耗统计数据报表 服务实现类
 * </p>
 *
 * @author han
 * @since 2023-09-11
 */
@Service
public class ReportResourceTotalServiceImpl extends AbstractCrudService<ReportResourceTotalMapper, ReportResourceTotal> implements ReportResourceTotalService {

    @Override
    public List<ReportResourceTotal> getTotalData(String productCode){
        LambdaQueryWrapper<ReportResourceTotal> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper
                .eq(ReportResourceTotal::getProductCode,productCode);
        List<ReportResourceTotal> list = this.list(queryWrapper);
        return list;
    }
}
