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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?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="HospitalListQuery">
        <![CDATA[
 
SELECT
syacc.sayacc_names,
syacc.sayacc_ids,
a.scmh_sn,
a.scmh_name,
a.scmh_short_name,
a.scmh_category,
a.scmh_phone,
a.scmh_state,
a.scmh_email,
a.scmh_site_url,
a.scmh_feature,
a.scmh_president,
a.scmh_syus_id,
a.scmh_province,
a.scmh_fax,
a.scmh_county,
a.scmh_city,
a.scmh_address,
a.scmh_post_code,
a.scmh_bank,
a.scmh_order,
a.scmh_remark,
a.scmh_id,
a.scmh_pid,
ifnull(b.scmh_name, '') as scmh_parent_name,
syus_real_name,
a.scmh_syacc_id,
syus_login_name
from scm_hospital a
left join (select GROUP_CONCAT(syac_name) sayacc_names,GROUP_CONCAT(syacc_id) sayacc_ids,
syacc_locationid from sys_accessory
GROUP BY syacc_locationid) syacc on syacc.syacc_locationid=a.scmh_id
left join scm_hospital b on a.scmh_pid=b.scmh_id 
left join sys_user on syus_id=a.scmh_syus_id
where 1=1
<<and a.scmh_sn like concat('%', :scmhSn, '%')>>
<<and a.scmh_name like concat('%', :scmhName, '%')>>
<<and a.scmh_pid is null and 1=:scmhPidIsNull>>
<<and a.scmh_pid=:scmhPid>>
<<and a.scmh_id=:scmhId>>
<<and a.scmh_state=:scmhState>>
   and ##CONDITIONS##
 
        ]]>
    </sql-query>
</hibernate-mapping>