package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.bu3;

import cn.estsh.i3plus.ext.mes.api.busi.bu3.ISxOutPutStatisticsService;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesOutPutStatistics;
import cn.estsh.i3plus.ext.mes.pojo.repository.MesOutPutStatisticsRepository;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class SxOutPutStatisticsService implements ISxOutPutStatisticsService {

    @Autowired
    private MesOutPutStatisticsRepository outPutStatisticsRepository;

    @Override
    public List<MesOutPutStatistics> queryOutPutStatisticsList(MesOutPutStatistics outPutStatistics) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(outPutStatistics.getOrganizeCode());
        DdlPreparedPack.timeBuilder(outPutStatistics.getModifyDateTimeStart(), outPutStatistics.getModifyDateTimeEnd(), MesExtConstWords.MODIFY_DATE_TIME, packBean, true);
        return outPutStatisticsRepository.findByHqlWhere(packBean);
    }

}
