20 lines
608 B
JavaScript
20 lines
608 B
JavaScript
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
|
|
`;
|