<?xml version="1.0"?>
|
<!DOCTYPE hibernate-mapping PUBLIC
|
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
|
<hibernate-mapping>
|
<sql-query name="SP_boHuiListQuery">
|
<![CDATA[
|
|
SELECT
|
scco_id,
|
scch_id,
|
scco_scch_id,
|
scco_org_id,
|
scco_flow_role,
|
scco_flow_state,
|
scch_title,
|
scca_name,
|
a.scrt_begin,
|
a.scrt_end,
|
a.scrt_over,
|
scch_state,
|
recode.scfr_task_date,
|
recode.scfr_tasker,
|
tijiao.scfr_task_date as bh_submit_date,
|
(
|
SELECT GROUP_CONCAT(aa.sccf_role) from
|
(
|
SELECT
|
sccf_scch_id,sccf_role,sccf_order
|
from sc_check_flow
|
ORDER BY sccf_order
|
) aa
|
WHERE
|
aa.sccf_scch_id = co.scco_scch_id
|
AND (sccf_role is not NULL or sccf_role <> '')
|
) rolenames
|
from sc_check_org co
|
LEFT JOIN sc_check on scco_scch_id = scch_id
|
LEFT JOIN sc_category on scca_id = scch_scca_id
|
LEFT JOIN
|
(
|
select * from (
|
select
|
scrt_begin,scrt_end,scrt_over,scrt_scco_id,sccf_order
|
from sc_role_date
|
LEFT JOIN sc_check_flow on sccf_id=scrt_sccf_id
|
WHERE 1=1
|
<<and scrt_org_id = :orgId>>
|
order by sccf_order
|
) as aa
|
GROUP BY aa.scrt_scco_id
|
) as a on a.scrt_scco_id=scco_id
|
LEFT JOIN
|
(
|
select * from (
|
select scfr_scco_id,scfr_task_date,scfr_tasker,scfr_org_id from sc_check_flow_record
|
LEFT JOIN sc_check_flow on sccf_id=scfr_sccf_id
|
where 1=1
|
<<and scfr_org_id = :orgId>>
|
order by scfr_task_date desc
|
) as temp_record
|
group by temp_record.scfr_scco_id
|
|
) as recode on recode.scfr_scco_id=co.scco_id
|
LEFT JOIN
|
(
|
select * from (
|
select scfr_scco_id,scfr_task_date,scfr_tasker,scfr_org_id from sc_check_flow_record
|
LEFT JOIN sc_check_flow on sccf_id=scfr_sccf_id
|
where 1=1
|
<<and scfr_org_id = :orgId>>
|
<<and sccf_role in (:sccfRole)>>
|
order by scfr_task_date desc
|
) as temp_tijiao
|
GROUP BY temp_tijiao.scfr_scco_id
|
) as tijiao on tijiao.scfr_scco_id=co.scco_id
|
|
WHERE 1=1
|
and scco_flow_state <>100
|
<<and scco_flow_role in (:sccfRole)>>
|
<<and scch_state <> :scchState>>
|
<<and scco_org_id = :orgId>>
|
<<and scco_flow_state = :sccoFlowState1>>
|
<<and scco_flow_state > :sccoFlowState2>>
|
<<and scca_name = :sccaName>>
|
and ##CONDITIONS##
|
GROUP BY co.scco_id
|
order by a.scrt_begin desc
|
|
]]>
|
</sql-query>
|
</hibernate-mapping>
|