package com.njcn.prepare.harmonic.service.mysql.Impl.area;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.harmonic.pojo.po.ROperatingIndexMPO;
import com.njcn.prepare.harmonic.mapper.mysql.area.ROperatingIndexMPOMapper;
import com.njcn.prepare.harmonic.service.mysql.area.ROperatingIndexMPOService;
import com.njcn.prepare.harmonic.utils.PublicUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 
 * Description:
 * 接口文档访问地址：http://serverIP:port/swagger-ui.html
 * Date: 2022/11/30  13:59【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */
@Service
public class ROperatingIndexMPOServiceImpl extends MppServiceImpl<ROperatingIndexMPOMapper, ROperatingIndexMPO> implements ROperatingIndexMPOService{

    private @Autowired
    ROperatingIndexMPOMapper rOperatingIndexMPOMapper;
    /**
     * @param orgid
     * @param beginTime
     * @param endTime
     * @Description: queryOneQtrData 查询一季度Mouth表数据
     * @Param: [orgid, dataDate]
     * @return: java.util.List<com.njcn.prepare.harmonic.pojo.mysql.po.ROperatingIndexMPO>
     * @Author: clam
     * @Date: 2022/11/30
     */
    @Override
    public List<ROperatingIndexMPO> queryOneQtrData(String orgid,String beginTime, String endTime) {

        QueryWrapper<ROperatingIndexMPO> queryWrapper = new QueryWrapper<> ();
        queryWrapper.eq ("org_no", orgid)
                .ge("data_date",beginTime)
                .le("data_date",endTime);
        List<ROperatingIndexMPO> list = rOperatingIndexMPOMapper.selectList (queryWrapper);



        return list;
    }

    /**
     * @param orgid
     * @param beginTime
     * @param endTime
     * @Description: queryOneYearData 查询一年Mouth表数据
     * @Param: [orgid, dataDate]
     * @return: java.util.List<com.njcn.prepare.harmonic.pojo.mysql.po.ROperatingIndexMPO>
     * @Author: clam
     * @Date: 2022/11/30
     */
    @Override
    public List<ROperatingIndexMPO> queryOneYearData(String orgid,String beginTime, String endTime) {
        QueryWrapper<ROperatingIndexMPO> queryWrapper = new QueryWrapper<> ();
        queryWrapper.eq ("org_no", orgid).
                ge("data_date",beginTime)
                .le("data_date",endTime);
        List<ROperatingIndexMPO> list = rOperatingIndexMPOMapper.selectList (queryWrapper);

        return list;
    }

}
