|
@ -814,6 +814,8 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
|
|
taskPatientDetailDO.setTimeSeparated(timeSeparated);
|
|
taskPatientDetailDO.setTimeSeparated(timeSeparated);
|
|
if (!taskPatientDetailDO.getPatientId().equals(patient)){
|
|
if (!taskPatientDetailDO.getPatientId().equals(patient)){
|
|
count4+=1;
|
|
count4+=1;
|
|
|
|
}else {
|
|
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@ -862,11 +864,14 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
|
|
TaskGoodsDO taskGoodsDO = taskGoodsDao.selectById(exchangeGoodsDO.getActivityGoodsId());
|
|
TaskGoodsDO taskGoodsDO = taskGoodsDao.selectById(exchangeGoodsDO.getActivityGoodsId());
|
|
exchangeGoodsDO.setTaskGoodsDO(taskGoodsDO);
|
|
exchangeGoodsDO.setTaskGoodsDO(taskGoodsDO);
|
|
}
|
|
}
|
|
if (taskPatientDetailDO.getPatientId().equals(taskPatientDetailDO.getPatientId())){
|
|
|
|
count6+=1;
|
|
|
|
}
|
|
|
|
taskPatientDetailDO.setExchangeGoodsDO(exchangeGoodsDOS);
|
|
taskPatientDetailDO.setExchangeGoodsDO(exchangeGoodsDOS);
|
|
taskPatientDetailDO.setTimeSeparated(timeSeparated);
|
|
taskPatientDetailDO.setTimeSeparated(timeSeparated);
|
|
|
|
if (!taskPatientDetailDO.getPatientId().equals(taskPatientDetailDO.getPatientId())){
|
|
|
|
count6+=1;
|
|
|
|
}else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -964,9 +969,9 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
|
|
}
|
|
}
|
|
*/
|
|
*/
|
|
|
|
|
|
//团队排名
|
|
|
|
|
|
//活动劵团队排名
|
|
String rankingSql7 = "SELECT count(1)+1 AS total FROM (SELECT " +
|
|
String rankingSql7 = "SELECT count(1)+1 AS total FROM (SELECT " +
|
|
" SUM(btpd.total) AS sum , " +
|
|
|
|
|
|
" SUM(btpd.coupon_total) AS sum , " +
|
|
" btpd.patient_id, " +
|
|
" btpd.patient_id, " +
|
|
" btpd.activity_id," +
|
|
" btpd.activity_id," +
|
|
" create_time " +
|
|
" create_time " +
|
|
@ -976,7 +981,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
|
|
"WHERE btpd1.patient_id IN(SELECT sf.patient FROM wlyy.wlyy_sign_family sf WHERE sf.status=1 " +
|
|
"WHERE btpd1.patient_id IN(SELECT sf.patient FROM wlyy.wlyy_sign_family sf WHERE sf.status=1 " +
|
|
"AND sf.admin_team_code=(SELECT sf.admin_team_code FROM wlyy.wlyy_sign_family sf WHERE sf.status=1 AND sf.patient='"+patient+"') ) AND btpd1.sum >= (SELECT SUM(s.coupon_total) as couponTotal " +
|
|
"AND sf.admin_team_code=(SELECT sf.admin_team_code FROM wlyy.wlyy_sign_family sf WHERE sf.status=1 AND sf.patient='"+patient+"') ) AND btpd1.sum >= (SELECT SUM(s.coupon_total) as couponTotal " +
|
|
"FROM wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND s.activity_id='"+activityId+"')"+
|
|
"FROM wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND s.activity_id='"+activityId+"')"+
|
|
" AND btpd1.create_time >=(SELECT s.create_time " +
|
|
|
|
|
|
" AND btpd1.create_time <=(SELECT s.create_time " +
|
|
"FROM wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND s.activity_id='"+activityId+"')" ;
|
|
"FROM wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND s.activity_id='"+activityId+"')" ;
|
|
List<Map<String,Object>> rstotal7 = jdbcTemplate.queryForList(rankingSql7);
|
|
List<Map<String,Object>> rstotal7 = jdbcTemplate.queryForList(rankingSql7);
|
|
Long count7 = 0L;
|
|
Long count7 = 0L;
|
|
@ -984,7 +989,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
|
|
count7 = (Long) rstotal7.get(0).get("total");
|
|
count7 = (Long) rstotal7.get(0).get("total");
|
|
}
|
|
}
|
|
|
|
|
|
//区排名
|
|
|
|
|
|
//积分团队排名
|
|
String rankingSql8 = "SELECT count(1)+1 AS total FROM (SELECT " +
|
|
String rankingSql8 = "SELECT count(1)+1 AS total FROM (SELECT " +
|
|
" SUM(btpd.total) AS sum , " +
|
|
" SUM(btpd.total) AS sum , " +
|
|
" btpd.patient_id, " +
|
|
" btpd.patient_id, " +
|
|
@ -994,9 +999,9 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
|
|
" wlyy_health_bank_task_patient_detail btpd WHERE btpd.activity_id ='"+activityId+"' AND btpd.patient_id !='"+patient+
|
|
" wlyy_health_bank_task_patient_detail btpd WHERE btpd.activity_id ='"+activityId+"' AND btpd.patient_id !='"+patient+
|
|
"' GROUP BY patient_id )btpd1 " +
|
|
"' GROUP BY patient_id )btpd1 " +
|
|
"WHERE btpd1.patient_id IN(SELECT sf.patient FROM wlyy.wlyy_sign_family sf WHERE sf.status=1 " +
|
|
"WHERE btpd1.patient_id IN(SELECT sf.patient FROM wlyy.wlyy_sign_family sf WHERE sf.status=1 " +
|
|
"AND sf.admin_team_code=(SELECT sf.admin_team_code FROM wlyy.wlyy_sign_family sf WHERE sf.status=1 AND sf.patient='"+patient+"') ) AND btpd1.sum >= (SELECT SUM(s.coupon_total) as couponTotal " +
|
|
|
|
|
|
"AND sf.admin_team_code=(SELECT sf.admin_team_code FROM wlyy.wlyy_sign_family sf WHERE sf.status=1 AND sf.patient='"+patient+"') ) AND btpd1.sum >= (SELECT SUM(s.total) as total " +
|
|
"FROM wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND s.activity_id='"+activityId+"')" +
|
|
"FROM wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND s.activity_id='"+activityId+"')" +
|
|
" AND btpd1.create_time >=(SELECT s.create_time " +
|
|
|
|
|
|
" AND btpd1.create_time <=(SELECT s.create_time " +
|
|
"FROM wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND s.activity_id='"+activityId+"')" ;
|
|
"FROM wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND s.activity_id='"+activityId+"')" ;
|
|
List<Map<String,Object>> rstotal8 = jdbcTemplate.queryForList(rankingSql8);
|
|
List<Map<String,Object>> rstotal8 = jdbcTemplate.queryForList(rankingSql8);
|
|
Long count8 = 0L;
|
|
Long count8 = 0L;
|