package com.lightinit.hsdatashow.controller.admin;

import com.lightinit.hsdatashow.model.ResultState;
import com.lightinit.hsdatashow.service.admin.IProduceSecurityService;
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.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author: sunxiang
 * @Date: 2018/8/2 15:40
 * @Description:
 **/
@Controller
@RequestMapping(value = "/admin/produceSecurity")
public class ProduceSecurityController {

    @Autowired
    private IProduceSecurityService produceSecurityService;
    @RequestMapping(value = "index.htm")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("admin/produceSecurity/index");
        return modelAndView;
    }

    /*
    *@Description 万人工伤事故死亡率
    *@Param 
    *@Date 2018/8/8
    *@return 
    **/
    @RequestMapping(value = "accidentdeath.action")
    @ResponseBody
    public ResultState getAccidentDeath(){
        return produceSecurityService.getAccidentDeath();
    }

    /*
    *@Description 区域工伤事故占比
    *@Param
    *@Date 2018/8/8
    *@return
    **/
    @RequestMapping(value = "accidentproportion.action")
    @ResponseBody
    public ResultState getAccidentProportion(){
        return produceSecurityService.getAccidentProportion();
    }

    /*
    *@Description   工伤事故类别排名
    *@Param
    *@Date 2018/8/9
    *@return
    **/
    @RequestMapping(value = "industrialaccidentranking.action")
    @ResponseBody
    public ResultState getIndustrialAccidentRanking(){
        return produceSecurityService.getIndustrialAccidentRanking();
    }

    /*
    *@Description   工伤事故类别排名
    *@Param
    *@Date 2018/8/9
    *@return
    **/
    @RequestMapping(value = "industrialaccidenttendency.action")
    @ResponseBody
    public ResultState getIndustrialAccidentTendency(){
        return produceSecurityService.getIndustrialAccidentTendency();

    }

    /*
    *@Description
    *@Param
    *@Date 2018/8/16
    *@return
    **/
    @RequestMapping(value = "industriaaccidentdistribution.action")
    @ResponseBody
    public ResultState getIndustrialAccidentDistribution(){
        return produceSecurityService.getIndustrialAccidentDistribution();

    }


}
