|
@ -2461,6 +2461,37 @@ public class StatisticsService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public PageEnvelop getCareServerList(String name,String idCard,String area,Integer status,Integer page,Integer pageSize){
|
|
|
|
page = page>0?page-1:0;
|
|
|
|
String olderFilter = " and EXISTS ( select 1 from " +
|
|
|
|
" base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " +
|
|
|
|
" where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id and i.del = 1 " +
|
|
|
|
" and sr.`status`=1 and CONVERT(sr.patient USING utf8) = life.patient " +
|
|
|
|
" and CONVERT(sr.patient USING utf8) not in (SELECT dict_code FROM `base`.`wlyy_hospital_sys_dict` WHERE `dict_name` = 'jkzl_older' or dict_name='jkzl_child') ) ";
|
|
|
|
String pageSql = " order by life.create_time desc limit "+page*pageSize+","+pageSize;
|
|
|
|
|
|
|
|
String headSql = "SELECT life.id,life.number,life.patient,life.patient_name patientName,life.patient_phone patientPhone,life.hospital,life.hospital_name hospitalName,CAST(DATE_FORMAT(life.create_time,'%Y-%m-%d %H:%i:%S') as char) createTime,de.name serviceName,p.idcard,p.residential_area residentialArea ";
|
|
|
|
String countSql = "SELECT count(*) ";
|
|
|
|
String tableSql = " FROM base_life_care_order life left join base_life_care_fee_detail de on life.id = de.order_id left join base_patient p on life.patient = p.id where 1=1 ";
|
|
|
|
if(StringUtils.isNotBlank(name)){
|
|
|
|
tableSql += " and p.name like '%"+name+"%' ";
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(idCard)){
|
|
|
|
tableSql += " and p.idcard like '%"+idCard+"%' ";
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(area)){
|
|
|
|
tableSql += " and p.residential_area like '%"+area+"%' ";
|
|
|
|
}
|
|
|
|
if(status == null){
|
|
|
|
tableSql += " and life.status in (1,2,3) ";
|
|
|
|
}else {
|
|
|
|
tableSql += " and life.status = "+status + " ";
|
|
|
|
}
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(headSql + tableSql + olderFilter+pageSql);
|
|
|
|
Long count = jdbcTemplate.queryForObject(countSql + tableSql + olderFilter, Long.class);
|
|
|
|
return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,count);
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
*获取老人服务情况(助老服务、紧急救助、医生服务 项目数量)
|
|
*获取老人服务情况(助老服务、紧急救助、医生服务 项目数量)
|
|
*/
|
|
*/
|