forked from ttc/micro-service-api
-แก้ไขระบบ Login Add
This commit is contained in:
@@ -20,16 +20,30 @@ export class AccountingAddService {
|
||||
return result
|
||||
}
|
||||
|
||||
async getLatestAccountingSeq(database) {
|
||||
// async getLatestAccountingSeq(database) {
|
||||
// const sql = `
|
||||
// SELECT
|
||||
// actseq
|
||||
// FROM ${database}.actmst
|
||||
// WHERE actseq=(SELECT max(actseq) FROM ${database}.actmst)
|
||||
// `
|
||||
|
||||
// const params = []
|
||||
// const result = await this.generalService.executeQueryParam(database, sql, params);
|
||||
// return result
|
||||
// }
|
||||
|
||||
async genNum(database) {
|
||||
const sql = `
|
||||
SELECT
|
||||
actseq
|
||||
MAX(actseq) as max_seq
|
||||
FROM ${database}.actmst
|
||||
WHERE actseq=(SELECT max(actseq) FROM ${database}.actmst)
|
||||
`
|
||||
|
||||
const params = []
|
||||
const result = await this.generalService.executeQueryParam(database, sql, params);
|
||||
return result
|
||||
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