123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- // 倾斜数据管理模块
- const express = require("express");
- const router = express.Router();
- const pgClient = require("../../core/pgClient/pgClient.js");
- const sqlUtil = require("./sql.js");
- /* 1.获取所有数据 */
- router.post("/getAlldata", function (req, res) {
- let sqlstr = sqlUtil.getAlldata(req);
- // 执行sql
- pgClient.query(sqlstr).then((data) => {
- res.send(data);
- });
- });
- /* 1.获取所有接图表数据 */
- router.post("/getAllJieTuBiao", function (req, res) {
- let sqlstr = sqlUtil.getAllJieTuBiao(req);
- // 执行sql
- pgClient.query(sqlstr).then((data) => {
- res.send(data);
- });
- });
- /* 2.插入数据 */
- router.post("/InsertDataWithGeom", function (req, res) {
- let sqlstr = sqlUtil.InsertDataWithGeom(req);
- // 执行sql
- pgClient.query(sqlstr).then((data) => {
- res.send(data);
- });
- });
- /* 3.单体化点击查询 */
- router.post("/selectWithPoint", function (req, res) {
- let sqlstr = sqlUtil.selectWithPoint(req);
- // 执行sql
- pgClient.query(sqlstr).then((data) => {
- res.send(data);
- });
- });
- /* 接图表点击查询 */
- router.post("/selectWithJieTuPoint", function (req, res) {
- let sqlstr = sqlUtil.selectWithJieTuPoint(req);
- // 执行sql
- pgClient.query(sqlstr).then((data) => {
- res.send(data);
- });
- });
- /* 4.单体化table用id查询 */
- router.post("/qureyByID", function (req, res) {
- let sqlstr = sqlUtil.qureyByID(req);
- // 执行sql
- pgClient.query(sqlstr).then((data) => {
- res.send(data);
- });
- });
- /*接图表table用id查询 */
- router.post("/qureyByJieTuID", function (req, res) {
- let sqlstr = sqlUtil.qureyByJieTuID(req);
- // 执行sql
- pgClient.query(sqlstr).then((data) => {
- res.send(data);
- });
- });
- /* 5.更新数据 */
- router.post("/UpdataDataWithGeom", function (req, res) {
- let sqlstr = sqlUtil.UpdataDataWithGeom(req);
- // 执行sql
- pgClient.query(sqlstr).then((data) => {
- res.send(data);
- });
- });
- /* 5.单体化table用label查询*/
- router.post("/getDataByLabel", function (req, res) {
- let sqlstr = sqlUtil.getDataByLabel(req);
- // 执行sql
- pgClient.query(sqlstr).then((data) => {
- res.send(data);
- });
- });
- module.exports = router;
|