Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
e3a6df29
Commit
e3a6df29
authored
Sep 29, 2021
by
xugaojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化:运营平台企业列表查询优化
parent
1d911326
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
197 additions
and
22 deletions
+197
-22
WxEnterpriseApiService.java
...gic/haoban/manage/api/service/WxEnterpriseApiService.java
+1
-1
EnterpriseController.java
...ic/haoban/manage/web/controller/EnterpriseController.java
+183
-18
WxEnterpriseMapper.java
.../haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
+5
-1
WxEnterpriseApiServiceImpl.java
.../service/service/out/impl/WxEnterpriseApiServiceImpl.java
+2
-2
WxEnterpriseMapper.xml
...-service/src/main/resources/mapper/WxEnterpriseMapper.xml
+6
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseApiService.java
View file @
e3a6df29
...
@@ -17,7 +17,7 @@ public interface WxEnterpriseApiService {
...
@@ -17,7 +17,7 @@ public interface WxEnterpriseApiService {
* 运维后台获取微信企业id列表
* 运维后台获取微信企业id列表
* @return
* @return
*/
*/
com
.
gic
.
api
.
base
.
commons
.
Page
<
YwWxEnterpriseDTO
>
list
(
BasePageInfo
pageInfo
,
String
keyword
,
List
<
String
>
enterpriseIds
,
Integer
gicContactFlag
,
String
version
);
com
.
gic
.
api
.
base
.
commons
.
Page
<
YwWxEnterpriseDTO
>
list
(
BasePageInfo
pageInfo
,
String
keyword
,
List
<
String
>
enterpriseIds
,
Integer
gicContactFlag
,
String
version
,
List
<
String
>
enterpriseIdsNotIn
);
/**
/**
* 获取一个
* 获取一个
* @param wxEnterpriseId
* @param wxEnterpriseId
...
...
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/EnterpriseController.java
View file @
e3a6df29
...
@@ -41,8 +41,10 @@ import com.gic.redis.data.util.RedisUtil;
...
@@ -41,8 +41,10 @@ import com.gic.redis.data.util.RedisUtil;
@RestController
@RestController
public
class
EnterpriseController
extends
WebBaseController
{
public
class
EnterpriseController
extends
WebBaseController
{
private
static
final
String
LOGIN_URL
=
"/haoban-manage3-web/yw-login"
;
private
static
final
String
LOGIN_URL
=
"/haoban-manage3-web/yw-login"
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
EnterpriseController
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
EnterpriseController
.
class
);
@Autowired
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
private
WxEnterpriseApiService
wxEnterpriseApiService
;
...
@@ -57,8 +59,163 @@ public class EnterpriseController extends WebBaseController {
...
@@ -57,8 +59,163 @@ public class EnterpriseController extends WebBaseController {
@Autowired
@Autowired
private
QywxTagSyncApiService
qywxTagSyncApiService
;
private
QywxTagSyncApiService
qywxTagSyncApiService
;
// @Autowired
private
static
final
String
QYWX_TAG_OPRN_KEY
=
"qywx-tag-open"
;
// private WxEnterpriseRelatedApiService wxEnterpriseRelllatedApiService;
private
static
final
String
QYWX_TAG_OPRN_KEY_LOCK
=
"qywx-tag-open-lock"
;
private
static
final
int
OPEN
=
1
;
private
static
final
int
CLOSE
=
0
;
private
static
final
int
ALL
=
2
;
/**
* 查询企业列表
* <p>
* 我们大致可以分为6种场景
* <p>
* 1、开启-无条件搜索:in(cache中id列表) - 展示状态全部为开启
* 2、开启-有条件搜索:in(cache中列表与查询出的id取交集) - 展示状态全部为开启
* 3、关闭-无条件搜索:not in(cache中id列表) - 展示状态全部为关闭
* 4、关闭-有条件搜索:展示状态全部为关闭
* 5、所有-无条件搜索:cache中id列表不参与sql - 展示状态通过判断得出
* 6、所有-有条件搜索:cache中id列表不参与sql - 展示状态通过判断得出
*
* @param pageInfo 分页参数
* @param keyword 授权方企业微信名称
* @param openTagFlag 标签开启状态:0 未开启 1 开启 2 所有
* @param gicEnterpriseName gic企业名称
* @param gicContactHelper 是否开启通讯录应用1是0否
* @param version 版本
* @return res
*/
@RequestMapping
(
"wx-enterprise-list-new"
)
public
HaobanResponse
wxEnterpriseListNew
(
BasePageInfo
pageInfo
,
String
keyword
,
Integer
openTagFlag
,
String
gicEnterpriseName
,
Integer
gicContactHelper
,
String
version
)
{
List
<
String
>
wxEnterpriseIdInList
=
Lists
.
newArrayList
();
if
(
haveCondition
(
gicEnterpriseName
))
{
wxEnterpriseIdInList
=
listWxEnterpriseIdByEnterpriseName
(
gicEnterpriseName
);
// 有条件并且查询为空返回
if
(
CollectionUtil
.
isEmpty
(
wxEnterpriseIdInList
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
new
PageResult
<>());
}
}
Set
<
String
>
wxEnterpriseIdSetInCache
=
listWxEnterpriseIdListInCache
();
PageResult
<
YwWxEnterpriseDTO
>
pageResult
=
new
PageResult
<>();
Page
<
YwWxEnterpriseDTO
>
page
=
new
Page
<>();
if
(
Objects
.
nonNull
(
openTagFlag
)
&&
ALL
==
openTagFlag
)
{
page
=
queryAll
(
pageInfo
,
keyword
,
gicContactHelper
,
version
,
wxEnterpriseIdInList
,
wxEnterpriseIdSetInCache
);
}
if
(
Objects
.
nonNull
(
openTagFlag
)
&&
OPEN
==
openTagFlag
)
{
page
=
queryOpen
(
pageInfo
,
keyword
,
gicEnterpriseName
,
gicContactHelper
,
version
,
wxEnterpriseIdInList
,
wxEnterpriseIdSetInCache
);
}
if
(
Objects
.
nonNull
(
openTagFlag
)
&&
CLOSE
==
openTagFlag
)
{
page
=
queryClose
(
pageInfo
,
keyword
,
gicContactHelper
,
version
,
wxEnterpriseIdInList
,
wxEnterpriseIdSetInCache
);
}
pageResult
.
setList
(
page
.
getResult
());
pageResult
.
setPageNum
(
page
.
getCurrentPage
());
pageResult
.
setPages
(
page
.
getPages
());
pageResult
.
setPageSize
(
page
.
getPageSize
());
pageResult
.
setTotal
(
page
.
getTotalCount
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageResult
);
}
private
List
<
String
>
listWxEnterpriseIdByEnterpriseName
(
String
gicEnterpriseName
)
{
if
(
StringUtils
.
isEmpty
(
gicEnterpriseName
))
{
return
Collections
.
emptyList
();
}
// 企业名称查询
List
<
EnterpriseDTO
>
enterpriseList
=
enterpriseService
.
getEnterpriseByName
(
gicEnterpriseName
);
if
(
CollectionUtil
.
isEmpty
(
enterpriseList
))
{
return
Collections
.
emptyList
();
}
// 查询gic企业与wx企业关系
List
<
String
>
gicEnterpriseIdList
=
enterpriseList
.
stream
().
map
(
EnterpriseDTO:
:
getEnterpriseId
).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDetailDTO
>
wxEnterpriseList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByEnterpriseIds
(
gicEnterpriseIdList
);
if
(
CollectionUtil
.
isEmpty
(
wxEnterpriseList
))
{
return
Collections
.
emptyList
();
}
return
wxEnterpriseList
.
stream
().
map
(
EnterpriseDetailDTO:
:
getWxEnterpriseId
).
collect
(
Collectors
.
toList
());
}
private
Set
<
String
>
listWxEnterpriseIdListInCache
()
{
// 查询开启标签同步缓存-详情在 /tag/open-tag 接口
String
wxEntIdStr
=
(
String
)
RedisUtil
.
getCache
(
QYWX_TAG_OPRN_KEY
);
Set
<
String
>
wxEntIdSet
=
Sets
.
newHashSet
();
if
(
StringUtils
.
isNotEmpty
(
wxEntIdStr
))
{
wxEntIdSet
=
Arrays
.
stream
(
wxEntIdStr
.
split
(
","
)).
collect
(
Collectors
.
toSet
());
}
return
wxEntIdSet
;
}
private
Page
<
YwWxEnterpriseDTO
>
queryAll
(
BasePageInfo
pageInfo
,
String
keyword
,
Integer
gicContactHelper
,
String
version
,
List
<
String
>
wxEnterpriseIdInList
,
Set
<
String
>
wxEnterpriseIdSetInCache
)
{
// 查询所有状态
Page
<
YwWxEnterpriseDTO
>
page
=
wxEnterpriseApiService
.
list
(
pageInfo
,
keyword
,
wxEnterpriseIdInList
,
gicContactHelper
,
version
,
null
);
page
.
getResult
().
forEach
(
one
->
{
one
.
setVersion
(
"3.0"
);
one
.
setBuyDate
(
new
Date
());
one
.
setBuyStatus
(
"1"
);
List
<
EnterpriseDetailDTO
>
counts
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
one
.
getWxEnterpriseId
());
one
.
setRelationCount
(
counts
.
size
());
if
(
wxEnterpriseIdSetInCache
.
contains
(
one
.
getWxEnterpriseId
()))
{
one
.
setTagOpenFlag
(
1
);
}
else
{
one
.
setTagOpenFlag
(
0
);
}
});
return
page
;
}
private
Page
<
YwWxEnterpriseDTO
>
queryOpen
(
BasePageInfo
pageInfo
,
String
keyword
,
String
gicEnterpriseName
,
Integer
gicContactHelper
,
String
version
,
List
<
String
>
wxEnterpriseIdInList
,
Set
<
String
>
wxEnterpriseIdSetInCache
)
{
// 查询开启状态
if
(
haveCondition
(
gicEnterpriseName
))
{
// 有条件-取交集
wxEnterpriseIdSetInCache
.
retainAll
(
wxEnterpriseIdInList
);
}
List
<
String
>
queryList
=
new
ArrayList
<>(
wxEnterpriseIdSetInCache
);
Page
<
YwWxEnterpriseDTO
>
page
=
wxEnterpriseApiService
.
list
(
pageInfo
,
keyword
,
queryList
,
gicContactHelper
,
version
,
null
);
page
.
getResult
().
forEach
(
one
->
{
one
.
setVersion
(
"3.0"
);
one
.
setBuyDate
(
new
Date
());
one
.
setBuyStatus
(
"1"
);
List
<
EnterpriseDetailDTO
>
counts
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
one
.
getWxEnterpriseId
());
one
.
setRelationCount
(
counts
.
size
());
// 全部打开
one
.
setTagOpenFlag
(
1
);
});
return
page
;
}
private
Page
<
YwWxEnterpriseDTO
>
queryClose
(
BasePageInfo
pageInfo
,
String
keyword
,
Integer
gicContactHelper
,
String
version
,
List
<
String
>
wxEnterpriseIdInList
,
Set
<
String
>
wxEnterpriseIdSetInCache
)
{
// 查询关闭状态
Page
<
YwWxEnterpriseDTO
>
page
=
wxEnterpriseApiService
.
list
(
pageInfo
,
keyword
,
wxEnterpriseIdInList
,
gicContactHelper
,
version
,
new
ArrayList
<>(
wxEnterpriseIdSetInCache
));
page
.
getResult
().
forEach
(
one
->
{
one
.
setVersion
(
"3.0"
);
one
.
setBuyDate
(
new
Date
());
one
.
setBuyStatus
(
"1"
);
List
<
EnterpriseDetailDTO
>
counts
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
one
.
getWxEnterpriseId
());
one
.
setRelationCount
(
counts
.
size
());
// 全部关闭
one
.
setTagOpenFlag
(
0
);
});
return
page
;
}
private
boolean
haveCondition
(
String
gicEnterpriseName
)
{
return
StringUtils
.
isNotEmpty
(
gicEnterpriseName
);
}
//企业列表
//企业列表
// openTagFlag 0 未开启 1 开启 2 所有
// openTagFlag 0 未开启 1 开启 2 所有
@RequestMapping
(
"wx-enterprise-list"
)
@RequestMapping
(
"wx-enterprise-list"
)
...
@@ -79,14 +236,14 @@ public class EnterpriseController extends WebBaseController {
...
@@ -79,14 +236,14 @@ public class EnterpriseController extends WebBaseController {
}
}
// 查询开启标签同步缓存-详情在 /tag/open-tag 接口
// 查询开启标签同步缓存-详情在 /tag/open-tag 接口
String
wxEntIdStr
=
(
String
)
RedisUtil
.
getCache
(
"qywx-tag-open"
);
String
wxEntIdStr
=
(
String
)
RedisUtil
.
getCache
(
QYWX_TAG_OPRN_KEY
);
Set
<
String
>
wxEntIdSet
=
Sets
.
newHashSet
();
Set
<
String
>
wxEntIdSet
=
Sets
.
newHashSet
();
if
(
StringUtils
.
isNotEmpty
(
wxEntIdStr
))
{
if
(
StringUtils
.
isNotEmpty
(
wxEntIdStr
))
{
wxEntIdSet
=
Arrays
.
stream
(
wxEntIdStr
.
split
(
","
)).
collect
(
Collectors
.
toSet
());
wxEntIdSet
=
Arrays
.
stream
(
wxEntIdStr
.
split
(
","
)).
collect
(
Collectors
.
toSet
());
}
}
Page
<
YwWxEnterpriseDTO
>
page
=
wxEnterpriseApiService
.
list
(
pageInfo
,
keyword
,
wxEnterpriseIds
,
gicContactHelper
,
version
);
Page
<
YwWxEnterpriseDTO
>
page
=
wxEnterpriseApiService
.
list
(
pageInfo
,
keyword
,
wxEnterpriseIds
,
gicContactHelper
,
version
,
null
);
PageResult
<
YwWxEnterpriseDTO
>
pageVo
=
new
PageResult
<>();
PageResult
<
YwWxEnterpriseDTO
>
pageVo
=
new
PageResult
<>();
List
<
YwWxEnterpriseDTO
>
list
=
EntityUtil
.
changeEntityListByJSON
(
YwWxEnterpriseDTO
.
class
,
page
.
getResult
());
List
<
YwWxEnterpriseDTO
>
list
=
EntityUtil
.
changeEntityListByJSON
(
YwWxEnterpriseDTO
.
class
,
page
.
getResult
());
...
@@ -125,7 +282,7 @@ public class EnterpriseController extends WebBaseController {
...
@@ -125,7 +282,7 @@ public class EnterpriseController extends WebBaseController {
*
*
* @param wxEnterpriseId 微信企业id
* @param wxEnterpriseId 微信企业id
* @param flag 操作标记 1 开启 0 关闭
* @param flag 操作标记 1 开启 0 关闭
* @return
HaobanResponse
* @return
res
*/
*/
@RequestMapping
(
"operate-tag-sync"
)
@RequestMapping
(
"operate-tag-sync"
)
public
HaobanResponse
operateTagSync
(
String
wxEnterpriseId
,
Integer
flag
)
{
public
HaobanResponse
operateTagSync
(
String
wxEnterpriseId
,
Integer
flag
)
{
...
@@ -135,23 +292,20 @@ public class EnterpriseController extends WebBaseController {
...
@@ -135,23 +292,20 @@ public class EnterpriseController extends WebBaseController {
if
(
Objects
.
isNull
(
flag
))
{
if
(
Objects
.
isNull
(
flag
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
// 操作缓存
String
key
=
"qywx-tag-open"
;
String
lockKey
=
"qywx-tag-open-lock"
;
try
{
try
{
RedisUtil
.
lock
(
lockKey
,
5L
);
RedisUtil
.
lock
(
QYWX_TAG_OPRN_KEY_LOCK
,
5L
);
String
wxEntIdStr
=
(
String
)
RedisUtil
.
getCache
(
key
);
String
wxEntIdStr
=
(
String
)
RedisUtil
.
getCache
(
QYWX_TAG_OPRN_KEY
);
if
(
flag
==
1
)
{
if
(
flag
==
1
)
{
// 开启
// 开启
if
(
StringUtils
.
isEmpty
(
wxEntIdStr
))
{
if
(
StringUtils
.
isEmpty
(
wxEntIdStr
))
{
wxEntIdStr
=
wxEnterpriseId
;
wxEntIdStr
=
wxEnterpriseId
;
}
else
{
}
else
{
wxEntIdStr
=
wxEntIdStr
+
","
+
wxEnterpriseId
;
wxEntIdStr
=
wxEntIdStr
+
","
+
wxEnterpriseId
;
}
}
logger
.
info
(
"开启企业标签同步, wxEntIdStr:{}"
,
wxEntIdStr
);
logger
.
info
(
"开启企业标签同步, wxEntIdStr:{}"
,
wxEntIdStr
);
RedisUtil
.
setCache
(
key
,
wxEntIdStr
);
RedisUtil
.
setCache
(
QYWX_TAG_OPRN_KEY
,
wxEntIdStr
);
}
}
if
(
flag
==
0
)
{
if
(
flag
==
0
)
{
...
@@ -170,25 +324,30 @@ public class EnterpriseController extends WebBaseController {
...
@@ -170,25 +324,30 @@ public class EnterpriseController extends WebBaseController {
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
String
closeStr
=
StringUtils
.
join
(
filterList
,
","
);
String
closeStr
=
StringUtils
.
join
(
filterList
,
","
);
logger
.
info
(
"关闭企业标签同步, closeStr:{}"
,
closeStr
);
logger
.
info
(
"关闭企业标签同步, closeStr:{}"
,
closeStr
);
RedisUtil
.
setCache
(
key
,
closeStr
);
RedisUtil
.
setCache
(
QYWX_TAG_OPRN_KEY
,
closeStr
);
}
}
}
finally
{
}
finally
{
RedisUtil
.
unlock
(
lockKey
);
RedisUtil
.
unlock
(
QYWX_TAG_OPRN_KEY_LOCK
);
}
}
// 文案提示-根据开启关闭类型提示
// 文案提示-根据开启关闭类型提示
if
(
flag
==
1
)
{
if
(
flag
==
1
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
"开启企微标签同步"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
"开启企微标签同步"
);
}
}
if
(
flag
==
0
)
{
if
(
flag
==
0
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
"关闭企微标签同步"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
"关闭企微标签同步"
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
//授权详情列表
/**
* 授权详情列表
*
* @param wxEnterpriseId 企业微信id
* @return res
*/
@RequestMapping
(
"authorize-detail"
)
@RequestMapping
(
"authorize-detail"
)
public
HaobanResponse
authorizeDetail
(
String
wxEnterpriseId
)
{
public
HaobanResponse
authorizeDetail
(
String
wxEnterpriseId
)
{
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
...
@@ -209,7 +368,13 @@ public class EnterpriseController extends WebBaseController {
...
@@ -209,7 +368,13 @@ public class EnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
result
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
result
);
}
}
//登录
/**
* 登录
*
* @param wxEnterpriseId 企业微信id
* @param httpServletResponse response
* @throws IOException exception
*/
@RequestMapping
(
"yw-login"
)
@RequestMapping
(
"yw-login"
)
public
void
ywLogin
(
String
wxEnterpriseId
,
HttpServletResponse
httpServletResponse
)
throws
IOException
{
public
void
ywLogin
(
String
wxEnterpriseId
,
HttpServletResponse
httpServletResponse
)
throws
IOException
{
String
host
=
GlobalVar
.
ctxPropertiesMap
.
get
(
"haoban_service_host"
);
String
host
=
GlobalVar
.
ctxPropertiesMap
.
get
(
"haoban_service_host"
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
View file @
e3a6df29
...
@@ -22,7 +22,11 @@ public interface WxEnterpriseMapper {
...
@@ -22,7 +22,11 @@ public interface WxEnterpriseMapper {
int
updateByPrimaryKey
(
TabHaobanWxEnterprise
record
);
int
updateByPrimaryKey
(
TabHaobanWxEnterprise
record
);
Page
<
TabHaobanWxEnterprise
>
list
(
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"enterpriseIds"
)
List
<
String
>
enterpriseIds
,
@Param
(
"gicContactFlag"
)
Integer
gicContactFlag
,
@Param
(
"version"
)
String
version
);
Page
<
TabHaobanWxEnterprise
>
list
(
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"enterpriseIds"
)
List
<
String
>
enterpriseIds
,
@Param
(
"gicContactFlag"
)
Integer
gicContactFlag
,
@Param
(
"version"
)
String
version
,
@Param
(
"enterpriseIdsNotIn"
)
List
<
String
>
enterpriseIdsNotIn
);
List
<
TabHaobanWxEnterprise
>
listBycorpId
(
@Param
(
"corpId"
)
String
corpId
);
List
<
TabHaobanWxEnterprise
>
listBycorpId
(
@Param
(
"corpId"
)
String
corpId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseApiServiceImpl.java
View file @
e3a6df29
...
@@ -104,9 +104,9 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
...
@@ -104,9 +104,9 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
}
}
@Override
@Override
public
com
.
gic
.
api
.
base
.
commons
.
Page
<
YwWxEnterpriseDTO
>
list
(
BasePageInfo
pageInfo
,
String
keyword
,
List
<
String
>
enterpriseIds
,
Integer
gicContactFlag
,
String
version
)
{
public
com
.
gic
.
api
.
base
.
commons
.
Page
<
YwWxEnterpriseDTO
>
list
(
BasePageInfo
pageInfo
,
String
keyword
,
List
<
String
>
enterpriseIds
,
Integer
gicContactFlag
,
String
version
,
List
<
String
>
enterpriseIdsNotIn
)
{
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
Page
<
TabHaobanWxEnterprise
>
page
=
wxEnterpriseMapper
.
list
(
keyword
,
enterpriseIds
,
gicContactFlag
,
version
);
Page
<
TabHaobanWxEnterprise
>
page
=
wxEnterpriseMapper
.
list
(
keyword
,
enterpriseIds
,
gicContactFlag
,
version
,
enterpriseIdsNotIn
);
return
PageUtil
.
changePageHelperToCurrentPage
(
page
,
YwWxEnterpriseDTO
.
class
);
return
PageUtil
.
changePageHelperToCurrentPage
(
page
,
YwWxEnterpriseDTO
.
class
);
}
}
...
...
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseMapper.xml
View file @
e3a6df29
...
@@ -431,6 +431,12 @@
...
@@ -431,6 +431,12 @@
<if
test=
"keyword != null and keyword != ''"
>
<if
test=
"keyword != null and keyword != ''"
>
and corp_name like CONCAT('%',#{keyword},'%')
and corp_name like CONCAT('%',#{keyword},'%')
</if>
</if>
<if
test=
"enterpriseIdsNotIn != null and enterpriseIdsNotIn.size() > 0"
>
and wx_enterprise_id NOT IN
<foreach
collection=
"enterpriseIdsNotIn"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
<if
test=
"enterpriseIds != null and enterpriseIds.size() > 0"
>
<if
test=
"enterpriseIds != null and enterpriseIds.size() > 0"
>
and wx_enterprise_id IN
and wx_enterprise_id IN
<foreach
collection=
"enterpriseIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"enterpriseIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment