From e3a6f97a51f85b2bb2e3208559a4e8b7593d8dd4 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 4 Oct 2022 14:47:14 +0200 Subject: [PATCH] changes --- back/methods/printServer/main.js | 13 +++++++++++++ back/methods/printServer/sql/printQueue.sql | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 back/methods/printServer/main.js create mode 100644 back/methods/printServer/sql/printQueue.sql diff --git a/back/methods/printServer/main.js b/back/methods/printServer/main.js new file mode 100644 index 000000000..3f60d51ac --- /dev/null +++ b/back/methods/printServer/main.js @@ -0,0 +1,13 @@ +const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; + +async function printServer(){ + const stmt = new ParameterizedSQL( + `SELECT * FROM campaign`); + stmt.merge(conn.makeWhere(filter.where)); + stmt.merge('GROUP BY code'); + stmt.merge(conn.makePagination(filter)); + + return conn.executeStmt(stmt); +} + +setInterval(printServer, 2000); \ No newline at end of file diff --git a/back/methods/printServer/sql/printQueue.sql b/back/methods/printServer/sql/printQueue.sql new file mode 100644 index 000000000..aced591aa --- /dev/null +++ b/back/methods/printServer/sql/printQueue.sql @@ -0,0 +1,2 @@ +SELECT * + FROM vn.printQueue; \ No newline at end of file