add AttachmentVariant
This commit is contained in:
@@ -26,33 +26,4 @@
|
||||
</if>
|
||||
ORDER BY `created_at`
|
||||
</select>
|
||||
<select id="selectThumb" resultType="com.imyeyu.api.modules.common.entity.Attachment">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`attachment`
|
||||
WHERE
|
||||
biz_type = #{bizType}
|
||||
AND biz_id = #{sourceId}
|
||||
AND attach_type = 'THUMB'
|
||||
<choose>
|
||||
<when test="requestWidth != null">
|
||||
AND JSON_EXTRACT(metadata, '$.requestWidth') = #{requestWidth}
|
||||
</when>
|
||||
<otherwise>
|
||||
AND JSON_EXTRACT(metadata, '$.requestWidth') IS NULL
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="requestHeight != null">
|
||||
AND JSON_EXTRACT(metadata, '$.requestHeight') = #{requestHeight}
|
||||
</when>
|
||||
<otherwise>
|
||||
AND JSON_EXTRACT(metadata, '$.requestHeight') IS NULL
|
||||
</otherwise>
|
||||
</choose>
|
||||
AND is_destroyed = FALSE
|
||||
AND UNIX_TIMESTAMP() * 1000 < destroy_at
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user