This commit is contained in:
seb
2026-10-01 17:40:04 +02:00
parent 62c3e69ed4
commit 84e547660e
53 changed files with 4604 additions and 2059 deletions

View File

@@ -0,0 +1,30 @@
export const LIST_BY_CATEGORY_ID = `
SELECT
cp.id,
cp.category_id AS categoryId,
cp.property_id AS propertyId,
pn.name AS name,
pn.exclusive,
cp.value,
cp.sort
FROM categoryproperty cp
INNER JOIN propertyname pn ON pn.id = cp.property_id
WHERE cp.category_id = @categoryId
ORDER BY cp.sort ASC, cp.id ASC
`;
export const DELETE_BY_CATEGORY_ID = `
DELETE FROM categoryproperty
WHERE category_id = @categoryId
`;
export const DELETE_BY_CATEGORY_AND_PROPERTY_ID = `
DELETE FROM categoryproperty
WHERE category_id = @categoryId AND property_id = @propertyId
`;
export const INSERT_ROW = `
INSERT INTO categoryproperty (category_id, property_id, value, sort)
OUTPUT INSERTED.id, INSERTED.category_id AS categoryId, INSERTED.property_id AS propertyId, INSERTED.value, INSERTED.sort
VALUES (@categoryId, @propertyId, @value, @sort)
`;