Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
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
base_platform_enterprise
gic-platform-auth
Commits
8d7454c0
Commit
8d7454c0
authored
Nov 04, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量分组接口修复:sql语法错误
parent
c52d0619
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
15 deletions
+68
-15
TabSysCollaborator.java
...src/main/java/com/gic/auth/entity/TabSysCollaborator.java
+14
-1
TabSysAccountGroupRelMapper.xml
...src/main/resources/mapper/TabSysAccountGroupRelMapper.xml
+1
-0
TabSysCollaboratorMapper.xml
...ce/src/main/resources/mapper/TabSysCollaboratorMapper.xml
+27
-14
CollaboratorController.java
...a/com/gic/auth/web/controller/CollaboratorController.java
+26
-0
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabSysCollaborator.java
View file @
8d7454c0
...
...
@@ -17,11 +17,16 @@ public class TabSysCollaborator {
private
String
collaboratorName
;
/**
* 商户
*
主体
商户
*/
private
Integer
enterpriseId
;
/**
* 协作商户
*/
private
Integer
collaborationEnterpriseId
;
/**
* 手机号码
*/
private
String
phone
;
...
...
@@ -85,6 +90,14 @@ public class TabSysCollaborator {
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getCollaborationEnterpriseId
()
{
return
collaborationEnterpriseId
;
}
public
void
setCollaborationEnterpriseId
(
Integer
collaborationEnterpriseId
)
{
this
.
collaborationEnterpriseId
=
collaborationEnterpriseId
;
}
public
String
getPhone
()
{
return
phone
;
}
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysAccountGroupRelMapper.xml
View file @
8d7454c0
...
...
@@ -141,6 +141,7 @@
user_id, enterprise_id, status,
type, create_time, update_time
)
VALUES
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.accountGroupRelId},
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysCollaboratorMapper.xml
View file @
8d7454c0
...
...
@@ -5,6 +5,7 @@
<id
column=
"collaborator_id"
jdbcType=
"INTEGER"
property=
"collaboratorId"
/>
<result
column=
"collaborator_name"
jdbcType=
"VARCHAR"
property=
"collaboratorName"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"collaboration_enterprise_id"
jdbcType=
"INTEGER"
property=
"collaborationEnterpriseId"
/>
<result
column=
"phone"
jdbcType=
"VARCHAR"
property=
"phone"
/>
<result
column=
"app_id"
jdbcType=
"VARCHAR"
property=
"appId"
/>
<result
column=
"app_name"
jdbcType=
"VARCHAR"
property=
"appName"
/>
...
...
@@ -15,7 +16,8 @@
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
collaborator_id, collaborator_name, enterprise_id, phone, app_id, app_name, creator, sub_app_ids, status, create_time, update_time
collaborator_id, collaborator_name, enterprise_id, collaboration_enterprise_id, phone,
app_id, app_name, creator, sub_app_ids, status, create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -29,13 +31,13 @@
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabSysCollaborator"
>
insert into tab_sys_collaborator (collaborator_id, collaborator_name,
enterprise_id,
phone, app
_id,
app_name,
enterprise_id,
collaboration_enterprise
_id,
phone, app_id, app_name,
creator, sub_app_ids, status,
create_time, update_time)
values (#{collaboratorId,jdbcType=INTEGER}, #{collaboratorName,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=INTEGER}, #{
phone,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHA
R},
#{
appName,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=INTEGER}, #{
collaborationEnterpriseId,jdbcType=INTEGE
R},
#{
phone,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR},
#{creator,jdbcType=VARCHAR}, #{subAppIds,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
...
...
@@ -51,6 +53,9 @@
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"collaborationEnterpriseId != null"
>
collaboration_enterprise_id,
</if>
<if
test=
"phone != null"
>
phone,
</if>
...
...
@@ -86,6 +91,9 @@
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"collaborationEnterpriseId != null"
>
#{collaborationEnterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"phone != null"
>
#{phone,jdbcType=VARCHAR},
</if>
...
...
@@ -121,6 +129,9 @@
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"collaborationEnterpriseId != null"
>
collaboration_enterprise_id = #{collaborationEnterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"phone != null"
>
phone = #{phone,jdbcType=VARCHAR},
</if>
...
...
@@ -152,6 +163,7 @@
update tab_sys_collaborator
set collaborator_name = #{collaboratorName,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
collaboration_enterprise_id = #{collaborationEnterpriseId,jdbcType=INTEGER},
phone = #{phone,jdbcType=VARCHAR},
app_id = #{appId,jdbcType=VARCHAR},
app_name = #{appName,jdbcType=VARCHAR},
...
...
@@ -168,7 +180,8 @@
a.collaborator_id collaboratorId,
a.collaborator_name collaboratorName,
a.enterprise_id enterpriseId,
b.enterprise_name enterpriseName,
a.collaboration_enterprise_id collaborationEnterpriseId,
b.enterprise_name collaborationEnterpriseName,
a.phone phone,
a.appId appId,
a.app_name appName,
...
...
@@ -177,8 +190,8 @@
a.create_time createTime
from tab_sys_collaborator a
left join tab_enterprise b on a.enterprise_id = b.enterprise_id
where
1=1
left join tab_enterprise b on a.
collaboration_
enterprise_id = b.enterprise_id
where
enterprise_id = #{enterpriseId}
<if
test=
"search != null and search != '' "
>
and (a.collaborator_name like concat('%', search, '%') or a.phone like concat('%', search, '%') or b.enterprise_name like concat('%', search, '%') )
</if>
...
...
@@ -191,24 +204,24 @@
</select>
<select
id=
"listByCollaboratorIdList"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
></include
>
SELECT
<include
refid=
"Base_Column_List"
/
>
from tab_sys_collaborator
where 1=1
<if
test=
"list != null and list.size()
>
0"
>
<if
test=
"list != null and list.size()
>
0"
>
and collaborator_id in
<foreach
c
ollection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")
"
>
<foreach
c
lose=
")"
collection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
",
"
>
#{item}
</foreach>
</if>
</select>
<select
id=
"listNotInCollaboratorIdList"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
></include
>
SELECT
<include
refid=
"Base_Column_List"
/
>
from tab_sys_collaborator
where enterprise_id = #{enterpriseId}
<if
test=
"list != null and list.size()
>
0"
>
<if
test=
"list != null and list.size()
>
0"
>
and collaborator_id not in
<foreach
c
ollection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")
"
>
<foreach
c
lose=
")"
collection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
",
"
>
#{item}
</foreach>
</if>
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/CollaboratorController.java
0 → 100644
View file @
8d7454c0
package
com
.
gic
.
auth
.
web
.
controller
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.auth.qo.CollaboratorListQO
;
import
com.gic.auth.service.CollaboratorApiService
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
@RestController
@RequestMapping
(
"/collaborator"
)
public
class
CollaboratorController
{
private
static
final
Logger
LOGGER
=
LogManager
.
getLogger
(
CollaboratorController
.
class
);
@Autowired
private
CollaboratorApiService
collaboratorApiService
;
@RequestMapping
(
"/list"
)
public
RestResponse
list
(
CollaboratorListQO
params
)
{
return
ResultControllerUtils
.
commonResult
(
collaboratorApiService
.
page
(
params
));
}
}
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