<?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.ProxyServletMapper">
|
<resultMap id="ServletBean" type="com.terra.proxy.bean.ServletBean">
|
<id column="ID" property="id" jdbcType="INTEGER"/>
|
<result column="ENABLE" property="enable" jdbcType="INTEGER"/>
|
<result column="URL" property="url" jdbcType="VARCHAR"/>
|
<result column="REMARK" property="remark" jdbcType="VARCHAR"/>
|
<result column="TIME" property="time" jdbcType="VARCHAR"/>
|
<result column="ISPUBLIC" property="ispublic" jdbcType="INTEGER"/>
|
</resultMap>
|
|
|
<select id="queryServer" parameterType="map"
|
resultType="map">
|
select
|
"ID",
|
"URL",
|
"ENABLE",
|
"ISPUBLIC",
|
"TIME",
|
"REMARK"
|
from "PROXYSERVLET" t where 1=1
|
<if test="id!=null and id !='' ">and t."ID"=#{id}</if>
|
<if test="url!=null and url!=''">and t."URL"=#{url}</if>
|
<if test="remark != null and remark!='' ">and t."REMARK"=#{remark}</if>
|
<if test="enable != null and enable != '' ">and t."ENABLE"=#{enable}</if>
|
<if test="ispublic != null and ispublic != '' ">and t."ISPUBLIC"=#{ispublic}</if>
|
<if test="starttime!=null and starttime!='' and endtime!=null and endtime!='' ">and t."TIME" BETWEEN
|
#{starttime} AND #{endtime}
|
</if>
|
limit #{limit} offset #{offSet};
|
</select>
|
|
<select id="queryTotalServer" parameterType="map"
|
resultType="integer">
|
select
|
count(*)
|
from "PROXYSERVLET" t where 1=1
|
<if test="id!=null and id !='' ">and t."ID"=#{id}</if>
|
<if test="url!=null and url!=''">and t."URL"=#{url}</if>
|
<if test="remark != null and remark!='' ">and t."REMARK"=#{remark}</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="starttime!=null and starttime!='' and endtime!=null and endtime!='' ">and t."TIME" BETWEEN
|
#{starttime} AND #{endtime}
|
</if>
|
</select>
|
|
|
<insert id="addServlet" parameterType="com.terra.proxy.bean.ServletBean" useGeneratedKeys="true" keyProperty="id">
|
INSERT INTO "PROXYSERVLET"(
|
"URL",
|
"ENABLE",
|
"ISPUBLIC",
|
"TIME",
|
"REMARK"
|
)
|
values
|
(
|
#{url,jdbcType=VARCHAR},
|
#{enable,jdbcType=INTEGER},
|
#{ispublic,jdbcType=INTEGER},
|
#{time},
|
#{remark,jdbcType=VARCHAR}
|
)
|
</insert>
|
|
|
<update id="updateServer" parameterType="com.terra.proxy.bean.ServletBean">
|
update "PROXYSERVLET"
|
<set>
|
<trim suffixOverrides=",">
|
<if test="url!=null and url!=''">"URL"=#{url} ,</if>
|
<if test="remark != null and remark!='' ">"REMARK"=#{remark},</if>
|
<if test="ispublic != null and ispublic != '' ">"ISPUBLIC"=#{ispublic},</if>
|
"ENABLE"=#{enable},
|
"TIME"= CURRENT_TIMESTAMP ,
|
</trim>
|
</set>
|
where "ID"= #{id,jdbcType=INTEGER}
|
</update>
|
|
<delete id="delServer" parameterType="java.lang.Integer">
|
delete from "PROXYSERVLET" WHERE "ID"=#{id,jdbcType=INTEGER}
|
</delete>
|
|
|
</mapper>
|