390 lines
12 KiB
XML
390 lines
12 KiB
XML
|
<?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="ink.wgink.gatewaymanage.dao.system.ISystemDao">
|
||
|
|
||
|
<resultMap id="systemDTO" type="ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO">
|
||
|
<result column="system_id" property="systemId"/>
|
||
|
<result column="name" property="name"/>
|
||
|
<result column="summary" property="summary"/>
|
||
|
<result column="logo" property="logo"/>
|
||
|
<result column="gateway_context" property="gatewayContext"/>
|
||
|
<result column="schema" property="schema"/>
|
||
|
<result column="ip_address" property="ipAddress"/>
|
||
|
<result column="system_context" property="systemContext"/>
|
||
|
<result column="audit_status" property="auditStatus"/>
|
||
|
<result column="audit_time" property="auditTime"/>
|
||
|
<result column="auditor" property="auditor"/>
|
||
|
<result column="audit_reason" property="auditReason"/>
|
||
|
<result column="gmt_create" property="gmtCreate"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="systemBO" type="ink.wgink.gatewaymanage.pojo.bos.system.SystemBO">
|
||
|
<result column="system_id" property="systemId"/>
|
||
|
<result column="name" property="name"/>
|
||
|
<result column="summary" property="summary"/>
|
||
|
<result column="logo" property="logo"/>
|
||
|
<result column="gateway_context" property="gatewayContext"/>
|
||
|
<result column="schema" property="schema"/>
|
||
|
<result column="ip_address" property="ipAddress"/>
|
||
|
<result column="system_context" property="systemContext"/>
|
||
|
<result column="audit_status" property="auditStatus"/>
|
||
|
<result column="audit_time" property="auditTime"/>
|
||
|
<result column="auditor" property="auditor"/>
|
||
|
<result column="audit_reason" property="auditReason"/>
|
||
|
<result column="gmt_create" property="gmtCreate"/>
|
||
|
<result column="creator" property="creator"/>
|
||
|
<result column="gmt_modified" property="gmtModified"/>
|
||
|
<result column="modifier" property="modifier"/>
|
||
|
<result column="is_delete" property="isDelete"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="systemPO" type="ink.wgink.gatewaymanage.pojo.pos.system.SystemPO">
|
||
|
<result column="system_id" property="systemId"/>
|
||
|
<result column="name" property="name"/>
|
||
|
<result column="summary" property="summary"/>
|
||
|
<result column="logo" property="logo"/>
|
||
|
<result column="gateway_context" property="gatewayContext"/>
|
||
|
<result column="schema" property="schema"/>
|
||
|
<result column="ip_address" property="ipAddress"/>
|
||
|
<result column="system_context" property="systemContext"/>
|
||
|
<result column="audit_status" property="auditStatus"/>
|
||
|
<result column="audit_time" property="auditTime"/>
|
||
|
<result column="auditor" property="auditor"/>
|
||
|
<result column="audit_reason" property="auditReason"/>
|
||
|
<result column="gmt_create" property="gmtCreate"/>
|
||
|
<result column="creator" property="creator"/>
|
||
|
<result column="gmt_modified" property="gmtModified"/>
|
||
|
<result column="modifier" property="modifier"/>
|
||
|
<result column="is_delete" property="isDelete"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<!-- 新增接口系统 -->
|
||
|
<insert id="save" parameterType="map">
|
||
|
INSERT INTO api_system(
|
||
|
system_id,
|
||
|
name,
|
||
|
summary,
|
||
|
logo,
|
||
|
gateway_context,
|
||
|
schema,
|
||
|
ip_address,
|
||
|
system_context,
|
||
|
audit_status,
|
||
|
audit_time,
|
||
|
auditor,
|
||
|
audit_reason,
|
||
|
gmt_create,
|
||
|
creator,
|
||
|
gmt_modified,
|
||
|
modifier,
|
||
|
is_delete
|
||
|
) VALUES(
|
||
|
#{systemId},
|
||
|
#{name},
|
||
|
#{summary},
|
||
|
#{logo},
|
||
|
#{gatewayContext},
|
||
|
#{schema},
|
||
|
#{ipAddress},
|
||
|
#{systemContext},
|
||
|
#{auditStatus},
|
||
|
#{auditTime},
|
||
|
#{auditor},
|
||
|
#{auditReason},
|
||
|
#{gmtCreate},
|
||
|
#{creator},
|
||
|
#{gmtModified},
|
||
|
#{modifier},
|
||
|
#{isDelete}
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
<!-- 删除接口系统 -->
|
||
|
<update id="remove" parameterType="map">
|
||
|
UPDATE
|
||
|
api_system
|
||
|
SET
|
||
|
gmt_modified = #{gmtModified},
|
||
|
modifier = #{modifier},
|
||
|
is_delete = 1
|
||
|
WHERE
|
||
|
system_id IN
|
||
|
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
||
|
#{systemIds[${index}]}
|
||
|
</foreach>
|
||
|
</update>
|
||
|
|
||
|
<!-- 删除接口系统(物理) -->
|
||
|
<update id="delete" parameterType="map">
|
||
|
DELETE FROM
|
||
|
api_system
|
||
|
WHERE
|
||
|
system_id IN
|
||
|
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
||
|
#{systemIds[${index}]}
|
||
|
</foreach>
|
||
|
</update>
|
||
|
|
||
|
<!-- 修改接口系统 -->
|
||
|
<update id="update" parameterType="map">
|
||
|
UPDATE
|
||
|
api_system
|
||
|
SET
|
||
|
<if test="name != null and name != ''">
|
||
|
name = #{name},
|
||
|
</if>
|
||
|
<if test="summary != null and summary != ''">
|
||
|
summary = #{summary},
|
||
|
</if>
|
||
|
<if test="logo != null and logo != ''">
|
||
|
logo = #{logo},
|
||
|
</if>
|
||
|
<if test="gatewayContext != null and gatewayContext != ''">
|
||
|
gateway_context = #{gatewayContext},
|
||
|
</if>
|
||
|
<if test="schema != null and schema != ''">
|
||
|
schema = #{schema},
|
||
|
</if>
|
||
|
<if test="ipAddress != null and ipAddress != ''">
|
||
|
ip_address = #{ipAddress},
|
||
|
</if>
|
||
|
<if test="systemContext != null and systemContext != ''">
|
||
|
system_context = #{systemContext},
|
||
|
</if>
|
||
|
gmt_modified = #{gmtModified},
|
||
|
modifier = #{modifier},
|
||
|
system_id = system_id
|
||
|
WHERE
|
||
|
system_id = #{systemId}
|
||
|
</update>
|
||
|
|
||
|
<!-- 接口系统详情 -->
|
||
|
<select id="get" parameterType="map" resultMap="systemDTO">
|
||
|
SELECT
|
||
|
t1.name,
|
||
|
t1.summary,
|
||
|
t1.logo,
|
||
|
t1.gateway_context,
|
||
|
t1.schema,
|
||
|
t1.ip_address,
|
||
|
t1.system_context,
|
||
|
t1.system_id
|
||
|
FROM
|
||
|
api_system t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<if test="systemId != null and systemId != ''">
|
||
|
AND
|
||
|
t1.system_id = #{systemId}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 接口系统详情 -->
|
||
|
<select id="getBO" parameterType="map" resultMap="systemBO">
|
||
|
SELECT
|
||
|
t1.system_id,
|
||
|
t1.name,
|
||
|
t1.summary,
|
||
|
t1.logo,
|
||
|
t1.gateway_context,
|
||
|
t1.schema,
|
||
|
t1.ip_address,
|
||
|
t1.system_context,
|
||
|
t1.audit_status,
|
||
|
t1.audit_time,
|
||
|
t1.auditor,
|
||
|
t1.audit_reason,
|
||
|
t1.gmt_create,
|
||
|
t1.creator,
|
||
|
t1.gmt_modified,
|
||
|
t1.modifier,
|
||
|
t1.is_delete
|
||
|
FROM
|
||
|
api_system t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<if test="systemId != null and systemId != ''">
|
||
|
AND
|
||
|
t1.system_id = #{systemId}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 接口系统详情 -->
|
||
|
<select id="getPO" parameterType="map" resultMap="systemPO">
|
||
|
SELECT
|
||
|
t1.system_id,
|
||
|
t1.name,
|
||
|
t1.summary,
|
||
|
t1.logo,
|
||
|
t1.gateway_context,
|
||
|
t1.schema,
|
||
|
t1.ip_address,
|
||
|
t1.system_context,
|
||
|
t1.audit_status,
|
||
|
t1.audit_time,
|
||
|
t1.auditor,
|
||
|
t1.audit_reason,
|
||
|
t1.gmt_create,
|
||
|
t1.creator,
|
||
|
t1.gmt_modified,
|
||
|
t1.modifier,
|
||
|
t1.is_delete
|
||
|
FROM
|
||
|
api_system t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<if test="systemId != null and systemId != ''">
|
||
|
AND
|
||
|
t1.system_id = #{systemId}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 接口系统列表 -->
|
||
|
<select id="list" parameterType="map" resultMap="systemDTO">
|
||
|
SELECT
|
||
|
t1.system_id,
|
||
|
t1.name,
|
||
|
t1.summary,
|
||
|
t1.logo,
|
||
|
t1.gateway_context,
|
||
|
t1.schema,
|
||
|
t1.ip_address,
|
||
|
t1.system_context,
|
||
|
t1.audit_status,
|
||
|
t1.audit_time,
|
||
|
t1.auditor,
|
||
|
t1.audit_reason,
|
||
|
t1.gmt_create,
|
||
|
1
|
||
|
FROM
|
||
|
api_system t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="startTime != null and startTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||
|
</if>
|
||
|
<if test="endTime != null and endTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||
|
</if>
|
||
|
<if test="systemIds != null and systemIds.size > 0">
|
||
|
AND
|
||
|
t1.system_id IN
|
||
|
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
||
|
#{systemIds[${index}]}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 接口系统列表 -->
|
||
|
<select id="listBO" parameterType="map" resultMap="systemBO">
|
||
|
SELECT
|
||
|
t1.system_id,
|
||
|
t1.name,
|
||
|
t1.summary,
|
||
|
t1.logo,
|
||
|
t1.gateway_context,
|
||
|
t1.schema,
|
||
|
t1.ip_address,
|
||
|
t1.system_context,
|
||
|
t1.audit_status,
|
||
|
t1.audit_time,
|
||
|
t1.auditor,
|
||
|
t1.audit_reason,
|
||
|
t1.gmt_create,
|
||
|
t1.creator,
|
||
|
t1.gmt_modified,
|
||
|
t1.modifier,
|
||
|
t1.is_delete
|
||
|
FROM
|
||
|
api_system t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="startTime != null and startTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||
|
</if>
|
||
|
<if test="endTime != null and endTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||
|
</if>
|
||
|
<if test="systemIds != null and systemIds.size > 0">
|
||
|
AND
|
||
|
t1.system_id IN
|
||
|
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
||
|
#{systemIds[${index}]}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 接口系统列表 -->
|
||
|
<select id="listPO" parameterType="map" resultMap="systemPO">
|
||
|
SELECT
|
||
|
t1.system_id,
|
||
|
t1.name,
|
||
|
t1.summary,
|
||
|
t1.logo,
|
||
|
t1.gateway_context,
|
||
|
t1.schema,
|
||
|
t1.ip_address,
|
||
|
t1.system_context,
|
||
|
t1.audit_status,
|
||
|
t1.audit_time,
|
||
|
t1.auditor,
|
||
|
t1.audit_reason,
|
||
|
t1.gmt_create,
|
||
|
t1.creator,
|
||
|
t1.gmt_modified,
|
||
|
t1.modifier,
|
||
|
t1.is_delete
|
||
|
FROM
|
||
|
api_system t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="startTime != null and startTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||
|
</if>
|
||
|
<if test="endTime != null and endTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||
|
</if>
|
||
|
<if test="systemIds != null and systemIds.size > 0">
|
||
|
AND
|
||
|
t1.system_id IN
|
||
|
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
||
|
#{systemIds[${index}]}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 接口系统统计 -->
|
||
|
<select id="count" parameterType="map" resultType="Integer">
|
||
|
SELECT
|
||
|
COUNT(*)
|
||
|
FROM
|
||
|
api_system t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
</select>
|
||
|
|
||
|
</mapper>
|