public class CMSDBFunction
extends java.lang.Object
| Constructor and Description |
|---|
CMSDBFunction() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getSiteFlowid(int siteid)
create or replace function site_flow_id(a_site_id int) return int is
l_parent_workflow char(1); l_parent_id number(10); l_workflow int; begin
select PARENT_WORKFLOW,mainsite_id,flow_id into
l_parent_workflow,l_parent_id,l_workflow from td_cms_site where site_id =
a_site_id;
if l_parent_workflow = '0' then return l_workflow; end if;
if l_parent_workflow = '1' then return site_flow_id(l_parent_id); end if;
return -1; end;
|
static FlowInfo |
getSiteFlowInfo(int siteid)
create or replace function f_site_flow(a_site_id int) return typ_id_name_list
is
l_parent_workflow char(1);
l_parent_id number(10);
l_workflow int;
l_workflow_name varchar(100);
ret_list typ_id_name_list := typ_id_name_list(); --返回结果集变量
begin
select PARENT_WORKFLOW,mainsite_id,flow_id,b.name
into l_parent_workflow,l_parent_id,l_workflow,l_workflow_name
from td_cms_site a left join tb_cms_flow b on a.flow_id=b.id
where site_id = a_site_id;
if l_parent_workflow = '0' then
ret_list.extend;
ret_list(1) := new TYP_ID_NAME(l_workflow,l_workflow_name);
return ret_list;
end if;
if l_parent_workflow = '1' then
return f_site_flow(l_parent_id);
end if;
return null;
end;
|
static int |
getSiteShannelFlowid(int channel)
create or replace function channel_flow_id(ch_id int) return int is
l_parent_workflow char(1); l_parent_id number(10); l_site_id number(10);
l_workflow int; begin select PARENT_WORKFLOW,parent_id,site_id,workflow
into l_parent_workflow,l_parent_id,l_site_id,l_workflow from
td_cms_channel where channel_id = ch_id;
if l_parent_workflow = '0' then return l_workflow; end if;
if l_parent_workflow = '1' then if l_parent_id is null then --select
flow_id into l_workflow from td_cms_site where site_id = l_site_id;
--return l_workflow; return site_flow_id(l_site_id); end if;
return channel_flow_id(l_parent_id); end if;
return -1; end;
|
static FlowInfo |
getSiteShannelFlowInfo(int channel)
create or replace function f_channel_flow(ch_id int) return typ_id_name_list
is
l_parent_workflow char(1);
l_parent_id number(10);
l_site_id number(10);
l_workflow int;
l_workflow_name varchar(100);
ret_list typ_id_name_list := typ_id_name_list(); --返回结果集变量
begin
select PARENT_WORKFLOW,parent_id,site_id,workflow,b.name
into l_parent_workflow,l_parent_id,l_site_id,l_workflow,l_workflow_name
from td_cms_channel a left join tb_cms_flow b on a.workflow = b.id
where channel_id = ch_id;
if l_parent_workflow = '0' then
ret_list.extend;
ret_list(1) := new TYP_ID_NAME(l_workflow,l_workflow_name);
return ret_list;
end if;
if l_parent_workflow = '1' then
if l_parent_id is null then
return f_site_flow(l_site_id);
end if;
return f_channel_flow(l_parent_id);
end if;
return null;
end;
|
static void |
main(java.lang.String[] args) |
static void |
recordpubrelation_proc(java.lang.String pubobject,
java.lang.String refobject,
int pubtype,
java.lang.String pubsite,
int reftype,
java.lang.String refsite)
create or replace procedure recordpubrelation_proc (pubobject in varchar2,
refobject in varchar2,
pubtype in number,
pubsite in varchar2,
reftype in number,
refsite in varchar2) AS num NUMBER;
BEGIN
select count(PUBLISHOBJECT) into num from td_cms_pubobject_relation where
PUBLISHOBJECT=pubobject and REFERENCEOBJECT=refobject and PUBLISHTYPE=pubtype
and PUBLISH_SITE=pubsite and REFERENCETYPE=reftype and REFERENCE_SITE=refsite;
DBMS_OUTPUT.PUT_LINE('Value is not exact because pi is
irrational.');
if(num = 0) then
insert into td_cms_pubobject_relation
(PUBLISHOBJECT,REFERENCEOBJECT,PUBLISHTYPE,PUBLISH_SITE,REFERENCETYPE,REFERENCE_SITE)
values( pubobject,refobject,pubtype,pubsite,reftype,refsite );
commit;
end if;
END;
|
public static int getSiteFlowid(int siteid)
throws java.lang.Exception
siteid - java.lang.Exceptionpublic static int getSiteShannelFlowid(int channel)
throws java.lang.Exception
channel - java.lang.Exceptionpublic static FlowInfo getSiteShannelFlowInfo(int channel) throws java.lang.Exception
channel - java.lang.Exceptionpublic static FlowInfo getSiteFlowInfo(int siteid) throws java.lang.Exception
siteid - java.lang.Exceptionpublic static void recordpubrelation_proc(java.lang.String pubobject,
java.lang.String refobject,
int pubtype,
java.lang.String pubsite,
int reftype,
java.lang.String refsite)
throws java.lang.Exception
pubobject - refobject - pubtype - pubsite - reftype - refsite - java.lang.Exceptionpublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception