From 7247fb1c2e8ff8e999f5727476cc0445b7a53383 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Tue, 6 Sep 2011 12:46:04 -0400 Subject: [PATCH] Last Circulation timestamp for reports Specifically intended for Weeding reports. Easily swapped out (if needed) to include legacy circ data, when available from a migration. Signed-off-by: Thomas Berezansky --- Open-ILS/examples/fm_IDL.xml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 4f11bbafd1..e8b78512c6 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -5119,6 +5119,7 @@ SELECT usr, + @@ -5139,6 +5140,7 @@ SELECT usr, + @@ -8625,6 +8627,38 @@ SELECT usr, + + + SELECT + ac.id, + coalesce(max(actac.xact_start), ac.create_date) as last_circ_or_create + FROM asset.copy ac + LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy + GROUP BY ac.id, ac.create_date + + -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp: + --SELECT + -- ac.id, + -- greatest(max(actac.xact_start), erlct.last_cko_ts, ac.create_date) as last_circ + --FROM asset.copy ac + -- LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy + -- LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id + --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts + + + + + + + + + + + + + + + -- 2.11.0