1
13693261870
2022-09-16 fee60c3e25fac0982f3b8cb8feea7225c4ed22f8
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.terra.proxy.mapper.ServiceMapper">
    <resultMap id="serverRgBean" type="com.terra.proxy.bean.ServerRgBean">
        <id column="ID" property="id" jdbcType="INTEGER"/>
        <result column="ISPUBLIC" property="ispublic" jdbcType="INTEGER"/>
        <result column="SERVERURL" property="serverurl" jdbcType="VARCHAR"/>
        <result column="RESOURCEID" property="resourceid" jdbcType="INTEGER"/>
        <result column="URLID" property="urlid" jdbcType="INTEGER"/>
        <result column="CONTEXTPATH" property="contextpath" jdbcType="VARCHAR"/>
        <result column="SUFFIX" property="suffix" jdbcType="INTEGER"/>
        <result column="ENABLE" property="enable" jdbcType="INTEGER"/>
    </resultMap>
 
 
    <select id="queryServer" parameterType="map" flushCache="true"
            resultType="map">
        select
        "ID",
        "SERVERURL",
        "RESOURCEID",
        "ISPUBLIC",
        "URLID",
        "CONTEXTPATH",
        "SUFFIX",
        "FROMSYS",
        "SERVERNAME",
        "ENABLE"
        from "SERVERRG" t where 1=1
        <if test="resourceid!=null and resourceid !='' ">and t."RESOURCEID"=#{resourceid}</if>
        <if test="serverurl!=null and serverurl!=''">and t."SERVERURL"=#{serverurl}</if>
        <if test="urlid!=null and urlid !=''">and t."URLID"=#{urlid}</if>
        <if test="suffix!=null and suffix!=''">and t."SUFFIX"=#{suffix}</if>
        <if test="fromsys!=null and fromsys!=''">and t."FROMSYS"=#{fromsys}</if>
        <if test="ispublic!= null and ispublic!= '' ">and t."ISPUBLIC"=#{ispublic}</if>
        <if test="enable!= null and enable!= '' ">and t."ENABLE"=#{enable}</if>
        <if test="servername!= null and servername!= '' ">and t."SERVERNAME" like '%'||#{servername}||'%'</if>
        order by "ID" desc
        <if test="limit!=null and limit!=''">limit #{limit} offset #{offSet}</if>
    </select>
 
    <select id="queryTotalServer" parameterType="map"
            resultType="integer">
        select
        count(*) as count
        from "SERVERRG" t where 1=1
        <if test="resourceid!=null and resourceid !='' ">and t."RESOURCEID"=#{resourceid}</if>
        <if test="serverurl!=null and serverurl!=''">and t."SERVERURL"=#{serverurl}</if>
        <if test="urlid!=null and urlid !=''">and t."URLID"=#{urlid}</if>
        <if test="suffix!=null and suffix!=''">and t."SUFFIX"=#{suffix}</if>
        <if test="fromsys!=null and fromsys!=''">and t."FROMSYS"=#{fromsys}</if>
        <if test="ispublic != null and ispublic != '' ">and t."ISPUBLIC"=#{ispublic}</if>
        <if test="enable!= null and enable != '' ">and t."ENABLE"=#{enable}</if>
        <if test="servername!= null and servername!= '' ">and t."SERVERNAME" like '%'||#{servername}||'%'</if>
    </select>
 
 
    <select id="queryConfigInfo" parameterType="map"
            resultType="map">
         select
          t."SERVERURL",t."TARGETURL",t."SERVLETCLASS"
         from  "PROXYCONFIGINFO" t
    </select>
 
    <select id="queryServer2" parameterType="map"
            resultType="map">
        select
        "ID",
        "SERVERURL",
        "RESOURCEID",
        "ISPUBLIC",
        "URLID",
        "CONTEXTPATH",
        "SUFFIX",
        "FROMSYS",
        "SERVERNAME",
        "ENABLE"
        from "SERVERRG" t where 1=1
        <if test="resourceid!=null ">and t."RESOURCEID"=#{resourceid}</if>
        <if test="fromsys!=null">and t."FROMSYS"=#{fromsys}</if>
        <if test="enable!= null and enable!= '' ">and t."ENABLE"=#{enable}</if>
        order by "ID" desc
    </select>
 
    <insert id="addServer" parameterType="com.terra.proxy.bean.ServerRgBean" useGeneratedKeys="true" keyProperty="id">
    INSERT INTO "SERVERRG"(
    "SERVERURL", 
    "RESOURCEID",
    "SERVERNAME", 
    "CONTEXTPATH",
    "ISPUBLIC", 
    "URLID",
    "SUFFIX",
    "FROMSYS",
    "ENABLE")
    values
    (
    #{serverurl,jdbcType=VARCHAR},
    #{resourceid,jdbcType=INTEGER},
    #{servername,jdbcType=VARCHAR},
    #{contextpath,jdbcType=VARCHAR},
    #{ispublic,jdbcType=INTEGER},
    #{urlid,jdbcType=INTEGER},
    #{suffix,jdbcType=INTEGER},
    #{fromsys,jdbcType=VARCHAR},
    #{enable,jdbcType=INTEGER}
    )
    </insert>
 
    <select id="querytianditumerge" parameterType="Integer" resultType="map">
        select * from "TIANDITUMERGE" t where 1=1
        <if test="_parameter!=null and _parameter!='0'">
            and t."MERGEID"=#{_parameter}
        </if>
    </select>
 
    <insert id="addtianditumerge" useGeneratedKeys="true" keyProperty="mergeid" parameterType="com.terra.proxy.bean.TiandiantuMergeInfo">
        INSERT INTO "TIANDITUMERGE"(
        "RESOURCEID",
        "BASEMAP",
        "ZHUJIMAPGROUP"
        )
        values
        (
        #{resourceid,jdbcType=INTEGER},
        #{basemap,jdbcType=VARCHAR},
        #{zhujimapgroup,jdbcType=VARCHAR}
        )
    </insert>
 
    <update id="updateServer" parameterType="map">
        update "SERVERRG" SET
        <trim suffixOverrides=",">
            <if test="servername !=null">"SERVERNAME"=#{servername},</if>
            <if test="resourceid !=null">"RESOURCEID"=#{resourceid},</if>
            <if test="serverurl !=null">"SERVERURL"=#{serverurl} ,</if>
            <if test="urlid !=null">"URLID"=#{urlid},</if>
            <if test="contextpath !=null">"CONTEXTPATH"=#{contextpath},</if>
            <if test="status !=null">"STATUS"=#{status},</if>
            <if test="ispublic !=null">"ISPUBLIC"=#{ispublic},</if>
            <if test="enable !=null">"ENABLE"=#{enable},</if>
        </trim>
        where "ID"= #{id,jdbcType=INTEGER}
    </update>
 
    <delete id="delServer" parameterType="java.lang.Integer">
       delete from "SERVERRG" WHERE "ID"=#{id,jdbcType=INTEGER}
  </delete>
</mapper>