Advertisement
roganhamby

Circ Limits

Apr 2nd, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. /*
  3. looking at circ limits
  4.  
  5. the logic is
  6. matrix 1850 is invoked, check the circ_matrix_limit_set_map
  7. it loads limit sets who say "how many items out"
  8. then it goes to the circ_limit_set_circ_mod_map and seews what circ mods to check against
  9.  
  10. so to remove some you have to find the circ_limit_sets you want to keep and the circ_mod_map associated
  11. and delete the circ_mod_maps you don't want associated with that one
  12. */
  13.  
  14. SELECT ccm.id AS "Circ Matrix Matchpoint ID", aou.shortname AS "Circ Short Org Unit Name",
  15. pgt.NAME AS "Permission Group Name", ccm.circ_modifier AS "Circ Modifier",
  16. lsm.id AS "Circ Matrix Limit Set Map ID", cls.id as "Circ Limit Set ID",
  17. cls.owning_lib AS "Circ Limit Set Owning Lib", aoucls.shortname AS "Circ Limit Set Owning Lib Name",
  18. cls.items_out "Circ Limit Set Items Out", cls.depth AS "Circ Limit Set Depth",
  19. cls.GLOBAL AS "Circ Limit Set Global", scmm.id as "Circ Limit Set Circ Mod Map ID",
  20. scmm.circ_mod AS "Circ Limit Set Circ Mod"
  21. FROM config.circ_matrix_matchpoint ccm
  22. LEFT JOIN actor.org_unit aou ON aou.id = ccm.org_unit
  23. LEFT JOIN actor.org_unit aou2 ON aou2.id = aou.parent_ou
  24. LEFT JOIN permission.grp_tree pgt ON pgt.id = ccm.grp
  25. LEFT JOIN config.rule_circ_duration dur ON dur.id = ccm.duration_rule
  26. LEFT JOIN config.rule_max_fine maxf ON maxf.id = ccm.max_fine_rule
  27. LEFT JOIN config.rule_recurring_fine recur ON recur.id = ccm.recurring_fine_rule
  28. LEFT JOIN config.hard_due_date hdd ON hdd.id = ccm.hard_due_date
  29. LEFT JOIN actor.org_unit aou3 ON aou3.id = ccm.copy_circ_lib
  30. LEFT JOIN actor.org_unit aou4 ON aou4.id = ccm.copy_owning_lib
  31. LEFT JOIN actor.org_unit aou5 ON aou5.id = ccm.user_home_ou
  32. LEFT JOIN config.circ_matrix_limit_set_map lsm ON lsm.matchpoint = ccm.id
  33. LEFT JOIN config.circ_limit_set cls ON cls.id = lsm.limit_set
  34. LEFT JOIN config.circ_limit_set_circ_mod_map scmm ON scmm.limit_set = lsm.id
  35. LEFT JOIN actor.org_unit aoucls ON aoucls.id = cls.owning_lib
  36. where aou.shortname = 'BCL' and ccm.circ_modifier in ('AUDIO','PLAYAWAY','AUDIO BOOK')
  37. -- and ccm.circ_modifier != scmm.circ_mod
  38. -- this will tell you where they don't match and effectively you have combined circ limits
  39. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement