Commit ff140296 by 刘鑫

FIX: 多技能组查询容量时 工程师需同时满足所有技能 且在指定工作队内

1 parent 6ab23bea
......@@ -11,6 +11,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.List;
import java.util.Set;
......@@ -66,15 +67,32 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
* @param teamId 工作队ID
* @return 工程师信息
*/
@Query(value = "SELECT ei.* FROM skill_info si LEFT JOIN skill_group sg ON sg.skill_group_code =si.skill_group_code \n" +
" LEFT JOIN engineer_skill_group esg ON sg.skill_group_code = esg.skill_group_code \n" +
" LEFT JOIN engineer_info ei ON esg.engineer_code = ei.engineer_code\n" +
" LEFT JOIN org_team_engineer ote ON ote.engineer_code = ei.engineer_code \n" +
" WHERE si.brand = :brand AND si.type= :productType AND si.skill = :skill \n" +
@Query(value = "SELECT ei.* FROM skill_info si LEFT JOIN skill_group sg ON sg.skill_group_code =si.skill_group_code " +
" LEFT JOIN engineer_skill_group esg ON sg.skill_group_code = esg.skill_group_code " +
" LEFT JOIN engineer_info ei ON esg.engineer_code = ei.engineer_code " +
" LEFT JOIN org_team_engineer ote ON ote.engineer_code = ei.engineer_code " +
" WHERE si.brand = :brand AND si.type= :productType AND si.skill = :skill " +
" AND ote.team_id = :teamId AND ote.status = 1 AND esg.status = 1", nativeQuery = true)
Set<EngineerInfoEntity> listByBrandAndTypeAndSkillAndTeamId(@Param("brand") String brand, @Param("productType") String productType,
@Param("skill") String skill, @Param("teamId") String teamId);
/**
* 查询在指定技能组中至少满足 skillGroupCodes.size 个技能的工程师
* @param skillGroupCodes 技能组编码
* @param skillGroupNumber 至少拥有其中skillGroupCodes.size 个技能
* @param teamId 工作队ID
* @return 工程师信息
*/
@Query(value = "SELECT * FROM org_team_engineer ote " +
" LEFT JOIN " +
" (SELECT esg.engineer_code AS engineer_code FROM engineer_skill_group esg " +
" WHERE esg.status = 1 AND esg.skill_group_code IN( :skillGroupCodes) group by esg.engineer_code having count(esg.skill_group_code) = :skillGroupNumber " +
" ) AS tabA ON tabA.engineer_code = ote.engineer_code " +
" LEFT JOIN engineer_info ei ON ei.engineer_code = tabA.engineer_code " +
" WHERE ote.team_id = :teamId " +
" order by ei.engineer_code desc", nativeQuery = true)
Set<EngineerInfoEntity> listBySkillGroupCode( @Param("skillGroupCodes")Collection<String> skillGroupCodes, @Param("skillGroupNumber")int skillGroupNumber, @Param("teamId")String teamId);
@Query(value = "SELECT ei.* from engineer_info ei left join engineer_skill_group esg on ei.engineer_code = esg.engineer_code " +
"left join skill_info si on si.skill_group_code = esg.skill_group_code left join map_layer_customize mlc on mlc.layer_id = si.layer_id " +
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!