|
|
@@ -2482,4 +2482,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
order by user_id desc
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 查询企业微信外部联系人用户列表 -->
|
|
|
+ <select id="selectFsUserListVOByExternalContact" resultType="com.fs.his.vo.FsUserVO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ f1.*,
|
|
|
+ f2.nick_name AS tui_name,
|
|
|
+ f2.phone AS tui_phone
|
|
|
+ FROM qw_external_contact cuu
|
|
|
+ LEFT JOIN fs_user f1 ON cuu.fs_user_id = f1.user_id
|
|
|
+ LEFT JOIN fs_user f2 ON f1.tui_user_id = f2.user_id
|
|
|
+ WHERE f1.is_del = 0
|
|
|
+ <if test="companyUserId != null">
|
|
|
+ AND cuu.company_user_id = #{companyUserId}
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ AND cuu.company_id = #{companyId}
|
|
|
+ </if>
|
|
|
+ <if test="nickName != null and nickName != ''">
|
|
|
+ AND f1.nick_name LIKE CONCAT(#{nickName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="avatar != null and avatar != ''">
|
|
|
+ AND f1.avatar = #{avatar}
|
|
|
+ </if>
|
|
|
+ <if test="phone != null and phone != ''">
|
|
|
+ AND f1.phone LIKE CONCAT('%', #{phone}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ AND f1.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="isBuy != null">
|
|
|
+ AND f1.is_buy = #{isBuy}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ AND f1.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="tuiUserId != null and tuiUserId != ''">
|
|
|
+ AND f1.tui_user_id = #{tuiUserId}
|
|
|
+ </if>
|
|
|
+ <if test="tuiTime != null">
|
|
|
+ AND f1.tui_time = #{tuiTime}
|
|
|
+ </if>
|
|
|
+ <if test="userCode != null and userCode != ''">
|
|
|
+ AND f1.user_code = #{userCode}
|
|
|
+ </if>
|
|
|
+ <if test="lastIp != null and lastIp != ''">
|
|
|
+ AND f1.last_ip = #{lastIp}
|
|
|
+ </if>
|
|
|
+ <if test="sTime != null">
|
|
|
+ AND f1.create_time >= #{sTime}
|
|
|
+ </if>
|
|
|
+ <if test="eTime != null">
|
|
|
+ <![CDATA[
|
|
|
+ AND f1.create_time < DATE_ADD(#{eTime}, INTERVAL 1 DAY)
|
|
|
+ ]]>
|
|
|
+ </if>
|
|
|
+ ORDER BY f1.user_id DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|