|  | @ -526,13 +526,13 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
 | 
												
													
														
															|  |         JSONObject jsonObject = new JSONObject();
 |  |         JSONObject jsonObject = new JSONObject();
 | 
												
													
														
															|  |         TaskPatientDetailDO taskPatientDetailDO1 = taskPatientDetailDao.selectByActivityIdAndPatientId(activityId,patient);
 |  |         TaskPatientDetailDO taskPatientDetailDO1 = taskPatientDetailDao.selectByActivityIdAndPatientId(activityId,patient);
 | 
												
													
														
															|  |         //积分排行
 |  |         //积分排行
 | 
												
													
														
															|  |         String sql  ="SELECT btpd.patient_id AS patientId,btpd.total,btpd.update_time AS updateTime FROM ( SELECT sum(btpd.total) AS total, btpd.patient_id,btpd.update_time " +
 |  | 
 | 
												
													
														
															|  | 
 |  |         String sql  ="SELECT btpd1.patientId, btpd1.total, btpd1.create_time AS updateTime FROM (SELECT btpd.patient_id AS patientId,btpd.total,btpd.create_time AS create_time FROM ( SELECT sum(btpd.total) AS total, btpd.patient_id,btpd.create_time " +
 | 
												
													
														
															|  |                 "FROM wlyy_health_bank_task_patient_detail btpd " +
 |  |                 "FROM wlyy_health_bank_task_patient_detail btpd " +
 | 
												
													
														
															|  |                 "WHERE btpd.activity_id = '"+activityId +
 |  |                 "WHERE btpd.activity_id = '"+activityId +
 | 
												
													
														
															|  |                 "' GROUP BY  btpd.patient_id " +
 |  |                 "' GROUP BY  btpd.patient_id " +
 | 
												
													
														
															|  |                 " ) btpd " +
 |  |                 " ) btpd " +
 | 
												
													
														
															|  |                 "ORDER BY " +
 |  |                 "ORDER BY " +
 | 
												
													
														
															|  |                 " btpd.total DESC LIMIT " + (page-1)*size+","+size;
 |  | 
 | 
												
													
														
															|  | 
 |  |                 " btpd.total DESC)btpd1 ORDER BY btpd1.create_time LIMIT " + (page-1)*size+","+size;
 | 
												
													
														
															|  |         List<TaskPatientDetailDO> patientDetailDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(TaskPatientDetailDO.class));
 |  |         List<TaskPatientDetailDO> patientDetailDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(TaskPatientDetailDO.class));
 | 
												
													
														
															|  |         for (TaskPatientDetailDO taskPatientDetailDO:patientDetailDOS){
 |  |         for (TaskPatientDetailDO taskPatientDetailDO:patientDetailDOS){
 | 
												
													
														
															|  |             String timeSeparated = DateUtils.getDatePoor(new Date(),taskPatientDetailDO.getUpdateTime());
 |  |             String timeSeparated = DateUtils.getDatePoor(new Date(),taskPatientDetailDO.getUpdateTime());
 | 
												
											
												
													
														
															|  | @ -547,13 +547,13 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
 | 
												
													
														
															|  |             taskPatientDetailDO.setTimeSeparated(timeSeparated);
 |  |             taskPatientDetailDO.setTimeSeparated(timeSeparated);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         //活动劵排行
 |  |         //活动劵排行
 | 
												
													
														
															|  |         String sqlCoupon  ="SELECT btpd.patient_id AS patientId,btpd.couponTotal,btpd.update_time AS updateTime  FROM ( SELECT sum(btpd.coupon_total) AS couponTotal, btpd.patient_id,btpd.update_time " +
 |  | 
 | 
												
													
														
															|  | 
 |  |         String sqlCoupon  ="SELECT btpd1.patientId, btpd1.total, btpd1.create_time AS updateTime FROM (SELECT btpd.patient_id AS patientId,btpd.couponTotal,btpd.create_time AS create_time  FROM ( SELECT sum(btpd.coupon_total) AS couponTotal, btpd.patient_id,btpd.create_time " +
 | 
												
													
														
															|  |                 "FROM wlyy_health_bank_task_patient_detail btpd " +
 |  |                 "FROM wlyy_health_bank_task_patient_detail btpd " +
 | 
												
													
														
															|  |                 "WHERE btpd.activity_id = '"+activityId +
 |  |                 "WHERE btpd.activity_id = '"+activityId +
 | 
												
													
														
															|  |                 "' GROUP BY  btpd.patient_id " +
 |  |                 "' GROUP BY  btpd.patient_id " +
 | 
												
													
														
															|  |                 " ) btpd " +
 |  |                 " ) btpd " +
 | 
												
													
														
															|  |                 "ORDER BY " +
 |  |                 "ORDER BY " +
 | 
												
													
														
															|  |                 " btpd.couponTotal DESC LIMIT " + (page-1)*size+","+size;
 |  | 
 | 
												
													
														
															|  | 
 |  |                 " btpd.couponTotal DESC)btpd1 WHERE btpd1.LIMIT " + (page-1)*size+","+size;
 | 
												
													
														
															|  |         List<TaskPatientDetailDO> patientDetailDOS1 = jdbcTemplate.query(sqlCoupon,new BeanPropertyRowMapper<>(TaskPatientDetailDO.class));
 |  |         List<TaskPatientDetailDO> patientDetailDOS1 = jdbcTemplate.query(sqlCoupon,new BeanPropertyRowMapper<>(TaskPatientDetailDO.class));
 | 
												
													
														
															|  |         for (TaskPatientDetailDO taskPatientDetailDO:patientDetailDOS1){
 |  |         for (TaskPatientDetailDO taskPatientDetailDO:patientDetailDOS1){
 | 
												
													
														
															|  |             String timeSeparated = DateUtils.getDatePoor(new Date(),taskPatientDetailDO.getUpdateTime());
 |  |             String timeSeparated = DateUtils.getDatePoor(new Date(),taskPatientDetailDO.getUpdateTime());
 | 
												
											
												
													
														
															|  | @ -574,7 +574,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
 | 
												
													
														
															|  |                 " activity_id " +
 |  |                 " activity_id " +
 | 
												
													
														
															|  |                 "FROM " +
 |  |                 "FROM " +
 | 
												
													
														
															|  |                 " wlyy_health_bank_task_patient_detail htpd " +
 |  |                 " wlyy_health_bank_task_patient_detail htpd " +
 | 
												
													
														
															|  |                 " where htpd.activity_id ='"+activityId+"' AND htpd.patient_id ='"+patient+
 |  | 
 | 
												
													
														
															|  | 
 |  |                 " where htpd.activity_id ='"+activityId+"' AND htpd.patient_id !='"+patient+
 | 
												
													
														
															|  |                 "' GROUP BY patient_id )btpd1 " +
 |  |                 "' GROUP BY patient_id )btpd1 " +
 | 
												
													
														
															|  |                 "WHERE " +
 |  |                 "WHERE " +
 | 
												
													
														
															|  |                 " btpd1.sum >= (SELECT SUM(s.total) as total " +
 |  |                 " btpd1.sum >= (SELECT SUM(s.total) as total " +
 |