zdm 6 years ago
parent
commit
07de24032c

+ 2 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -122,11 +122,12 @@ public class SpecialistController extends EnvelopRestEndpoint {
    @ApiOperation(value = "根据标签获取居民信息")
    public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(@ApiParam(name = "doctor", value = "医生") @RequestParam(required = true)String doctor,
                                                        @ApiParam(name = "labelType", value = "标签类型") @RequestParam(required = true)String labelType,
                                                        @ApiParam(name = "teamCode", value = "医生当前所在团队") @RequestParam(required = true) String teamCode,
                                                        @ApiParam(name = "labelCode", value = "标签code") @RequestParam(required = true)String labelCode,
                                                        @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
                                                        @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size){
        try {
            return specialistService.getPatientByLabel(doctor,labelType,labelCode,page,size);
            return specialistService.getPatientByLabel(doctor,labelType,teamCode,labelCode,page,size);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

+ 3 - 7
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -186,7 +186,7 @@ public class SpecialistService{
    }
    public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(String doctor, String labelType, String labelCode, Integer page, Integer size){
    public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(String doctor, String labelType,String teamCode, String labelCode, Integer page, Integer size){
        String sql="SELECT " +
                " p. NAME, " +
                " p. CODE, " +
@ -222,9 +222,7 @@ public class SpecialistService{
                " JOIN "+basedb+".wlyy_patient p ON p. CODE = lb.patient " +
                " JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient " +
                " WHERE s.doctor in " +
                " (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id in " +
                " (SELECT dt.id FROM  wlyy.wlyy_admin_team dt LEFT JOIN  wlyy.wlyy_admin_team_member watm ON dt.id=watm.team_id " +
                " WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctor+"') AND  m.available='1') "+
                "  (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id ='" +teamCode+"') "+
                " AND s.status >=0  AND s.sign_status >0"+
                " LIMIT "+(page-1)*size+","+size;
        System.out.print("日志:"+sql);
@ -247,9 +245,7 @@ public class SpecialistService{
                    " WHERE a.sign_status> 0 AND a.`status`>=0 " +
//                    "AND a.doctor='"+doctor+"' OR a.health_assistant= '"+doctor+
                    " AND a.doctor in " +
                    " (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id in " +
                    " (SELECT dt.id FROM  wlyy.wlyy_admin_team dt LEFT JOIN  wlyy.wlyy_admin_team_member watm ON dt.id=watm.team_id " +
                    " WHERE dt.available='1' AND watm.available='1' AND watm.doctor_code='"+doctor+"') AND  m.available='1') "+
                    " (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id ='" +teamCode+"') "+
                    " LIMIT "+(page-1)*size+","+size;
        }
        List<PatientLabelVO> PatientLabelVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientLabelVO.class));