Browse Source

优化签约居民总数接口

humingfen 7 years ago
parent
commit
a766b64d78

+ 8 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -333,7 +333,7 @@ public class SignWebService extends BaseService {
     * @param doctor
     * @return
     */
    public JSONObject getSignWebByDoctorCount(String doctor) {
    public JSONObject getSignWebByDoctorCount(String doctor, String patientInfo) {
        Doctor d = doctorDao.findByCode(doctor);
        String sql ;
@ -350,6 +350,7 @@ public class SignWebService extends BaseService {
                    " AND STATUS = 0 " +
                    " AND type = 2 " +
                    " AND expenses_status = '0' " +
                     " AND (`name` or mobile like ? ) " +
                    " ) AS waitSignCount, " +
                    "( " +
                    " SELECT " +
@ -361,6 +362,7 @@ public class SignWebService extends BaseService {
                    " AND STATUS > 0 " +
                    " AND type = 2 " +
                    " AND expenses_status = '0'  " +
                     " AND (`name` or mobile like ? ) " +
                    " ) AS waitPayCount, " +
                    "( " +
                    " SELECT " +
@ -372,6 +374,7 @@ public class SignWebService extends BaseService {
                    " AND STATUS = 1 " +
                    " AND type = 2 " +
                    " AND expenses_status = '1'  " +
                     " AND (`name` or mobile like ? ) " +
                    " ) AS signCount";
        }else{
             sql ="SELECT  " +
@ -385,6 +388,7 @@ public class SignWebService extends BaseService {
                    " AND STATUS = 0 " +
                    " AND type = 2 " +
                    " AND expenses_status = '0' " +
                     " AND (`name` or mobile like ? ) " +
                    " ) AS waitSignCount, " +
                    "( " +
                    " SELECT " +
@ -396,6 +400,7 @@ public class SignWebService extends BaseService {
                    " AND STATUS > 0 " +
                    " AND type = 2 " +
                    " AND expenses_status = '0'  " +
                     " AND (`name` or mobile like ? ) " +
                    " ) AS waitPayCount, " +
                    "( " +
                    " SELECT " +
@ -407,10 +412,11 @@ public class SignWebService extends BaseService {
                    " AND STATUS = 1 " +
                    " AND type = 2 " +
                    " AND expenses_status = '1'  " +
                     " AND (`name` or mobile like ? ) " +
                    " ) AS signCount";
        }
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> list = StringUtils.isBlank(patientInfo) ? jdbcTemplate.queryForList(sql, new Object[]{"%%", "%%", "%%"}) : jdbcTemplate.queryForList(sql, new Object[]{ "%"+patientInfo + "%", "%"+patientInfo + "%", "%"+patientInfo + "%"});
        if(list!=null&&list.size()>0){
            return new JSONObject(list.get(0));

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -347,10 +347,10 @@ public class DoctorSignController extends WeixinBaseController {
    @RequestMapping("/sign_info_count")
    @ApiOperation(value = "签约居民数目")
    public String getSignWebByDoctorCount() {
    public String getSignWebByDoctorCount(@RequestParam(required = false) String patientInfo) {
        try {
            //hxmD201703150222
            return write(200, "查询成功", "data", signWebService.getSignWebByDoctorCount(getUID()));
            return write(200, "查询成功", "data", signWebService.getSignWebByDoctorCount(getUID(), patientInfo));
        } catch (Exception e) {
            return error(-1, "查询失败");
        }