<?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="cn.xluobo.business.wechat.cp.repo.mapper.WechatCpContactWayMapper">

    <select id="selectForSearchTable" resultType="cn.xluobo.business.wechat.cp.domain.req.RespWechatCpContactWay">
        select a.*,
               (select group_concat(name) from wechat_cp_user b where find_in_set(b.userid, a.user)) as user_names,
               (select group_concat(name) from wechat_cp_group_tag b where find_in_set(b.tag_id, a.add_tag)) as add_tag_names
        from wechat_cp_contact_way a  where 1=1
        <if test="reqSearchWechatCpContactWay.scene != null and reqSearchWechatCpContactWay.scene != ''">
            and a.scene = #{reqSearchWechatCpContactWay.scene}
        </if>
    </select>
</mapper>
