CREATE DEFINER=`jhise`@`localhost` PROCEDURE `view_library_get_by_view`(in i_viewname varchar(200))
BEGIN

select
    vp.package_key,
    vp.name,
    vl.content
from
    view_library_ep_jct j
        join view_package vp on vp.package_key = j.package_key
            join view_library vl on vl.view_package_id = vp.id
WHERE   j.ep = i_viewname or j.ep = 'ALL';

END
