This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
//@ts-check | |
const fs = require('fs') | |
const path = require('path') | |
const dns = require('dns') | |
const util = require('util') | |
const dateformat = require('dateformat') | |
const Tail = require('tail').Tail | |
const resolve4 = util.promisify(dns.resolve4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim: set ts=4 sw=4 sts=4 et cindent: | |
const pg = require('pg') | |
const Pool = pg.Pool | |
const Cursor = require('pg-cursor') | |
//@ts-check | |
class PgCursors { | |
/** | |
* @param {pg.Pool} db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
DISTINCT DECODE(CARNO, NULL, 'X','Y') P -- 是否有車號, 'X':無, 'Y':有 | |
, RQT_NO RNO -- 叫車序號 | |
, RQTSEQ_NO RSNO -- 叫車序號支號 | |
, DEP -- 通關類別 | |
, (SELECT SUBSTR(DEP_NAME,1,2) FROM ORG WHERE ORG.DEP_ID = T.DEP_ID) DEP_ID -- 部門名稱前2碼 | |
, RQT_BY | |
, DECODE(BOX_NOCAR,NULL, CARNO,CARNO||','||BOX_NOCAR) CARNO | |
, NVL((SELECT CEMP_NAME FROM EMPLOYEE WHERE EMP_CODE= T.DRIVER),DRIVER)DR | |
, CASE WHEN RESERVED_FLAG = 'Y' THEN -- 若是專車 |