<?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>
|