--查询某人名下的账簿
select a.user_code 用户编码,a.user_name 用户名称 ,
d.role_code 角色编码,d.role_name 角色名称,
e.PK_ORG,f.NAME,f.CODE
from sm_user a
left join sm_user_role b on a.cuserid=b.cuserid
left join sm_role d on b.pk_role=d.pk_role
left join sm_subject_org e on e.SUBJECTID=d.pk_role
left join org_orgs f on f.PK_ORG=e.PK_ORG
where user_name='' and f.ORGTYPE5='Y' --ORGTYPE5=Y为财务组织,即账套
order by a.user_code;
12-02
03-30
07-21
2755
