<?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.iailab.module.data.gateway.dao.ApiAuthorizedDao">
|
<resultMap id="ApiAuthorizedEntity" type="com.iailab.module.data.gateway.entity.ApiAuthorizedEntity">
|
<result property="id" column="id"/>
|
<result property="appId" column="app_id"/>
|
<result property="appKey" column="app_key"/>
|
<result property="serverName" column="server_name"/>
|
<result property="apiId" column="api_id"/>
|
<result property="apiName" column="api_name"/>
|
<result property="limitMin" column="limit_min"/>
|
<result property="limitHour" column="limit_hour"/>
|
<result property="limitDay" column="limit_day"/>
|
<result property="createTime" column="create_time"/>
|
</resultMap>
|
|
<resultMap id="SysGatewayApi" type="com.iailab.module.data.gateway.vo.SysGatewayApi">
|
<result property="appKey" column="app_key"/>
|
<result property="apiStatus" column="api_status"/>
|
<result property="apiAddress" column="api_address"/>
|
<result property="serverName" column="server_name"/>
|
</resultMap>
|
|
<select id="queryList" parameterType="map" resultMap="ApiAuthorizedEntity">
|
SELECT t1.*,
|
t2.api_name,
|
t2.api_address,
|
t3.server_name
|
FROM t_api_authorized t1
|
LEFT JOIN t_api_info t2 ON t2.id = t1.api_id
|
LEFT JOIN t_api_server t3 ON t3.id = t2.api_server_id
|
<where>
|
<if test="params.appId != null and params.appId != ''">
|
AND t1.app_id = #{params.appId}
|
</if>
|
</where>
|
ORDER BY t1.create_time DESC
|
</select>
|
|
<select id="queryListGatewayApi" parameterType="map" resultMap="SysGatewayApi">
|
SELECT
|
t1.app_key,
|
t2.api_address,
|
t3.server_name,
|
t2.status as api_status
|
FROM
|
t_api_authorized t1
|
LEFT JOIN t_api_info t2 ON t2.id = t1.api_id
|
LEFT JOIN t_api_server t3 ON t3.id = t2.api_server_id
|
<where>
|
<if test="apiStatus != null and apiStatus != ''">
|
AND t2.status = #{apiStatus}
|
</if>
|
<if test="serverStatus != null and serverStatus != ''">
|
AND t3.status = #{serverStatus}
|
</if>
|
</where>
|
</select>
|
|
</mapper>
|