This commit is contained in:
seb
2026-09-27 22:01:56 +02:00
parent 0cafa11a32
commit 87da854de4
12 changed files with 686 additions and 0 deletions

View 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
`;