瀏覽代碼

通过患者的签约团队取得所属的行政团队

Sand 8 年之前
父節點
當前提交
eaed4e3f5a

+ 4 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamDao.java

@ -56,21 +56,18 @@ public interface DoctorAdminTeamDao extends
                                                 Pageable pageable);
    /**
     * 患者所签约团队。
     * 通过患者约团队取得行政团队。
     *
     * @param patientCode
     * @return
     */
    @Query("SELECT  t.id, t.name, t.leaderCode, d1.code, d1.name, d2.code, d2.name\n" +
            "FROM SignFamily f, Doctor d1, Doctor d2, AdminTeam t, AdminTeamMember m \n" +
            "WHERE d1.code = f.doctor AND f.doctorHealth = d2.code AND f.patient = :patientCode AND m.doctorCode = " +
            "d1.code AND m.teamId = t.id")
    Object getPatientSigningTeam(@Param("patientCode") String patientCode);
    @Query("SELECT t.id, t.name, t.leaderCode, f.doctor, f.doctorName, f.doctorHealth, f.doctorHealthName " +
            "FROM SignFamily f, AdminTeam t WHERE f.patient = :patientCode AND f.status in (-3, 1) AND t.id=f.adminTeamId ORDER BY f.czrq DESC")
    Object findTop1AdminTeamByPatientSignTeam(@Param("patientCode") String patientCode);
    @Query("SELECT t.id from AdminTeam t WHERE t.leaderCode = :leaderCode")
    Long findIdByLeaderCode(@Param("leaderCode") String leaderCode);
    @Query(" from AdminTeam t")
    List<AdminTeam> findAllTeam();

+ 6 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -22,14 +22,14 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	@Query("select count(1) from SignFamily a where a.idcard = ?1 and a.type = 2 and a.status >= 0")
	int hasSingStatus(String idcard);
	@Query("select a from SignFamily a where a.idcard = ?1 and status = ?2 and a.type = 2")
	SignFamily findByPatientStatus(String idcard, int status);
    @Query("select a from SignFamily a where a.idcard = ?1 and status = ?2 and a.type = 2")
    SignFamily findByPatientStatus(String idcard, int status);
	@Query("select a from SignFamily a where a.patient = ?1 and status = ?2 and a.type = 2")
	SignFamily findByPatientCodeStatus(String patient, int status);
    @Query("select a from SignFamily a where a.patient = ?1 and status = ?2 and a.type = 2")
    SignFamily findByPatientCodeStatus(String patient, int status);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type = ?2 and a.status >= 1")
	SignFamily findByPatientAndType(String patient,int type);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type = ?2 and a.status >= 1")
    SignFamily findByPatientAndType(String patient,int type);
	SignFamily findByCode(String code);

+ 4 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/team/AdminTeamService.java

@ -82,7 +82,8 @@ public class AdminTeamService extends BaseService {
    }
    public Map<String, Object> getPatientSigningTeam(String patientCode, String currentDoctor){
        Object result[] = (Object[]) teamDao.getPatientSigningTeam(patientCode);
        Object result[] = (Object[]) teamDao.findTop1AdminTeamByPatientSignTeam(patientCode);
        if (result == null) return null;
        Map<String, Object> team = new HashMap<>();
@ -91,8 +92,8 @@ public class AdminTeamService extends BaseService {
        team.put("isLeader", currentDoctor != null && result[2].equals(currentDoctor));
        team.put("doctorCode", result[3]);
        team.put("doctorName", result[4]);
        team.put("healthDoctorCode", result[5]);
        team.put("healthDoctorName", result[6]);
        team.put("healthDoctorCode", result[5] == null ? "" : result[5]);
        team.put("healthDoctorName", result[6] == null ? "" : result[6]);
        return team;
    }

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -225,8 +225,8 @@ public class ConsultController extends WeixinBaseController {
	@RequestMapping(value = "add")
	@ResponseBody
	public String add(@RequestParam(required = false) Integer type,
					  String when,
					  String symptoms,
                      @RequestParam(required = false) String when,
                      @RequestParam String symptoms,
					  @RequestParam(required = false) String images,
					  @RequestParam(required = false) String voice,
					  @RequestParam(required = false) Long guidance) {