|
@ -477,6 +477,35 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
|
|
|
return list ;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导出设备体征上传明细(包含绑定未使用)
|
|
|
* @param town
|
|
|
* @param hospital
|
|
|
* @return
|
|
|
*/
|
|
|
public List<DeviceHealthIndexExportVO> exportDeviceHealthList(String town, String hospital) {
|
|
|
List<DeviceHealthIndexExportVO> list = new ArrayList<>();
|
|
|
String sql = "SELECT " +
|
|
|
"s.patient," +
|
|
|
"s.`name`," +
|
|
|
"case when s.mobile !='' then CONCAT(left(s.mobile,3),'*******',right(s.mobile,2)) else s.mobile end mobile," +
|
|
|
"CONCAT(left(s.idcard,6),'**********',right(s.idcard,2)) idcard," +
|
|
|
"pd.device_sn," +
|
|
|
"pd.device_name," +
|
|
|
"d.record_date," +
|
|
|
"d.amount,"+
|
|
|
// "CASE d.type WHEN 1 THEN '血糖' WHEN 2 THEN '血压' WHEN 3 THEN '体重' WHEN 4 THEN '腰围' END statusName,"+
|
|
|
"s.doctor_name," +
|
|
|
"p.address FROM wlyy_sign_family s,wlyy_patient p,wlyy_patient_device pd LEFT JOIN(" +
|
|
|
"SELECT i.`user`,i.device_sn, i.type, max(i.record_date) record_date, count(i.id) amount, w.device_name " +
|
|
|
"FROM device.wlyy_patient_health_index i,wlyy_patient_device w "+
|
|
|
"WHERE i.device_sn = w.device_sn AND i.del=1 AND i.`type` IN (1, 2) GROUP BY i.`user`,i.device_sn,i.type) d on pd.user = d.`user`"+
|
|
|
"WHERE s.patient = pd.`user` AND s.hospital='"+hospital+"' AND s.`status`> 0 AND s.patient=p.code ORDER BY d.record_date desc ";
|
|
|
|
|
|
list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(DeviceHealthIndexExportVO.class));
|
|
|
return list ;
|
|
|
}
|
|
|
|
|
|
public JSONObject gethealthStandard(Integer type, String patientCode) {
|
|
|
//血糖校验
|
|
|
JSONObject json = new JSONObject();
|