21 lines
692 B
JavaScript
21 lines
692 B
JavaScript
|
|
const dbConfig = require('../config/dbConfig.js');
|
||
|
|
|
||
|
|
const { Pool } = require('pg');
|
||
|
|
const pool = new Pool({
|
||
|
|
host: dbConfig.hubsoft.databaseHost,
|
||
|
|
port: dbConfig.hubsoft.databasePort,
|
||
|
|
database: dbConfig.hubsoft.databaseName,
|
||
|
|
user: dbConfig.hubsoft.databaseUser,
|
||
|
|
password: dbConfig.hubsoft.databasePassword
|
||
|
|
});
|
||
|
|
|
||
|
|
const getAtendimentosFromDB = async () => {
|
||
|
|
const query = 'SELECT * FROM atendimento WHERE id_tipo_atendimento = 4 AND id_usuario_abertura = 248 AND ( id_atendimento_status = 33 OR id_atendimento_status = 1 OR id_atendimento_status = 2 );';
|
||
|
|
|
||
|
|
const { rows } = await pool.query(query);
|
||
|
|
return rows;
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = {
|
||
|
|
getAtendimentosFromDB
|
||
|
|
};
|