/*
 * Author: wangjian
 * 生成ServiceImpl
 */
package com.tofly.xrtymis.custom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtymis.custom.service.GdglinfoService;
import com.tofly.xrtymis.custom.service.GdhftjService;
import com.tofly.xrtymis.entity.Gdglinfo;
import com.tofly.xrtymis.entity.Gdhftj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tofly.xrtymis.mapper.GdhftjMapper;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * ${comments}
 *
 * @author fcl
 * @date Wed May 12 00:00:00 CST 2021
 */
@Service("gdhftjService")
public class GdhftjServiceImpl extends ServiceImpl<GdhftjMapper, Gdhftj> implements GdhftjService {

    @Autowired
    private GdglinfoService gdglinfoService;
    @Autowired
    private GdhftjService gdhftjService;
    @Override
    public Gdhftj selectByTime(String timeAndDate) {
        QueryWrapper<Gdhftj> wrapper = new QueryWrapper<>();
        wrapper.eq("DATE",timeAndDate);
        return baseMapper.selectOne(wrapper);
    }

    @Override
    public ResultRespone updateProportion(Gdhftj gdhftj) {
        return ResultRespone.success(gdhftjService.updateById(gdhftj));
    }

    @Override
    public List<Gdhftj> listDate(String timeAndDate) {
        QueryWrapper<Gdhftj> wrapper = new QueryWrapper<>();
        wrapper.eq("DATE_TIME",timeAndDate);
        return baseMapper.selectList(wrapper);
    }
}
