2021-08-16 16:52:28 +08:00
|
|
|
<?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.api.IApiDao">
|
|
|
|
|
|
|
|
<resultMap id="apiDTO" type="ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO">
|
|
|
|
<result column="api_id" property="apiId"/>
|
|
|
|
<result column="system_id" property="systemId"/>
|
|
|
|
<result column="title" property="title"/>
|
|
|
|
<result column="summary" property="summary"/>
|
|
|
|
<result column="url" property="url"/>
|
|
|
|
<result column="method" property="method"/>
|
|
|
|
<result column="request_example_url" property="requestExampleUrl"/>
|
|
|
|
<result column="request_example_body" property="requestExampleBody"/>
|
|
|
|
<result column="response_success_example" property="responseSuccessExample"/>
|
|
|
|
<result column="response_fail_example" property="responseFailExample"/>
|
|
|
|
<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="is_publish" property="isPublish"/>
|
|
|
|
<result column="publish_time" property="publishTime"/>
|
|
|
|
<result column="is_can_claim" property="isCanClaim"/>
|
|
|
|
<result column="is_usable" property="isUsable"/>
|
|
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap id="apiBO" type="ink.wgink.gatewaymanage.pojo.bos.api.ApiBO">
|
|
|
|
<result column="api_id" property="apiId"/>
|
|
|
|
<result column="system_id" property="systemId"/>
|
|
|
|
<result column="title" property="title"/>
|
|
|
|
<result column="summary" property="summary"/>
|
|
|
|
<result column="url" property="url"/>
|
|
|
|
<result column="method" property="method"/>
|
|
|
|
<result column="request_example_url" property="requestExampleUrl"/>
|
|
|
|
<result column="request_example_body" property="requestExampleBody"/>
|
|
|
|
<result column="response_success_example" property="responseSuccessExample"/>
|
|
|
|
<result column="response_fail_example" property="responseFailExample"/>
|
|
|
|
<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="is_publish" property="isPublish"/>
|
|
|
|
<result column="publish_time" property="publishTime"/>
|
|
|
|
<result column="is_can_claim" property="isCanClaim"/>
|
|
|
|
<result column="is_usable" property="isUsable"/>
|
|
|
|
<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="apiPO" type="ink.wgink.gatewaymanage.pojo.pos.api.ApiPO">
|
|
|
|
<result column="api_id" property="apiId"/>
|
|
|
|
<result column="system_id" property="systemId"/>
|
|
|
|
<result column="title" property="title"/>
|
|
|
|
<result column="summary" property="summary"/>
|
|
|
|
<result column="url" property="url"/>
|
|
|
|
<result column="method" property="method"/>
|
|
|
|
<result column="request_example_url" property="requestExampleUrl"/>
|
|
|
|
<result column="request_example_body" property="requestExampleBody"/>
|
|
|
|
<result column="response_success_example" property="responseSuccessExample"/>
|
|
|
|
<result column="response_fail_example" property="responseFailExample"/>
|
|
|
|
<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="is_publish" property="isPublish"/>
|
|
|
|
<result column="publish_time" property="publishTime"/>
|
|
|
|
<result column="is_can_claim" property="isCanClaim"/>
|
|
|
|
<result column="is_usable" property="isUsable"/>
|
|
|
|
<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>
|
|
|
|
|
2021-08-23 16:04:14 +08:00
|
|
|
<resultMap id="examineDTO" type="ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO">
|
|
|
|
<result column="audit_status" property="auditStatus"/>
|
|
|
|
<result column="audit_time" property="auditTime"/>
|
|
|
|
<result column="auditor" property="auditor"/>
|
|
|
|
<result column="audit_reason" property="auditReason"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<insert id="createTable">
|
|
|
|
CREATE TABLE IF NOT EXISTS `api_api` (
|
|
|
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
|
|
|
`api_id` char(36) NOT NULL COMMENT '主键',
|
|
|
|
`system_id` char(36) NOT NULL COMMENT '系统ID',
|
|
|
|
`title` varchar(255) NOT NULL COMMENT '标题',
|
|
|
|
`summary` varchar(500) DEFAULT NULL COMMENT '说明',
|
|
|
|
`url` varchar(1000) NOT NULL COMMENT '请求地址',
|
|
|
|
`method` varchar(255) NOT NULL COMMENT '方法',
|
|
|
|
`request_example_url` text COMMENT '请求示例',
|
|
|
|
`request_example_body` longtext COMMENT '请求正文',
|
|
|
|
`response_success_example` longtext COMMENT '响应成功示例',
|
|
|
|
`response_fail_example` longtext COMMENT '响应失败示例',
|
|
|
|
`audit_status` varchar(100) DEFAULT 'none' COMMENT '审核状态',
|
|
|
|
`audit_time` varchar(20) DEFAULT NULL COMMENT '审核时间',
|
|
|
|
`auditor` char(36) DEFAULT NULL COMMENT '审核人',
|
|
|
|
`audit_reason` text COMMENT '审核原因',
|
|
|
|
`is_publish` int(11) NOT NULL DEFAULT '0' COMMENT '是否发布',
|
|
|
|
`publish_time` varchar(255) DEFAULT NULL COMMENT '发布时间',
|
|
|
|
`is_can_claim` int(1) NOT NULL DEFAULT '1' COMMENT '是否可认领',
|
|
|
|
`is_usable` int(1) NOT NULL DEFAULT '0' COMMENT '是否可用',
|
|
|
|
`gmt_create` datetime NOT NULL COMMENT '创建时间',
|
|
|
|
`creator` char(36) NOT NULL COMMENT '创建人',
|
|
|
|
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
|
|
|
|
`modifier` char(36) NOT NULL COMMENT '修改人',
|
|
|
|
`is_delete` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
UNIQUE KEY `api_id` (`api_id`) USING BTREE,
|
|
|
|
KEY `system_id` (`system_id`) USING BTREE
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='接口';
|
|
|
|
</insert>
|
|
|
|
|
2021-08-16 16:52:28 +08:00
|
|
|
<!-- 新增接口 -->
|
|
|
|
<insert id="save" parameterType="map">
|
|
|
|
INSERT INTO api_api(
|
|
|
|
api_id,
|
|
|
|
system_id,
|
|
|
|
title,
|
|
|
|
summary,
|
|
|
|
url,
|
|
|
|
method,
|
|
|
|
request_example_url,
|
|
|
|
request_example_body,
|
|
|
|
response_success_example,
|
|
|
|
response_fail_example,
|
|
|
|
audit_status,
|
|
|
|
audit_time,
|
|
|
|
auditor,
|
|
|
|
audit_reason,
|
|
|
|
is_publish,
|
|
|
|
publish_time,
|
|
|
|
is_can_claim,
|
|
|
|
is_usable,
|
|
|
|
gmt_create,
|
|
|
|
creator,
|
|
|
|
gmt_modified,
|
|
|
|
modifier,
|
|
|
|
is_delete
|
|
|
|
) VALUES(
|
|
|
|
#{apiId},
|
|
|
|
#{systemId},
|
|
|
|
#{title},
|
|
|
|
#{summary},
|
|
|
|
#{url},
|
|
|
|
#{method},
|
|
|
|
#{requestExampleUrl},
|
|
|
|
#{requestExampleBody},
|
|
|
|
#{responseSuccessExample},
|
|
|
|
#{responseFailExample},
|
|
|
|
#{auditStatus},
|
|
|
|
#{auditTime},
|
|
|
|
#{auditor},
|
|
|
|
#{auditReason},
|
|
|
|
#{isPublish},
|
|
|
|
#{publishTime},
|
|
|
|
#{isCanClaim},
|
|
|
|
#{isUsable},
|
|
|
|
#{gmtCreate},
|
|
|
|
#{creator},
|
|
|
|
#{gmtModified},
|
|
|
|
#{modifier},
|
|
|
|
#{isDelete}
|
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<!-- 删除接口 -->
|
|
|
|
<update id="remove" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
api_api
|
|
|
|
SET
|
|
|
|
gmt_modified = #{gmtModified},
|
|
|
|
modifier = #{modifier},
|
|
|
|
is_delete = 1
|
|
|
|
WHERE
|
2021-08-23 16:04:14 +08:00
|
|
|
<if test="apiIds != null and apiIds.size > 0">
|
2021-08-16 16:52:28 +08:00
|
|
|
api_id IN
|
2021-08-23 16:04:14 +08:00
|
|
|
<foreach collection="apiIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{apiIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
2021-10-14 23:09:07 +08:00
|
|
|
<if test="systemIds != null and systemIds.size > 0">
|
2021-08-23 16:04:14 +08:00
|
|
|
system_id IN
|
|
|
|
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{systemIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
2021-08-16 16:52:28 +08:00
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 删除接口(物理) -->
|
|
|
|
<update id="delete" parameterType="map">
|
|
|
|
DELETE FROM
|
|
|
|
api_api
|
|
|
|
WHERE
|
2021-08-23 16:04:14 +08:00
|
|
|
<if test="apiIds != null and apiIds.size > 0">
|
2021-08-16 16:52:28 +08:00
|
|
|
api_id IN
|
2021-08-23 16:04:14 +08:00
|
|
|
<foreach collection="apiIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{apiIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
<if test="systemIds != null and systemId.size > 0">
|
|
|
|
system_id IN
|
|
|
|
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{systemIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
2021-08-16 16:52:28 +08:00
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 修改接口 -->
|
|
|
|
<update id="update" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
api_api
|
|
|
|
SET
|
|
|
|
<if test="systemId != null and systemId != ''">
|
|
|
|
system_id = #{systemId},
|
|
|
|
</if>
|
|
|
|
<if test="title != null and title != ''">
|
|
|
|
title = #{title},
|
|
|
|
</if>
|
|
|
|
<if test="summary != null and summary != ''">
|
|
|
|
summary = #{summary},
|
|
|
|
</if>
|
|
|
|
<if test="url != null and url != ''">
|
|
|
|
url = #{url},
|
|
|
|
</if>
|
|
|
|
<if test="method != null and method != ''">
|
|
|
|
method = #{method},
|
|
|
|
</if>
|
|
|
|
<if test="requestExampleUrl != null and requestExampleUrl != ''">
|
|
|
|
request_example_url = #{requestExampleUrl},
|
|
|
|
</if>
|
|
|
|
<if test="requestExampleBody != null and requestExampleBody != ''">
|
|
|
|
request_example_body = #{requestExampleBody},
|
|
|
|
</if>
|
|
|
|
<if test="responseSuccessExample != null and responseSuccessExample != ''">
|
|
|
|
response_success_example = #{responseSuccessExample},
|
|
|
|
</if>
|
|
|
|
<if test="responseFailExample != null and responseFailExample != ''">
|
|
|
|
response_fail_example = #{responseFailExample},
|
|
|
|
</if>
|
|
|
|
<if test="isPublish != null">
|
|
|
|
is_publish = #{isPublish},
|
|
|
|
</if>
|
|
|
|
<if test="isCanClaim != null">
|
|
|
|
is_can_claim = #{isCanClaim},
|
|
|
|
</if>
|
|
|
|
<if test="isUsable != null">
|
|
|
|
is_usable = #{isUsable},
|
|
|
|
</if>
|
|
|
|
gmt_modified = #{gmtModified},
|
|
|
|
modifier = #{modifier},
|
|
|
|
api_id = api_id
|
|
|
|
WHERE
|
|
|
|
api_id = #{apiId}
|
|
|
|
</update>
|
|
|
|
|
2021-08-23 16:04:14 +08:00
|
|
|
<!-- 修改审核接口 -->
|
|
|
|
<update id="updateExamine" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
api_api
|
|
|
|
SET
|
|
|
|
audit_status = #{auditStatus},
|
|
|
|
audit_time = #{auditTime},
|
|
|
|
auditor = #{auditor},
|
|
|
|
audit_reason = #{auditReason}
|
|
|
|
WHERE
|
|
|
|
api_id = #{apiId}
|
|
|
|
</update>
|
|
|
|
|
2021-08-16 16:52:28 +08:00
|
|
|
<!-- 接口详情 -->
|
|
|
|
<select id="get" parameterType="map" resultMap="apiDTO">
|
|
|
|
SELECT
|
|
|
|
t1.system_id,
|
|
|
|
t1.title,
|
|
|
|
t1.summary,
|
|
|
|
t1.url,
|
|
|
|
t1.method,
|
|
|
|
t1.request_example_url,
|
|
|
|
t1.request_example_body,
|
|
|
|
t1.response_success_example,
|
|
|
|
t1.response_fail_example,
|
|
|
|
t1.is_publish,
|
|
|
|
t1.is_can_claim,
|
|
|
|
t1.is_usable,
|
|
|
|
t1.api_id
|
|
|
|
FROM
|
|
|
|
api_api t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="apiId != null and apiId != ''">
|
|
|
|
AND
|
|
|
|
t1.api_id = #{apiId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 接口详情 -->
|
|
|
|
<select id="getBO" parameterType="map" resultMap="apiBO">
|
|
|
|
SELECT
|
|
|
|
t1.api_id,
|
|
|
|
t1.system_id,
|
|
|
|
t1.title,
|
|
|
|
t1.summary,
|
|
|
|
t1.url,
|
|
|
|
t1.method,
|
|
|
|
t1.request_example_url,
|
|
|
|
t1.request_example_body,
|
|
|
|
t1.response_success_example,
|
|
|
|
t1.response_fail_example,
|
|
|
|
t1.audit_status,
|
|
|
|
t1.audit_time,
|
|
|
|
t1.auditor,
|
|
|
|
t1.audit_reason,
|
|
|
|
t1.is_publish,
|
|
|
|
t1.publish_time,
|
|
|
|
t1.is_can_claim,
|
|
|
|
t1.is_usable,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.modifier,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
api_api t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="apiId != null and apiId != ''">
|
|
|
|
AND
|
|
|
|
t1.api_id = #{apiId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 接口详情 -->
|
|
|
|
<select id="getPO" parameterType="map" resultMap="apiPO">
|
|
|
|
SELECT
|
|
|
|
t1.api_id,
|
|
|
|
t1.system_id,
|
|
|
|
t1.title,
|
|
|
|
t1.summary,
|
|
|
|
t1.url,
|
|
|
|
t1.method,
|
|
|
|
t1.request_example_url,
|
|
|
|
t1.request_example_body,
|
|
|
|
t1.response_success_example,
|
|
|
|
t1.response_fail_example,
|
|
|
|
t1.audit_status,
|
|
|
|
t1.audit_time,
|
|
|
|
t1.auditor,
|
|
|
|
t1.audit_reason,
|
|
|
|
t1.is_publish,
|
|
|
|
t1.publish_time,
|
|
|
|
t1.is_can_claim,
|
|
|
|
t1.is_usable,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.modifier,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
api_api t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="apiId != null and apiId != ''">
|
|
|
|
AND
|
|
|
|
t1.api_id = #{apiId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 接口列表 -->
|
|
|
|
<select id="list" parameterType="map" resultMap="apiDTO">
|
|
|
|
SELECT
|
|
|
|
t1.api_id,
|
|
|
|
t1.system_id,
|
|
|
|
t1.title,
|
|
|
|
t1.summary,
|
|
|
|
t1.url,
|
|
|
|
t1.method,
|
|
|
|
t1.request_example_url,
|
|
|
|
t1.request_example_body,
|
|
|
|
t1.response_success_example,
|
|
|
|
t1.response_fail_example,
|
|
|
|
t1.audit_status,
|
|
|
|
t1.audit_time,
|
|
|
|
t1.auditor,
|
|
|
|
t1.audit_reason,
|
|
|
|
t1.is_publish,
|
|
|
|
t1.publish_time,
|
|
|
|
t1.is_can_claim,
|
|
|
|
t1.is_usable,
|
|
|
|
t1.gmt_create,
|
2021-08-23 16:04:14 +08:00
|
|
|
t1.gmt_modified
|
2021-08-16 16:52:28 +08:00
|
|
|
FROM
|
|
|
|
api_api t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="keywords != null and keywords != ''">
|
|
|
|
AND (
|
2021-08-23 16:04:14 +08:00
|
|
|
t1.title LIKE CONCAT('%', #{keywords}, '%')
|
2021-08-16 16:52:28 +08:00
|
|
|
)
|
|
|
|
</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>
|
2021-08-23 16:04:14 +08:00
|
|
|
<if test="auditStartTime != null and auditStartTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.audit_time, 10) <![CDATA[ >= ]]> #{auditStartTime}
|
|
|
|
</if>
|
|
|
|
<if test="auditEndTime != null and auditEndTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.audit_time, 10) <![CDATA[ <= ]]> #{auditEndTime}
|
|
|
|
</if>
|
|
|
|
<if test="auditStatus != null and auditStatus">
|
|
|
|
AND
|
|
|
|
t1.audit_status = #{auditStatus}
|
|
|
|
</if>
|
2021-08-16 16:52:28 +08:00
|
|
|
<if test="apiIds != null and apiIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.api_id IN
|
|
|
|
<foreach collection="apiIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{apiIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
2021-12-13 20:43:43 +08:00
|
|
|
<if test="systemIds != null and systemIds != ''">
|
|
|
|
AND
|
|
|
|
t1.system_id IN
|
|
|
|
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{systemIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
2021-08-23 16:04:14 +08:00
|
|
|
<if test="creator != null and creator != ''">
|
|
|
|
AND
|
|
|
|
t1.creator = #{creator}
|
|
|
|
</if>
|
|
|
|
<if test="claimApiIds != null and claimApiIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.api_id IN
|
|
|
|
<foreach collection="claimApiIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{claimApiIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
<if test="unclaimedApiIds != null and unclaimedApiIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.api_id NOT IN
|
|
|
|
<foreach collection="unclaimedApiIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{unclaimedApiIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
2021-08-16 16:52:28 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 接口列表 -->
|
|
|
|
<select id="listBO" parameterType="map" resultMap="apiBO">
|
|
|
|
SELECT
|
|
|
|
t1.api_id,
|
|
|
|
t1.system_id,
|
|
|
|
t1.title,
|
|
|
|
t1.summary,
|
|
|
|
t1.url,
|
|
|
|
t1.method,
|
|
|
|
t1.request_example_url,
|
|
|
|
t1.request_example_body,
|
|
|
|
t1.response_success_example,
|
|
|
|
t1.response_fail_example,
|
|
|
|
t1.audit_status,
|
|
|
|
t1.audit_time,
|
|
|
|
t1.auditor,
|
|
|
|
t1.audit_reason,
|
|
|
|
t1.is_publish,
|
|
|
|
t1.publish_time,
|
|
|
|
t1.is_can_claim,
|
|
|
|
t1.is_usable,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.modifier,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
api_api 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="apiIds != null and apiIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.api_id IN
|
|
|
|
<foreach collection="apiIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{apiIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 接口列表 -->
|
|
|
|
<select id="listPO" parameterType="map" resultMap="apiPO">
|
|
|
|
SELECT
|
|
|
|
t1.api_id,
|
|
|
|
t1.system_id,
|
|
|
|
t1.title,
|
|
|
|
t1.summary,
|
|
|
|
t1.url,
|
|
|
|
t1.method,
|
|
|
|
t1.request_example_url,
|
|
|
|
t1.request_example_body,
|
|
|
|
t1.response_success_example,
|
|
|
|
t1.response_fail_example,
|
|
|
|
t1.audit_status,
|
|
|
|
t1.audit_time,
|
|
|
|
t1.auditor,
|
|
|
|
t1.audit_reason,
|
|
|
|
t1.is_publish,
|
|
|
|
t1.publish_time,
|
|
|
|
t1.is_can_claim,
|
|
|
|
t1.is_usable,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.modifier,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
api_api 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="apiIds != null and apiIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.api_id IN
|
|
|
|
<foreach collection="apiIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{apiIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 接口统计 -->
|
|
|
|
<select id="count" parameterType="map" resultType="Integer">
|
|
|
|
SELECT
|
|
|
|
COUNT(*)
|
|
|
|
FROM
|
|
|
|
api_api t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
</select>
|
|
|
|
|
2021-08-23 16:04:14 +08:00
|
|
|
<!-- 获取审核结果 -->
|
|
|
|
<select id="getExamineResult" parameterType="map" resultMap="examineDTO">
|
|
|
|
SELECT
|
|
|
|
t1.audit_status,
|
|
|
|
t1.audit_time,
|
|
|
|
t1.auditor,
|
|
|
|
t1.audit_reason
|
|
|
|
FROM
|
|
|
|
api_api t1
|
|
|
|
WHERE
|
2021-12-13 20:43:43 +08:00
|
|
|
t1.is_delete = 0
|
|
|
|
AND
|
2021-08-23 16:04:14 +08:00
|
|
|
t1.api_id = #{apiId}
|
|
|
|
</select>
|
|
|
|
|
2021-12-13 20:43:43 +08:00
|
|
|
<!-- 接口ID列表 -->
|
|
|
|
<select id="listId" parameterType="map" resultType="String">
|
|
|
|
SELECT
|
|
|
|
api_id
|
|
|
|
FROM
|
|
|
|
api_api
|
|
|
|
WHERE
|
|
|
|
is_delete = 0
|
|
|
|
<if test="systemIds != null and systemIds.size > 0">
|
|
|
|
AND
|
|
|
|
system_id IN
|
|
|
|
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{systemIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
2021-08-16 16:52:28 +08:00
|
|
|
</mapper>
|