潘志宝
2024-08-15 31802db28f0dd6f34b50e6e588591ad1d6c3e4c1
提交 | 用户 | 时间
a6de49 1 <?xml version="1.0" encoding="UTF-8"?>
H 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.iailab.module.data.gateway.dao.ApiInfoDao">
4     <resultMap id="ApiInfoEntity" type="com.iailab.module.data.gateway.entity.ApiInfoEntity">
5         <result property="id" column="id"/>
6         <result property="apiName" column="api_name"/>
7         <result property="apiGroupId" column="api_group_id"/>
8         <result property="groupName" column="group_name"/>
9         <result property="apiServerId" column="api_server_id"/>
10         <result property="serverName" column="server_name"/>
11         <result property="apiDesc" column="api_desc"/>
12         <result property="apiAddress" column="api_address"/>
13         <result property="status" column="status"/>
14         <result property="createTime" column="create_time"/>
15     </resultMap>
16     <select id="queryList" parameterType="map" resultMap="ApiInfoEntity">
17         SELECT t1.*,
18         t2.group_name,
19         t3.server_name
20         FROM t_api_info t1
21         LEFT JOIN t_api_group t2 ON t2.id = t1.api_group_id
22         LEFT JOIN t_api_server t3 ON t3.id = t1.api_server_id
23         <where>
24             <if test="params.apiName != null and params.apiName != ''">
25                 AND t1.api_name LIKE CONCAT('%', #{params.apiName}, '%')
26             </if>
27             <if test="params.groupName != null and params.groupName != ''">
28                 AND t2.group_name LIKE CONCAT('%', #{params.groupName}, '%')
29             </if>
30             <if test="params.serverName != null and params.serverName != ''">
31                 AND t3.server_name LIKE CONCAT('%', #{params.serverName}, '%')
32             </if>
33         </where>
34         ORDER BY t1.create_time DESC
35     </select>
36
37 </mapper>