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

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.szgl.entity.SzglGsdGcz;
import com.elephant.framework.galaxy.aroad.module.szgl.service.SzglGsdGczService;
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-13 11:08:50
 */
@RestController
@AllArgsConstructor
@RequestMapping("/szgl/szglgsdgcz")
public class SzglGsdGczController extends BaseController {

    private final SzglGsdGczService szglGsdGczService;

    /**
     * 查询全部观测站
     *
     * @param page
     * @return
     */
    @GetMapping("/page")
    public R getSzglGsdGczPage(Page page) {
        QueryWrapper<SzglGsdGcz> queryWrapper = new QueryWrapper<>();
        queryWrapper.ne("jsdj","高速公路");
        return new R<>(szglGsdGczService.page(page,queryWrapper));
    }



    /**
     * 查询全部观测站
     *
     * @param szglGsdGcz 数字公路-观测站
     * @return
     */
    @GetMapping("/all")
    public R getGczList(SzglGsdGcz szglGsdGcz) {
        QueryWrapper<SzglGsdGcz> queryWrapper = new QueryWrapper<>();
                                queryWrapper.ne("jsdj","高速公路");
        return new R<>(szglGsdGczService.list(queryWrapper));
    }

    @GetMapping("/getGczFroQS/{lxbh}/{zxzh}")
    public R getGczForQS(@PathVariable String lxbh,@PathVariable double zxzh){
        return  new R<>(szglGsdGczService.getGczForQS(lxbh,zxzh));
    }

}
