'Generic' , 'Normandy Park' , 'Choice Reads', 'Lucky Day', 'Book Club'
)
);
+
+ -- hiding by stat cat (hidden in bibliocommons)
+
+UPDATE asset.copy
+ SET (edit_date, opac_visible) = (now(), 'f')
+ WHERE id IN
+ (
+ SELECT
+ asset."copy"."id"
+ FROM
+ asset."copy"
+ INNER JOIN asset.stat_cat_entry_copy_map ON asset."copy"."id" = asset.stat_cat_entry_copy_map.owning_copy
+ WHERE
+ asset.stat_cat_entry_copy_map.stat_cat = 6
+ and asset.copy.deleted = 'f'
+ and asset.copy.opac_visible = 't'
+ );
-- make the items that should be visible again as they become some
-- kind of "available", but still following our business rules
ON asset.copy.location = asset.copy_location.id
INNER JOIN config.i18n_core
ON cast(config.i18n_core.identity_value as integer) = asset.copy_location.id
+ LEFT OUTER JOIN asset.stat_cat_entry_copy_map ON asset."copy"."id" = asset.stat_cat_entry_copy_map.owning_copy
WHERE asset.copy.deleted = 'f'
AND asset.copy.opac_visible = 'f'
AND asset.copy.status IN ('0', '1', '6', '7', '8')
'KidReach' , 'Tech Lab' , 'Storage' , 'Teen Materials' ,
'Generic' , 'Normandy Park' , 'Choice Reads', 'Lucky Day', 'Book Club' )
AND floating IS NULL
+ AND (stat_cat is null or stat_cat != 6)
);