Browse Source

心理咨询师详细信息app接口

hotfix/yujt_opt
zhangyuan 6 years ago
parent
commit
929743b1e4
  1. 9
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/AppPsychologistController.java
  2. 12
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistDao.java
  3. 12
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleRelationDao.java
  4. 12
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistService.java
  5. 14
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistServiceImpl.java
  6. 10
      epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml
  7. 14
      epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleRelationDao.xml

9
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/AppPsychologistController.java

@ -20,6 +20,8 @@ package com.elink.esua.epdc.modules.psychology.controller;
import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.psychology.form.PsychologistFormDTO;
import com.elink.esua.epdc.dto.psychology.form.PsychologistInfoFormDTO;
import com.elink.esua.epdc.dto.psychology.result.PsychologistInfoResultDTO;
import com.elink.esua.epdc.dto.psychology.result.PsychologistResultDTO;
import com.elink.esua.epdc.modules.psychology.service.PsychologistService;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,9 +47,14 @@ public class AppPsychologistController {
private PsychologistService psychologistService;
@GetMapping("listPsychiatrist")
public Result<List<PsychologistResultDTO>> export(@RequestBody PsychologistFormDTO formDto) throws Exception {
public Result<List<PsychologistResultDTO>> listPsychiatrist(@RequestBody PsychologistFormDTO formDto) throws Exception {
List<PsychologistResultDTO> list = psychologistService.listPsychiatrist(formDto);
return new Result<List<PsychologistResultDTO>>().ok(list);
}
@GetMapping("psychologistInfo")
public Result<PsychologistInfoResultDTO> psychologistInfo(@RequestBody PsychologistInfoFormDTO formDto) throws Exception {
PsychologistInfoResultDTO data = psychologistService.psychologistInfo(formDto);
return new Result<PsychologistInfoResultDTO>().ok(data);
}
}

12
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistDao.java

@ -19,6 +19,7 @@ package com.elink.esua.epdc.modules.psychology.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.psychology.form.PsychologistFormDTO;
import com.elink.esua.epdc.dto.psychology.form.PsychologistInfoFormDTO;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity;
import org.apache.ibatis.annotations.Mapper;
@ -53,4 +54,15 @@ public interface PsychologistDao extends BaseDao<PsychologistEntity> {
* @since 2020/5/21 14:54
*/
List<PsychologistEntity> listPsychiatrist(PsychologistFormDTO dto);
/**
* 心理咨询师详细
*
* @return java.util.List<com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity>
* @params [params]
* @author zhangyuan
* @since 2020/5/21 14:54
*/
PsychologistEntity psychologistInfo(PsychologistInfoFormDTO dto);
}

12
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleRelationDao.java

@ -34,7 +34,17 @@ import java.util.List;
public interface PsychologistTitleRelationDao extends BaseDao<PsychologistTitleRelationEntity> {
/**
* 咨询师列表
* 咨询师头衔id列表
*
* @return java.util.List<com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity>
* @params [id]
* @author zhangyuan
* @since 2020/5/21 14:54
*/
List<String> selectTitleIds(@Param("id") String id);
/**
* 咨询师头衔名称列表
*
* @return java.util.List<com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity>
* @params [id]

12
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistService.java

@ -21,6 +21,8 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.psychology.PsychologistDTO;
import com.elink.esua.epdc.dto.psychology.form.PsychologistFormDTO;
import com.elink.esua.epdc.dto.psychology.form.PsychologistInfoFormDTO;
import com.elink.esua.epdc.dto.psychology.result.PsychologistInfoResultDTO;
import com.elink.esua.epdc.dto.psychology.result.PsychologistResultDTO;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity;
@ -105,4 +107,14 @@ public interface PsychologistService extends BaseService<PsychologistEntity> {
*/
List<PsychologistResultDTO> listPsychiatrist(PsychologistFormDTO dto);
/**
* 心理咨询师详细API
*
* @param dto
* @return PsychologistInfoResultDTO
* @author zhangyuan
* @date 2020-06-04
*/
PsychologistInfoResultDTO psychologistInfo(PsychologistInfoFormDTO dto);
}

14
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistServiceImpl.java

@ -25,6 +25,8 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.dto.psychology.PsychologistDTO;
import com.elink.esua.epdc.dto.psychology.form.PsychologistFormDTO;
import com.elink.esua.epdc.dto.psychology.form.PsychologistInfoFormDTO;
import com.elink.esua.epdc.dto.psychology.result.PsychologistInfoResultDTO;
import com.elink.esua.epdc.dto.psychology.result.PsychologistResultDTO;
import com.elink.esua.epdc.modules.psychology.dao.PsychologistDao;
import com.elink.esua.epdc.modules.psychology.dao.PsychologistTitleRelationDao;
@ -86,7 +88,7 @@ public class PsychologistServiceImpl extends BaseServiceImpl<PsychologistDao, Ps
public PsychologistDTO get(String id) {
PsychologistEntity entity = baseDao.selectById(id);
PsychologistDTO dto = ConvertUtils.sourceToTarget(entity, PsychologistDTO.class);
List<String> titles = psychologistTitleRelationDao.selectTitles(id);
List<String> titles = psychologistTitleRelationDao.selectTitleIds(id);
dto.setTitles(titles == null ? new ArrayList<>() : titles);
return dto;
}
@ -136,4 +138,14 @@ public class PsychologistServiceImpl extends BaseServiceImpl<PsychologistDao, Ps
List<PsychologistEntity> entity = baseDao.listPsychiatrist(dto);
return ConvertUtils.sourceToTarget(entity, PsychologistResultDTO.class);
}
@Override
public PsychologistInfoResultDTO psychologistInfo(PsychologistInfoFormDTO dto) {
PsychologistEntity entity = baseDao.psychologistInfo(dto);
PsychologistInfoResultDTO data = ConvertUtils.sourceToTarget(entity, PsychologistInfoResultDTO.class);
List<String> titles = psychologistTitleRelationDao.selectTitles(dto.getPsychologistId());
data.setTitle(titles == null ? new ArrayList<>() : titles);
return data;
}
}

10
epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml

@ -57,4 +57,14 @@
LIMIT 4
</if>
</select>
<select id="psychologistInfo" resultType="com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity">
SELECT
<include refid="Base_Column_List"/>
FROM
epdc_psychologist
WHERE
DEL_FLAG = '0'
AND ID = #{psychologistId}
</select>
</mapper>

14
epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleRelationDao.xml

@ -15,7 +15,7 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectTitles" resultType="java.lang.String">
<select id="selectTitleIds" resultType="java.lang.String">
SELECT
TITLE_ID
FROM
@ -27,6 +27,18 @@
t.SORT ASC,
t.CREATED_TIME DESC
</select>
<select id="selectTitles" resultType="java.lang.String">
SELECT
t.TITLE
FROM
epdc_psychologist_title_relation r
LEFT JOIN epdc_psychologist_title t ON r.TITLE_ID = t.id
WHERE
r.PSYCHOLOGIST_ID = #{id}
ORDER BY
t.SORT ASC,
t.CREATED_TIME DESC
</select>
<delete id="clearRelation">
DELETE
FROM

Loading…
Cancel
Save