mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-07-24 02:09:35 +08:00
update
This commit is contained in:
parent
761458c370
commit
f42c5a4236
@ -48,6 +48,7 @@ public class Course implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 1:必修,0:选修
|
* 1:必修,0:选修
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("is_required")
|
||||||
private Integer isRequired;
|
private Integer isRequired;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,8 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface UserLearnDurationStatsMapper extends BaseMapper<UserLearnDurationStats> {
|
public interface UserLearnDurationStatsMapper extends BaseMapper<UserLearnDurationStats> {
|
||||||
|
|
||||||
Integer getUserDateDuration(Integer userId, String createdDate);
|
|
||||||
|
|
||||||
Integer getUserDuration(Integer userId);
|
Integer getUserDuration(Integer userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,12 @@ public class UserLearnDurationStatsServiceImpl extends ServiceImpl<UserLearnDura
|
|||||||
@Override
|
@Override
|
||||||
public Integer todayUserDuration(Integer userId) {
|
public Integer todayUserDuration(Integer userId) {
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
return getBaseMapper().getUserDateDuration(userId, simpleDateFormat.format(new Date()));
|
String today = simpleDateFormat.format(new Date());
|
||||||
|
UserLearnDurationStats stats = getOne(query().getWrapper().eq("user_id", userId).eq("created_date", today));
|
||||||
|
if (stats == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return stats.getDuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -15,12 +15,6 @@
|
|||||||
id,user_id,duration,
|
id,user_id,duration,
|
||||||
created_date
|
created_date
|
||||||
</sql>
|
</sql>
|
||||||
<select id="getUserDateDuration" resultType="java.lang.Integer">
|
|
||||||
SELECT `duration`
|
|
||||||
FROM `user_learn_duration_stats`
|
|
||||||
where `user_id` = #{userId}
|
|
||||||
and `created_date` = #{createdDate};
|
|
||||||
</select>
|
|
||||||
<select id="getUserDuration" resultType="java.lang.Integer">
|
<select id="getUserDuration" resultType="java.lang.Integer">
|
||||||
SELECT sum(`duration`)
|
SELECT sum(`duration`)
|
||||||
FROM `user_learn_duration_stats`
|
FROM `user_learn_duration_stats`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user