查询集团账户信息详情菜单(livebos)
1、菜单需求说明
1、查询条件
根据输入的条件查询出对应的符合条件的数据记录(支持多条件):
业务系统、客户号、所属营业部、所属单位、手机号、邮箱、认证日期、绑定日期、开户日期、用户类型、是否中航证券员工、是否绑定交易账号
2、返回结果展示参数
统一账号、客户号、认证客户名称、绑定的亲友信息、业务系统、所属营业部、认证日期、绑定日期、认证手机、认证邮箱、所属单位、 是否中航证券员工、绑定员工手机号、用户类型、推荐人

3、菜单涉及的数据库表
以客户号为查询条件的查询语句例子:
select a.cid,a.khh,a.khmc,case when a.ywxt=1000 then '集中交易' else '融资融券' end as ywxt,a.yyb,a.sj,a.ssdw,a.rzksrq,a.bdrq,case when a.yhlx=1 then '集团户' else '亲友户' end as yhlx,case when a.yhqx=1 then '是' else '否' end as yhqx,a.email,a.tjr,a.fid from(select c.cid,a.khh,c.khmc,a.ywxt,a.yyb,c.sj,c.ssdw,c.rzksrq,c.bdrq,c.yhlx,c.yhqx,c.email,c.tjr,c.fidfrom tywzh a,(select b.khh,a.khmc,a.sj,a.rzksrq,a.bdrq,a.yhlx,a.ssdw,a.yhqx,a.email,a.tjr,a.cid,a.fid from tjtzhxx a,tkhxx b where (a.cid=b.cid and b.khzt=0 and b.ygtcid is not null) or (a.sj=b.sj and b.khmc=a.khmc and a.cid is null and b.khzt=0 and b.ygtcid is not null)) cwhere a.khh=c.khh) a where a.khh='000700006236'
tywzh(业务账户表):
主键是ywxt、ywzh字段
tkhxx(客户信息表):
主键是khh字段
tjtzhxx(集团账户信息表):
2、菜单(livebos)添加
1、在功能模块下创建数据集Sql
数据集设置查询条件、设计sql语句调用存储过程

