Просмотр исходного кода

feat:企微客户添加是否下载app筛选条件

caoliqin 6 дней назад
Родитель
Сommit
dcd374f1dc

+ 11 - 3
fs-service/src/main/java/com/fs/qw/mapper/QwExternalContactMapper.java

@@ -1,8 +1,6 @@
 package com.fs.qw.mapper;
 package com.fs.qw.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.fs.common.annotation.DataSource;
-import com.fs.common.enums.DataSourceType;
 import com.fs.fastGpt.domain.FastgptChatArtificialWords;
 import com.fs.fastGpt.domain.FastgptChatArtificialWords;
 import com.fs.hisStore.vo.FsStoreOrderScrmSidebarVO;
 import com.fs.hisStore.vo.FsStoreOrderScrmSidebarVO;
 import com.fs.qw.domain.QwExternalContact;
 import com.fs.qw.domain.QwExternalContact;
@@ -15,7 +13,6 @@ import com.fs.qw.result.QwExternalContactVo;
 import com.fs.qw.vo.*;
 import com.fs.qw.vo.*;
 import com.fs.qw.vo.newvo.ExternalContactListVO;
 import com.fs.qw.vo.newvo.ExternalContactListVO;
 import com.fs.qw.vo.newvo.ExternalContactNumVO;
 import com.fs.qw.vo.newvo.ExternalContactNumVO;
-import com.fs.qw.vo.sidebar.ExternalContactQwUserVO;
 import com.fs.qwApi.param.QwExternalContactHParam;
 import com.fs.qwApi.param.QwExternalContactHParam;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Select;
@@ -241,6 +238,7 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
             "select c.id from qw_external_ai_analyze c " +
             "select c.id from qw_external_ai_analyze c " +
             "where c.qw_user_id = ec.user_id and c.external_user_id = ec.external_user_id and c.corp_id = ec.corp_id " +
             "where c.qw_user_id = ec.user_id and c.external_user_id = ec.external_user_id and c.corp_id = ec.corp_id " +
             "order by c.create_time desc limit 1) " +
             "order by c.create_time desc limit 1) " +
+            " <if test=\"isDownloadApp != null\"> left join fs_user fapp on fapp.user_id = ec.fs_user_id and fapp.is_del = 0 </if> " +
             "<where>  \n" +
             "<where>  \n" +
             "            <if test=\"id != null  and id != ''\"> and ec.id   like concat( #{id}, '%') </if>\n" +
             "            <if test=\"id != null  and id != ''\"> and ec.id   like concat( #{id}, '%') </if>\n" +
             "            <if test=\"userId != null  and userId != ''\"> and ec.user_id   like concat( #{userId}, '%') </if>\n" +
             "            <if test=\"userId != null  and userId != ''\"> and ec.user_id   like concat( #{userId}, '%') </if>\n" +
@@ -307,6 +305,16 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
             "<if test ='companyUser!=null'> " +
             "<if test ='companyUser!=null'> " +
                 "and (cu.nick_name like concat('%', #{companyUser}, '%') or cu.phonenumber= #{companyUser})"+
                 "and (cu.nick_name like concat('%', #{companyUser}, '%') or cu.phonenumber= #{companyUser})"+
             "</if> " +
             "</if> " +
+            "            <if test=\"isDownloadApp != null\"> \n" +
+            "                <choose> \n" +
+            "                    <when test=\"isDownloadApp == 1\"> \n" +
+            "                        and ec.fs_user_id is not null and fapp.user_id is not null and (fapp.source is not null or fapp.login_device is not null) \n" +
+            "                    </when> \n" +
+            "                    <when test=\"isDownloadApp == 0\"> \n" +
+            "                        and (ec.fs_user_id is null or fapp.user_id is null or (fapp.source is null and fapp.login_device is null)) \n" +
+            "                    </when> \n" +
+            "                </choose> \n" +
+            "            </if> \n" +
             "        </where>"+
             "        </where>"+
             "order by ec.create_time desc,ec.id desc"+
             "order by ec.create_time desc,ec.id desc"+
             "</script>"})
             "</script>"})

+ 6 - 0
fs-service/src/main/java/com/fs/qw/param/QwExternalContactParam.java

@@ -155,4 +155,10 @@ public class QwExternalContactParam {
      */
      */
     private Integer isReply;
     private Integer isReply;
 
 
+    /**
+     * 是否已下载/使用 app:1-是 0-否;
+     */
+    @TableField(exist = false)
+    private Integer isDownloadApp;
+
 }
 }