소스 검색

代码修改

liubing 3 년 전
부모
커밋
d7b019bf53

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientHealthIndexService.java

@ -1608,7 +1608,7 @@ public class PatientHealthIndexService extends BaseJpaService<DevicePatientHealt
    public List<Map<String,Object>> getErrorHealthIndexPatients(String doctor){
        String sql = " select count(id),patient,photo,mobile,record_date from (\n" +
                "select idx.id,p.id patient,p.photo,idx.record_date,p.mobile from wlyy_patient_health_index idx,base_patient p " +
                "select idx.id,p.id patient,p.photo,DATE_FORMAT(idx.record_date,'%Y-%m-%d %H:%i:%S')record_date ,p.mobile from wlyy_patient_health_index idx,base_patient p " +
                "where  idx.user = p.id and  status=1 and (manage_result=0 or manage_result is null)  and EXISTS ( " +
                " SELECT 1 from base_service_package_sign_record sr,base_service_package_record r ,base_team_member m where " +
                "idx.user = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and   m.team_code = r.team_code  " +
@ -1619,7 +1619,7 @@ public class PatientHealthIndexService extends BaseJpaService<DevicePatientHealt
    }
    public List<Map<String,Object>> getErrorHealthIndexByPatients(String patient){
        String sql = " select * from  wlyy_patient_health_index where user='"+patient+"' and  " +
        String sql = " select *,cast(DATE_FORMAT(max(idx.record_date),'%Y-%m-%d %H:%i:%S') as char)record_date  from  wlyy_patient_health_index where user='"+patient+"' and  " +
                "status=1 and (manage_result=0 or manage_result is null) ";
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
        return result;

+ 6 - 8
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/DoctorMessageService.java

@ -21,10 +21,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by Bing on 2021/4/10.
@ -136,13 +134,13 @@ public class DoctorMessageService {
        }
        if (typeNull||type.equals("13")){//居民体征异常消息
            JSONObject tmpJson = new JSONObject();
            count=0;
            String sql = " select count(idx.id) from wlyy_patient_health_index idx where status=1 and (manage_result=0 or manage_result is null) " +
            Map<String,Object> tmpObj = new HashMap<>();
            String sql = " select count(idx.id) count,DATE_FORMAT( max(idx.record_date),'%Y-%m-%d %H:%i:%S') record_date from wlyy_patient_health_index idx where status=1 and (manage_result=0 or manage_result is null) " +
                    "and  EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r ,base_team_member m " +
                    " where idx.user = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and m.team_code = r.team_code " +
                    "  and sr.`status`=1  and m.doctor_code = '"+doctor+"' and m.del = '1')  order by idx.record_date desc   ";
            count = jdbcTemplate.queryForObject(sql,Integer.class);
            result.put("errorHealthIndex",count);
            tmpObj = jdbcTemplate.queryForMap(sql);
            result.put("errorHealthIndex",tmpObj);
        }
        return result;
    }