sql修改

This commit is contained in:
joylink_zhangsai 2021-03-25 15:40:36 +08:00
parent 7e425787d9
commit 354f676238
2 changed files with 10 additions and 11 deletions

View File

@ -1,7 +1,5 @@
alter table org_lesson alter table org_lesson
add creator_id bigint not null comment '创建人id'; add creator_id bigint not null comment '创建人id',
alter table org_lesson
add create_time datetime default current_timestamp not null comment '创建时间'; 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 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_scoring_rule_rel modify org_id bigint not null;
alter table org_lesson modify org_id bigint not null comment '班级id'; 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_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';

View File

@ -67,7 +67,7 @@ public interface UserTrainingStatsMapper {
"ut.user_id AS userId " + "ut.user_id AS userId " +
"FROM user_training_stats ut " + "FROM user_training_stats ut " +
"LEFT JOIN sys_user u ON u.id = ut.user_id " + "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 &gt; #{startTime} AND finishTime &lt; #{endTime} " +
"AND ut.lesson_id IN" + "AND ut.lesson_id IN" +
"<foreach collection='lessonIds' item='lessonId' open='(' separator=',' close=')'>" + "<foreach collection='lessonIds' item='lessonId' open='(' separator=',' close=')'>" +
"#{lessonId}" + "#{lessonId}" +