<?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.hhh.cloud.framework.example.client.mapper.SysClientMapper">

    <select id="list" resultType="com.hhh.cloud.framework.example.client.entity.SysClient">
        SELECT client_key, client_ip, client_name, owner, secret, status, created_date FROM sys_client WHERE 1=1
        <if test="map.clientName != null and map.clientName != ''">
            and client_name=#{map.clientName}
        </if>
        <if test="map.statuses != null and map.status.size() > 0 ">
            and status in
            <foreach collection="map.statuses" item="status" index="index" open="(" close=")" separator=",">
                #{status}
            </foreach>
        </if>
        <include refid="com.hhh.cloud.framework.command.mapper.CommandMapper.tableLogic" />  <!-- 逻辑删除 -->
        ORDER BY created_date DESC
    </select>
</mapper>
