2025-01-27 18:39:35 +01:00
|
|
|
{% extends 'minifigure/base/base.sql' %}
|
2025-01-17 11:03:00 +01:00
|
|
|
|
2025-01-17 16:28:43 +01:00
|
|
|
{% block total_missing %}
|
2025-01-20 19:39:12 +01:00
|
|
|
SUM(IFNULL("missing"."quantity", 0)) AS "total_missing",
|
2025-01-17 16:28:43 +01:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block join %}
|
2025-01-20 19:39:12 +01:00
|
|
|
LEFT JOIN "missing"
|
2025-01-27 18:39:35 +01:00
|
|
|
ON "rebrickable_minifigures"."figure" IS NOT DISTINCT FROM "missing"."set_num"
|
|
|
|
AND "bricktracker_minifigures"."bricktracker_set_id" IS NOT DISTINCT FROM "missing"."u_id"
|
2025-01-17 16:28:43 +01:00
|
|
|
{% endblock %}
|
|
|
|
|
2025-01-17 11:03:00 +01:00
|
|
|
{% block where %}
|
2025-01-27 18:39:35 +01:00
|
|
|
WHERE "rebrickable_minifigures"."figure" IN (
|
2025-01-17 11:03:00 +01:00
|
|
|
SELECT
|
2025-01-20 19:39:12 +01:00
|
|
|
"missing"."set_num"
|
|
|
|
FROM "missing"
|
2025-01-17 11:03:00 +01:00
|
|
|
|
2025-01-20 19:39:12 +01:00
|
|
|
WHERE "missing"."color_id" IS NOT DISTINCT FROM :color_id
|
|
|
|
AND "missing"."element_id" IS NOT DISTINCT FROM :element_id
|
|
|
|
AND "missing"."part_num" IS NOT DISTINCT FROM :part_num
|
2025-01-17 11:03:00 +01:00
|
|
|
|
2025-01-20 19:39:12 +01:00
|
|
|
GROUP BY "missing"."set_num"
|
2025-01-17 11:03:00 +01:00
|
|
|
)
|
|
|
|
{% endblock %}
|
2025-01-17 16:28:43 +01:00
|
|
|
|
|
|
|
{% block group %}
|
|
|
|
GROUP BY
|
2025-01-27 18:39:35 +01:00
|
|
|
"rebrickable_minifigures"."figure"
|
2025-01-17 16:28:43 +01:00
|
|
|
{% endblock %}
|