Commit b4449251 by 丁伟峰

返回结果过滤掉状态为0(已删除)的team

1 parent 79e41ac3
......@@ -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);
......
......@@ -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);
......
......@@ -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.findAllByTeamId(teamId);
// 构建新的关系映射
Map<String, OrgTeamEngineerEntity> newRelationsMap = new HashMap<>();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!