CREATEmaterialized VIEW MVTCUSERLESSONDEPT
build immediate refresh fast on commit enable query rewrite
AS
select tu.rowid turowid,u.rowid urowid,tc.rowid tcrowid,tl.rowid tlrowid,l.rowid lrowid,
u.ID UserID, u.name us_name, u.regname, tc.TC_ID ,tl.TL_ID,tl.LE_ID,tc.begindate createtime,
tc.TrainingForm,tc.TrainingFee,tc.otherFee,tl.fee,tu.Type,l.Hour,l.LE_NAME LessonName,l.le_name, l.le_code,
l.trainingtype,l.kj_type,l.allowday,l.status,tc.year,tc.tc_name,u.groupids, u.corpid, u.phone, u.email, u.business
from TC_User tu,Tuser u,TrainingClass tc,TC_Lesson tl,Lesson l
where tu.TC_ID = tc.TC_ID and tc.TC_ID=tl.TC_ID
and u.groupids like '%,,'||tu.entityID ||',,%'
and tu.Type=2
and u.WorkDate <= tc.Bm_enddate and tc.status = 1
and tl.LE_ID=l.le_ID
and tc.secondafter = 1 ;
|