|
|
@@ -230,12 +230,15 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
|
|
|
public int deleteQwExternalContactByIds(Long[] ids);
|
|
|
|
|
|
@Select({"<script> " +
|
|
|
- "select ec.*,qu.qw_user_name,qd.dept_name as departmentName,cw.name way_name,wg.group_name way_group_name from qw_external_contact ec " +
|
|
|
+ "select ec.*,qu.qw_user_name,qd.dept_name as departmentName,cw.name way_name,wg.group_name way_group_name, " +
|
|
|
+ "case when fsuser.history_app is not null then '是' else '否' end as is_download_app " +
|
|
|
+ " from qw_external_contact ec " +
|
|
|
"left join qw_user qu on ec.user_id=qu.qw_user_id and qu.corp_id=ec.corp_id " +
|
|
|
"left join qw_dept qd on qd.dept_id=qu.department and qd.corp_id=qu.corp_id " +
|
|
|
"left join company_user cu on ec.company_user_id=cu.user_id " +
|
|
|
"left join qw_contact_way cw on cw.id = ec.way_id " +
|
|
|
- "left join qw_contact_way_group wg on wg.id=cw.group_id" +
|
|
|
+ "left join qw_contact_way_group wg on wg.id=cw.group_id " +
|
|
|
+ "left join fs_user fsuser on ec.fs_user_id = fsuser.user_id " +
|
|
|
"<where> \n" +
|
|
|
" <if test=\"userId != null and userId != ''\"> and ec.user_id like concat( #{userId}, '%') </if>\n" +
|
|
|
" <if test=\"qwUserName != null and qwUserName != ''\"> and qu.qw_user_name like concat( #{qwUserName}, '%') </if>\n" +
|
|
|
@@ -302,6 +305,14 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
|
|
|
"<if test ='companyUser!=null'> " +
|
|
|
"and (cu.nick_name like concat('%', #{companyUser}, '%') or cu.phonenumber= #{companyUser})"+
|
|
|
"</if> " +
|
|
|
+ "<if test = 'isDownloadApp != null'>" +
|
|
|
+ " <if test='isDownloadApp == 1'> "+
|
|
|
+ " and fsuser.history_app is not null " +
|
|
|
+ " </if>" +
|
|
|
+ " <if test='isDownloadApp == 0'>" +
|
|
|
+ " and fsuser.history_app is null " +
|
|
|
+ " </if>" +
|
|
|
+ "</if>" +
|
|
|
" </where>"+
|
|
|
"order by ec.create_time desc,ec.id desc"+
|
|
|
"</script>"})
|