Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
仟微科技
Link Wechat
提交
66627870
Link Wechat
项目概览
仟微科技
/
Link Wechat
通知
48
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Link Wechat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
66627870
编写于
11月 06, 2020
作者:
S
sunxiwang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
客户条件查询功能完善;
客户同步异步采用多线程方式,调用批量获取客户详情接口优化同步速度; 客户列表导出暂时可以导出客户基本信息
上级
f2bf716f
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
411 addition
and
250 deletion
+411
-250
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
...linkwechat/web/controller/wecom/WeCustomerController.java
+30
-18
linkwe-admin/src/main/resources/application.yml
linkwe-admin/src/main/resources/application.yml
+6
-5
linkwe-common/src/main/java/com/linkwechat/common/constant/WeConstans.java
.../main/java/com/linkwechat/common/constant/WeConstans.java
+2
-1
linkwe-common/src/main/java/com/linkwechat/common/utils/Threads.java
...on/src/main/java/com/linkwechat/common/utils/Threads.java
+14
-5
linkwe-framework/src/main/java/com/linkwechat/framework/manager/ShutdownManager.java
...ava/com/linkwechat/framework/manager/ShutdownManager.java
+3
-0
linkwe-ui/src/api/customer/index.js
linkwe-ui/src/api/customer/index.js
+10
-0
linkwe-ui/src/views/customerManage/customer.vue
linkwe-ui/src/views/customerManage/customer.vue
+26
-4
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerClient.java
...in/java/com/linkwechat/wecom/client/WeCustomerClient.java
+10
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
...src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
+13
-3
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/customer/ExternalUserDetail.java
...kwechat/wecom/domain/dto/customer/ExternalUserDetail.java
+21
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/customer/ExternalUserList.java
...inkwechat/wecom/domain/dto/customer/ExternalUserList.java
+4
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
...in/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
+6
-6
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
...java/com/linkwechat/wecom/service/IWeCustomerService.java
+11
-2
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeAccessTokenServiceImpl.java
...nkwechat/wecom/service/impl/WeAccessTokenServiceImpl.java
+1
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
.../linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
+210
-194
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
...ecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
+44
-12
未找到文件。
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
浏览文件 @
66627870
...
...
@@ -8,10 +8,13 @@ import com.linkwechat.common.core.controller.BaseController;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.utils.Threads
;
import
com.linkwechat.common.utils.poi.ExcelUtil
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.context.SecurityContext
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -62,27 +65,27 @@ public class WeCustomerController extends BaseController
return
AjaxResult
.
success
(
weCustomerService
.
getCustomersByUserId
(
userId
));
}
//
/**
//
* 导出企业微信客户列表
//
*/
//
@PreAuthorize("@ss.hasPermi('wecom:customer:export')")
//
@Log(title = "企业微信客户", businessType = BusinessType.EXPORT)
//
@GetMapping("/export")
//
public AjaxResult export(WeCustomer weCustomer)
//
{
//
List<WeCustomer> list = weCustomerService.selectWeCustomerList(weCustomer);
//
ExcelUtil<WeCustomer> util = new ExcelUtil<WeCustomer>(WeCustomer.class);
//
return util.exportExcel(list, "customer");
//
}
/**
* 导出企业微信客户列表
*/
@PreAuthorize
(
"@ss.hasPermi('wecom:customer:export')"
)
@Log
(
title
=
"企业微信客户"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
WeCustomer
weCustomer
)
{
List
<
WeCustomer
>
list
=
weCustomerService
.
selectWeCustomerList
(
weCustomer
);
ExcelUtil
<
WeCustomer
>
util
=
new
ExcelUtil
<
WeCustomer
>(
WeCustomer
.
class
);
return
util
.
exportExcel
(
list
,
"customer"
);
}
/**
* 获取企业微信客户详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('customerManage:customer:view')"
)
@GetMapping
(
value
=
"/{
i
d}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"
id"
)
Long
i
d
)
@GetMapping
(
value
=
"/{
externalUserI
d}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"
externalUserId"
)
String
externalUserI
d
)
{
return
AjaxResult
.
success
(
weCustomerService
.
selectWeCustomerById
(
i
d
));
return
AjaxResult
.
success
(
weCustomerService
.
selectWeCustomerById
(
externalUserI
d
));
}
...
...
@@ -108,9 +111,18 @@ public class WeCustomerController extends BaseController
@Log
(
title
=
"企业微信客户同步接口"
,
businessType
=
BusinessType
.
DELETE
)
@GetMapping
(
"/synchWeCustomer"
)
public
AjaxResult
synchWeCustomer
(){
weCustomerService
.
synchWeCustomer
();
SecurityContext
securityContext
=
SecurityContextHolder
.
getContext
();
try
{
Threads
.
SINGLE_THREAD_POOL
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
SecurityContextHolder
.
setContext
(
securityContext
);
weCustomerService
.
synchWeCustomer
();
}
});
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
AjaxResult
.
success
(
WeConstans
.
SYNCH_TIP
);
}
...
...
linkwe-admin/src/main/resources/application.yml
浏览文件 @
66627870
...
...
@@ -44,7 +44,7 @@ spring:
messages
:
# 国际化资源文件路径
basename
:
i18n/messages
profiles
:
profiles
:
active
:
druid
# 文件上传
servlet
:
...
...
@@ -65,7 +65,7 @@ spring:
# 端口,默认为6379
port
:
6379
# 密码
password
:
password
:
# 连接超时时间
timeout
:
10s
lettuce
:
...
...
@@ -105,11 +105,11 @@ mybatis-plus:
# configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper
:
pagehelper
:
helperDialect
:
mysql
reasonable
:
true
supportMethodsArguments
:
true
params
:
count=countSql
params
:
count=countSql
# Swagger配置
swagger
:
...
...
@@ -119,7 +119,7 @@ swagger:
pathMapping
:
# 防止XSS攻击
xss
:
xss
:
# 过滤开关
enabled
:
true
# 排除链接(多个用逗号分隔)
...
...
@@ -148,6 +148,7 @@ wecome:
-
/externalcontact/edit_corp_tag
-
/externalcontact/list
-
/externalcontact/get
-
/externalcontact/batch/get_by_user
-
/externalcontact/groupchat/list
-
/externalcontact/groupchat/get
-
/externalcontact/mark_tag
...
...
linkwe-common/src/main/java/com/linkwechat/common/constant/WeConstans.java
浏览文件 @
66627870
...
...
@@ -170,5 +170,6 @@ public class WeConstans {
public
static
final
String
COMMA
=
","
;
public
static
final
String
USER_ID
=
"userid"
;
public
static
final
String
CURSOR
=
"cursor"
;
}
linkwe-common/src/main/java/com/linkwechat/common/utils/Threads.java
浏览文件 @
66627870
package
com.linkwechat.common.utils
;
import
java.util.concurrent.CancellationException
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.*
;
import
com.google.common.util.concurrent.ThreadFactoryBuilder
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -17,6 +15,17 @@ public class Threads
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Threads
.
class
);
private
static
final
int
CORE_POOL_SIZE
=
Runtime
.
getRuntime
().
availableProcessors
();
private
static
final
ThreadFactory
NAMED_THREAD_FACTORY
=
new
ThreadFactoryBuilder
().
setNameFormat
(
"common-pool-%d"
).
build
();
/**
* 创建线程池
*/
public
static
final
ThreadPoolExecutor
SINGLE_THREAD_POOL
=
new
ThreadPoolExecutor
(
CORE_POOL_SIZE
,
CORE_POOL_SIZE
+
1
,
10
l
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
1024
),
NAMED_THREAD_FACTORY
);
/**
* sleep等待,单位为毫秒
*/
...
...
linkwe-framework/src/main/java/com/linkwechat/framework/manager/ShutdownManager.java
浏览文件 @
66627870
package
com.linkwechat.framework.manager
;
import
com.linkwechat.common.utils.Threads
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
...
...
@@ -30,6 +31,8 @@ public class ShutdownManager
{
logger
.
info
(
"====关闭后台任务任务线程池===="
);
AsyncManager
.
me
().
shutdown
();
logger
.
info
(
"====关闭后台线程池===="
);
Threads
.
shutdownAndAwaitTermination
(
Threads
.
SINGLE_THREAD_POOL
);
}
catch
(
Exception
e
)
{
...
...
linkwe-ui/src/api/customer/index.js
浏览文件 @
66627870
...
...
@@ -17,6 +17,7 @@ const service = config.services.wecom + '/customer'
export
function
getList
(
params
)
{
return
request
({
url
:
service
+
'
/list
'
,
method
:
'
get
'
,
params
})
}
...
...
@@ -84,4 +85,13 @@ export function updateBirthday(data) {
method
:
'
PUT
'
,
data
})
}
// 导出用户
export
function
exportCustomer
(
query
)
{
return
request
({
url
:
service
+
'
/export
'
,
method
:
'
get
'
,
params
:
query
})
}
\ No newline at end of file
linkwe-ui/src/views/customerManage/customer.vue
浏览文件 @
66627870
...
...
@@ -15,7 +15,7 @@ export default {
pageNum
:
1
,
pageSize
:
10
,
name
:
""
,
// "客户名称",
userId
:
""
,
// "添加人id",
userId
s
:
""
,
// "添加人id",
tagIds
:
""
,
// "标签id,多个标签,id使用逗号隔开",
beginTime
:
""
,
// "开始时间",
endTime
:
""
,
// "结束时间"
...
...
@@ -96,6 +96,9 @@ export default {
if
(
this
.
dateRange
[
0
])
{
this
.
query
.
beginTime
=
this
.
dateRange
[
0
];
this
.
query
.
endTime
=
this
.
dateRange
[
1
];
}
else
{
this
.
query
.
beginTime
=
""
;
this
.
query
.
endTime
=
""
;
}
page
&&
(
this
.
query
.
pageNum
=
page
);
this
.
loading
=
true
;
...
...
@@ -173,11 +176,30 @@ export default {
api
.
sync
().
then
(()
=>
{
loading
.
close
();
this
.
msgSuccess
(
"
后台开始同步数据,请稍后关注进度
"
);
});
}).
catch
(
fail
=>
{
loading
.
close
();
console
.
log
(
fail
)
});;
},
/** 导出按钮操作 */
exportCustomer
()
{
const
queryParams
=
this
.
query
;
this
.
$confirm
(
"
是否确认导出所有客户数据项?
"
,
"
警告
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
})
.
then
(
function
()
{
return
api
.
exportCustomer
(
queryParams
);
})
.
then
((
response
)
=>
{
this
.
download
(
response
.
msg
);
})
.
catch
(
function
()
{});
},
selectedUser
(
list
)
{
this
.
queryUser
=
list
;
this
.
query
.
userId
=
list
.
map
((
d
)
=>
d
.
i
d
)
+
""
;
this
.
query
.
userId
s
=
list
.
map
((
d
)
=>
d
.
userI
d
)
+
""
;
},
submitSelectTag
(
formName
)
{
if
(
this
.
tagDialogType
.
type
===
"
query
"
)
{
...
...
@@ -267,7 +289,7 @@ export default {
<el-button
v-hasPermi=
"['customerManage:customer:export']"
type=
"cyan"
@
click=
"
isMoreFilter = !isMoreFilt
er"
@
click=
"
exportCustom
er"
>
导出列表
</el-button>
</el-form-item>
</el-form>
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerClient.java
浏览文件 @
66627870
...
...
@@ -10,6 +10,8 @@ import com.linkwechat.wecom.domain.dto.customer.ExternalUserDetail;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserList
;
import
com.linkwechat.wecom.domain.dto.customer.FollowUserList
;
import
java.util.Map
;
/**
* @description: 获取配置客户联系人功能的成员
* @author: HaoN
...
...
@@ -42,6 +44,14 @@ public interface WeCustomerClient {
@Request
(
url
=
"/externalcontact/get"
)
ExternalUserDetail
get
(
@Query
(
"external_userid"
)
String
externalUserid
);
/**
* 根据企业成员id批量获取客户详情
* @param query
* @return
*/
@Request
(
url
=
"/externalcontact/batch/get_by_user"
,
type
=
"POST"
)
ExternalUserList
getByUser
(
@DataObject
Map
<
String
,
Object
>
query
);
/**
* 修改客户备注信息
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
浏览文件 @
66627870
...
...
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.linkwechat.common.annotation.Excel
;
import
com.linkwechat.common.annotation.Excels
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
lombok.AllArgsConstructor
;
...
...
@@ -29,7 +31,7 @@ import javax.validation.constraints.NotBlank;
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"we_customer"
)
public
class
WeCustomer
public
class
WeCustomer
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -40,15 +42,18 @@ public class WeCustomer
private
String
externalUserid
;
/** 外部联系人名称 */
@Excel
(
name
=
"客户"
)
private
String
name
;
/** 外部联系人头像 */
private
String
avatar
;
/** 外部联系人的类型,1表示该外部联系人是微信用户,2表示该外部联系人是企业微信用户 */
@Excel
(
name
=
"客户类型"
,
readConverterExp
=
"1=微信,2=企业微信"
)
private
Integer
type
;
/** 外部联系人性别 0-未知 1-男性 2-女性 */
@Excel
(
name
=
"性别"
,
readConverterExp
=
"0=未知,1=男性,2=女性"
)
private
Integer
gender
;
/** 外部联系人在微信开放平台的唯一身份标识,通过此字段企业可将外部联系人与公众号/小程序用户关联起来。 */
...
...
@@ -60,6 +65,7 @@ public class WeCustomer
/** 客户企业简称 */
@Excel
(
name
=
"公司名称"
)
private
String
corpName
;
/** 客户企业全称 */
...
...
@@ -72,8 +78,12 @@ public class WeCustomer
@TableField
(
exist
=
false
)
private
List
<
WeFlowerCustomerRel
>
weFlowerCustomerRels
;
/** 添加人id */
@TableField
(
exist
=
false
)
private
String
userIds
;
/** 标签 */
@TableField
(
exist
=
false
)
private
String
tagIds
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/customer/ExternalUserDetail.java
浏览文件 @
66627870
...
...
@@ -21,6 +21,7 @@ public class ExternalUserDetail extends WeResultDto {
/** 客户联系人 */
private
List
<
FollowUser
>
follow_user
;
private
List
<
FollowInfo
>
follow_info
;
@Data
...
...
@@ -68,4 +69,24 @@ public class ExternalUserDetail extends WeResultDto {
private
List
<
ExternalUserTag
>
tags
;
}
@Data
public
class
FollowInfo
{
/**该成员对此外部联系人的备注*/
private
String
remark
;
/**该成员对此外部联系人的描述*/
private
String
description
;
/**该成员添加此外部联系人的时间*/
private
long
createtime
;
/**该成员对此客户备注的企业名称*/
private
String
remark_company
;
/**该成员对此客户备注的手机号码*/
private
String
[]
remark_mobiles
;
/**该成员添加此客户的来源*/
private
Integer
add_way
;
/**发起添加的userid,如果成员主动添加,为成员的userid;如果是客户主动添加,则为客户的外部联系人userid;如果是内部成员共享/管理员分配,则为对应的成员/管理员userid*/
private
String
oper_userid
;
/**标签**/
private
String
[]
tag_id
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/customer/ExternalUserList.java
浏览文件 @
66627870
...
...
@@ -3,6 +3,8 @@ package com.linkwechat.wecom.domain.dto.customer;
import
com.linkwechat.wecom.domain.dto.WeResultDto
;
import
lombok.Data
;
import
java.util.List
;
/**
* @description: 客户列表
* @author: HaoN
...
...
@@ -11,4 +13,6 @@ import lombok.Data;
@Data
public
class
ExternalUserList
extends
WeResultDto
{
private
String
[]
external_userid
;
private
List
<
ExternalUserDetail
>
external_contact_list
;
private
String
next_cursor
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
浏览文件 @
66627870
...
...
@@ -18,10 +18,10 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
/**
* 查询企业微信客户
*
* @param
i
d 企业微信客户ID
* @param
externalUserI
d 企业微信客户ID
* @return 企业微信客户
*/
public
WeCustomer
selectWeCustomerById
(
Long
i
d
);
public
WeCustomer
selectWeCustomerById
(
String
externalUserI
d
);
/**
* 查询企业微信客户列表
...
...
@@ -50,18 +50,18 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
/**
* 删除企业微信客户
*
* @param
i
d 企业微信客户ID
* @param
externalUserI
d 企业微信客户ID
* @return 结果
*/
public
int
deleteWeCustomerById
(
Long
i
d
);
public
int
deleteWeCustomerById
(
String
externalUserI
d
);
/**
* 批量删除企业微信客户
*
* @param
i
ds 需要删除的数据ID
* @param
externalUserI
ds 需要删除的数据ID
* @return 结果
*/
public
int
deleteWeCustomerByIds
(
Long
[]
i
ds
);
public
int
deleteWeCustomerByIds
(
String
[]
externalUserI
ds
);
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
浏览文件 @
66627870
...
...
@@ -19,10 +19,19 @@ public interface IWeCustomerService extends IService<WeCustomer>
/**
* 查询企业微信客户
*
* @param
i
d 企业微信客户ID
* @param
externalUserI
d 企业微信客户ID
* @return 企业微信客户
*/
public
WeCustomer
selectWeCustomerById
(
Long
id
);
public
WeCustomer
selectWeCustomerById
(
String
externalUserId
);
/**
* 新增/修改企业微信客户
*
* @param weCustomer 企业微信客户
* @return 修改结果
*/
@Override
public
boolean
saveOrUpdate
(
WeCustomer
weCustomer
);
/**
* 查询企业微信客户列表
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeAccessTokenServiceImpl.java
浏览文件 @
66627870
...
...
@@ -96,6 +96,7 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
if
(
StringUtils
.
isNotEmpty
(
token
)){
redisCache
.
setCacheObject
(
accessTokenKey
,
token
,
expires_in
.
intValue
(),
TimeUnit
.
SECONDS
);
weAccessToken
=
token
;
}
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
浏览文件 @
66627870
此差异已折叠。
点击以展开。
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
浏览文件 @
66627870
...
...
@@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectWeCustomerVo"
>
select
id,
external_userid, name, avatar, type, gender, unionid, birthday, corp_name, corp_full_name, position from we_customer
select external_userid, name, avatar, type, gender, unionid, birthday, corp_name, corp_full_name, position from we_customer
</sql>
<select
id=
"selectWeCustomerList"
parameterType=
"WeCustomer"
resultMap=
"WeCustomerResult"
>
...
...
@@ -73,17 +73,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN we_user wu ON wu.user_id=wfcr.user_id
LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.flower_customer_rel_id = wfcr.id
LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id
<where>
<if
test=
"name != null and name !=''"
>
AND wc.name like concat('%', #{name}, '%')
</if>
<if
test=
"userIds != null and userIds !=''"
>
<if
test=
"userIds.indexOf(',') != -1"
>
and wfcr.user_id in
<foreach
item=
"item"
index=
"index"
collection=
"userIds.split(',')"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"userIds.indexOf(',') == -1"
>
and wfcr.user_id=#{userIds}
</if>
</if>
<if
test=
"tagIds != null and tagIds !=''"
>
<if
test=
"tagIds.indexOf(',') != -1"
>
and wt.tag_id in
<foreach
item=
"item"
index=
"index"
collection=
"tagIds.split(',')"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"tagIds.indexOf(',') == -1"
>
and wt.tag_id=#{tagIds}
</if>
</if>
<if
test=
"beginTime != null and beginTime != ''"
>
<!-- 开始时间检索 -->
AND date_format(wfcr.create_time,'%y%m%d')
>
= date_format(#{beginTime},'%y%m%d')
</if>
<if
test=
"endTime != null and endTime != ''"
>
<!-- 结束时间检索 -->
AND date_format(wfcr.create_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
</if>
</where>
</select>
<select
id=
"selectWeCustomerById"
parameterType=
"
Lo
ng"
resultMap=
"WeCustomerResult"
>
<select
id=
"selectWeCustomerById"
parameterType=
"
Stri
ng"
resultMap=
"WeCustomerResult"
>
<include
refid=
"selectWeCustomerVo"
/>
where
id = #{i
d}
where
external_userid = #{externalUserI
d}
</select>
<insert
id=
"insertWeCustomer"
parameterType=
"WeCustomer"
>
insert into we_customer
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"externalUserid != null"
>
external_userid,
</if>
<if
test=
"name != null"
>
name,
</if>
<if
test=
"avatar != null"
>
avatar,
</if>
...
...
@@ -96,7 +129,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"position != null"
>
position,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id},
</if>
<if
test=
"externalUserid != null"
>
#{externalUserid},
</if>
<if
test=
"name != null"
>
#{name},
</if>
<if
test=
"avatar != null"
>
#{avatar},
</if>
...
...
@@ -124,17 +156,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"corpFullName != null"
>
corp_full_name = #{corpFullName},
</if>
<if
test=
"position != null"
>
position = #{position},
</if>
</trim>
where
id = #{
id}
where
external_userid = #{externalUser
id}
</update>
<delete
id=
"deleteWeCustomerById"
parameterType=
"
Lo
ng"
>
delete from we_customer where
id = #{i
d}
<delete
id=
"deleteWeCustomerById"
parameterType=
"
Stri
ng"
>
delete from we_customer where
external_userid = #{externalUserI
d}
</delete>
<delete
id=
"deleteWeCustomerByIds"
parameterType=
"String"
>
delete from we_customer where
id in
<foreach
item=
"i
d
"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{i
d
}
<delete
id=
"deleteWeCustomerByIds"
>
delete from we_customer where
external_userid in
<foreach
item=
"i
tem
"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{i
tem
}
</foreach>
</delete>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录