-- 菜单命名空间
#namespace("Base")

  #sql("listScheme")
     select t1.*,t2.subject_name,t3.stage_name from t_resource_scheme as t1
              inner join t_dm_subject as t2 on t1.subject_id=t2.subject_id
              inner join t_dm_stage as t3 on t1.stage_id=t3.stage_id
         where t1.b_use=1
         #if(stage_id)
            and t1.stage_id=#para(stage_id)
         #end
         #if(subject_id)
            and t1.subject_id=#para(subject_id)
         #end
         order by t1.stage_id,t1.sort_id
  #end
#end