Oracle (1)多表联合查询

    xiaoxiao2021-11-29  22

    --1、机构A下有那几个用户,用户权限和菜单配置,查询条件:机构编码 /*机构名称 机构类别编码 机构类别名称 用户名 用户类型编码 用户类型名称 角色名称 菜单名称 菜单路径 */ select * from t_company_organ where organ_id=100410 ;-- 、用户类型名称 ?、 select * from t_user where organ_id=100410 ; select ot.type_name 机构类型名称, o.organ_name 机构名称,o.organ_type 机构类型编码,u.user_name 用户名,u.user_type 用户类型 , r.role_name 角色名,mr.menu_name 菜单名称,mr.entry_url 菜单路径 from t_company_organ o ,t_user u,t_organ_type ot,t_role r,t_user_role ur,t_role_resource rr,t_menu_resource mr where o.organ_id=u.organ_id and r.role_id=rr.role_id and rr.resource_id=mr.resource_id and r.role_id=ur.role_id and ur.user_id=u.user_id and ot.organ_type=o.organ_type and o.organ_code='000059' ;

    select * from t_organ_type ; select * from t_user where user_name='amazing3'; select * from t_user_role where user_id=10376 ; select * from t_role where role_id=100241 ; select * from t_role_resource where role_id=100241; select * from T_MENU_RESOURCE ; select * from t_user_role ;

    select * from t_role_resource rr,t_menu_resource mr ,t_role r where rr.resource_id=mr.resource_id and r.role_id=rr.role_id and r.role_id=100241 ;

    --2、保险公司下有哪些产品组,以及对应的产品和责任信息,查询条件:保险公司编码 /*保险公司编码,保险公司名称,产品组编码,产品组名称,是否税优,产品编码,产品名称,是否是主险, 险种期限,险种分类代码,分类名称,责任名称, 平台责任分类代码, 平台责任分类名称, 责任代码 */

    select * from t_company_organ where organ_code='000059'; select * from t_package_product where organ_id=100410 ; select * from t_product_life where package_id=100109 ; select * from t_benefit_type ; select * from t_product_liab where product_id=100164 ;

    select * from t_product_type ; select * from t_liability_category where category_id=0708; select * from t_tax_preference_config ;--? 如何查看备注 select o.organ_code 保险公司编码,o.organ_name 保险公司名称,pp.package_code 产品组编码,pp.package_name 产品组名称, pp.tax_preference 是否税优 ,l.product_code 产品编码,l.product_name 产品名称,l.ins_type 是否主险,l.period_type 险种期限, l.benefit_type 险种分类代码,b.type_name 分类名称,tpl.liab_name 责任名称,tpl.liab_code 责任代码,tpl.category_id 平台责任分类代码, tlc.category_name 平台责任分类名称 from t_package_product pp,t_company_organ o,t_product_life l ,t_benefit_type b,t_product_liab tpl,t_liability_category tlc where pp.organ_id=o.organ_id and pp.package_id=l.package_id and l.benefit_type=b.benefit_type and l.product_id=tpl.product_id and tpl.category_id=tlc.category_id and o.organ_code='000059';

    select item_id,uw_date,uw_date,uw_desc from t_uw_product where policy_id='100004524'; --select * from t_cash where policy_id='100004524' ; select com_fee_id,premium,fee_type,fee_status,due_date,actual_date,pay_start_date,pay_end_date,payment_frequency from t_cash where policy_id='100004524' ; select * from T_PRODUCT_FEE where policy_id='100004524';

    --3、保单号主要信息以及对应的产品责任信息,查询条件:保单号 /*保单号 投保日期 生效日 满期日 保单来源 保单状态 所属机构编码 所属机构名称 产品组编码 产品编码 产品名称 首期保费 产品生效日,产品满期日 产品保额 核保日期 核保结论 责任编码 责任保额 责任状态 */ select * from t_contract_master where policy_id=100004524; select * from t_company_organ ; select * from t_package_product where organ_id=100410; select * from t_product_life where package_id=100109; select * from t_contract_product where package_id=100109 ; select * from t_uw_product where policy_id=100004524; select * from t_product_liab where product_id=100164; select * from t_item_liab where liab_code='345'; select distinct cm.policy_id 保单号 ,cm.issue_date 承保日期,cm.effective_date 生效日期,cm.expire_date 期满日期,cm.policy_source 保单来源, cm.liability_status 保单状态,cm.organ_code 所属机构编码,o.organ_name 机构名称,pp.package_code 产品组编码,tpl.product_code 产品编码, tpl.product_name 产品名称,tcp.initial_premium 首期保费,tcp.effective_date 生效日期,tcp.expire_date 期满日期,tcp.sum_assured 产品保额, up.uw_date 核保日期,up.uw_decision 核保结论 ,pb.liab_code 责任编码,til.liab_sa 责任保额,til.liab_status 责任状态 from t_contract_master cm ,t_company_organ o,t_package_product pp,t_product_life tpl,t_contract_product tcp, t_uw_product up,t_product_liab pb,t_item_liab til where cm.organ_code=o.organ_code and pp.organ_id=o.organ_id and pp.package_id=tpl.package_id and pp.package_id=tcp.package_id and up.policy_id=cm.policy_id and tpl.product_id=pb.product_id and pb.liab_code=til.liab_code and cm.policy_id=100004524 ;

    转载请注明原文地址: https://ju.6miu.com/read-678779.html

    最新回复(0)