bibs not loaded report added
[migration-tools.git] / mig-xml / evergreen_staged_report.xml
index 0430f0c..526e3c5 100644 (file)
@@ -528,6 +528,15 @@ id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3</query>
         <query>SELECT COUNT(map.id), tag.tag_type, tag.label, tag.staff_note, tag.pub FROM asset_copy_tag tag JOIN asset_copy_tag_copy_map map ON map.tag = tag.id GROUP BY 2,3,4,5 ORDER BY 2,3</query>
     </report>
 
+    <report>
+         <name>asset_copy_alerts</name>
+        <report_title>Copy Alerts</report_title>
+        <tag>assets</tag>
+        <iteration>0</iteration>
+        <heading>Alert Count.Alert Type</heading>
+               <query>SELECT COUNT(*), cat.name FROM asset_copy_alert aca JOIN config.copy_alert_type cat ON cat.id = aca.alert_type GROUP BY 2</query>
+    </report>
+
     <!-- MONEY REPORTS -->
 
     <report>
@@ -651,12 +660,12 @@ id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3</query>
     <!-- BIBS REPORTS -->
 
     <report>
-        <name>bibs</name>
-        <report_title>Extracted Bibliographic Records</report_title>
+        <name>bibs_loaded</name>
+        <report_title>Loaded Bibliographic Records</report_title>
         <tag>bibs</tag>
         <iteration>0</iteration>
-        <heading>Count.Sourcee.Migrated</heading>
-        <query>SELECT COUNT(bre.id), bre.x_source, bre.x_migrate::TEXT FROM biblio_record_entry_legacy bre GROUP BY 2, 3 ORDER BY 2, 3</query>
+        <heading>Count.Loaded</heading>
+        <query>SELECT COUNT(bre.id), bre.x_migrate::TEXT FROM biblio_record_entry_legacy bre WHERE id IN (SELECT id FROM biblio.record_entry WHERE deleted = FALSE) GROUP BY 2 ORDER BY 2</query>
         <note>False means the records are not deleted.</note>
     </report>
 
@@ -723,6 +732,38 @@ id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3</query>
         <query>SELECT COUNT(b.id) FROM biblio_monograph_part b</query>
     </report>
 
+    <report>
+        <name>bib_merges</name>
+        <report_title>Bibliographic Merge Count</report_title>
+        <tag>bibs</tag>
+        <iteration>0</iteration>
+        <heading>Records Merged.Incumbent Records Merged Into</heading>
+        <query>SELECT SUM(array_length(records,1)), COUNT(*) FROM groups</query>
+    </report>
+
+    <report>
+        <name>bib_merges_by_search_format</name>
+        <report_title>Bibliographic Merges By Search Format</report_title>
+        <tag>bibs</tag>
+        <iteration>0</iteration>
+        <heading>Count.Item Type</heading>
+        <query>WITH g AS (SELECT UNNEST(records) FROM groups) SELECT COUNT(record), search_format_str FROM dedupe_batch WHERE record IN (SELECT * FROM g) GROUP BY 2</query>
+    </report>
+
+       </report>
+        <name>bibs_not_loaded</name>
+        <report_title>Bibliographic Records That Failed to Load</report_title>
+        <tag>bibs</tag>
+        <iteration>0</iteration>
+        <heading>Title.Author.Control Number</heading>
+        <query>SELECT LEFT(ARRAY_TO_STRING(oils_xpath( '//*[@tag="245"]/*[@code="a"]/text()', a.marc),''),50) AS "Title",
+                               LEFT(ARRAY_TO_STRING(oils_xpath( '//*[@tag="100"]/*[@code="a"]/text()', a.marc),''),50) AS "Author",
+                               ARRAY_TO_STRING(oils_xpath( '//*[@tag="001"]/text()', a.marc),'') AS "001"
+                               FROM biblio_record_entry aLEFT JOIN biblio.record_entry b ON b.id = a.id WHERE b.id IS NULL AND a.x_migrate;
+               </query>
+    </report>
+
+
     <!-- ACTORS REPORTS -->
 
     <report>