Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b4449251
authored
Jul 11, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回结果过滤掉状态为0(已删除)的team
1 parent
79e41ac3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
project-order/src/main/java/com/dituhui/pea/order/dao/OrgTeamDao.java
project-order/src/main/java/com/dituhui/pea/order/dao/OrgTeamEngineerDao.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessTeamServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/dao/OrgTeamDao.java
View file @
b444925
...
...
@@ -12,16 +12,21 @@ import org.springframework.stereotype.Repository;
import
java.util.List
;
@Repository
@Where
(
clause
=
"status = 1"
)
public
interface
OrgTeamDao
extends
JpaRepository
<
OrgTeamEntity
,
Integer
>
{
@Query
(
"select t from OrgTeamEntity t where t.clusterId = :clusterId and t.status=1"
)
List
<
OrgTeamEntity
>
findAllByClusterId
(
String
clusterId
);
@Query
(
"select t from OrgTeamEntity t where t.branchId = :branchId and t.status=1"
)
List
<
OrgTeamEntity
>
findAllByBranchId
(
String
branchId
);
@Query
(
"select t from OrgTeamEntity t where t.groupId = :groupId and t.status=1"
)
List
<
OrgTeamEntity
>
findAllByGroupId
(
String
groupId
);
@Query
(
"select t from OrgTeamEntity t where t.groupId = :groupId and t.status=1"
)
Page
<
OrgTeamEntity
>
findAllByGroupId
(
String
groupId
,
Pageable
pageable
);
@Query
(
"select t from OrgTeamEntity t where t.branchId = :branchId and t.status=1"
)
Page
<
OrgTeamEntity
>
findAllByBranchId
(
String
branchId
,
Pageable
pageable
);
OrgTeamEntity
getByTeamId
(
String
teamId
);
...
...
project-order/src/main/java/com/dituhui/pea/order/dao/OrgTeamEngineerDao.java
View file @
b444925
...
...
@@ -12,15 +12,14 @@ import java.util.List;
@Repository
@Where
(
clause
=
"status = 1"
)
public
interface
OrgTeamEngineerDao
extends
JpaRepository
<
OrgTeamEngineerEntity
,
Integer
>
{
@Query
(
"select t from OrgTeamEngineerEntity t where t.teamId = :teamId and t.status=1"
)
List
<
OrgTeamEngineerEntity
>
findAllByTeamId
(
String
teamId
);
@Query
(
"select t from OrgTeamEngineerEntity t where t.teamId in :teamIds and t.status=1"
)
List
<
OrgTeamEngineerEntity
>
findAllByTeamIdIn
(
List
<
String
>
teamIds
);
List
<
OrgTeamEngineerEntity
>
findByTeamId
(
String
teamId
);
@Query
(
"select a.teamId from OrgTeamEngineerEntity a where a.engineerCode=:engineerCode"
)
List
<
String
>
getTeamIdsByEngineerCode
(
String
engineerCode
);
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessTeamServiceImpl.java
View file @
b444925
...
...
@@ -185,7 +185,7 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
public
void
updateTeamEngineers
(
String
teamId
,
List
<
String
>
engineerCodes
)
{
// 获取现有的工作队和技术员之间的所有关系
List
<
OrgTeamEngineerEntity
>
existingRelations
=
orgTeamEngineerDao
.
findByTeamId
(
teamId
);
List
<
OrgTeamEngineerEntity
>
existingRelations
=
orgTeamEngineerDao
.
find
All
ByTeamId
(
teamId
);
// 构建新的关系映射
Map
<
String
,
OrgTeamEngineerEntity
>
newRelationsMap
=
new
HashMap
<>();
...
...
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