Commit 32bac8a1 by huangjinxin

fix:工程师,组织结构,技能逻辑删除相关

1 parent a6acb7a8
......@@ -82,7 +82,8 @@ public class EngineerUtils {
Predicate engineerCodePredicate = criteriaBuilder.like(root.get("engineerCode"), "%" + keyword + "%");
Predicate mobilePredicate = criteriaBuilder.like(root.get("phone"), "%" + keyword + "%");
Predicate msgContentPredicate = criteriaBuilder.like(root.get("name"), "%" + keyword + "%");
predicates.add(criteriaBuilder.or(engineerCodePredicate, mobilePredicate, msgContentPredicate));
Predicate statusContentPredicate = criteriaBuilder.equal(root.get("beanStatus"), 1);
predicates.add(criteriaBuilder.or(engineerCodePredicate, mobilePredicate, msgContentPredicate, statusContentPredicate));
return criteriaBuilder.and(predicates.toArray(new Predicate[0]));
}
......
......@@ -53,7 +53,7 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
@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 "
+ " WHERE si.brand = :brand AND si.type= :productType AND si.skill = :skill "
+ " WHERE ei.bean_status = 1 and esg.status = 1 and si.brand = :brand AND si.type= :productType AND si.skill = :skill "
+ " AND group_id = :groupId ", nativeQuery = true)
Set<EngineerInfoEntity> listByBrandAndTypeAndSkillAndGroupId(@Param("brand") String brand, @Param("productType") String productType,
@Param("skill") String skill, @Param("groupId") String groupId);
......@@ -71,7 +71,7 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
" 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 " +
" WHERE ei.bean_status = 1 and 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);
......@@ -90,7 +90,7 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
" ) AS tabA" +
" LEFT JOIN org_team_engineer ote ON tabA.engineer_code = ote.engineer_code " +
" LEFT JOIN engineer_info ei ON ei.engineer_code = tabA.engineer_code " +
"WHERE ote.team_id = :teamId AND ote.status = 1" +
"WHERE ei.bean_status = 1 and ote.team_id = :teamId AND ote.status = 1" +
" order by ei.engineer_code desc ", nativeQuery = true)
Set<EngineerInfoEntity> listBySkillGroupCode(@Param("skillGroupCodes") Collection<String> skillGroupCodes, @Param("skillGroupNumber") int skillGroupNumber, @Param("teamId") String teamId);
......@@ -107,14 +107,14 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
" 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 " +
" LEFT JOIN engineer_info ei ON ei.engineer_code = tabA.engineer_code " +
" WHERE ei.group_id = :groupId AND ei.id is not null " +
" WHERE ei.bean_status = 1 and ei.group_id = :groupId AND ei.id is not null " +
" order by ei.engineer_code desc ", nativeQuery = true)
Set<EngineerInfoEntity> listByBranchSkillGroupCode(@Param("skillGroupCodes") Collection<String> skillGroupCodes, @Param("skillGroupNumber") int skillGroupNumber, @Param("groupId") String groupId);
@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 " +
" WHERE si.brand = :brand and si.`type` = :productType and si.skill_code = :skillCode and ei.group_id in ( :teamIds ) " +
" WHERE ei.bean_status = 1 AND esg.status = 1 AND mlc.status = 1 and si.brand = :brand and si.`type` = :productType and si.skill_code = :skillCode and ei.group_id in ( :teamIds ) " +
" order by mlc.priority ", nativeQuery = true)
List<EngineerInfoEntity> listBrandAndSkillCodeAndTeamIdIn(@Param("brand") String brand, @Param("productType") String productType,
@Param("skillCode") String skillCode, @Param("teamIds") List<String> teamIds);
......@@ -122,7 +122,7 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
@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 " +
" WHERE si.brand = :brand and si.`type` = :productType and si.skill = :skill and ei.group_id in ( :teamIds ) " +
" WHERE ei.bean_status = 1 AND esg.status = 1 AND mlc.status = 1 and si.brand = :brand and si.`type` = :productType and si.skill = :skill and ei.group_id in ( :teamIds ) " +
" order by mlc.priority ", nativeQuery = true)
List<EngineerInfoEntity> listBrandAndSkillAndTeamIdIn(@Param("brand") String brand, @Param("productType") String productType,
@Param("skill") String skill, @Param("teamIds") List<String> teamIds);
......@@ -130,7 +130,7 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
@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 " +
" WHERE si.brand = :brand and si.`type` = :productType and si.skill = :skill and ei.engineer_code in ( :engineerCodes ) " +
" WHERE ei.bean_status = 1 AND esg.status = 1 AND mlc.status = 1 and si.brand = :brand and si.`type` = :productType and si.skill = :skill and ei.engineer_code in ( :engineerCodes ) " +
" order by mlc.priority ", nativeQuery = true)
List<EngineerInfoEntity> listBrandAndSkillAndEngineerCodes(@Param("brand") String brand, @Param("productType") String productType,
@Param("skill") String skill, @Param("engineerCodes") List<String> engineerCodes);
......@@ -143,7 +143,7 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
* @return 工作队下没有工程师则返回空
*/
@Query(value = "SELECT ei.* from org_team_engineer ote left join engineer_info ei ON ote.engineer_code = ei.engineer_code " +
"WHERE ote.team_id = :teamId AND ote.engineer_code = :engineerCode AND ote.`status` = 1", nativeQuery = true)
"WHERE ei.bean_status = 1 AND ote.team_id = :teamId AND ote.engineer_code = :engineerCode AND ote.`status` = 1", nativeQuery = true)
EngineerInfoEntity selectEngineerByEngineerCodeAndTeamId(@Param("engineerCode") String engineerCode, @Param("teamId") String teamId);
@Query(value = "SELECT DISTINCT esg.engineer_code FROM engineer_skill_group esg WHERE engineer_code in (:engineerCodes) and skill_group_code in (:skillGroupCodes) and status = 1", nativeQuery = true)
......
......@@ -29,7 +29,7 @@ public interface OrgGroupDao extends JpaRepository<OrgGroupEntity, Integer> {
public List<OrgGroupEntity> findByGroupIdIn(List<String> ids);
@Query(value = "SELECT * from org_group og left join org_team ot on og.group_id = ot.group_id WHERE ot.team_id in (:teamIds) order by og.category ", nativeQuery = true)
@Query(value = "SELECT * from org_group og left join org_team ot on og.group_id = ot.group_id WHERE og.status = 1 and ot.status = 1 and ot.team_id in (:teamIds) order by og.category ", nativeQuery = true)
List<OrgGroupEntity> findByTeamIdIn(@Param("teamIds") List<String> teamIds);
/**
......@@ -39,7 +39,7 @@ public interface OrgGroupDao extends JpaRepository<OrgGroupEntity, Integer> {
* @return 工作队ID
*/
@Query(value = "SELECT og.* FROM org_group og left join org_team ot ON ot.group_id = og.group_id "
+ "WHERE ot.team_id = :teamId",nativeQuery = true)
+ "WHERE og.status = 1 and ot.status = 1 and ot.team_id = :teamId",nativeQuery = true)
OrgGroupEntity queryGroupByTeam(String teamId);
OrgGroupEntity getByCitycodeListLike(String citycodeList);
......
......@@ -2,6 +2,7 @@ package com.dituhui.pea.order.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.time.LocalDateTime;
......@@ -10,6 +11,7 @@ import java.time.LocalDateTime;
@Entity
@Table(name = "engineer_info")
@EqualsAndHashCode
@Where(clause = "bean_status = 1")
public class EngineerInfoEntity {
/**
* 工程师id
......
package com.dituhui.pea.order.entity;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.time.LocalDateTime;
......@@ -9,6 +10,7 @@ import java.util.Date;
@Entity
@Data
@Table(name = "org_branch")
@Where(clause = "status = 1")
public class OrgBranchEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......
package com.dituhui.pea.order.entity;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.time.LocalDateTime;
......@@ -9,6 +10,7 @@ import java.util.Date;
@Entity
@Data
@Table(name = "org_cluster")
@Where(clause = "status = 1")
public class OrgClusterEntity {
@Id
......
package com.dituhui.pea.order.entity;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.time.LocalDateTime;
......@@ -9,6 +10,7 @@ import java.util.Date;
@Entity
@Data
@Table(name = "org_group")
@Where(clause = "status = 1")
public class OrgGroupEntity {
/**
......
......@@ -2,6 +2,7 @@ package com.dituhui.pea.order.entity;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.time.LocalDateTime;
......@@ -10,6 +11,7 @@ import java.time.LocalDateTime;
@Table(name = "org_team")
@Data
@Accessors(chain = true)
@Where(clause = "status = 1")
public class OrgTeamEntity {
@Id
......
......@@ -39,4 +39,7 @@ public interface ISaaSRemoteService {
@PostMapping("/saas/baseData/area/getDistrictByRegion")
public String getAdminDistrict(@RequestParam("ak") String ak, @RequestBody AdministrativeDistrictReq districtReq);
@GetMapping("/saas/baseData/area/getAreaById")
public String getAreaById(@RequestParam String ak, @RequestParam String areaId, @RequestParam Boolean needPoints, @RequestParam Boolean layerStyle);
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!