u
This commit is contained in:
19
src/providers/mssql/queries/companyhistory.js
Normal file
19
src/providers/mssql/queries/companyhistory.js
Normal file
@@ -0,0 +1,19 @@
|
||||
export const INSERT = `
|
||||
INSERT INTO companyhistory (company_id, companyuser_id, [text])
|
||||
OUTPUT INSERTED.id, INSERTED.companyuser_id AS companyuserId, INSERTED.[date], INSERTED.[text]
|
||||
VALUES (@companyId, @companyuserId, @text)
|
||||
`;
|
||||
|
||||
export const LIST_BY_COMPANY_ID = `
|
||||
SELECT id, companyuser_id AS companyuserId, [date], [text]
|
||||
FROM companyhistory
|
||||
WHERE company_id = @companyId
|
||||
ORDER BY [date] DESC, id DESC
|
||||
`;
|
||||
|
||||
export const LIST_BY_COMPANY_ID_LIMITED = `
|
||||
SELECT TOP (@limit) id, companyuser_id AS companyuserId, [date], [text]
|
||||
FROM companyhistory
|
||||
WHERE company_id = @companyId
|
||||
ORDER BY [date] DESC, id DESC
|
||||
`;
|
||||
Reference in New Issue
Block a user