|
@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@ -51,6 +52,25 @@ class EsStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
private BaseDoctorDao baseDoctorDao;
|
|
|
@Autowired
|
|
|
private BaseDoctorHospitalDao baseDoctorHospitalDao;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
@GetMapping(value = "findDeptWorkList")
|
|
|
@ApiOperation(value = "科室排班统计")
|
|
|
public ListEnvelop findDeptWorkList(@RequestParam(required = true) String queryDate){
|
|
|
try {
|
|
|
String sql = "SELECT d.dept_name,COUNT(w.id) total,sum(if(w.time_type=1,1,0)) time_type1, " +
|
|
|
"sum(if(w.time_type=2,1,0)) time_type2,sum(if(w.time_type=3,1,0)) time_type3 " +
|
|
|
" from wlyy_doctor_work_time w,base_doctor_hospital d " +
|
|
|
"WHERE w.doctor = d.doctor_code and w.work_date='"+queryDate+"' and d.del='1' " +
|
|
|
"GROUP BY d.dept_name order by total desc";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
return ListEnvelop.getSuccess("查询成功",list);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return ListEnvelop.getError("查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|