<?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="C_R_GetCityCheckCollectQuery">
|
<![CDATA[
|
|
select base.* from (
|
select
|
org.id as orgId,
|
org.name as orgName,
|
org.pid as quId,
|
qu.name as quName,
|
(
|
select count(*) from sc_check_org sco
|
where 1=1
|
and sco.scco_org_id=org.id
|
<<and sco.scco_begin_date>=:beginDate>>
|
<<and sco.scco_begin_date<=:endDate>>
|
) as checkNum,
|
(
|
select count(*) from sc_check_org sco
|
where 1=1
|
and sco.scco_submit_data is not null
|
and sco.scco_org_id=org.id
|
<<and sco.scco_begin_date>=:beginDate>>
|
<<and sco.scco_begin_date<=:endDate>>
|
) as processNum,
|
(
|
select count(*) from sc_check_org_subject as os1
|
left join sc_check_org sco on sco.scco_id=scos_scco_id
|
where 1=1
|
and os1.scos_is_ok='N'
|
and sco.scco_org_id=org.id
|
<<and sco.scco_begin_date>=:beginDate>>
|
<<and sco.scco_begin_date<=:endDate>>
|
) as problemNum
|
from t_sys_organization as org
|
left join t_sys_organization as qu on qu.id=org.pid
|
where 1=1
|
and org.id in (:orgIds)
|
and
|
) as base
|
where 1=1
|
<<and base.tiJiaoNum>:tiJiaoNum>>
|
<<and base.processNum>:processNum>>
|
<<and base.problemNum>:problemNum>>
|
and ##CONDITIONS##
|
order by org.pid,org.id
|
|
]]>
|
</sql-query>
|
</hibernate-mapping>
|