瀏覽代碼

Merge branch 'dev' of lyr/patient-co-management into dev

lyr 8 年之前
父節點
當前提交
3dbfca8eee

+ 11 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/SignPatientLabelInfoDao.java

@ -28,6 +28,17 @@ public interface SignPatientLabelInfoDao extends
     */
     */
    List<SignPatientLabelInfo> findByPatientAndStatus(String patient, Integer status);
    List<SignPatientLabelInfo> findByPatientAndStatus(String patient, Integer status);
    /**
     * 查询某个患者的标签
     *
     * @param patient 患者
     * @param status  状态
     * @return
     */
    @Query("select f from SignPatientLabelInfo f,SignPatientLabel l where f.patient = ?1 and f.status = ?2 and f.label = l.labelCode and f.labelType =l.labelType" +
            " and l.status = ?2 and (l.labelType <> '4' or l.teamCode = ?3 or ( l.labelType = '4' and l.labelCode in (1,2)) )")
    List<SignPatientLabelInfo> findByPatientAndStatusByTeam(String patient, Integer status, Long teamCode);
    /**
    /**
     * 查询某个患者的某个类型标签
     * 查询某个患者的某个类型标签
     *
     *

+ 11 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -105,8 +105,8 @@ public class SignPatientLabelInfoService extends BaseService {
        // 社保号
        // 社保号
        json.put("ssc", p.getSsc());
        json.put("ssc", p.getSsc());
        SignFamily ssSign = signFamilyDao.findSignByPatient(patient,1);
        SignFamily familySign = signFamilyDao.findSignByPatient(patient,2);
        SignFamily ssSign = signFamilyDao.findSignByPatient(patient, 1);
        SignFamily familySign = signFamilyDao.findSignByPatient(patient, 2);
        if (ssSign != null) {
        if (ssSign != null) {
            // 设置患者紧急联系人
            // 设置患者紧急联系人
@ -1146,6 +1146,7 @@ public class SignPatientLabelInfoService extends BaseService {
                        " join " : " left join ") +
                        " join " : " left join ") +
                "    wlyy_sign_patient_label_info t2 " +
                "    wlyy_sign_patient_label_info t2 " +
                " ON t1.patient = t2.patient " +
                " ON t1.patient = t2.patient " +
                (teamCode > 0 ? " join (select * from wlyy_sign_patient_label where label_type != '4' or team_code = " + teamCode + " or (label_type = '4' and (label_code in (1,2)))) lb on t2.label = lb.label_code and t2.label_type = lb.label_type " : "") +
                " WHERE " +
                " WHERE " +
                "    t1.repdoctor = ? " +
                "    t1.repdoctor = ? " +
                "    AND t1.status > 0 " +
                "    AND t1.status > 0 " +
@ -1164,7 +1165,7 @@ public class SignPatientLabelInfoService extends BaseService {
        }
        }
        String sqlDoc = sql.replaceAll("repdoctor", "doctor");
        String sqlDoc = sql.replaceAll("repdoctor", "doctor");
        String sqlDocHealth = sql.replaceAll("repdoctor", "doctor_health").replaceAll("t1", "t3").replaceAll("t2", "t4");
        String sqlDocHealth = sql.replaceAll("repdoctor", "doctor_health").replaceAll("t1", "t3").replaceAll("t2", "t4").replaceAll("lb", "lb1");
        sql = "select DISTINCT t.* from (" + sqlDoc + " union all " + sqlDocHealth + ") t limit " + page + "," + pagesize;
        sql = "select DISTINCT t.* from (" + sqlDoc + " union all " + sqlDocHealth + ") t limit " + page + "," + pagesize;
        signList = jdbcTemplate.queryForList(sql, args);
        signList = jdbcTemplate.queryForList(sql, args);
@ -1218,7 +1219,13 @@ public class SignPatientLabelInfoService extends BaseService {
                    }
                    }
                }
                }
                List<SignPatientLabelInfo> labels = labelInfoDao.findByPatientAndStatus(sign.get("patient").toString(), 1);
                List<SignPatientLabelInfo> labels = null;
                if (teamCode > 0) {
                    labels = labelInfoDao.findByPatientAndStatusByTeam(sign.get("patient").toString(), 1, teamCode);
                } else {
                    labels = labelInfoDao.findByPatientAndStatus(sign.get("patient").toString(), 1);
                }
                JSONObject json = new JSONObject();
                JSONObject json = new JSONObject();