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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsGcxmShape;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsGcxm;
import com.elephant.framework.galaxy.aroad.module.zhjs.service.ZhjsGcxmService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;

import java.util.List;


/**
 * 工程项目信息表

 *
 * @author wangjian
 * @date 2019-04-08 18:14:32
 */
@RestController
@AllArgsConstructor
@RequestMapping("/zhjs/gcxm")
public class ZhjsGcxmController extends BaseController  {

  private final  ZhjsGcxmService zhjsGcxmService;

  /**
   * 分页查询
   * @param page 分页对象
   * @param zhjsGcxm 工程项目信息表

   * @return
   */
  @GetMapping("/page")
  public R getZhjsGcxmPage(Page page, ZhjsGcxm zhjsGcxm) {
    return  new R<>(zhjsGcxmService.page(page,Wrappers.query(zhjsGcxm)));
  }

  /**
   * 获取token
   * @return
   */
  @GetMapping("/getToken")
  public R getTokenData() {
    return new R(zhjsGcxmService.getTokenData());
  }

  /**
   * 根据项目名称分页模糊查询数据
   */
  @GetMapping("/getGcxm")
  public R getZhjsGcxmPageByProName(Page page, String proname) {
    return new R<>(zhjsGcxmService.getZhjsGcxmPageByProName(page,proname));
  }

  /**
   * 根据项目ID获取汇总明细
   * @return
   */
  @GetMapping("/getHzmx")
  public R getHzmxByProId(String token, String proId) {
    return new R<>(zhjsGcxmService.getHzmxByProId(token,proId));
  }


  /**
   * 根据项目ID查询项目情况
   * @param xmid
   * @return
   */
  @GetMapping("/getXmqk")
  public R getZhjsXmqkByXmid(String xmid) {
    return new R<>(zhjsGcxmService.getZhjsXmqkByXmid(xmid));
  }

  /**
   * 查询综合展示页面图一数据
   * @return
   */
  @GetMapping("/getZhzsOne")
  public R getZhjsZhzsOneData() {
    return new R<>(zhjsGcxmService.getZhjsZhzsOneDatas());
  }

  /**
   * 查询综合展示页面图二数据
   * @return
   */
  @GetMapping("/getZhzsTwo")
  public R getZhjsZhzsTwoData(String city) {
    return new R<>(zhjsGcxmService.getZhjsZhzsTwoDatas(city));
  }

  /**
   * 查询综合展示页面图三数据
   * @return
   */
  @GetMapping("/getZhzsThree")
  public R getZhjsZhzsThreeData() {
    return new R<>(zhjsGcxmService.getZhjsZhzsThreeDatas());
  }

  /**
   * 查询项目信息
   */
  @GetMapping("/getGcxmShape")
  public R getGcxmAndShape(Integer attribute, Integer invmodel) {
    return new R<>(zhjsGcxmService.getGcxmAndShape(attribute,invmodel));
  }
}
