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