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.ROperatingIndexDPO;
import com.njcn.prepare.harmonic.mapper.mysql.area.ROperatingIndexDPOMapper;
import com.njcn.prepare.harmonic.service.mysql.area.ROperatingIndexDPOService;
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/25  10:01【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */
@Service
public class ROperatingIndexDPOServiceImpl extends MppServiceImpl<ROperatingIndexDPOMapper, ROperatingIndexDPO> implements ROperatingIndexDPOService{


    private @Autowired
    ROperatingIndexDPOMapper rOperatingIndexDPOMapper;
    /**
     * @param orgid
     * @param dataDate
     * @Description: 查询day表一个月的数据数据生成月表数据
     * @Param: [orgid, dataDate]
     * @return: java.util.List<com.njcn.harmonic.pojo.po.ROperatingIndexDPO>
     * @Author: clam
     * @Date: 2022/11/30
     */
    @Override
    public List<ROperatingIndexDPO> queryOneMothData(String orgid, String dataDate) {


        QueryWrapper<ROperatingIndexDPO> queryWrapper = new QueryWrapper<> ();
        queryWrapper.eq ("org_no", orgid).
                eq("DATE_FORMAT( data_date ,'%Y-%m')",dataDate.substring (0, 7));
        List<ROperatingIndexDPO> list = rOperatingIndexDPOMapper.selectList (queryWrapper);



        return list;
    }
}
