package com.lightinit.hsdatashow.controller.topic.water;

import com.lightinit.hsdatashow.entity.Region;
import com.lightinit.hsdatashow.model.ResultState;
import com.lightinit.hsdatashow.model.topic.water.PageReturnModel;
import com.lightinit.hsdatashow.model.topic.water.STRainModel;
import com.lightinit.hsdatashow.model.topic.water.STRainSearchModel;
import com.lightinit.hsdatashow.service.topic.water.IYuQingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @Author: sunxiang
 * @Date: 2018/12/25 11:10
 * @Description:
 **/
@Controller
@RequestMapping(value="/topic/water/yuqing/")
public class YuQingController {

    @Autowired
    private IYuQingService yuQingService;
    @RequestMapping(value = "index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("topic/water/floodAndDry/yuqing");
        return modelAndView;
    }

    /*
     *@Description 今日降雨量----最近1小时降雨量----最近3小时降雨量-----最近6小时降雨量
     *@Param
     *@Date 2018/12/22
     *@return
     **/
    @RequestMapping(value = "getjiangyuliang.action")
    @ResponseBody
    public ResultState getjiangyuliang(){
        return yuQingService.getjiangyuliang();
    }

     /*
     *@Description 本市本月降雨变化
     *@Param
     *@Date 2018/12/22
     *@return
     **/
    @RequestMapping(value = "getbenshibenyuejiangyubianhua.action")
    @ResponseBody
    public ResultState getbenshibenyuejiangyubianhua(){
        return yuQingService.getbenshibenyuejiangyubianhua();
    }

    /*
     *@Description 今年降雨变化
     *@Param
     *@Date 2018/12/22
     *@return
     **/
    @RequestMapping(value = "getjinnianjiangyubianhua.action")
    @ResponseBody
    public ResultState getjinnianjiangyubianhua(){
        return yuQingService.getjinnianjiangyubianhua();
    }

    /*
     *@Description 今日降雨与周边地市比较
     *@Param
     *@Date 2018/12/22
     *@return
     **/
    @RequestMapping(value = "getjinrijiangyuyuzhoubiandishibijiao.action")
    @ResponseBody
    public ResultState getjinrijiangyuyuzhoubiandishibijiao(){
        return yuQingService.getjinrijiangyuyuzhoubiandishibijiao();
    }

    /*
     *@Description 本月降雨与周边地市比较
     *@Param
     *@Date 2018/12/22
     *@return
     **/
    @RequestMapping(value = "getbenyuejiangyuyuzhoubiandishibijiao.action")
    @ResponseBody
    public ResultState getbenyuejiangyuyuzhoubiandishibijiao(){
        return yuQingService.getbenyuejiangyuyuzhoubiandishibijiao();
    }

 /*
     *@Description 今年降雨与周边地市比较
     *@Param
     *@Date 2018/12/22
     *@return
     **/
    @RequestMapping(value = "getjinnianjiangyuyuzhoubiandishibijiao.action")
    @ResponseBody
    public ResultState getjinnianjiangyuyuzhoubiandishibijiao(){
        return yuQingService.getjinnianjiangyuyuzhoubiandishibijiao();
    }

    /*
     *@Description 历年降雨与周边地市比较
     *@Param
     *@Date 2018/12/22
     *@return
     **/
    @RequestMapping(value = "getlinianjiangyuyuzhoubianbijiao.action")
    @ResponseBody
    public ResultState getlinianjiangyuyuzhoubianbijiao(){
        return yuQingService.getlinianjiangyuyuzhoubianbijiao();
    }

/*
     *@Description 本市历年降雨变化
     *@Param
     *@Date 2018/12/22
     *@return
     **/
    @RequestMapping(value = "getbenshilinianjiangyubianhua.action")
    @ResponseBody
    public ResultState getbenshilinianjiangyubianhua(){
        return yuQingService.getbenshilinianjiangyubianhua();
    }

/*
     *@Description 降雨量明细查询
     *@Param
     *@Date 2018/12/22
     *@return
     **/
    @RequestMapping(value = "getjiangyumingxichaxun.action")
    @ResponseBody
    public PageReturnModel getjiangyumingxichaxun(STRainSearchModel stRainSearchModel){
        stRainSearchModel.automaticPageNo();
        PageReturnModel PageReturnModel= yuQingService.getjiangyumingxichaxun(stRainSearchModel);
        return PageReturnModel;
    }

    //得到衡水个区县
    @RequestMapping(value = "getRegion.action")
    @ResponseBody
    public List getRegion(){
        List<Region> list= yuQingService.getRegion();
        return list;
    }


}
