package com.elephant.framework.galaxy.aroad.module.zhjc.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
import com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcPtgsdLwzs;
import com.elephant.framework.galaxy.aroad.module.zhjc.service.ZhjcPtgsdLwzsService;
import com.elephant.framework.galaxy.aroad.response.R;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 普通国道路线平均行程车速
 *
 * @author zyw
 * @date 2019-05-06 14:29:11
 */
@RestController
@AllArgsConstructor
@RequestMapping("/zhjc/lwzs")
public class ZhjcPtgsdLwzsController extends BaseController  {

  private final ZhjcPtgsdLwzsService zhjcPtgsdLwzsService;

  /**
   * 查询路网指数数据
   * @param page
   * @param lwjcPtgdlxpjxscs
   * @return
   */
  @GetMapping("/list")
  public R getLwzsList(Page page, ZhjcPtgsdLwzs lwjcPtgdlxpjxscs) {
    return  new R<>(zhjcPtgsdLwzsService.selectLwzs(lwjcPtgdlxpjxscs));
  }

  /**
   * 路网监测--综合监测路网指数top5
   * @author : Xingyuyang
   * @date : 2019/05/29 16:11
   */
  @GetMapping("/getlwzstop")
  public R roadNetZhjcTop(Page page, ZhjcPtgsdLwzs lwjcPtgdlxpjxscs){
    return  new R<>(zhjcPtgsdLwzsService.roadNetZhjcTop(lwjcPtgdlxpjxscs));
  }


  /**
   * 按路线编号查询
   * @Param keyword 搜索条件
   */
  @GetMapping("/getLines/{lxbh}")
  public R getLines(@PathVariable String lxbh) throws Exception {
    return new R<>(zhjcPtgsdLwzsService.getLinesByLxbh(lxbh));
  }
}
