LAPTOP-KB9HII50\70708 11 mēneši atpakaļ
vecāks
revīzija
e02977ee26

+ 2 - 1
business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintService.java

@ -779,6 +779,7 @@ public class BaseComplaintService {
            recieve = baseComplaintDao.getCountByStatus("1");
            deal = baseComplaintDao.getCountByStatus("2");
            cacel = baseComplaintDao.getCountByStatus("-1");
            passto = getCountByPassto("");
            total = complaints + recieve + deal;
            if (StringUtils.isNotBlank(pcAdmin)) {
                //是管理员加上撤销的
@ -797,7 +798,7 @@ public class BaseComplaintService {
    public Integer getCountByPassto(String doctor) {
        String sql = "select count(1) as \"total\" from (select  DISTINCT t.id   from base_complaint t left join base_complaint_operate_log b" +
                " on t.id=b.relation_code where t.is_del='1' and b.status='3'";
                " on t.id=b.relation_code where t.is_del='1' and t.passto is not null ";
        if (StringUtils.isNoneBlank(doctor)) {
            sql += " and b.operate_from='" + doctor + "'";
        }

+ 20 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -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("查询失败");
        }
    }
    /**