Result Entry

select
count(1)
from lims_folderservgrp t2
left join lims_folders t1
on t1.foldersid = t2.foldersid
left join lims_clearanceform t
on t1.clearanceid = t.clearanceid
left join base_corp t3
on t2.dept = t3.corpcode
left join lims_prodgroup lbp
on t.inspectionitem = lbp.prodgroupid
left join lims_domainreport ld
on ld.reqsubtypeid = t.reqsubtypid
left join lims_folderstimelimit t4
on t4.foldersid = t2.foldersid
and t4.dept = t2.dept
and t4.operationno = '2'
left join right_rightuser rr2--
on rr2.datacode = t2.dept
left join base_user bu2
on bu2.usercode = rr2.usercode--
WHERE nvl (t2.status, '0' ) = 'Done' - NVL (E1, E2) for the function:! If E1 is NULL, then the function returns E2, E1 itself otherwise.
EXISTS and
(SELECT. 1
from lims_ordtask ordertask
WHERE ordertask.foldersid = t1.foldersid
and InStr ( 'JGLRZJZ, JGLRZJX, JGLRXJZ', ordertask.wfnodecode)> 0 - LO presence JGLR
and ordertask.dept = t2.dept-- and lo is equal to fs department table sections
and EXISTS (SELECT. 1
from v_corp_user_auth usercorp
WHERE usercorp.corpcode = ordertask.dept) - department code and user data to be Chinese name ah
and instr (concat3 ( ',' , ordertask.fullcode, ' , '),
concat3 (', ', USERCODE # {},', '))> 0) - LO test person equal to the logged in user
and bu2.usercode = # {usercode} - I do not mind
and ld.dept = 'NJIFDC' - I do not mind
and (t1.status <> 'ending check' or t1.

Guess you like

Origin www.cnblogs.com/jingcx/p/12572356.html
Recommended