trick9191 il y a 7 ans
Parent
commit
bc176de24c

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -687,5 +687,29 @@ public class SpecialistService extends BaseService {
        }
    }
    public Long findMessagePatientCount(String doctor){
        String sql ="SELECT " +
                " COUNT(s.sender) AS total " +
                " FROM " +
                " ( " +
                "  SELECT DISTINCT " +
                "   m.sender " +
                "  FROM " +
                "   wlyy_message m " +
                "  WHERE " +
                "   m.type IN (16,17) " +
                "  AND m.receiver = '"+doctor+"' " +
                "  AND m.has_read = 1 " +
                "  AND m.over = 1 " +
                " ) s";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        Long total = 0L;
        if(list!=null&&list.size()>0){
            Map<String,Object> map = list.get(0);
            total = (Long)map.get("total");
        }
        return total;
    }
}

+ 12 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/SpecialistController.java

@ -267,4 +267,16 @@ public class SpecialistController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "/findMessagePatientCount", method = RequestMethod.GET)
    @ApiOperation(value = "获取等待专科医生处理消息人数")
    public String findMessagePatientCount(String doctor) {
        try {
            return write(200, "获取成功", "data", specialistService.findMessagePatientCount(doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    }