houzhongjian
2024-07-23 a6de490948278991e47952e90671ddba4555e9a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?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.ApiInfoDao">
    <resultMap id="ApiInfoEntity" type="com.iailab.module.data.gateway.entity.ApiInfoEntity">
        <result property="id" column="id"/>
        <result property="apiName" column="api_name"/>
        <result property="apiGroupId" column="api_group_id"/>
        <result property="groupName" column="group_name"/>
        <result property="apiServerId" column="api_server_id"/>
        <result property="serverName" column="server_name"/>
        <result property="apiDesc" column="api_desc"/>
        <result property="apiAddress" column="api_address"/>
        <result property="status" column="status"/>
        <result property="createTime" column="create_time"/>
    </resultMap>
    <select id="queryList" parameterType="map" resultMap="ApiInfoEntity">
        SELECT t1.*,
        t2.group_name,
        t3.server_name
        FROM t_api_info t1
        LEFT JOIN t_api_group t2 ON t2.id = t1.api_group_id
        LEFT JOIN t_api_server t3 ON t3.id = t1.api_server_id
        <where>
            <if test="params.apiName != null and params.apiName != ''">
                AND t1.api_name LIKE CONCAT('%', #{params.apiName}, '%')
            </if>
            <if test="params.groupName != null and params.groupName != ''">
                AND t2.group_name LIKE CONCAT('%', #{params.groupName}, '%')
            </if>
            <if test="params.serverName != null and params.serverName != ''">
                AND t3.server_name LIKE CONCAT('%', #{params.serverName}, '%')
            </if>
        </where>
        ORDER BY t1.create_time DESC
    </select>
 
</mapper>