commit
This commit is contained in:
+5
@@ -10,6 +10,7 @@ import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.StringUtil;
|
||||
import io.v.nutz.fitnessWalk.contants.FitnessWalkMode;
|
||||
import io.v.nutz.fitnessWalk.model.FitnessWalkActivity;
|
||||
import io.v.nutz.fitnessWalk.service.FitnessWalkCommonService;
|
||||
import io.v.nutz.fitnessWalk.utils.WeAppCloudUtil;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
@@ -82,6 +83,7 @@ public class FitnessWalkStepStatisticsController {
|
||||
@Param(value = "activityDate", required = false) String[] activityDate,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId) {
|
||||
FitnessWalkActivity activity = fitnessWalkCommonService.getActivity(activityId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create(getSql());
|
||||
if (Lang.isNotEmpty(activityDate)) {
|
||||
@@ -94,6 +96,7 @@ public class FitnessWalkStepStatisticsController {
|
||||
seg.orLike("u.loginname",pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.and("u.id","in",Sqls.create("select userId from activity_user_scope where groupId = @groupId").setParam("groupId",activity.getGroupId()));
|
||||
cnd.andEX("YEAR(al.applyDate)", "=", year);
|
||||
cnd.andEX("al.activityId", "=", activityId);
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
@@ -119,6 +122,7 @@ public class FitnessWalkStepStatisticsController {
|
||||
@Param(value = "activityDate", required = false) String[] activityDate,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId, HttpServletResponse response) {
|
||||
FitnessWalkActivity activity = fitnessWalkCommonService.getActivity(activityId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create(getSql());
|
||||
if (activityDate.length > 0) {
|
||||
@@ -128,6 +132,7 @@ public class FitnessWalkStepStatisticsController {
|
||||
cnd.andEX("al.activityId", "=", activityId);
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
cnd.andEX("u.unitId", "=", unitId);
|
||||
cnd.and("u.id","in",Sqls.create("select userId from activity_user_scope where groupId = @groupId").setParam("groupId",activity.getGroupId()));
|
||||
cnd.desc("al.applyDate");
|
||||
cnd.desc("u.unioncode");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
@@ -401,13 +401,13 @@ public class FitnessWalkCommonServiceImpl extends ViServiceImpl implements Fitne
|
||||
FROM
|
||||
`fitness_walk_step`
|
||||
WHERE
|
||||
step > 3000
|
||||
step >= @step
|
||||
AND activityId=@activityId and $dateSql
|
||||
GROUP BY
|
||||
userId
|
||||
) AS over3k ON u.id = over3k.userId
|
||||
$condition
|
||||
""").setParam("activityId",activityId);
|
||||
""").setParam("activityId",activityId).setParam("step",activity.get_id().equals("2b13da7f661dd9ea07708f1044d26dcc")?6000:3000);
|
||||
|
||||
if ("today".equals(mode)) {
|
||||
sql.setVar("dateSql",new Static("DATE(applyDate) = '"+DateUtil.today()+"'"));
|
||||
@@ -420,25 +420,7 @@ public class FitnessWalkCommonServiceImpl extends ViServiceImpl implements Fitne
|
||||
cnd.and("DATE( applyDate )", "<=", DateUtil.format(DateUtil.date(activity.getEndTime()), "yyyy-MM-dd"));
|
||||
}
|
||||
|
||||
// Sql sqlq = Sqls.create("""
|
||||
// SELECT
|
||||
// userId,
|
||||
// sum(step) as step,
|
||||
// u.username,
|
||||
// u.loginname,
|
||||
// u.unionname,
|
||||
// u.unitname
|
||||
// FROM
|
||||
// `fitness_walk_step` step
|
||||
// LEFT JOIN user u ON step.userId = u.id
|
||||
// $condition
|
||||
// """);
|
||||
// if ("today".equals(mode)) {
|
||||
// cnd.and("DATE( applyDate )", "=", DateUtil.today());
|
||||
// } else {
|
||||
// cnd.and("DATE( applyDate )", ">=", DateUtil.format(DateUtil.date(activity.getStartTime()), "yyyy-MM-dd"));
|
||||
// cnd.and("DATE( applyDate )", "<=", DateUtil.format(DateUtil.date(activity.getEndTime()), "yyyy-MM-dd"));
|
||||
// }
|
||||
|
||||
cnd.and("s.activityId", "=", activityId);
|
||||
if (Strings.isNotBlank(unitId)) {
|
||||
cnd.and("u.unitId", "=", unitId);
|
||||
@@ -450,6 +432,7 @@ public class FitnessWalkCommonServiceImpl extends ViServiceImpl implements Fitne
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(searchName, "LIKE", "%" + searchKeyword + "%");
|
||||
}
|
||||
cnd.and("u.id","in",Sqls.create("select userId from activity_user_scope where groupId = @groupId").setParam("groupId",activity.getGroupId()));
|
||||
cnd.groupBy("s.userId");
|
||||
cnd.desc("s.step");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Reference in New Issue
Block a user