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

import com.lightinit.hsdatashow.model.admin.*;
import com.lightinit.hsdatashow.service.topic.water.ISyntheticalService;
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("/topic/water/synthetical")
public class SyntheticalController {

    @Autowired
    private ISyntheticalService syntheticalService ;

    @RequestMapping(value = "/index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("topic/water/synthetical/index") ;
        return modelAndView ;
    }

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

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

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

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

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

    //农村自来水普及率
    @RequestMapping("/getCountrysideWater.action")
    @ResponseBody
    public CountrysideNameAndValue getCountrysideWater(){
        CountrysideNameAndValue countrysideNameAndValue = syntheticalService.getCountrysideWater() ;
        return countrysideNameAndValue ;
    }

    //农村生活垃圾无害化处理率
    @RequestMapping("/getCountrysideGarbage.action")
    @ResponseBody
    public CountrysideNameAndValue getCountrysideGarbage(){
        CountrysideNameAndValue countrysideNameAndValue = syntheticalService.getCountrysideGarbage() ;
        return countrysideNameAndValue ;
    }

    @RequestMapping(value = "/getConsume.action")
    @ResponseBody
    public ConsumeListModel getConsume() {
        ConsumeListModel model = syntheticalService.getConsume();
        return model;
    }

    @RequestMapping(value = "/getDealWithTheStandard.action")
    @ResponseBody
    public SpreadListModel getDealWithTheStandard() {
        SpreadListModel model = syntheticalService.getDealWithTheStandard();
        return model;
    }

}
