u
This commit is contained in:
@@ -1,9 +1,29 @@
|
||||
export const CREATE = `
|
||||
INSERT INTO pic (
|
||||
w, h, size, hash, thumbw, thumbh, thumbhash, source, [binary], thumbbinary
|
||||
w, h, size, hash, thumbw, thumbh, thumbhash, source, fullbinary, thumbbinary
|
||||
)
|
||||
OUTPUT INSERTED.id
|
||||
VALUES (
|
||||
@w, @h, @size, @hash, @thumbw, @thumbh, @thumbhash, @source, @binary, @thumbbinary
|
||||
@w, @h, @size, @hash, @thumbw, @thumbh, @thumbhash, @source, @fullbinary, @thumbbinary
|
||||
)
|
||||
`;
|
||||
|
||||
export const GET_CATEGORY_ID_BY_HASH = `
|
||||
SELECT TOP 1 ca.category_id AS categoryId
|
||||
FROM pic p
|
||||
INNER JOIN articlepic ap ON ap.pic_id = p.id
|
||||
INNER JOIN categoryarticle ca ON ca.article_id = ap.article_id
|
||||
WHERE p.hash = @hash
|
||||
`;
|
||||
|
||||
export const GET_FULL_BY_HASH = `
|
||||
SELECT w, h, size, fullbinary AS buffer
|
||||
FROM pic
|
||||
WHERE hash = @hash
|
||||
`;
|
||||
|
||||
export const GET_THUMB_BY_HASH = `
|
||||
SELECT thumbw AS w, thumbh AS h, thumbbinary AS buffer
|
||||
FROM pic
|
||||
WHERE hash = @hash
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user