Commit 78a823fe authored by 徐俊's avatar 徐俊

xujun

parent 624c10a6
......@@ -24,4 +24,6 @@ public interface ComExpertSpecDAO extends BaseMapper<ComExpertSpec>, BaseDAO<Com
List<ComExpertDTO> getExpertListBySpecIdProjId(@Param("specIds") List<String> SpecList, @Param("porjIds") List<String> ProjList);
List<ComExpertDTO> getExpertListByExpertSpecIds(@Param("specIds") List<String> SpecList, @Param("parentIds") List<String> ParentList, @Param("personName") String personName);
List<ComExpertDTO> getExpertListByExpertSpecIdOrParentId(@Param("specId")String specId, @Param("pkey")String pkey, @Param("ppkey")String ppkey, @Param("personName") String personName);
}
......@@ -68,4 +68,11 @@ public class ComExpertSpecController extends BaseController<ComExpertSpecService
return ResponseDataModel.ok(comExpertSpecService.getExpertListByExpertSpecIds(SpecList, ParentList, personName));
}
@ApiOperation(value = "根据学科Id获取专家列表", httpMethod = "GET", notes = "根据学科Id获取专家列表")
@GetMapping
@RequestMapping("/getExpertListByExpertSpecIdOrParentId")
public ResponseDataModel<List<SelectListItem>> getExpertListByExpertSpecIdOrParentId(String specId, String pkey, String ppkey, String personName) {
return ResponseDataModel.ok(comExpertSpecService.getExpertListByExpertSpecIdOrParentId(specId, pkey, ppkey, personName));
}
}
......@@ -46,4 +46,14 @@ public interface ComExpertSpecService extends BaseService<ComExpertSpecQueryVO,
* @param SpecList
*/
List<SelectListItem> getExpertListByExpertSpecIds(List<String> SpecList, List<String> ParentList, String personName);
/**
* 根据学科Id获取专家列表
* @param specId
* @param pkey
* @param ppkey
* @param personName
* @return
*/
List<SelectListItem> getExpertListByExpertSpecIdOrParentId(String specId, String pkey, String ppkey, String personName);
}
......@@ -115,4 +115,18 @@ public class ComExpertSpecServiceImpl extends BaseServiceImpl<ComExpertSpecDAO,
}
return allItem;
}
public List<SelectListItem> getExpertListByExpertSpecIdOrParentId(String specId, String pkey, String ppkey, String personName) {
List<ComExpertDTO> list = comExpertSpecDAO.getExpertListByExpertSpecIdOrParentId(specId, pkey, ppkey, personName);
List<SelectListItem> allItem = new ArrayList<>();
if (null != list && list.size() > 0) {
list.forEach((e) -> {
String description = e.getSex() + "/" + AgeUtil.getResidentAge(e.getBirthday()) + "岁/" + e.getWorkUnit();
SelectListItem treeListItem = new SelectListItem(e.getPersonName(), e.getId(), description, false, false, new ArrayList<>());
allItem.add(treeListItem);
});
}
return allItem;
}
}
......@@ -72,5 +72,24 @@
where c.person_name like CONCAT('%',#{personName},'%')
</if>
</select>
<select id="getExpertListByExpertSpecIdOrParentId" resultType="com.yiboshi.science.param.dto.ComExpertDTO">
select distinct a.expert_id id,c.person_name,c.cert_id,c.sex,c.birthday,e.unit_name as work_unit
from com_expert_spec a
left join com_expert b on a.expert_id = b.id
left join com_person c on b.person_id = c.id
left join system_parameter p on a.spec_id = p.id
left join system_parameter p1 on p.parent_id = p1.id
left join system_parameter p2 on p1.parent_id = p2.id
left join com_unit e on c.unit_id = e.id
<if test=' specId != null '>
where a.spec_id = #{specId}
</if>
<if test=' pkey != null '>
where p1.id = #{pkey}
</if>
<if test=' ppkey != null '>
where p2.id = #{ppkey}
</if>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment