package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.model.admin.WaterqualityFocusResultModel;
import com.lightinit.hsdatashow.model.admin.WaterqualityIndustryResultModel;
import com.lightinit.hsdatashow.model.admin.WaterqualitySurfaceResultModel;
import com.lightinit.hsdatashow.service.admin.IWaterQualityService;
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.math.BigDecimal;

@Controller
@RequestMapping(value = "/admin/waterQuality")
public class WaterQualityController {

    @Autowired
    private IWaterQualityService waterQualityService ;

    @RequestMapping("/index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/waterQuality/index") ;
        return modelAndView ;
    }

    //水质达标率
    @RequestMapping("/getWaterqualityHandle.action")
    @ResponseBody
    public BigDecimal getWaterqualityHandle(){
        BigDecimal value = waterQualityService.getWaterqualityHandle() ;
        return value ;
    }

    //城市污水处理率
    @RequestMapping("/getWaterqualityCityHandle.action")
    @ResponseBody
    public BigDecimal getWaterqualityCityHandle(){
        BigDecimal value = waterQualityService.getWaterqualityCityHandle() ;
        return value ;
    }

    //地表水按水域功能类型占比
    @RequestMapping("/getWaterqualitySurface.action")
    @ResponseBody
    public WaterqualitySurfaceResultModel getWaterqualitySurface(){
        WaterqualitySurfaceResultModel waterqualitySurfaceResultModel = waterQualityService.getWaterqualitySurface() ;
        return waterqualitySurfaceResultModel ;
    }

    //重点污染源工业废水排放
    @RequestMapping("/getWaterqualityIndustry.action")
    @ResponseBody
    public WaterqualityIndustryResultModel getWaterqualityIndustry(){
        WaterqualityIndustryResultModel waterqualityIndustryResultModel = waterQualityService.getWaterqualityIndustry() ;
        return waterqualityIndustryResultModel ;
    }

    //集中式饮用水水源地水质情况
    @RequestMapping("/getWaterqualityFocus.action")
    @ResponseBody
    public WaterqualityFocusResultModel getWaterqualityFocus(){
        WaterqualityFocusResultModel waterqualityFocusResultModel = waterQualityService.getWaterqualityFocus() ;
        return waterqualityFocusResultModel ;
    }
}
