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)的功能为:如果E1为NULL,则函数返回E2,否则返回E1本身。
and exists
(select 1
from lims_ordtask ordertask
where ordertask.foldersid = t1.foldersid
and instr('JGLRZJZ,JGLRZJX,JGLRXJZ', ordertask.wfnodecode) > 0--lo的存在JGLR
and ordertask.dept = t2.dept--并且是lo科室等于fs表科室
and exists (select 1
from v_corp_user_auth usercorp
where usercorp.corpcode = ordertask.dept)--科室用户 代码和中文名 必须有数据啊
and instr(concat3(',', ordertask.fullcode, ','),
concat3(',',#{usercode}, ',')) > 0)--LO的检验人等于登录用户
and bu2.usercode = #{usercode}--我觉得无所谓
and ld.dept = 'NJIFDC'--我觉得无所谓
and (t1.status <> '终止检验' or t1.status is null)
结果录入
猜你喜欢
转载自www.cnblogs.com/jingcx/p/12572356.html
今日推荐
周排行