Jelajahi Sumber

Merge branch 'dev' of chinawu123/wlyy2.0 into dev

叶仕杰 2 tahun lalu
induk
melakukan
9b4fc7bbef

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/BaseServiceNewsService.java

@ -202,10 +202,10 @@ public class BaseServiceNewsService {
        String sql = "SELECT p.id,p.`name`,p.address,p.photo,p.mobile,p.lat_lon latLon,sex,idcard,archive_type type,p.pad_imei,p.openid " +
                " from base_patient p " +
                "WHERE  p.del =1 and p.archive_type=1 and p.sign_status=0 and p.lat_lon is not null "+filter+" limit "+page*size+","+size;
                "WHERE  p.del =1 and p.archive_type=1 and p.sign_status=0 and p.register = 1 and p.lat_lon is not null "+filter+" limit "+page*size+","+size;
        String sqlCount = "SELECT count(p.id) " +
                " from base_patient p " +
                "WHERE  p.del =1 and p.archive_type=1 and p.sign_status=0 and p.lat_lon is not null "+filter ;
                "WHERE  p.del =1 and p.archive_type=1 and p.sign_status=0 and p.register = 1 and  p.lat_lon is not null "+filter ;
        Long count = jdbcTemplate.queryForObject(sqlCount,Long.class);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String,Object> map:list){

+ 26 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -884,16 +884,16 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
    }
    /**
     * 查找签约老人
     * 查找签约老人 + 名单800
     * @param name
     * @param residentialArea
     * @param limit
     * @return
     */
    public List<Map<String,Object>> findOld(String name,String residentialArea,String area,Integer level,String limit,String filter1){
        String sql = "SELECT a.id,a.name,a.photo,a.idcard,CAST(IFNULL(a.birthday,'') AS char ) birthday,a.residential_area residentialArea,a.sex " +
        String sql = "SELECT DISTINCT a.id,a.name,a.photo,a.idcard,CAST(IFNULL(a.birthday,'') AS char ) birthday,a.residential_area residentialArea,a.sex " +
                ",a.ykt_id yktId, case 1 WHEN openid is not null then 1 WHEN a.on_line = '1' then 1 ELSE 0 end as online,IFNULL(sign_status,0) signStatus from base_patient a " +
                " WHERE a.archive_type = 1 and a.del = '1' and a.sign_status=1  ";
                " WHERE a.archive_type = 1 and a.del = '1' and (a.sign_status=1 or a.register = '1')  ";
        //case 1 WHEN openid is not null then 1 WHEN a.on_line = '1' then 1 ELSE 0 end as online
        //if(openid is null,0,1) onlineWx,IFNULL(a.on_line,0) onlinePad
@ -907,7 +907,18 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
            sql += " and EXISTS ( select 1 from " +
                    "base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " +
                    " where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id " +
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8)  = a.id and r.team_code='"+area+"') ";
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8)  = a.id and r.team_code='"+area+"')  ";
            sql += " OR (a.saas_id = '"+area+"' ";
            if (StringUtils.isNotBlank(name)){
                sql+= " and a.name like '%"+name+"%' ";
            }
            if(StringUtils.isNotBlank(residentialArea)){
                sql+= " and a.residential_area = '"+residentialArea+"' ";
            }
            sql +=" )";
        }
        sql += filter1;
        sql += " GROUP BY a.id,a.name,a.photo,a.idcard,a.birthday,a.residential_area,a.sex,a.ykt_id,online,signStatus ";
@ -956,7 +967,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
    }
    public Integer findOldTotal(String name,String residentialArea,String area,Integer level,String filter){
        String sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' and a.sign_status=1 ";
        String sql = "SELECT count(DISTINCT a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' and (a.sign_status=1 or a.register = 1)";
        if(!StringUtil.isBlank(name)){
            sql+= " and name like '%"+name+"%' ";
        }
@ -967,7 +978,16 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
            sql += " and EXISTS ( select 1 from " +
                    "base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " +
                    " where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id " +
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8)  = a.id and r.team_code='"+area+"' ) ";
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8)  = a.id and r.team_code='"+area+"' )  ";
            sql += "OR (a.saas_id = '"+area+"' ";
            if (StringUtils.isNotBlank(name)){
                sql+= " and a.name like '%"+name+"%' ";
            }
            if(StringUtils.isNotBlank(residentialArea)){
                sql+= " and a.residential_area = '"+residentialArea+"' ";
            }
            sql +=" )";
        }
        sql += filter;
        return jdbcTemplate.queryForObject(sql,Integer.class);

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -752,9 +752,9 @@ public class StatisticsService {
            areaFilter = " and EXISTS ( select 1 from " +
                    "base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " +
                    " where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id " +
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8)  = a.id and r.team_code='"+area+"') ";
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8)  = a.id and r.team_code='"+area+"') OR ( a.saas_id = '"+area+"')";
        }
        String sql1 = "SELECT COUNT(*) c,case 1 WHEN openid is not null then 1 WHEN a.on_line = '1' then 1 ELSE 0 end as online from base_patient a WHERE archive_type = 1 and sign_status=1 " +
        String sql1 = "SELECT COUNT(*) c,case 1 WHEN openid is not null then 1 WHEN a.on_line = '1' then 1 ELSE 0 end as online from base_patient a WHERE archive_type = 1 and (a.sign_status=1 or a.register = 1) " +
                " and del='1' "+areaFilter+" " + oldFilter + " GROUP BY online";
        List<Map<String, Object>> list1 = jdbcTemplate.queryForList(sql1);
        for (Map<String, Object> map : list1) {