|
@ -418,18 +418,20 @@ public class DataHandingService {
|
|
}
|
|
}
|
|
|
|
|
|
public void addPointOldDeviceBind()throws Exception{
|
|
public void addPointOldDeviceBind()throws Exception{
|
|
String sql = "SELECT pd.*,sf.hospital FROM wlyy_patient_device pd LEFT JOIN wlyy_sign_family sf ON pd.`user` = sf.patient where sf.`status`>0";
|
|
|
|
|
|
//String sql = "SELECT pd.*,sf.hospital FROM wlyy_patient_device pd LEFT JOIN wlyy_sign_family sf ON pd.`user` = sf.patient where sf.`status`>0";
|
|
|
|
String sql = "SELECT pd.*,sf.hospital FROM wlyy_patient_device pd LEFT JOIN wlyy_sign_family sf ON pd.`user` = sf.patient WHERE pd.czrq>'2017-07-01 00:00:00' AND pd.czrq<='2018-06-30 23:59:59' AND LEFT(sf.hospital,6)='350205' GROUP BY pd.id";
|
|
List<Map<String,Object>> patientDeviceList = jdbcTemplate.queryForList(sql);
|
|
List<Map<String,Object>> patientDeviceList = jdbcTemplate.queryForList(sql);
|
|
Map<String,String> map = new HashedMap();
|
|
Map<String,String> map = new HashedMap();
|
|
for (Map<String,Object> patientDeviceMap : patientDeviceList) {
|
|
for (Map<String,Object> patientDeviceMap : patientDeviceList) {
|
|
if (org.apache.commons.lang.StringUtils.equals(String.valueOf(patientDeviceMap.get("hospital")).substring(0,6),"350205")){
|
|
|
|
String deviceType=null;
|
|
|
|
if (!map.containsKey(String.valueOf(patientDeviceMap.get("user")))) {
|
|
|
|
deviceType = map.get(String.valueOf(patientDeviceMap.get("user")));
|
|
|
|
if (StringUtils.isEmpty(deviceType)) {
|
|
|
|
deviceType = String.valueOf(patientDeviceMap.get("category_code"));
|
|
|
|
map.put(String.valueOf(patientDeviceMap.get("user")), deviceType);
|
|
|
|
}
|
|
|
|
|
|
/*if (org.apache.commons.lang.StringUtils.equals(String.valueOf(patientDeviceMap.get("hospital")).substring(0,6),"350205")){
|
|
|
|
|
|
|
|
}*/
|
|
|
|
String deviceType=null;
|
|
|
|
if (!map.containsKey(String.valueOf(patientDeviceMap.get("user")))) {
|
|
|
|
deviceType = map.get(String.valueOf(patientDeviceMap.get("user")));
|
|
|
|
if (StringUtils.isEmpty(deviceType)) {
|
|
|
|
deviceType = String.valueOf(patientDeviceMap.get("category_code"));
|
|
|
|
map.put(String.valueOf(patientDeviceMap.get("user")), deviceType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|