This commit is contained in:
seb
2026-10-22 23:33:00 +02:00
parent d6e5da93cb
commit e31566e6ee
4 changed files with 121 additions and 2 deletions

View File

@@ -254,6 +254,28 @@ INSERT INTO categoryarticle (category_id, article_id)
VALUES (@categoryId, @articleId)
`;
export const LIST_PAIRED_POSTERMINAL_IDS_BY_ARTICLE = `
SELECT DISTINCT pt.id AS posterminal_id
FROM posterminal pt
INNER JOIN posterminalcategory pc ON pc.posterminal_id = pt.id
INNER JOIN categoryarticle ca ON ca.category_id = pc.category_id
WHERE ca.article_id = @articleId
AND pt.company_id = @companyId
AND pt.token IS NOT NULL
`;
export const INSERT_POSTERMINAL_OBITUARY = `
INSERT INTO posterminalobituary (posterminal_id, entity_type, entity_id)
VALUES (@posterminalId, @entityType, @entityId)
`;
export const CLEAR_POSTERMINAL_OBITUARY = `
DELETE FROM posterminalobituary
WHERE posterminal_id = @posterminalId
AND entity_type = @entityType
AND entity_id = @entityId
`;
export const GET_BRAND_BY_COMPANY_AND_ID = `
SELECT id
FROM brand