- 문서조회 시, 부서별로 권한을 부여하여 조회 가능한 문서만 보이도록 한다.
- 권한 테이블 dcr03_org_auth 와 조인하여 권한에 필요한 dcr03_org_code_id와 dcr03_retrieve_yn을 맵핑해준다.
- dcr03_org_code는 로그인 한 사용자의 조직코드아이디를 담아준다.
- -> service.addParam("orgId", LoginUser.getOrgCodeId()); !!!!!!!!!!!!!!!!
- 결과 : 로그인 한 사용자가 속한 부서가 조회할 수 있는 문서만 보여준다.
select rownum dcr00_id
, x.*
, y.*
, z.dcr01_class_tree_nm as dcr01_parent_tree_nm
, v.*
from dcr00_doc_list x
, apr01_appr y
,dcr01_class_tree z
,dcr03_org_auth v
where dcr00_appr_id = apr01_appr_id
and dcr00_fund_close_yn like #
and dcr00_fund_public_yn like #
and dcr00_fund_sintak_gb like #
and dcr00_fund_type_cd like #
and trunc(dcr00_reg_date) between nvl(#, to_date('19000101', 'yyyyMMdd')) and nvl(#,to_date('99991231', 'yyyyMMdd'))
and trunc(dcr00_fund_start_date) between nvl(#, to_date('19000101', 'yyyyMMdd')) and nvl(#,to_date('99991231', 'yyyyMMdd'))
and dcr00_org_nm like #
and dcr00_emp_nm like #
and dcr00_fund_nm like #
and dcr00_class_tree_nm like #
and x.dcr00_parent_tree_id = z.dcr01_class_tree_id
and v.dcr03_class_tree_id = x.dcr00_class_tree_id
and v.dcr03_org_code_id = #
and v.dcr03_retrieve_yn = 'true';
'코딩이 쉬워진다! > 02. spring' 카테고리의 다른 글
spring 6일차 (2) | 2018.01.23 |
---|---|
spring 5일차 (2) | 2018.01.22 |
spring 4일차 (2) | 2018.01.19 |
spring 3일차 (0) | 2018.01.19 |
spring 2일차 (0) | 2018.01.17 |