u
This commit is contained in:
87
src/providers/mssql/queries/labeltemplate.js
Normal file
87
src/providers/mssql/queries/labeltemplate.js
Normal file
@@ -0,0 +1,87 @@
|
||||
export const LABELTEMPLATE_COLUMNS = `
|
||||
id,
|
||||
company_id,
|
||||
name,
|
||||
width,
|
||||
height,
|
||||
dpi,
|
||||
type,
|
||||
content,
|
||||
thumb
|
||||
`;
|
||||
|
||||
export const LIST_BY_COMPANY = `
|
||||
SELECT
|
||||
${LABELTEMPLATE_COLUMNS}
|
||||
FROM labeltemplate
|
||||
WHERE company_id = @companyId
|
||||
ORDER BY id ASC
|
||||
`;
|
||||
|
||||
export const GET_BY_COMPANY_AND_ID = `
|
||||
SELECT
|
||||
${LABELTEMPLATE_COLUMNS}
|
||||
FROM labeltemplate
|
||||
WHERE id = @id AND company_id = @companyId
|
||||
`;
|
||||
|
||||
export const CREATE = `
|
||||
INSERT INTO labeltemplate (
|
||||
company_id,
|
||||
name,
|
||||
width,
|
||||
height,
|
||||
dpi,
|
||||
type,
|
||||
content,
|
||||
thumb
|
||||
)
|
||||
OUTPUT
|
||||
INSERTED.id,
|
||||
INSERTED.company_id,
|
||||
INSERTED.name,
|
||||
INSERTED.width,
|
||||
INSERTED.height,
|
||||
INSERTED.dpi,
|
||||
INSERTED.type,
|
||||
INSERTED.content,
|
||||
INSERTED.thumb
|
||||
VALUES (
|
||||
@companyId,
|
||||
@name,
|
||||
@width,
|
||||
@height,
|
||||
@dpi,
|
||||
@type,
|
||||
@content,
|
||||
@thumb
|
||||
)
|
||||
`;
|
||||
|
||||
export const UPDATE = `
|
||||
UPDATE labeltemplate
|
||||
SET
|
||||
name = @name,
|
||||
width = @width,
|
||||
height = @height,
|
||||
dpi = @dpi,
|
||||
type = @type,
|
||||
content = @content,
|
||||
thumb = @thumb
|
||||
OUTPUT
|
||||
INSERTED.id,
|
||||
INSERTED.company_id,
|
||||
INSERTED.name,
|
||||
INSERTED.width,
|
||||
INSERTED.height,
|
||||
INSERTED.dpi,
|
||||
INSERTED.type,
|
||||
INSERTED.content,
|
||||
INSERTED.thumb
|
||||
WHERE id = @id AND company_id = @companyId
|
||||
`;
|
||||
|
||||
export const DELETE_BY_COMPANY_AND_ID = `
|
||||
DELETE FROM labeltemplate
|
||||
WHERE id = @id AND company_id = @companyId
|
||||
`;
|
||||
Reference in New Issue
Block a user