-gennumber
This commit is contained in:
@@ -13,9 +13,23 @@ export class BudgetAddService {
|
||||
bdgnam
|
||||
FROM ${database}.bdgmst
|
||||
WHERE bdgnam = $1
|
||||
`
|
||||
`
|
||||
const params = [name]
|
||||
const result = await this.generalService.executeQueryParam(database, sql, params);
|
||||
return result
|
||||
}
|
||||
|
||||
async genNum(database) {
|
||||
const sql = `
|
||||
SELECT
|
||||
MAX(bdgseq) as max_seq
|
||||
FROM ${database}.bdgmst
|
||||
`
|
||||
const params = []
|
||||
const aryResult = await this.generalService.executeQueryParam(database, sql, params);
|
||||
|
||||
const lastSeq = aryResult[0]?.max_seq || 0;
|
||||
|
||||
return lastSeq + 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user