declare
cursor c_order_id is select a.row_id from te_cust_order_list a where nvl(a.del_flag,'0')='0' and nvl(a.arc_flag,'0')='0'
and f_o_get_customer_info(a.cust_id,'5') in ('運營商','企業客戶','市場部')
and not exists (select 1 from te_order_query q where q.order_id=a.row_id
and q.access_type ='1' and q.access_obj_type='1' and q.access_obj_id in
(select u.user_id from th_user_pos_rel u where u.pos_id=(select row_id from th_position pos where pos.pos_code='hkxszl')))
;v_order_id varchar2(100);
begin
open c_order_id;
loop
fetch c_order_id into v_order_id;
exit when c_order_id%notfound;
chushihua(v_order_id);
end loop;
close c_order_id;
end;
create or replace procedure chushihua(
v_order_id in varchar2) as
v_cust_id varchar2(40);
v_cust_attr varchar2(40);
v_order_line_id varchar2(200);
cursor c_order_line_ids is select line.row_id from te_cust_order_line line where line.order_id=v_order_id;
begin
select cust_id into v_cust_id from te_cust_order_list t where row_id = v_order_id;
select f_o_get_customer_info(v_cust_id,'5') into v_cust_attr from dual;
if v_cust_attr='運營商' then
---插入 運營關係部的銷售助理
open c_order_line_ids;
loop
fetch c_order_line_ids into v_order_line_id;
exit when c_order_line_ids%notfound;
insert into te_order_query (row_id,order_id,order_line_id,access_type,access_obj_type,create_by,access_obj_id)
select f_get_globalid,order_id,order_line_id,access_type,access_obj_type,create_by,access_obj_id
from (
select v_order_id as order_id,v_order_line_id as order_line_id ,'1' as access_type,'1' as access_obj_type ,'chenxm' as create_by,a.row_id as access_obj_id from th_user a,th_user_pos_rel b
where a.row_id=b.user_id and b.pos_id='2011042600631231'
and a.user_dept_id= (select row_id from th_int_dept a where a.dept_code='hkyygxb'));
end loop;
close c_order_line_ids;
elsif v_cust_attr='企業客戶' then
---插入 企業客戶部的銷售助理
open c_order_line_ids;
loop
fetch c_order_line_ids into v_order_line_id;
exit when c_order_line_ids%notfound;
insert into te_order_query (row_id,order_id,order_line_id,access_type,access_obj_type,create_by,access_obj_id)
select f_get_globalid,order_id,order_line_id,access_type,access_obj_type,create_by,access_obj_id
from (
select v_order_id as order_id,v_order_line_id as order_line_id ,'1' as access_type,'1' as access_obj_type ,'chenxm' as create_by,a.row_id as access_obj_id from th_user a,th_user_pos_rel b
where a.row_id=b.user_id and b.pos_id='2011042600631231'
and a.user_dept_id= (select row_id from th_int_dept a where a.dept_code='hkqykhb'));
end loop;
close c_order_line_ids;
elsif v_cust_attr='市場部' then
---插入 企業客戶部的銷售助理
open c_order_line_ids;
loop
fetch c_order_line_ids into v_order_line_id;
exit when c_order_line_ids%notfound;
insert into te_order_query (row_id,order_id,order_line_id,access_type,access_obj_type,create_by,access_obj_id)
select f_get_globalid,order_id,order_line_id,access_type,access_obj_type,create_by,access_obj_id
from (
select v_order_id as order_id,v_order_line_id as order_line_id ,'1' as access_type,'1' as access_obj_type ,'chenxm' as create_by ,a.row_id as access_obj_id from th_user a,th_user_pos_rel b
where a.row_id=b.user_id and b.pos_id='2011042600631231'
and a.user_dept_id= (select row_id from th_int_dept a where a.dept_code='hkscb'));
end loop;
close c_order_line_ids;
---接應收入 暫時沒有部門
end if;
end chushihua;
static資料的初始化
class bowl void f1 int marker class table void f2 int marker static bowl bowl2 new bowl 2 class cupboard void f3 int marker static bowl bowl5 new bowl...
初始化 關於tensorflow的初始化
在寫mnist手寫體識別任務 已放github 時遇到的 問題 我們都知道在session run的時候需要初始化。但是初始化在什麼位置是至關重要的。來看下這段 sess tf.session sess.run tf.global variables initializer mnist model ...
類的初始化和例項的初始化
有如下兩個類 father 父類 package com.yzx.test01 父類物件 父類初始化 1 j method 5 2 父類的靜態 塊 1 父類的例項化方法 1 super 最前 2 i test 3 父類的非靜態 塊 4 父類的無參構造 最後 非靜態方法前面其實有乙個預設物件this ...