<?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.ads.business.dao.DocConversationRelDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ads.business.entity.DocConversationRel">
        <id column="id" property="id" />
        <result column="doc_id" property="docId" />
        <result column="chat_id" property="chatId" />
        <result column="open_conversation_id" property="openConversationId" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, doc_id, chat_id, open_conversation_id
    </sql>

    <select id="getListByDocId" resultType="java.lang.String">
        select
            hcur.phone
        FROM
            hsay_doc_conversation_rel hdcr
            LEFT JOIN hsay_conversation_user_rel hcur ON hdcr.chat_id = hcur.chat_id
        WHERE
            hdcr.doc_id =  #{id} and hcur.phone = #{mobile}

    </select>

</mapper>
