|
@ -424,6 +424,45 @@ public class StatisticsService {
|
|
|
return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,count);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* @param type 类型。1医生,2社工,3教师,4助老员
|
|
|
* @param page
|
|
|
* @param pageSize
|
|
|
* @param name
|
|
|
* @param idCard
|
|
|
* @return
|
|
|
*/
|
|
|
public PageEnvelop getUserListByPage(String type,Integer page,Integer pageSize,String name,String idCard){
|
|
|
page = page>0?page-1:0;
|
|
|
String selectSql = "SELECT a.id,a.name,\n" +
|
|
|
"\tCASE\n" +
|
|
|
"\t\ta.sex \n" +
|
|
|
"\t\tWHEN 1 THEN\n" +
|
|
|
"\t\t'男' \n" +
|
|
|
"\t\tWHEN 2 THEN\n" +
|
|
|
"\t\t'女' ELSE a.sex \n" +
|
|
|
"\tEND AS sex,\n" +
|
|
|
"\tTIMESTAMPDIFF(YEAR,a.birthday,now()) AS age,\n" +
|
|
|
"\ta.doctor_level,a.mobile,h.org_name,a.idcard ";
|
|
|
String countSql = "select count(a.id)";
|
|
|
String fromSql = " from base_doctor a,base_doctor_hospital h where a.id=h.doctor_code and a.del = '1' and h.del = '1' " +
|
|
|
" and a.doctor_level is not null and h.org_code not in ( " +
|
|
|
" SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' ) and a.doctor_level="+type+" ";
|
|
|
if(StringUtils.isNotBlank(name)){
|
|
|
fromSql+=" and a.name like '%"+name+"%' ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(idCard)){
|
|
|
fromSql+=" and a.idcard like '%"+idCard+"%' ";
|
|
|
}
|
|
|
Long count = jdbcTemplate.queryForObject(countSql + fromSql, Long.class);
|
|
|
fromSql+=" limit "+page*pageSize+","+pageSize;
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(selectSql + fromSql);
|
|
|
return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,count);
|
|
|
}
|
|
|
|
|
|
|
|
|
// v0.7.0实时数据 照护对象、检测设备、紧急救助
|
|
|
public JSONObject realTimeDataNew() throws Exception {
|
|
|
JSONObject res = new JSONObject();
|