配置页面展示方案:
3、虚拟对象配置
配置你的查询结果要展示的列记录
4、挂载菜单功能权限树
挂载之后在测试环境可以看到该菜单
5、存储过程
CREATE OR REPLACE PROCEDURE PTYZH_CXJTZHXX_XB(o_result OUT SYS_REFCURSOR,i_pageno IN NUMBER,i_pagelength IN NUMBER,i_totalrows OUT NUMBER,i_ywxt IN VARCHAR2, --业务系统i_khh IN VARCHAR2, --客户号i_yyb IN NUMBER, --营业部i_ssdw IN VARCHAR2, --所属单位i_sj IN VARCHAR2, --认证手机i_email IN VARCHAR2, --认证邮箱i_rzrq_start IN NUMBER, --认证日期i_rzrq_end IN NUMBER, --认证日期i_bdrq_start IN NUMBER, --绑定日期i_bdrq_end IN NUMBER, --绑定日期i_khrq_start IN NUMBER, --开户日期i_khrq_end IN NUMBER, --开户日期i_yhlx IN NUMBER, --用户类型i_yhqx IN VARCHAR2, --是否中航证券员工i_cid IN VARCHAR2 --是否绑定交易账号) ASl_collist VARCHAR2(32767);l_code NUMBER(10);l_note VARCHAR2(100);l_sort VARCHAR2(100);l_sql VARCHAR2(3000);l_sql1 VARCHAR2(1500);l_where VARCHAR2(2000);BEGINl_sort := ' a.khh ';l_collist := ' * ';l_sql := 'select a.cid,a.khh,a.khmc,case when a.ywxt=1000 then ''集中交易'' else ''融资融券'' end as ywxt,a.yyb,a.sj,a.ssdw,a.rzksrq,a.bdrq,case when a.yhlx=1 then ''集团户'' else ''亲友户'' end as yhlx,case when a.yhqx=1 then ''是'' else ''否'' end as yhqx,a.email,a.tjr,a.fid from ';l_sql1 := '(select c.cid,a.khh,c.khmc,a.ywxt,a.yyb,c.sj,c.ssdw,c.rzksrq,c.bdrq,c.yhlx,c.yhqx,c.email,c.tjr,c.fid,a.khrqfrom tywzh a,(select b.khh,a.khmc,a.sj,a.rzksrq,a.bdrq,a.yhlx,a.ssdw,a.yhqx,a.email,a.tjr,a.cid,a.fid from tjtzhxx a,tkhxx b where (a.cid=b.cid and b.khzt=0 and b.ygtcid is not null) or (a.sj=b.sj and b.khmc=a.khmc and a.cid is null and b.khzt=0 and b.ygtcid is not null)) cwhere a.khh=c.khh) a';l_where := ' where a.ywxt in (1000,1001) ';--业务系统做为查询条件IF i_ywxt IS NOT NULL THENl_where := l_where || ' and a.ywxt = ' || i_ywxt;END IF;--客户号做为查询条件IF i_khh IS NOT NULL THENl_where := l_where || ' and a.khh = ''' || i_khh || '''';END IF;--认证所属单位作为查询条件IF i_ssdw IS NOT NULL THENl_where := l_where || ' and a.ssdw like ''%' || i_ssdw || '%''';END IF;--认证手机号作为查询条件IF i_sj IS NOT NULL THENl_where := l_where || ' and a.sj = ' || i_sj;END IF;--营业部作为查询条件IF i_yyb IS NOT NULL THENl_where := l_where || ' and a.yyb = ' || i_yyb;END IF;--认证邮箱作为查询条件IF i_email IS NOT NULL THENl_where := l_where || ' and a.email like ''%' || i_email || '%''';END IF;--用户类型做为查询条件IF i_yhlx IS NOT NULL THENl_where := l_where || ' and a.yhlx = ' || i_yhlx;END IF;--是中航证券员工做为查询条件IF i_yhqx IS NOT NULL AND i_yhqx = 1 THENl_where := l_where || ' and a.yhqx = ' || i_yhqx;END IF;--是中航证券员工做为查询条件 || i_yhqxIF i_yhqx IS NOT NULL AND i_yhqx != 1 THENl_where := l_where || ' and a.yhqx != 1';END IF;--认证日期作为查询条件IF i_rzrq_start IS NOT NULL AND i_rzrq_end IS NULL THENl_where := l_where || ' and a.rzksrq >= ' || i_rzrq_start;END IF;IF i_rzrq_start IS NULL AND i_rzrq_end IS NOT NULL THENl_where := l_where || ' and a.rzksrq <= ' || i_rzrq_end;END IF;IF i_rzrq_start IS NOT NULL AND i_rzrq_end IS NOT NULL THENl_where := l_where || ' and a.rzksrq >= ' || i_rzrq_start ||' and a.rzksrq <= ' || i_rzrq_end;END IF;--绑定日期作为查询条件IF i_bdrq_start IS NOT NULL AND i_bdrq_end IS NULL THENl_where := l_where || ' and a.bdrq >= ' || i_bdrq_start;END IF;IF i_bdrq_start IS NULL AND i_bdrq_end IS NOT NULL THENl_where := l_where || ' and a.bdrq <= ' || i_bdrq_end;END IF;IF i_bdrq_start IS NOT NULL AND i_bdrq_end IS NOT NULL THENl_where := l_where || ' and a.bdrq >= ' || i_bdrq_start ||' and a.bdrq <= ' || i_bdrq_end;END IF;--开户日期作为查询条件IF i_khrq_start IS NOT NULL AND i_khrq_end IS NULL THENl_where := l_where || ' and a.khrq >= ' || i_khrq_start;END IF;IF i_khrq_start IS NULL AND i_khrq_end IS NOT NULL THENl_where := l_where || ' and a.khrq <= ' || i_khrq_end;END IF;IF i_khrq_start IS NOT NULL AND i_khrq_end IS NOT NULL THENl_where := l_where || ' and a.khrq >= ' || i_khrq_start ||' and a.khrq <= ' || i_khrq_end;END IF;--是否绑定交易账号作为查询条件1IF i_cid IS NOT NULL AND i_cid = 0 THENl_where := l_where || ' and a.cid is null ';END IF;--是否绑定交易账号作为查询条件2IF i_cid IS NOT NULL AND i_cid = 1 THENl_where := l_where || ' and a.cid is not null ';END IF;l_sql := l_sql || l_sql1 || l_where;dbms_output.put_line(l_sql);pcx_paging_query(l_code,l_note,o_result,i_pageno,i_pagelength,i_totalrows,sqls => l_sql,collist => l_collist,haswhere => TRUE,groupislast => CASEWHEN l_sort IS NULL THENFALSEELSETRUEEND,i_sort => l_sort,i_haswith => FALSE,i_recount => TRUE);END PTYZH_CXJTZHXX_XB;
