TG.WXCRM.V4/Model/Sql/2023-5-30.txt

38 lines
2.1 KiB
Plaintext

alter table SYNC_RECEIVE add grade INTEGER;
alter table SYNC_RECEIVE add noticetime DATE;
comment on column SYNC_RECEIVE.grade is '等级';
comment on column SYNC_RECEIVE.noticetime is '提醒时间';
alter table sync_receive add GRADE int;
alter table sync_receive add NOTICETIME datetime;
alter table RES_CUSTOMER_RELATION add pkid number default 0;
update RES_CUSTOMER_RELATION set pkid =pack_base.Seq_smallid_get;
alter table res_myallocateres add deptid number default 0;
-- 换主键
alter table RES_ALLCOTE_USER add deptid number default 0;
alter table res_allcotelog_detail add deptid number default 0;
alter table res_tobeallcoted add deptid number default 0;
alter table res_poollog add deptid number default 0;
alter table res_poollog_his add deptid number default 0;
alter table cache_RES_POOLLOG add deptid number default 0;
alter table res_apply add deptid number default 0;
alter table res_apply_his add deptid number default 0;
alter table res_myvalidres add deptid number default 0;
create index IDX_RES_POOLLOG_RESID_DEPTID on res_poollog(resid,deptid);
create index IDX_RES_POOLLOG_applyid on res_poollog(applyid);
create index res_myallocateres_resid_deptid on res_myallocateres(resid,deptid);
UPDATE res_myallocateres T1 SET T1.deptid = (select T2.deptid from bas_inneruser T2 where T2.pkid = T1.inneruserid) where T1.deptid is null or T1.deptid =0 ;
UPDATE RES_ALLCOTE_USER T1 SET T1.deptid = (select T2.deptid from bas_inneruser T2 where T2.pkid = T1.inneruserid) where T1.deptid is null or T1.deptid =0 ;
UPDATE res_allcotelog_detail T1 SET T1.deptid = (select T2.deptid from bas_inneruser T2 where T2.pkid = T1.salesid)where T1.deptid is null or T1.deptid =0 ;
update res_apply T1 set t1.deptid = (select deptid from res_customer_relation t2 where t2.resid=t1.resid and deptid in (select businessid from bas_businesslines) and rownum <2)
alter table CSVR_TODOITEM add deptid number default null;
-- PACK_RES_ALLOCATE GetMyAllocatedResNew UpdateAllocateAndFPRnew ExeSeniorDistributeByResIdnew
-- PACK_RES_ALLOCATE.DefaultAllocate PACK_RES_ALLOCATE.ChangShaAllocate
-- initresRalation
-- PACK_RES.res_ClearResource PACK_RES_CHECK