BrickTracker/bricktracker/sql/part/list/from_minifigure.sql

29 lines
796 B
MySQL
Raw Permalink Normal View History

2025-01-17 11:03:00 +01:00
{% extends 'part/base/select.sql' %}
{% block total_missing %}
SUM(IFNULL("missing"."quantity", 0)) AS "total_missing",
2025-01-17 11:03:00 +01:00
{% endblock %}
{% block join %}
LEFT JOIN "missing"
ON "missing"."set_num" IS NOT DISTINCT FROM "inventory"."set_num"
AND "missing"."id" IS NOT DISTINCT FROM "inventory"."id"
AND "missing"."part_num" IS NOT DISTINCT FROM "inventory"."part_num"
AND "missing"."color_id" IS NOT DISTINCT FROM "inventory"."color_id"
AND "missing"."element_id" IS NOT DISTINCT FROM "inventory"."element_id"
2025-01-17 11:03:00 +01:00
{% endblock %}
{% block where %}
WHERE "inventory"."set_num" IS NOT DISTINCT FROM :set_num
2025-01-17 11:03:00 +01:00
{% endblock %}
{% block group %}
GROUP BY
"inventory"."part_num",
"inventory"."name",
"inventory"."color_id",
"inventory"."is_spare",
"inventory"."element_id"
2025-01-17 11:03:00 +01:00
{% endblock %}