select r.review_id as reviewid, r.delete_flag as deleteflag, ecu.emp_sub_role as empsubrole,
r.emp_sub_role_tech as empsubroletech, nvl(r.review_mng_flag, 'N') as reviewmngflag, r.submit_date as submitdate,
r.last_submit_date as lastsubmitdate, r.approve_signatory_id as approvesignatoryid,
case when r.status in ('0', '1', '5', '10')
then null
else r.middle_position_conf
end as middlepositionconf, case when r.status in ('0', '1', '5', '10')
then null
else r.high_position_conf
end as highpositionconf,
decode(r.status, '5', null, nvl(r.approve_signatory_conf, 'N')) as approvesignatoryconf,
case when r.status = '5' then null else r.min_position_condition end as minpositioncondition,
case when r.status = '5' then null else r.max_position_condition end as maxpositioncondition,
r.standard_auditor_id as standardauditorid, r.final_hw_position as finalhwposition, r.depty_palce as deptypalce,
l6.item_code as deptypalcecode, r.operator_date as operatordate, r.flow_busi_key as flowbusikey,
r.item_condition as itemcondition, r.institute_hr_condition as institutehrcondition,
r.institute_pdu_condition as institutepducondition, r.business_reviewer_id as businessreviewerid,
r.comprehensive_reviewer_id as comprehensivereviewerid,
( select u.lname from tpl_user_t u where u.user_id = r.business_reviewer_id ) as businessreviewername,
( select u.lname from tpl_user_t u where u.user_id = r.comprehensive_reviewer_id ) as comprehensivereviewername,
r.trial_run_dept_condition as trialrundeptcondition, r.hr_config as hrconfig, r.pdu_rep_config as pdurepconfig,
r.pdu_mng_config as pdumngconfig, r.flow_version as flowversion, r.entry_model as entrymode,
nvl(technical_model, '0') as technicalmode,
decode(r.status, '9', '录用', '12', '撤销', '13', '复核不通过', '待定') as reviewresult,
nvl(r.review_palace, r.depty_palce) as reviewpalace,
case when r.status in ('5', '7', '8', '9', '13', '15', '16', '17')
then r.review_start_date
else null
end as reviewstartdate,
case when r.status in ('5', '7', '8', '9', '13', '15', '16', '17')
then to_char(r.review_start_date, 'yyyy-MM-dd hh24:mi:ss')
else null
end as reviewstartdatestr, r.review_desc as reviewdesc, r.review_next_handler as reviewnexthandler,
case when r.status in ('7', '8', '9') then r.position_time else null end as positiontime,
r.review_date as reviewdate, to_char(r.review_date, 'yyyy/MM/dd') as reviewdatestr,
decode(r.is_exception, 'Y', '是', '否') as isexception, nvl(r.exception_type, '无') as exceptiontype,
r.pdu_rep_id as pdurepid, r.pdu_mng_id as pdumngid,
( select u.lname from tpl_user_t u where u.user_id = r.pdu_rep_id ) as pdurepname,
( select u.lname from tpl_user_t u where u.user_id = r.pdu_mng_id ) as pdumngname,
r.emp_employee_id as empemployeeid, r.last_updated_by as lastupdatedby, r.creation_date as creationdate,
r.review_mng_id as reviewmngid, r.project_no as projectno, r.examine_status as examinestatus, r.status as status,
r.remark as remark,
case when r.flow_version = 'V3'
then decode(r.status, '0', '申请', '1', '离司审查', '5', '复核结果录入', '15', '技术复核', '16',
'综合复核', '17', '技术复核', '7', '筛选结果审批', '8', '筛选结果审批', '9', '完成', '10',
'重新申请', '11', '已删除', '12', '已撤单', '13', '结束')
else decode(r.status, '0', '申请', '1', '离司审查', '2', '接收推荐信息', '3', '初步复核(研究所HR)', '4',
'初步复核(产品线HR)', '5', '复核结果录入', '15', '技术复核', '16', '综合复核', '17',
'技术复核', '6', '规范审核', '7', '筛选结果审核', '8', '筛选结果审批', '9', '完成', '10',
'重新申请', '11', '已删除', '12', '已撤单', '13', '结束')
end as statusname, r.created_by as applicatedby,
( select u.lname from tpl_user_t u where u.user_id = r.created_by ) as creationusercn,
r.cooperate_rank_type as cooperateranktype, l5.item_code as cooperateranktypecode,
r.last_update_date as lastupdatedate, r.institute_hr_id as institutehrid, r.project_team as projectteam,
r.cooperate_secretary_id as cooperatesecretaryid, r.dept_rep_id as deptrepid, p1.assignee_ as operatorid,
decode(r.status, '9', null, '12', null, '13', null,
( select u.lname from tpl_user_t u where u.user_id = p1.assignee_ )) as operatorname,
r.review_no as reviewno, r.cooperate_position as cooperateposition, l7.item_code as cooperatepositioncode,
r.prodline_hr_id as prodlinehrid, r.employee_type as employeetype, l4.item_code as employeetypecode,
r.is_check_files as ischeckfiles, decode(ecu.is_archived, 'Y', '***', 'N', ecu.emp_name) as empname,
ecu.is_archived as isarchived, to_char(ecu.archived_date, 'yyyy-MM-dd') as archiveddate,
ecu.emp_number as empnumber, decode(ecu.is_archived, 'Y', '***', 'N', ecu.emp_pyname) as emppyname,
ecu.emp_sex as empsex, ecu.emp_userid as empuserid, ecu.emp_userid_mask as empuseridmask,
l1.item_code as emppositioncode, ecu.emp_position as empposition, ecu.emp_university_name as empuniversityname,
nvl(ecu.is_second_degree_flag, decode(undergraduate_level, null, 'N', 'Y')) as isseconddegreeflag,
decode(is_211, '1', 'Y', 'N') as is211universityflag, ecu.emp_graduated_date as empgraduateddate,
to_char(ecu.emp_graduated_date, 'yyyy-MM-dd') as empgraduateddatestr,
trim(ecu.is_common_recruit_flag) as iscommonrecruitflag, ecu.emp_speciality as empspeciality,
ecu.emp_role as emprolecode, ecu.emp_role as emprole, l2.item_code as empskillcode, ecu.emp_skill as empskill,
ecu.doc_edoc_id as docedocid, decode(ecu.doc_edoc_id, null, '请上传简历', '已上传简历') as recommendinfostatus,
p.project_id as projectid, p.project_name as projectname, c.abbr_name as vendorname,
ecu.vendor_code as vendorcode, ecu.certificate_no as certificateno, ecu.is_checked_items as ischeckeditems,
ecu.compliance_confirm_item4 as complianceconfirmitem4, ecu.compliance_confirm_item5 as complianceconfirmitem5,
ecu.emp_country as empcountry, ecu.birthday as birthday, ecu.emp_role_code as emprolecode,
r.previous_hw_position as previoushwposition, r.previous_position_time as previouspositiontime,
r.review_score_status as reviewscoreflag, p.po_num as ponum, p.pr_num as prnum,
p.commerical_model as commericalmodel, p.hw_pm_work as hwpmid,
( select u.lname from tpl_user_t u where u.user_id = p.hw_pm_work ) as hwpmname,
p1.proc_inst_id_ as procinstanceid, p1.task_id as taskid, nvl(org_v.l1_id, org1.prodline_id) as prodlineid,
nvl(org_v.l2_id, org1.product_id) as subprodlineid, nvl(org_v.l3_id, org1.pdu_id) as pduid,
nvl(org_v.l4_id, org1.develop_id) as developid, org1.org_full_name as pduname, p.hw_dept_code as hwdeptcode,
nvl(org_v.l1_org_name, org1.prodline_name) as prodlinename,
nvl(org_v.l2_org_name, org1.product_name) as subprodlinename, nvl(org_v.l3_org_name, org1.pdu_name) as pdu,
nvl(org_v.l4_org_name, org1.develop_name) as developname, org1.org_full_name as pdunamevalue,
nvl(org_v.id, org1.local_org_id) as localorgid, nvl(r.local_org_id, r.pdu_code) as pduidvalue,
r.approve_edoc_ids as approveedocids,
case when ( select count(1)
from tpl_lookup_item_t li
where li.classify_code = 'EMP_RESULT_ROLE_CONF' and li.item_name = org_v.l2_org_name ) > 0
then 'Y'
else 'N'
end as ischangedroleflag,
nvl(( select item_attr2
from tpl_lookup_item_t
where classify_code = 'REVIEW_REVOKE_CONFITION' and item_code = 'MAIL_RENDER' ), '20') as limitdays,
case when r.status in ('5', '15', '16', '17')
then to_number(date_part('epoch', trunc(sysdate) - trunc(r.operator_date)) / 86400)
else null
end as delaydays,
case when r.status in ('1', '5', '7', '8', '15', '16', '17', '10')
then to_number(date_part('epoch', trunc(sysdate) - trunc(r.submit_date)) / 86400)
else null
end as costdays,
case when r.status in ('0', '10')
then sd.execute_service_duration
else r.execute_service_duration
end as serviceduration,
case when r.status in ('0', '10')
then get_nearly_four_performance(ecu.emp_number, null)
else r.nearly_four_performance
end as nearlyfourperformance, ecu.pass_cert_records as passcertrecords,
case when ecu.pass_cert_records = '是' then ecu.title else null end as title,
r.old_created_by as oldapplicatedby, r.old_dept_rep_id as olddeptrepid, r.old_review_mng_id as oldreviewmngid,
r.old_business_reviewer_id as oldbusinessreviewerid,
r.old_comprehensive_reviewer_id as oldcomprehensivereviewerid,
r.old_approve_signatory_id as oldapprovesignatoryid, r.old_pdu_rep_id as oldpdurepid,
r.old_pdu_mng_id as oldpdumngid
from omp_emp_review_t r
join omp_emp_review_user_t ecu on ecu.emp_employee_id = r.emp_employee_id
left join omp_emp_service_duration_t sd
on sd.emp_number = ecu.emp_number and sd.vendor_code = ecu.vendor_code
left join ( select p.business_key_, p.proc_inst_id_, rt.id_ as task_id,
nvl(rt.assignee_, ( select u.user_id
from tpl_user_t u
where lower(u.lname) = replace(lower(wpf.bs_handlers_), 'u.', '') )) as assignee_,
wpf.bs_created_by_
from act_hi_procinst p
join act_re_procdef rpd on p.proc_def_id_ = rpd.id_
join tpl_wf_hi_procform_t wpf on p.proc_inst_id_ = wpf.bs_proc_inst_id_
left join act_ru_task rt on rt.proc_inst_id_ = p.proc_inst_id_
where p.proc_def_id_ like 'ReviewProcess%' and p.business_key_ like 'RE%' ) p1
on p1.business_key_ = r.flow_busi_key
left join tpl_lookup_item_t l1
on l1.classify_code = 'DEGREE' and l1.item_name = ecu.emp_position and l1.status = '1'
left join tpl_lookup_item_t l2
on l2.classify_code = 'SKILL' and l2.item_name = ecu.emp_skill and l2.status = '1'
left join tpl_lookup_item_t l4
on l4.classify_code = 'EMP_TYPE' and l4.item_name = r.employee_type and l4.status = '1'
left join tpl_lookup_item_t l5
on l5.classify_code = 'EMP_POSITION_TYPE' and l5.item_name = r.cooperate_rank_type and l5.status = '1'
left join omp_coop_t c on c.code = ecu.vendor_code and c.status = 'ACTIVE'
left join ( select distinct u.university_name, u.undergraduate_level, u.is_211, u.is_985
from omp_university_t u ) u
on u.university_name = ecu.emp_university_name
left join omp_project_prpo_info_query_v p on p.project_no = r.project_no
left join omp_local_org_t org_v on org_v.id = p.local_org_id
left join omp_local_org_develop_v org1 on org1.local_org_id = r.local_org_id
left join tpl_lookup_item_t l6
on l6.classify_code = 'REGION_DIMENSION' and l6.item_name = r.depty_palce and l6.status = '1'
left join tpl_lookup_item_t l7
on l7.classify_code = 'EMP_POSITION' and l7.item_name = r.cooperate_position and l7.status = '1'
where 1 = 1 and r.flow_busi_key = 'RE2025081200002N' and r.review_id is not null and ((1 = 1) or (1 = 1) or
p1.bs_created_by_ =
340809824852183 or
exists ( select 1
from act_hi_identitylink i
where i.proc_inst_id_ = p1.proc_inst_id_
and i.type_ = 'participant'
and (i.user_id_ = 340809824852183)
union
select 1
from act_hi_identitylink i
where i.proc_inst_id_ = p1.proc_inst_id_
and i.type_ = 'candidate'
and (i.user_id_ = 340809824852183)
union
select 1
from act_hi_identitylink i
where i.proc_inst_id_ = p1.proc_inst_id_
and i.type_ = 'CC'
and (i.user_id_ = 340809824852183) ))
limit 1
select '笔试(或机试)' as "reviewType1",
( select rr.review_record_id
from omp_emp_review_record_t rr
where rr.review_type = '笔试(或机试)' and rr.review_id = '5336020' ) as "reviewRecordId1",
( select rr.record_result
from omp_emp_review_record_t rr
where rr.review_type = '笔试(或机试)' and rr.review_id = '5336020' ) as "recordResult1",
( select rr.review_score
from omp_emp_review_record_t rr
where rr.review_type = '笔试(或机试)' and rr.review_id = '5336020' ) as "reviewScore1",
'技术复核' as "reviewType2",
( select rr.review_record_id
from omp_emp_review_record_t rr
where rr.review_type = '技术复核' and rr.review_id = '5336020' ) as "reviewRecordId2",
( select rr.record_result
from omp_emp_review_record_t rr
where rr.review_type = '技术复核' and rr.review_id = '5336020' ) as "recordResult2",
( select rr.review_score
from omp_emp_review_record_t rr
where rr.review_type = '技术复核' and rr.review_id = '5336020' ) as "reviewScore2",
( select rr.rank_type
from omp_emp_review_record_t rr
where rr.review_type = '技术复核' and rr.review_id = '5336020' ) as "reviewRankType2",
( select rr.hw_position
from omp_emp_review_record_t rr
where rr.review_type = '技术复核' and rr.review_id = '5336020' ) as "reviewHwPosition2",
( select rr.reviewer_id
from omp_emp_review_record_t rr
where rr.review_type = '技术复核' and rr.review_id = '5336020' ) as "reviewerId2",
( select u.lname
from omp_emp_review_record_t rr, tpl_user_t u
where rr.reviewer_id = u.user_id and rr.review_type = '技术复核'
and rr.review_id = '5336020' ) as "reviewerName2",
( select rr.review_method
from omp_emp_review_record_t rr
where rr.review_type = '技术复核' and rr.review_id = '5336020' ) as "reviewMethod2",
( select rr.review_evaluation
from omp_emp_review_record_t rr
where rr.review_type = '技术复核' and rr.review_id = '5336020' ) as "reviewEvaluation2",
( select rr.review_date
from omp_emp_review_record_t rr
where rr.review_type = '技术复核' and rr.review_id = '5336020' ) as "reviewDate2",
'综合复核' as "reviewType4",
( select rr.review_record_id
from omp_emp_review_record_t rr
where rr.review_type = '综合复核' and rr.review_id = '5336020' ) as "reviewRecordId4",
( select rr.record_result
from omp_emp_review_record_t rr
where rr.review_type = '综合复核' and rr.review_id = '5336020' ) as "recordResult4",
( select rr.review_score
from omp_emp_review_record_t rr
where rr.review_type = '综合复核' and rr.review_id = '5336020' ) as "reviewScore4",
( select rr.rank_type
from omp_emp_review_record_t rr
where rr.review_type = '综合复核' and rr.review_id = '5336020' ) as "reviewRankType4",
( select rr.hw_position
from omp_emp_review_record_t rr
where rr.review_type = '综合复核' and rr.review_id = '5336020' ) as "reviewHwPosition4",
( select rr.reviewer_id
from omp_emp_review_record_t rr
where rr.review_type = '综合复核' and rr.review_id = '5336020' ) as "reviewerId4",
( select u.lname
from omp_emp_review_record_t rr, tpl_user_t u
where rr.reviewer_id = u.user_id and rr.review_type = '综合复核'
and rr.review_id = '5336020' ) as "reviewerName4",
( select rr.review_method
from omp_emp_review_record_t rr
where rr.review_type = '综合复核' and rr.review_id = '5336020' ) as "reviewMethod4",
( select rr.review_evaluation
from omp_emp_review_record_t rr
where rr.review_type = '综合复核' and rr.review_id = '5336020' ) as "reviewEvaluation4",
( select rr.review_date
from omp_emp_review_record_t rr
where rr.review_type = '综合复核' and rr.review_id = '5336020' ) as "reviewDate4",
'复核扫描件' as "reviewType5",
( select rr.review_record_id
from omp_emp_review_record_t rr
where rr.review_type = '复核扫描件' and rr.review_id = '5336020' ) as "reviewRecordId5",
( select rr.review_edoc_id
from omp_emp_review_record_t rr
where rr.review_type = '复核扫描件' and rr.review_id = '5336020' ) as "reviewEdocId",
( select d.doc_name
from omp_emp_review_record_t rr, tpl_document_t d
where rr.review_edoc_id = d.doc_edoc_id and rr.review_type = '复核扫描件'
and rr.review_id = '5336020' ) as "reviewEdocName"
-- 6 -- ==>
select emp_role
from ( select c.emp_role
from omp_emp_resource_t r
join omp_emp_cooperate_user_t c on r.emp_employee_id = c.emp_employee_id
where c.emp_number = 'WB334479' and c.vendor_code = 'C51134' and r.emp_state != '4'
union all
select c.emp_role
from omp_emp_activity_t a
join omp_emp_cooperate_user_t c on a.emp_employee_id = c.emp_employee_id
where c.emp_number = 'WB334479' and c.vendor_code = 'C51134' and a.emp_state != '4' ) uu
limit 1
-- 7 -- ==>
select v.research_min_position as researchminlevel, v.operate_max_position as operationmaxlevel,
case when '5' in ('0', '1', '5', '10')
then v.middle_position_conf
else nvl(null, v.middle_position_conf)
end as middlepositionconf,
case when '5' in ('0', '1', '5', '10')
then v.high_position_conf
else nvl(null, v.high_position_conf)
end as highpositionconf, decode('5', '5', v.signatory_conf, nvl(null, 'N')) as approvesignatoryconf,
case when '5' = '5' and v.middle_position_conf is not null and to_number(replace(
replace(replace(replace(replace(nvl(v.middle_position_conf, '0'), 'A', ''), 'B', ''), '初级', '0'), '级',
''), '初', '')) > to_number(replace(
replace(replace(replace(replace(nvl('4B', '0'), 'A', ''), 'B', ''), '初级', '0'), '级', ''), '初', ''))
then 'Y'
when '5' = '5' and v.middle_position_conf is not null and to_number(replace(
replace(replace(replace(replace(nvl(v.middle_position_conf, '0'), 'A', ''), 'B', ''), '初级', '0'),
'级', ''), '初', '')) <= to_number(replace(
replace(replace(replace(replace(nvl('4B', '0'), 'A', ''), 'B', ''), '初级', '0'), '级', ''), '初', ''))
then 'N'
else null
end as minpositioncondition,
case when '5' = '5' and v.high_position_conf is not null and to_number(replace(
replace(replace(replace(replace(nvl(v.high_position_conf, '10'), 'A', ''), 'B', ''), '初级', '0'), '级', ''),
'初', '')) > to_number(replace(
replace(replace(replace(replace(nvl('4B', '0'), 'A', ''), 'B', ''), '初级', '0'), '级', ''), '初', ''))
then 'N'
when '5' = '5' and v.high_position_conf is not null and to_number(replace(
replace(replace(replace(replace(nvl(v.high_position_conf, '10'), 'A', ''), 'B', ''), '初级', '0'), '级',
''), '初', '')) <= to_number(replace(
replace(replace(replace(replace(nvl('4B', '0'), 'A', ''), 'B', ''), '初级', '0'), '级', ''), '初', ''))
then 'Y'
else null
end as maxpositioncondition
from omp_emp_review_position_conf_v v
where v.pdu_id = '700' and rownum = 1
-- 8 -- ==>
select a6.entrust_order_id as oldentryorderid
from omp_emp_activity_t a6, omp_emp_cooperate_user_t u6,
( select u9.emp_number, max(a9.dimission_date) as dimission_date
from omp_emp_activity_t a9, omp_emp_cooperate_user_t u9
where u9.emp_employee_id = a9.emp_employee_id and a9.emp_state = '4'
and u9.emp_userid = 'pwjNN1L2/Q1dag+9am6S5zCu7ADNygTh2G5/9HOAFB8=' and u9.vendor_code != 'C51134'
group by u9.emp_number ) a7
where u6.emp_employee_id = a6.emp_employee_id and u6.emp_number = a7.emp_number
and a6.dimission_date = a7.dimission_date and u6.emp_userid = 'pwjNN1L2/Q1dag+9am6S5zCu7ADNygTh2G5/9HOAFB8='
and u6.vendor_code != 'C51134' and a6.emp_state = '4' and rownum = 1
-- 9 -- ==>
select doc_edoc_id as docid, doc_name as docname, doc_v as docversion, doc_size as docsize, doc_server as servername
from tpl_document_t doc
where doc.doc_edoc_id = 'M3T1A904N1164612586533650526'
-- 10 -- ==>
select v.user_id as userid, v.employee_number as useraccount, v.w3_account as w3account, v.user_name as username
from omp_user_privilege_conf_v v
where 1 = 1 and v.apartment_code in ('OUTSOURC_MANAGER', 'PDU_MANAGER')
and v.prodline_value_code in ('458', '@ALLCONDITION@') and v.subprodline_value_code in ('487', '@ALLCONDITION@')
and v.pdu_value_code in ('700', '@ALLCONDITION@') and v.develop_value_code in ('56454', '@ALLCONDITION@')
group by v.user_id, v.employee_number, v.w3_account, v.user_name
-- 11 -- ==>
select count(1) as rscount
from t_hoas_resttime t
where date_format(concat(concat(t.restyear, '-'), t.restdate), '%Y-%m-%d') >
date_format('2025-08-19T17:14:46.000+0800', '%Y-%m-%d')
and date_format(concat(concat(t.restyear, '-'), t.restdate), '%Y-%m-%d') <= date_format('2025-09-09', '%Y-%m-%d')
-- 19 -- ==>
select count(1)
from ( select *
from ( select v.emp_employee_id as empemployeeid, v.record_no as recordno, v.emp_number as empnumber,
v.emp_userid as empuserid, v.emp_userid_mask as empuseridmask, v.emp_name as empname,
v.creation_date as creationdate, v.last_update_date as lastupdatedate,
v.vendor_code as vendorcode, v.status_name as statusname, v.event_name as eventname,
v.event_type as eventtype, v.depty_palce as deptypalce, v.rank_type as ranktype,
v.hw_position as hwposition, v.new_hw_position as newhwposition, v.created_by as applicatedby,
v.project_team as projectteam, v.vendor_name as vendorname, v.project_no as projectno,
v.project_name as projectname, v.po_num as ponum, v.pr_num as prnum,
v.commerical_model as commericalmodel, v.hw_dept_code as hwdeptcode,
v.hw_org_name as hworgname, v.created_name as applicatedname, v.hw_pm_work_name as hwpmname,
v.proc_inst_id as procinstid, v.handlers as handlerbyname, v.bg as prodlinename,
v.bu as subprodlinename, v.pdu as pdu
from omp_user_flow_query_t v
where 1 = 1 and v.is_archived = 'N' and v.emp_number = upper('WB334479') ) t )
-- 20 -- ==>
select data_from as "dataFrom", flow_key as "flowKey", decode(is_archived, 'Y', '***', 'N', emp_name) as "empName",
emp_number as "empNumber", vendor_code as "vendorCode", abbr_name as "vendorName", emp_position as "empPosition",
emp_speciality as "empSpeciality", last_update_date as "lastUpdateDate"
from ( select '0' as data_from, '人员基本信息' as flow_key, ecu.emp_name, ecu.emp_number, ecu.vendor_code,
c.abbr_name, ecu.emp_position, ecu.emp_speciality, ecu.is_archived, ecu.last_update_date
from omp_emp_cooperate_user_t ecu
join omp_emp_activity_t a on a.emp_employee_id = ecu.emp_employee_id
left join omp_coop_t c on c.status = 'ACTIVE' and c.code = ecu.vendor_code
where ecu.emp_number = 'WB334479'
union all
select '1' as data_from, r.flow_busi_key as flow_key, ru.emp_name, ru.emp_number, ru.vendor_code, c.abbr_name,
ru.emp_position, ru.emp_speciality, ru.is_archived, ru.last_update_date
from omp_emp_review_user_t ru
join omp_emp_review_t r on ru.emp_employee_id = r.emp_employee_id
left join omp_coop_t c on c.status = 'ACTIVE' and c.code = ru.vendor_code
where r.delete_flag = 'N' and r.status = '9' and ru.emp_number = 'WB334479' )
order by data_from, last_update_date desc
帮我优化SQL输出,并添加便于阅读的注释