Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 70ae4164
authored
Oct 20, 2020
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改客户列表error
1 parent
d4197c7e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
216 additions
and
79 deletions
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCropTagClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeFlowerCustomerRel.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeFlowerCustomerTagRel.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/tag/WeFindCropTagParam.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeFlowerCustomerTagRelMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeFlowerCustomerTagRelService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeFlowerCustomerTagRelServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCropTagClient.java
View file @
70ae416
...
@@ -28,12 +28,22 @@ public interface WeCropTagClient {
...
@@ -28,12 +28,22 @@ public interface WeCropTagClient {
* @return
* @return
*/
*/
@Request
(
url
=
"/externalcontact/get_corp_tag_list"
,
@Request
(
url
=
"/externalcontact/get_corp_tag_list"
,
type
=
"POST"
type
=
"POST"
)
)
WeCropGroupTagListDto
getAllCorpTagList
();
WeCropGroupTagListDto
getAllCorpTagList
();
/**
/**
* 根据指定标签的id,获取标签详情
* @return
*/
@Request
(
url
=
"/externalcontact/get_corp_tag_list"
,
type
=
"POST"
)
WeCropGroupTagListDto
getCorpTagListByTagIds
(
@DataObject
WeFindCropTagParam
weFindCropTagParam
);
/**
* 删除企业客户标签
* 删除企业客户标签
* @param weCropDelDto
* @param weCropDelDto
* @return
* @return
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
View file @
70ae416
...
@@ -67,7 +67,7 @@ public class WeCustomer
...
@@ -67,7 +67,7 @@ public class WeCustomer
/** 添加人员 */
/** 添加人员 */
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
List
<
WeFlowerCustomerRel
>
weFlowerCustomerRels
;
private
List
<
WeFlowerCustomerRel
>
weFlowerCustomerRels
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeFlowerCustomerRel.java
View file @
70ae416
package
com
.
linkwechat
.
wecom
.
domain
;
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
...
@@ -28,9 +29,11 @@ public class WeFlowerCustomerRel
...
@@ -28,9 +29,11 @@ public class WeFlowerCustomerRel
{
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@TableId
private
Long
id
=
SnowFlakeUtil
.
nextId
();
/** 添加了此外部联系人的企业成员userid */
/** 添加了此外部联系人的企业成员userid */
@TableId
private
String
userId
;
private
String
userId
;
/** 外部联系人名称 */
/** 外部联系人名称 */
...
@@ -57,7 +60,7 @@ public class WeFlowerCustomerRel
...
@@ -57,7 +60,7 @@ public class WeFlowerCustomerRel
private
String
state
;
private
String
state
;
/** 客户id */
/** 客户id */
private
Long
customerI
d
;
private
String
externalUseri
d
;
/** 状态(0正常 1删除) */
/** 状态(0正常 1删除) */
private
String
status
;
private
String
status
;
...
@@ -66,6 +69,8 @@ public class WeFlowerCustomerRel
...
@@ -66,6 +69,8 @@ public class WeFlowerCustomerRel
private
Date
createTime
;
private
Date
createTime
;
/** 微信用户添加的标签 */
/** 微信用户添加的标签 */
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
List
<
WeFlowerCustomerTagRel
>
weFlowerCustomerTagRels
;
private
List
<
WeFlowerCustomerTagRel
>
weFlowerCustomerTagRels
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeFlowerCustomerTagRel.java
View file @
70ae416
package
com
.
linkwechat
.
wecom
.
domain
;
package
com
.
linkwechat
.
wecom
.
domain
;
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.core.domain.BaseEntity
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
/**
...
@@ -11,21 +21,30 @@ import lombok.Data;
...
@@ -11,21 +21,30 @@ import lombok.Data;
* @date 2020-09-19
* @date 2020-09-19
*/
*/
@Data
@Data
public
class
WeFlowerCustomerTagRel
extends
BaseEntity
@TableName
(
"we_flower_customer_tag_rel"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
WeFlowerCustomerTagRel
{
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
/** $column.columnComment */
private
Long
id
;
@TableId
private
Long
id
=
SnowFlakeUtil
.
nextId
();
/** 添加客户的企业微信用户 */
/** 添加客户的企业微信用户 */
private
Long
flowerCustomerRelId
;
private
Long
flowerCustomerRelId
;
/** 标签id */
/** 标签id */
private
Lo
ng
tagId
;
private
Stri
ng
tagId
;
/** 标签名 */
/** 标签名 */
@TableField
(
exist
=
false
)
private
String
tagName
;
private
String
tagName
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/tag/WeFindCropTagParam.java
0 → 100644
View file @
70ae416
package
com
.
linkwechat
.
wecom
.
domain
.
dto
.
tag
;
import
lombok.Builder
;
import
lombok.Data
;
/**
* @description: 获取标签接口参数实体
* @author: HaoN
* @create: 2020-10-20 13:03
**/
@Data
@Builder
public
class
WeFindCropTagParam
{
private
String
[]
tag_id
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeFlowerCustomerTagRelMapper.java
View file @
70ae416
package
com
.
linkwechat
.
wecom
.
mapper
;
package
com
.
linkwechat
.
wecom
.
mapper
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeFlowerCustomerTagRel
;
import
com.linkwechat.wecom.domain.WeFlowerCustomerTagRel
;
/**
/**
...
@@ -9,7 +11,7 @@ import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
...
@@ -9,7 +11,7 @@ import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
* @author ruoyi
* @author ruoyi
* @date 2020-09-19
* @date 2020-09-19
*/
*/
public
interface
WeFlowerCustomerTagRelMapper
public
interface
WeFlowerCustomerTagRelMapper
extends
BaseMapper
<
WeFlowerCustomerTagRel
>
{
{
/**
/**
* 查询客户标签关系
* 查询客户标签关系
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeFlowerCustomerTagRelService.java
View file @
70ae416
package
com
.
linkwechat
.
wecom
.
service
;
package
com
.
linkwechat
.
wecom
.
service
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeFlowerCustomerTagRel
;
import
com.linkwechat.wecom.domain.WeFlowerCustomerTagRel
;
/**
/**
...
@@ -9,7 +11,7 @@ import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
...
@@ -9,7 +11,7 @@ import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
* @author ruoyi
* @author ruoyi
* @date 2020-09-19
* @date 2020-09-19
*/
*/
public
interface
IWeFlowerCustomerTagRelService
public
interface
IWeFlowerCustomerTagRelService
extends
IService
<
WeFlowerCustomerTagRel
>
{
{
/**
/**
* 查询客户标签关系
* 查询客户标签关系
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
70ae416
...
@@ -2,28 +2,33 @@ package com.linkwechat.wecom.service.impl;
...
@@ -2,28 +2,33 @@ package com.linkwechat.wecom.service.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.utils.SecurityUtils
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.common.utils.bean.BeanUtils
;
import
com.linkwechat.common.utils.bean.BeanUtils
;
import
com.linkwechat.framework.web.domain.server.Sys
;
import
com.linkwechat.framework.web.domain.server.Sys
;
import
com.linkwechat.wecom.client.WeCropTagClient
;
import
com.linkwechat.wecom.client.WeCustomerClient
;
import
com.linkwechat.wecom.client.WeCustomerClient
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.*
;
import
com.linkwechat.wecom.domain.WeFlowerCustomerRel
;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserDetail
;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserDetail
;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserList
;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserList
;
import
com.linkwechat.wecom.domain.dto.customer.ExternalUserTag
;
import
com.linkwechat.wecom.domain.dto.customer.FollowUserList
;
import
com.linkwechat.wecom.domain.dto.customer.FollowUserList
;
import
com.linkwechat.wecom.domain.dto.tag.WeCropGroupTagDto
;
import
com.linkwechat.wecom.domain.dto.tag.WeCropGroupTagListDto
;
import
com.linkwechat.wecom.domain.dto.tag.WeCropTagDto
;
import
com.linkwechat.wecom.domain.dto.tag.WeFindCropTagParam
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.mapper.WeCustomerMapper
;
import
com.linkwechat.wecom.mapper.WeCustomerMapper
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.*
;
import
com.linkwechat.wecom.service.IWeFlowerCustomerRelService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -46,6 +51,20 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
...
@@ -46,6 +51,20 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
@Autowired
@Autowired
private
IWeFlowerCustomerRelService
iWeFlowerCustomerRelService
;
private
IWeFlowerCustomerRelService
iWeFlowerCustomerRelService
;
@Autowired
private
WeCropTagClient
weCropTagClient
;
@Autowired
private
IWeTagService
iWeTagService
;
@Autowired
private
IWeTagGroupService
iWeTagGroupService
;
@Autowired
private
IWeFlowerCustomerTagRelService
iWeFlowerCustomerTagRelService
;
// @Autowired
// @Autowired
// private WeUserClient weUserClient;
// private WeUserClient weUserClient;
...
@@ -162,41 +181,112 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
...
@@ -162,41 +181,112 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
this
.
saveOrUpdate
(
weCustomer
);
this
.
saveOrUpdate
(
weCustomer
);
//客户与通讯录客户关系
//客户与通讯录客户关系
List
<
WeTag
>
weTags
=
new
ArrayList
<>();
List
<
WeTagGroup
>
weGroups
=
new
ArrayList
<>();
List
<
WeFlowerCustomerTagRel
>
weFlowerCustomerTagRels
=
new
ArrayList
<>();
List
<
WeFlowerCustomerRel
>
weFlowerCustomerRel
=
new
ArrayList
<>();
List
<
WeFlowerCustomerRel
>
weFlowerCustomerRel
=
new
ArrayList
<>();
externalUserDetail
.
getFollow_user
().
stream
().
forEach
(
kk
->{
externalUserDetail
.
getFollow_user
().
stream
().
forEach
(
kk
->{
WeFlowerCustomerRel
weFlowerCustomerRelOne
=
new
WeFlowerCustomerRel
();
WeFlowerCustomerRel
weFlowerCustomerRelOne
=
new
WeFlowerCustomerRel
();
BeanUtils
.
copyPropertiesignoreOther
(
kk
,
weFlowerCustomerRelOne
);
BeanUtils
.
copyPropertiesignoreOther
(
kk
,
weFlowerCustomerRelOne
);
Long
weFlowerCustomerRelId
=
SnowFlakeUtil
.
nextId
();
weFlowerCustomerRelOne
.
setId
(
weFlowerCustomerRelId
);
weFlowerCustomerRelOne
.
setExternalUserid
(
weCustomer
.
getExternalUserid
());
weFlowerCustomerRel
.
add
(
weFlowerCustomerRelOne
);
weFlowerCustomerRel
.
add
(
weFlowerCustomerRelOne
);
List
<
ExternalUserTag
>
tags
=
kk
.
getTags
();
if
(
CollectionUtil
.
isNotEmpty
(
tags
)){
//获取相关标签组
WeCropGroupTagListDto
weCropGroupTagListDto
=
weCropTagClient
.
getCorpTagListByTagIds
(
WeFindCropTagParam
.
builder
()
.
tag_id
(
ArrayUtil
.
toArray
(
tags
.
stream
().
map
(
ExternalUserTag:
:
getTag_id
).
collect
(
Collectors
.
toList
()),
String
.
class
))
.
build
());
if
(
weCropGroupTagListDto
.
getErrcode
().
equals
(
WeConstans
.
WE_SUCCESS_CODE
)){
List
<
WeCropGroupTagDto
>
tagGroups
=
weCropGroupTagListDto
.
getTag_group
();
if
(
CollectionUtil
.
isNotEmpty
(
tagGroups
)){
tagGroups
.
stream
().
forEach
(
tagGroup
->{
weGroups
.
add
(
WeTagGroup
.
builder
()
.
groupId
(
tagGroup
.
getGroup_id
())
.
gourpName
(
tagGroup
.
getGroup_name
())
.
createBy
(
SecurityUtils
.
getUsername
())
.
build
()
);
List
<
WeCropTagDto
>
weCropTagDtos
=
tagGroup
.
getTag
();
if
(
CollectionUtil
.
isNotEmpty
(
weCropTagDtos
)){
Set
<
String
>
tagIdsSet
=
weCropTagDtos
.
stream
().
map
(
WeCropTagDto:
:
getId
).
collect
(
Collectors
.
toSet
());
tags
.
stream
().
forEach
(
tag
->{
if
(
tagIdsSet
.
contains
(
tag
.
getTag_id
())){
weTags
.
add
(
WeTag
.
builder
()
.
groupId
(
tagGroup
.
getGroup_id
())
.
tagId
(
tag
.
getTag_id
())
.
name
(
tag
.
getTag_name
())
.
build
()
);
weFlowerCustomerTagRels
.
add
(
WeFlowerCustomerTagRel
.
builder
()
.
flowerCustomerRelId
(
weFlowerCustomerRelId
)
.
tagId
(
tag
.
getTag_id
())
.
createTime
(
new
Date
())
.
build
()
);
}
});
}
});
}
}
}
});
});
iWeFlowerCustomerRelService
.
saveOrUpdateBatch
(
weFlowerCustomerRel
);
List
<
WeFlowerCustomerRel
>
weFlowerCustomerRels
=
iWeFlowerCustomerRelService
.
list
(
new
LambdaQueryWrapper
<
WeFlowerCustomerRel
>()
.
eq
(
WeFlowerCustomerRel:
:
getExternalUserid
,
weCustomer
.
getExternalUserid
()));
if
(
CollectionUtil
.
isNotEmpty
(
weFlowerCustomerRels
)){
List
<
Long
>
weFlowerCustomerRelIds
=
weFlowerCustomerRels
.
stream
().
map
(
WeFlowerCustomerRel:
:
getId
).
collect
(
Collectors
.
toList
());
iWeFlowerCustomerTagRelService
.
remove
(
new
LambdaQueryWrapper
<
WeFlowerCustomerTagRel
>().
in
(
WeFlowerCustomerTagRel:
:
getFlowerCustomerRelId
,
weFlowerCustomerRelIds
)
);
iWeFlowerCustomerRelService
.
removeByIds
(
weFlowerCustomerRelIds
);
}
//设置标签跟客户关系,根据标签id获取到标签组,saveOrUpdate标签,建立标签与添加人关系
iWeFlowerCustomerRelService
.
saveBatch
(
weFlowerCustomerRel
);
//设置标签跟客户关系,标签和标签组,saveOrUpdate,建立标签与添加人关系
if
(
CollectionUtil
.
isNotEmpty
(
weTags
)&&
CollectionUtil
.
isNotEmpty
(
weGroups
)){
iWeTagService
.
saveOrUpdateBatch
(
weTags
);
iWeTagGroupService
.
saveOrUpdateBatch
(
weGroups
);
iWeFlowerCustomerTagRelService
.
saveOrUpdateBatch
(
weFlowerCustomerTagRels
);
}
}
}
// if(WeConstans.WE_SUCCESS_CODE.equals(externalContact.getErrcode())){
//
// WeCustomer weCustomer
// = externalContact.transformWeCustomer();
//
// if(null != weCustomer){
//
// this.insertWeCustomer(weCustomer);
//
// if(CollectionUtil.isNotEmpty(weCustomer.getWeFlowerCustomerRels())){
//
// iWeFlowerCustomerRelService.batchInsetWeFlowerCustomerRel(weCustomer.getWeFlowerCustomerRels());
//
//
//
// }
//
// }
//
//
// }
});
});
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeFlowerCustomerTagRelServiceImpl.java
View file @
70ae416
...
@@ -2,6 +2,7 @@ package com.linkwechat.wecom.service.impl;
...
@@ -2,6 +2,7 @@ package com.linkwechat.wecom.service.impl;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.utils.DateUtils
;
import
com.linkwechat.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -16,7 +17,7 @@ import com.linkwechat.wecom.service.IWeFlowerCustomerTagRelService;
...
@@ -16,7 +17,7 @@ import com.linkwechat.wecom.service.IWeFlowerCustomerTagRelService;
* @date 2020-09-19
* @date 2020-09-19
*/
*/
@Service
@Service
public
class
WeFlowerCustomerTagRelServiceImpl
implements
IWeFlowerCustomerTagRelService
public
class
WeFlowerCustomerTagRelServiceImpl
extends
ServiceImpl
<
WeFlowerCustomerTagRelMapper
,
WeFlowerCustomerTagRel
>
implements
IWeFlowerCustomerTagRelService
{
{
@Autowired
@Autowired
private
WeFlowerCustomerTagRelMapper
weFlowerCustomerTagRelMapper
;
private
WeFlowerCustomerTagRelMapper
weFlowerCustomerTagRelMapper
;
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
View file @
70ae416
...
@@ -5,8 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -5,8 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper
namespace=
"com.linkwechat.wecom.mapper.WeCustomerMapper"
>
<mapper
namespace=
"com.linkwechat.wecom.mapper.WeCustomerMapper"
>
<resultMap
type=
"WeCustomer"
id=
"WeCustomerResult"
>
<resultMap
type=
"WeCustomer"
id=
"WeCustomerResult"
>
<result
property=
"id"
column=
"id"
/>
<id
property=
"externalUserid"
column=
"external_userid"
/>
<result
property=
"externalUserid"
column=
"external_userid"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"avatar"
column=
"avatar"
/>
<result
property=
"avatar"
column=
"avatar"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"type"
column=
"type"
/>
...
@@ -23,14 +22,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -23,14 +22,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"description"
column=
"description"
/>
<result
property=
"description"
column=
"description"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"remarkCorpName"
column=
"remark_corp_name"
/>
<result
property=
"remarkCorpName"
column=
"remark_corp_name"
/>
<!-- <result property="remarkMobiles" column="remark_mobiles" />-->
<result
property=
"operUserid"
column=
"oper_userid"
/>
<result
property=
"operUserid"
column=
"oper_userid"
/>
<result
property=
"addWay"
column=
"add_way"
/>
<result
property=
"addWay"
column=
"add_way"
/>
<result
property=
"state"
column=
"state"
/>
<result
property=
"state"
column=
"state"
/>
<result
property=
"customerId"
column=
"customer_id"
/
>
<!-- <result property="customerId" column="customer_id" />--
>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"userName"
column=
"user_name"
/>
<collection
property=
"weFlowerCustomerTagRels"
ofType=
"com.linkwechat.wecom.domain.WeFlowerCustomerTagRel"
>
<collection
property=
"weFlowerCustomerTagRels"
ofType=
"com.linkwechat.wecom.domain.WeFlowerCustomerTagRel"
>
<result
property=
"id"
column=
"tagRelid"
/>
<result
property=
"flowerCustomerRelId"
column=
"flower_customer_rel_id"
/>
<result
property=
"flowerCustomerRelId"
column=
"flower_customer_rel_id"
/>
<result
property=
"tagId"
column=
"tag_id"
/>
<result
property=
"tagId"
column=
"tag_id"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
...
@@ -44,41 +41,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -44,41 +41,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
</sql>
<select
id=
"selectWeCustomerList"
parameterType=
"WeCustomer"
resultMap=
"WeCustomerResult"
>
<select
id=
"selectWeCustomerList"
parameterType=
"WeCustomer"
resultMap=
"WeCustomerResult"
>
SELECT
SELECT
wc.id,
wc.external_userid,
wc.external_userid,
wc.`name`,
wc.`name`,
wc.avatar,
wc.avatar,
wc.type,
wc.type,
wc.gender,
wc.gender,
wc.unionid,
wc.unionid,
wc.birthday,
wc.birthday,
wc.corp_name,
wc.position,
wc.corp_full_name,
wc.corp_name,
wc.position,
wc.corp_full_name,
wfcr.id as wfcrId,
wfcr.id as wfcrId,
wfcr.user_id,
wfcr.user_id,
wfcr.remark,
wfcr.remark,
wfcr.description,
wfcr.description,
wfcr.create_time,
wfcr.create_time,
wfcr.remark_corp_name,
wfcr.remark_corp_name,
wfcr.oper_userid,
wfcr.remark_mobiles,
wfcr.add_way,
wfcr.oper_userid,
wfcr.state,
wfcr.add_way,
wu.user_name,
wfcr.state,
wfcrf.flower_customer_rel_id,
wfcr.customer_id,
wt.tag_id,
wfcrf.id as tagRelid,
wt.create_time,
wfcrf.flower_customer_rel_id,
wt.`name` as tagName
wfcrf.tag_id,
wfcrf.create_time,
wt.`name` as tagName,
wu.user_name
FROM
FROM
we_customer wc
we_customer wc
INNER JOIN we_flower_customer_rel wfcr ON wc.id = wfcr.customer_
id
LEFT JOIN we_flower_customer_rel wfcr ON wc.external_userid=wfcr.external_user
id
INNER JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.flower_customer_rel_id = wfcr.
id
LEFT JOIN we_user wu ON wu.user_id=wfcr.user_
id
INNER JOIN we_tag wt ON wt.id = wfcrf.tag_
id
LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.flower_customer_rel_id = wfcr.
id
INNER JOIN we_user wu ON wu.user_id=wfcr.user
_id
LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag
_id
</select>
</select>
<select
id=
"selectWeCustomerById"
parameterType=
"Long"
resultMap=
"WeCustomerResult"
>
<select
id=
"selectWeCustomerById"
parameterType=
"Long"
resultMap=
"WeCustomerResult"
>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment