This commit is contained in:
Felipe Batista
2025-01-27 17:44:27 -03:00
commit 47e7f75720
238 changed files with 36425 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/*
https://docs.nestjs.com/providers#services
*/
import { Injectable } from '@nestjs/common';
import { connectionOptions } from 'src/configs/typeorm.config';
import { Connection } from 'typeorm';
@Injectable()
export class SellerService {
async getSellers(){
const connection = new Connection(connectionOptions);
await connection.connect();
const queryRunner = connection.createQueryRunner();
await queryRunner.connect();
try {
const sellers = await queryRunner.query('SELECT PCUSUARI.CODUSUR as "sellerId" ' +
' ,PCUSUARI.NOME as "name" ' +
' FROM PCUSUARI ' +
' WHERE PCUSUARI.DTTERMINO IS NULL ' +
' AND PCUSUARI.DTEXCLUSAO IS NULL ' +
' AND PCUSUARI.TIPOVEND NOT IN (\'P\') ');
return sellers;
} finally {
await queryRunner.release();
await connection.close();
}
}
}