From: Thomas Berezansky Date: Tue, 6 Sep 2011 16:46:04 +0000 (-0400) Subject: Last Circulation timestamp for reports X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4a2b6049eadf5e42982189bb0c03f485a6056ac2;p=evergreen%2Fmasslnc.git 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 Signed-off-by: Dan Scott Signed-off-by: Thomas Berezansky --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 6d35afe747..fd474891fe 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -5221,6 +5221,7 @@ SELECT usr, + @@ -5242,6 +5243,7 @@ SELECT usr, + @@ -8731,6 +8733,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 + + + + + + + + + + + + + + +