trick9191 8 rokov pred
rodič
commit
e998d300da

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -311,7 +311,7 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >= 0")
    List<SignFamily> findByPatients(String patient);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.signYear =?2")
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.signYear =?2 and a.status in (-4,1,2,3) order by a.id desc ")
    List<SignFamily> findByPatientsLastYear(String patient, String signYear);
    @Query("select a from SignFamily a where a.idcard = ?1 and a.type = 1 and a.status >= 0")

+ 10 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -281,21 +281,24 @@ public class SignPatientLabelInfoService extends BaseService {
            if(flag!=-1){
                String label[] = labelCode.split("-");
                sql = "SELECT " +
                        "    t1.* " +
                        " t1.* " +
                        " p.openid " +
                        " FROM " +
                        "    wlyy_sign_family t1 " +
                        " WHERE (t1.doctor = ? or t1.doctor_health = ?) " +
                        "    wlyy_sign_family t1 ,wlyy_patient p" +
                        " WHERE p.code = t1.patient " +
                        "    AND (t1.doctor = ? or t1.doctor_health = ?) " +
                        "    AND t1.status > 0 " +
                        "    AND t1.admin_team_code = ? AND  t1.special_population = '"+label[1]+"'";
                        "    AND t1.admin_team_code = ? AND  t1.special_population = '"+label[1]+"' ORDER BY p.openid DESC ";
                args = new Object[]{doctor, doctor, teamCode};
            }else{
                sql = "SELECT " +
                        "    t1.* "+
                        " FROM " +
                        "    wlyy_sign_family t1 " +
                        " WHERE (t1.doctor = ? or t1.doctor_health = ?) " +
                        "    wlyy_sign_family t1 ,wlyy_patient p " +
                        " WHERE  p.code = t1.patient " +
                        "    AND (t1.doctor = ? or t1.doctor_health = ?) " +
                        "    AND t1.status > 0 " +
                        "    AND t1.admin_team_code = ? AND  t1.server_type = '"+labelCode+"'";
                        "    AND t1.admin_team_code = ? AND  t1.server_type = '"+labelCode+"'  ORDER BY p.openid DESC ";
                args = new Object[]{doctor, doctor, teamCode};
            }
        } else {

+ 5 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -1849,7 +1849,7 @@ public class StatisticsService extends BaseService {
                    " GROUP BY left(f.apply_date,10)";
            //按月
        } else {
            sql = "SELECT (DATE_FORMAT(f.apply_date,'%v')-DATE_FORMAT('" + DateUtil.getFristDayOfMonth() + "','%v')+1) as weekOfMonth,count(1) as signCount " +
            sql = "SELECT (DATE_FORMAT(f.apply_date,'%v')-DATE_FORMAT('" +startDate + "','%v')+1) as weekOfMonth,count(1) as signCount " +
                    " FROM wlyy_sign_family f " +
                    " where f.apply_date >='" + startDate + " 00:00:00' " +
                    " AND f.apply_date<='" + endDate + " 23:59:59' " +
@ -1892,6 +1892,7 @@ public class StatisticsService extends BaseService {
                    " f.apply_date >= '"+startDate+"' " +
                    " AND f.apply_date <= '"+endDate+"' " +
                    " AND f.admin_team_id = " +id+
                    " AND f.old_admin_team_id = f.admin_team_id"+
                    " GROUP BY " +
                    " LEFT (f.apply_date, 10)";
            //按月
@ -1905,6 +1906,7 @@ public class StatisticsService extends BaseService {
                    " f.apply_date >= '"+startDate+"' " +
                    " AND f.apply_date <= '"+endDate+"' " +
                    " AND f.admin_team_id = " +id+
                    " AND f.old_admin_team_id = f.admin_team_id"+
                    " GROUP BY " +
                    " DATE_FORMAT(f.apply_date, '%m %v')";
        }
@ -4469,7 +4471,7 @@ public class StatisticsService extends BaseService {
                    " GROUP BY dateNo ";
        } else {
            inSql = "SELECT ( " +
                    "  DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
                    "  DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('"+startDate+"', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.admin_team_id ='" + teamCode + "'  " +
                    " AND r.apply_date >= '" + startDate + "'  " +
@ -4477,7 +4479,7 @@ public class StatisticsService extends BaseService {
                    " AND r.old_admin_team_id <> r.admin_team_id " +
                    " GROUP BY weekOfMonth ";
            outSql = "SELECT ( " +
                    "  DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
                    "  DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('"+startDate+"', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS outCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.old_admin_team_id ='" + teamCode + "'  " +
                    " AND r.apply_date >= '" + startDate + "'  " +