|
@ -95,7 +95,7 @@ public class DoctorMessageService {
|
|
sql+= "and EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," +
|
|
sql+= "and EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," +
|
|
"base_team_member m " +
|
|
"base_team_member m " +
|
|
"where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and " +
|
|
"where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and " +
|
|
" r.service_package_id = i.service_package_id and m.team_code = i.team_code and i.del = 1 and sr.`status`=1 and i.code='preventLost' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
|
|
|
|
|
|
" r.service_package_id = i.service_package_id and m.team_code = r.team_code and i.del = 1 and sr.`status`=1 and i.code='preventLost' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
|
|
sql+=" order by create_time asc ";
|
|
sql+=" order by create_time asc ";
|
|
Map<String,Object> sqlResult = jdbcTemplate.queryForMap(sql);
|
|
Map<String,Object> sqlResult = jdbcTemplate.queryForMap(sql);
|
|
if (sqlResult.containsKey("count")){
|
|
if (sqlResult.containsKey("count")){
|
|
@ -119,7 +119,7 @@ public class DoctorMessageService {
|
|
sql+= "and EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," +
|
|
sql+= "and EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," +
|
|
"base_team_member m " +
|
|
"base_team_member m " +
|
|
"where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and " +
|
|
"where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and " +
|
|
" r.service_package_id = i.service_package_id and m.team_code = i.team_code and i.del = 1 and sr.`status`=1 and i.code='emergencyAssistance' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
|
|
|
|
|
|
" r.service_package_id = i.service_package_id and m.team_code = r.team_code and i.del = 1 and sr.`status`=1 and i.code='emergencyAssistance' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
|
|
sql+=" order by create_time asc ";
|
|
sql+=" order by create_time asc ";
|
|
Map<String,Object> sqlResult = jdbcTemplate.queryForMap(sql);
|
|
Map<String,Object> sqlResult = jdbcTemplate.queryForMap(sql);
|
|
if (sqlResult.containsKey("count")){
|
|
if (sqlResult.containsKey("count")){
|
|
@ -148,7 +148,7 @@ public class DoctorMessageService {
|
|
"and EXISTS ( \n" +
|
|
"and EXISTS ( \n" +
|
|
"SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
|
|
"SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
|
|
"base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and \n" +
|
|
"base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and \n" +
|
|
"r.service_package_id = i.service_package_id and m.team_code = i.team_code and i.del = 1 and sr.`status`=1 and i.code='preventLost' \n" +
|
|
|
|
|
|
"r.service_package_id = i.service_package_id and m.team_code = r.team_code and i.del = 1 and sr.`status`=1 and i.code='preventLost' \n" +
|
|
"and m.doctor_code = '"+doctor+"' and m.del = '1') \n" +
|
|
"and m.doctor_code = '"+doctor+"' and m.del = '1') \n" +
|
|
"order by create_time DESC ";
|
|
"order by create_time DESC ";
|
|
|
|
|
|
@ -159,7 +159,7 @@ public class DoctorMessageService {
|
|
"and EXISTS ( \n" +
|
|
"and EXISTS ( \n" +
|
|
"SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
|
|
"SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
|
|
"base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and \n" +
|
|
"base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and \n" +
|
|
"r.service_package_id = i.service_package_id and m.team_code = i.team_code and i.del = 1 and sr.`status`=1 and i.code='preventLost' \n" +
|
|
|
|
|
|
"r.service_package_id = i.service_package_id and m.team_code = r.team_code and i.del = 1 and sr.`status`=1 and i.code='preventLost' \n" +
|
|
"and m.doctor_code = '"+doctor+"' and m.del = '1') ";
|
|
"and m.doctor_code = '"+doctor+"' and m.del = '1') ";
|
|
}
|
|
}
|
|
|
|
|
|
@ -173,7 +173,7 @@ public class DoctorMessageService {
|
|
"and EXISTS ( \n" +
|
|
"and EXISTS ( \n" +
|
|
"SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
|
|
"SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
|
|
"base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and \n" +
|
|
"base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and \n" +
|
|
"r.service_package_id = i.service_package_id and m.team_code = i.team_code and i.del = 1 and sr.`status`=1 and i.code='emergencyAssistance' \n" +
|
|
|
|
|
|
"r.service_package_id = i.service_package_id and m.team_code = r.team_code and i.del = 1 and sr.`status`=1 and i.code='emergencyAssistance' \n" +
|
|
"and m.doctor_code = '"+doctor+"' and m.del = '1')\n" +
|
|
"and m.doctor_code = '"+doctor+"' and m.del = '1')\n" +
|
|
"order by create_time DESC ";
|
|
"order by create_time DESC ";
|
|
|
|
|
|
@ -186,7 +186,7 @@ public class DoctorMessageService {
|
|
"and EXISTS ( \n" +
|
|
"and EXISTS ( \n" +
|
|
"SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
|
|
"SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
|
|
"base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and \n" +
|
|
"base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and sr.id = r.sign_id and sr.status=1 and \n" +
|
|
"r.service_package_id = i.service_package_id and m.team_code = i.team_code and i.del = 1 and sr.`status`=1 and i.code='emergencyAssistance' \n" +
|
|
|
|
|
|
"r.service_package_id = i.service_package_id and m.team_code = r.team_code and i.del = 1 and sr.`status`=1 and i.code='emergencyAssistance' \n" +
|
|
"and m.doctor_code = '"+doctor+"' and m.del = '1')";
|
|
"and m.doctor_code = '"+doctor+"' and m.del = '1')";
|
|
}
|
|
}
|
|
|
|
|