diff --git a/sql/20210324-zhangsai.sql b/sql/20210324-zhangsai.sql index f0904927c..9e4cd0fe6 100644 --- a/sql/20210324-zhangsai.sql +++ b/sql/20210324-zhangsai.sql @@ -1,7 +1,5 @@ alter table org_lesson - add creator_id bigint not null comment '创建人id'; - -alter table org_lesson + add creator_id bigint not null comment '创建人id', add create_time datetime default current_timestamp not null comment '创建时间'; -- 删除外键 @@ -34,13 +32,6 @@ alter table race_question modify company_id bigint null comment '公司题库'; alter table race_questions_rules modify company_id bigint null; --- 添加字段 -alter table org_scoring_rule_rel - add rule_org_id bigint not null comment '规则关联的顶级组织id', - add rule_school_year varchar(16) not null comment '规则所属学年', - add rule_term int(1) not null comment '规则所属学期', - add rule_creator_id bigint not null comment '创建者id'; - alter table org_scoring_rule_rel modify org_id bigint not null; alter table org_lesson modify org_id bigint not null comment '班级id'; @@ -49,6 +40,14 @@ alter table org_scoring_rule modify org_id bigint not null comment '该规则属 alter table org_user modify org_id bigint not null comment '部门id'; +-- 添加字段 +alter table org_scoring_rule_rel + add rule_org_id bigint not null comment '规则关联的顶级组织id', + add rule_school_year varchar(16) not null comment '规则所属学年', + add rule_term int(1) not null comment '规则所属学期', + add rule_creator_id bigint not null comment '创建者id'; + + diff --git a/src/main/java/club/joylink/rtss/dao/UserTrainingStatsMapper.java b/src/main/java/club/joylink/rtss/dao/UserTrainingStatsMapper.java index 4264e40d5..59c4b43ea 100644 --- a/src/main/java/club/joylink/rtss/dao/UserTrainingStatsMapper.java +++ b/src/main/java/club/joylink/rtss/dao/UserTrainingStatsMapper.java @@ -67,7 +67,7 @@ public interface UserTrainingStatsMapper { "ut.user_id AS userId " + "FROM user_training_stats ut " + "LEFT JOIN sys_user u ON u.id = ut.user_id " + - "WHERE u.id = #{userId} AND finishTime >= #{startTime} AND finishTime <= #{endTime} " + + "WHERE u.id = #{userId} AND finishTime > #{startTime} AND finishTime < #{endTime} " + "AND ut.lesson_id IN" + "" + "#{lessonId}" +