liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?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_getSchoolDetailListQuery">
        <![CDATA[
select aa.* from
(
    select 
    scco_id,
    (
        select count(*) from sc_check_org_subject 
        left join sc_check_org on scco_id=scos_scco_id
        where 1=1
        and scos_is_ok = 'N'
        and scos_scco_id=scco_id
        
        
    ) as problemSize
 
 
    from sc_check_org
    left join sc_check on scch_id = scco_scch_id
    left join sc_category on scch_scca_id = scca_id
    where 1=1
    <<and scco_org_id = :orgId>>
    <<and (1 = :isNotNull and scco_submit_data is not null)>>
    <<and (1 = :isNull and scco_submit_data is null)>>
    <<and scca_id = :sccaId>>
    <<and scco_begin_date >= :beginDate>>
    <<and scco_begin_date <= :endDate>>
) as  aa
where 1=1
   <<and aa.problemSize > :problemSize>>
   and ##CONDITIONS##
   order by aa.scco_begin_date desc
        ]]>
    </sql-query>
</hibernate-mapping>