<?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.wecloud.im.mapper.ImClientBlacklistMapper">

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id
        , create_time, update_time, fk_appid, fk_client_id_prevent, fk_client_id_be_prevent
    </sql>

    <select id="getImClientBlacklistById" resultType="com.wecloud.im.param.ImClientBlacklistQueryVo">
        select
        <include refid="Base_Column_List"/>
        from im_client_blacklist where id = #{id}
    </select>

    <select id="getImClientBlacklistPageList" resultType="com.wecloud.im.param.ImClientBlacklistQueryVo">
        SELECT im_client.client_id AS clientIdBePrevent
        FROM im_client_blacklist
                 INNER JOIN im_client ON im_client.id = im_client_blacklist.fk_client_id_be_prevent
        WHERE im_client_blacklist.fk_client_id_prevent = #{clientId}
    </select>

    <!--    <select id="getImClientBlacklistPageList" parameterType="com.wecloud.im.param.ImClientBlacklistPageParam"-->
    <!--            resultType="com.wecloud.im.param.ImClientBlacklistQueryVo">-->
    <!--        select-->
    <!--        <include refid="Base_Column_List"/>-->
    <!--        from im_client_blacklist-->
    <!--    </select>-->

</mapper>
