提交 89839009 编写于 作者: F fengyw

处理学习进度

上级 f9e5344a
......@@ -4,8 +4,9 @@
###### v13.0.0-RELEASE(待发布)
1. 增加点播私有化视频播放功能
2. 增加对象存储类型支持:阿里云cos
3. 优化打包流程,修复打包配置错误bug
2. 增加文档课时功能,课时可以选择文档,不限于音视频
3. 增加对象存储类型支持:阿里云cos
4. 优化打包流程,修复打包配置错误bug
---
......
......@@ -26,7 +26,7 @@ public class Resource implements Serializable {
private Integer videoStatus;
private String videoLength;
private Integer videoLength;
private String videoVid;
......@@ -122,12 +122,12 @@ public class Resource implements Serializable {
this.videoStatus = videoStatus;
}
public String getVideoLength() {
public Integer getVideoLength() {
return videoLength;
}
public void setVideoLength(String videoLength) {
this.videoLength = videoLength == null ? null : videoLength.trim();
public void setVideoLength(Integer videoLength) {
this.videoLength = videoLength;
}
public String getVideoVid() {
......
......@@ -815,62 +815,52 @@ public class ResourceExample {
return (Criteria) this;
}
public Criteria andVideoLengthEqualTo(String value) {
public Criteria andVideoLengthEqualTo(Integer value) {
addCriterion("video_length =", value, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthNotEqualTo(String value) {
public Criteria andVideoLengthNotEqualTo(Integer value) {
addCriterion("video_length <>", value, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthGreaterThan(String value) {
public Criteria andVideoLengthGreaterThan(Integer value) {
addCriterion("video_length >", value, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthGreaterThanOrEqualTo(String value) {
public Criteria andVideoLengthGreaterThanOrEqualTo(Integer value) {
addCriterion("video_length >=", value, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthLessThan(String value) {
public Criteria andVideoLengthLessThan(Integer value) {
addCriterion("video_length <", value, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthLessThanOrEqualTo(String value) {
public Criteria andVideoLengthLessThanOrEqualTo(Integer value) {
addCriterion("video_length <=", value, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthLike(String value) {
addCriterion("video_length like", value, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthNotLike(String value) {
addCriterion("video_length not like", value, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthIn(List<String> values) {
public Criteria andVideoLengthIn(List<Integer> values) {
addCriterion("video_length in", values, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthNotIn(List<String> values) {
public Criteria andVideoLengthNotIn(List<Integer> values) {
addCriterion("video_length not in", values, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthBetween(String value1, String value2) {
public Criteria andVideoLengthBetween(Integer value1, Integer value2) {
addCriterion("video_length between", value1, value2, "videoLength");
return (Criteria) this;
}
public Criteria andVideoLengthNotBetween(String value1, String value2) {
public Criteria andVideoLengthNotBetween(Integer value1, Integer value2) {
addCriterion("video_length not between", value1, value2, "videoLength");
return (Criteria) this;
}
......
......@@ -19,6 +19,12 @@ public class UserStudy implements Serializable {
private Long userId;
private Integer resourceType;
private Integer currentDuration;
private Integer currentPage;
private BigDecimal progress;
private static final long serialVersionUID = 1L;
......@@ -79,6 +85,30 @@ public class UserStudy implements Serializable {
this.userId = userId;
}
public Integer getResourceType() {
return resourceType;
}
public void setResourceType(Integer resourceType) {
this.resourceType = resourceType;
}
public Integer getCurrentDuration() {
return currentDuration;
}
public void setCurrentDuration(Integer currentDuration) {
this.currentDuration = currentDuration;
}
public Integer getCurrentPage() {
return currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
public BigDecimal getProgress() {
return progress;
}
......@@ -100,6 +130,9 @@ public class UserStudy implements Serializable {
sb.append(", chapterId=").append(chapterId);
sb.append(", periodId=").append(periodId);
sb.append(", userId=").append(userId);
sb.append(", resourceType=").append(resourceType);
sb.append(", currentDuration=").append(currentDuration);
sb.append(", currentPage=").append(currentPage);
sb.append(", progress=").append(progress);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
......
......@@ -546,6 +546,186 @@ public class UserStudyExample {
return (Criteria) this;
}
public Criteria andResourceTypeIsNull() {
addCriterion("resource_type is null");
return (Criteria) this;
}
public Criteria andResourceTypeIsNotNull() {
addCriterion("resource_type is not null");
return (Criteria) this;
}
public Criteria andResourceTypeEqualTo(Integer value) {
addCriterion("resource_type =", value, "resourceType");
return (Criteria) this;
}
public Criteria andResourceTypeNotEqualTo(Integer value) {
addCriterion("resource_type <>", value, "resourceType");
return (Criteria) this;
}
public Criteria andResourceTypeGreaterThan(Integer value) {
addCriterion("resource_type >", value, "resourceType");
return (Criteria) this;
}
public Criteria andResourceTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("resource_type >=", value, "resourceType");
return (Criteria) this;
}
public Criteria andResourceTypeLessThan(Integer value) {
addCriterion("resource_type <", value, "resourceType");
return (Criteria) this;
}
public Criteria andResourceTypeLessThanOrEqualTo(Integer value) {
addCriterion("resource_type <=", value, "resourceType");
return (Criteria) this;
}
public Criteria andResourceTypeIn(List<Integer> values) {
addCriterion("resource_type in", values, "resourceType");
return (Criteria) this;
}
public Criteria andResourceTypeNotIn(List<Integer> values) {
addCriterion("resource_type not in", values, "resourceType");
return (Criteria) this;
}
public Criteria andResourceTypeBetween(Integer value1, Integer value2) {
addCriterion("resource_type between", value1, value2, "resourceType");
return (Criteria) this;
}
public Criteria andResourceTypeNotBetween(Integer value1, Integer value2) {
addCriterion("resource_type not between", value1, value2, "resourceType");
return (Criteria) this;
}
public Criteria andCurrentDurationIsNull() {
addCriterion("current_duration is null");
return (Criteria) this;
}
public Criteria andCurrentDurationIsNotNull() {
addCriterion("current_duration is not null");
return (Criteria) this;
}
public Criteria andCurrentDurationEqualTo(Integer value) {
addCriterion("current_duration =", value, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentDurationNotEqualTo(Integer value) {
addCriterion("current_duration <>", value, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentDurationGreaterThan(Integer value) {
addCriterion("current_duration >", value, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentDurationGreaterThanOrEqualTo(Integer value) {
addCriterion("current_duration >=", value, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentDurationLessThan(Integer value) {
addCriterion("current_duration <", value, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentDurationLessThanOrEqualTo(Integer value) {
addCriterion("current_duration <=", value, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentDurationIn(List<Integer> values) {
addCriterion("current_duration in", values, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentDurationNotIn(List<Integer> values) {
addCriterion("current_duration not in", values, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentDurationBetween(Integer value1, Integer value2) {
addCriterion("current_duration between", value1, value2, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentDurationNotBetween(Integer value1, Integer value2) {
addCriterion("current_duration not between", value1, value2, "currentDuration");
return (Criteria) this;
}
public Criteria andCurrentPageIsNull() {
addCriterion("current_page is null");
return (Criteria) this;
}
public Criteria andCurrentPageIsNotNull() {
addCriterion("current_page is not null");
return (Criteria) this;
}
public Criteria andCurrentPageEqualTo(Integer value) {
addCriterion("current_page =", value, "currentPage");
return (Criteria) this;
}
public Criteria andCurrentPageNotEqualTo(Integer value) {
addCriterion("current_page <>", value, "currentPage");
return (Criteria) this;
}
public Criteria andCurrentPageGreaterThan(Integer value) {
addCriterion("current_page >", value, "currentPage");
return (Criteria) this;
}
public Criteria andCurrentPageGreaterThanOrEqualTo(Integer value) {
addCriterion("current_page >=", value, "currentPage");
return (Criteria) this;
}
public Criteria andCurrentPageLessThan(Integer value) {
addCriterion("current_page <", value, "currentPage");
return (Criteria) this;
}
public Criteria andCurrentPageLessThanOrEqualTo(Integer value) {
addCriterion("current_page <=", value, "currentPage");
return (Criteria) this;
}
public Criteria andCurrentPageIn(List<Integer> values) {
addCriterion("current_page in", values, "currentPage");
return (Criteria) this;
}
public Criteria andCurrentPageNotIn(List<Integer> values) {
addCriterion("current_page not in", values, "currentPage");
return (Criteria) this;
}
public Criteria andCurrentPageBetween(Integer value1, Integer value2) {
addCriterion("current_page between", value1, value2, "currentPage");
return (Criteria) this;
}
public Criteria andCurrentPageNotBetween(Integer value1, Integer value2) {
addCriterion("current_page not between", value1, value2, "currentPage");
return (Criteria) this;
}
public Criteria andProgressIsNull() {
addCriterion("progress is null");
return (Criteria) this;
......
......@@ -45,10 +45,11 @@ public class UserStudyJob {
UserStudy userStudy = userStudyDao.getById(req.getStudyId());
if (ResourceTypeEnum.VIDEO.getCode().equals(req.getResourceType()) || ResourceTypeEnum.AUDIO.getCode().equals(req.getResourceType())) {
userStudy.setProgress(req.getCurrentDuration().divide(req.getTotalDuration(), BigDecimal.ROUND_CEILING).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP));
userStudy.setCurrentDuration(req.getCurrentDuration().intValue());
} else if (ResourceTypeEnum.DOC.getCode().equals(req.getResourceType())) {
userStudy.setProgress(BigDecimal.valueOf(req.getCurrentPage()).divide(BigDecimal.valueOf(req.getTotalPage())).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP));
userStudy.setCurrentPage(req.getCurrentPage());
}
userStudyDao.updateById(userStudy);
// 清楚缓存
cacheRedis.delete(Constants.RedisPre.USER_STUDY + req.getStudyId());
......
......@@ -68,7 +68,6 @@ public class ApiUserStudyBiz extends BaseBiz {
if (ObjectUtil.isEmpty(userStudy)) {
return Result.error("studyId不正确");
}
userStudy.setProgress(BigDecimal.valueOf(100));
// 更新观看记录
dao.updateById(userStudy);
......
......@@ -50,7 +50,7 @@ public class AuthCourseController {
*
* @author fengyw
*/
@ApiOperation(value = "观看授权", notes = "课程观看授权")
@ApiOperation(value = "学习配置", notes = "获取课时学习需要的配置参数")
@RequestMapping(value = "/sign", method = RequestMethod.POST)
public Result<AuthCourseSignResp> sign(@RequestBody AuthCourseSignReq req) {
return biz.sign(req);
......
......@@ -82,6 +82,9 @@ public class AuthCourseBiz extends BaseBiz {
userStudy.setChapterId(period.getChapterId());
userStudy.setPeriodId(period.getId());
userStudy.setUserId(ThreadContext.userId());
userStudy.setResourceType(resource.getResourceType());
userStudy.setCurrentDuration(0);
userStudy.setCurrentPage(0);
userStudy.setProgress(BigDecimal.ZERO);
userStudyDao.save(userStudy);
}
......@@ -93,8 +96,14 @@ public class AuthCourseBiz extends BaseBiz {
resp.setResourceId(resource.getId());
resp.setVid(resource.getVideoVid());
resp.setVodPlatform(resource.getVodPlatform());
// 播放参数
playConfig(req, resp);
resp.setCurrentDuration(userStudy.getCurrentDuration());
resp.setCurrentPage(userStudy.getCurrentPage());
if (ResourceTypeEnum.VIDEO.getCode().equals(resource.getResourceType()) || ResourceTypeEnum.AUDIO.getCode().equals(resource.getResourceType())) {
// 播放参数
playConfig(req, resp);
} else if (ResourceTypeEnum.DOC.getCode().equals(resource.getResourceType())) {
docConfig(req, resp);
}
return Result.success(resp);
}
......@@ -114,6 +123,10 @@ public class AuthCourseBiz extends BaseBiz {
resp.setVodPlayConfig(VodUtil.getPlayConfig(vodConfig, playConfigReq));
}
private void docConfig(AuthCourseSignReq req, AuthCourseSignResp resp) {
}
private Boolean check(CourseChapterPeriod period) {
UserCourse userCourse = userCourseDao.getByCourseIdAndUserId(period.getCourseId(), ThreadContext.userId());
if (ObjectUtil.isEmpty(userCourse)) {
......
......@@ -40,6 +40,15 @@ public class AuthCourseSignResp implements Serializable {
@ApiModelProperty(value = "点播平台")
private Integer vodPlatform;
@ApiModelProperty(value = "当前观看时长,单位秒")
private Integer currentDuration;
@ApiModelProperty(value = "点播播放配置参数")
private String vodPlayConfig;
@ApiModelProperty(value = "当前观看页数")
private Integer currentPage;
@ApiModelProperty(value = "文档学习配置参数")
private String docStudyConfig;
}
......@@ -53,6 +53,9 @@ public class ResourceResp implements Serializable {
@ApiModelProperty(value = "资源地址")
private String resourceUrl;
@ApiModelProperty(value = "点播平台")
private Integer vodPlatform;
@ApiModelProperty(value = "状态(1转码中,2成功,3失败)")
private Integer videoStatus;
......@@ -61,4 +64,7 @@ public class ResourceResp implements Serializable {
@ApiModelProperty(value = "vid")
private String videoVid;
@ApiModelProperty(value = "页数")
private Integer docPage;
}
......@@ -13,9 +13,9 @@
<result column="resource_url" jdbcType="VARCHAR" property="resourceUrl" />
<result column="vod_platform" jdbcType="TINYINT" property="vodPlatform" />
<result column="video_status" jdbcType="TINYINT" property="videoStatus" />
<result column="video_length" jdbcType="VARCHAR" property="videoLength" />
<result column="video_length" jdbcType="INTEGER" property="videoLength"/>
<result column="video_vid" jdbcType="VARCHAR" property="videoVid" />
<result column="doc_page" jdbcType="INTEGER" property="docPage"/>
<result column="doc_page" jdbcType="INTEGER" property="docPage"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -97,8 +97,8 @@
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
select
<include refid="Base_Column_List" />
from resource
where id = #{id,jdbcType=BIGINT}
</select>
......@@ -121,7 +121,7 @@
values (#{id,jdbcType=BIGINT}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
#{statusId,jdbcType=TINYINT}, #{sort,jdbcType=INTEGER}, #{resourceName,jdbcType=VARCHAR},
#{resourceType,jdbcType=TINYINT}, #{resourceSize,jdbcType=BIGINT}, #{resourceUrl,jdbcType=VARCHAR},
#{vodPlatform,jdbcType=TINYINT}, #{videoStatus,jdbcType=TINYINT}, #{videoLength,jdbcType=VARCHAR},
#{vodPlatform,jdbcType=TINYINT}, #{videoStatus,jdbcType=TINYINT}, #{videoLength,jdbcType=INTEGER},
#{videoVid,jdbcType=VARCHAR}, #{docPage,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.roncoo.education.course.dao.impl.mapper.entity.Resource">
......@@ -148,15 +148,15 @@
<if test="resourceType != null">
resource_type,
</if>
<if test="resourceSize != null">
resource_size,
</if>
<if test="resourceUrl != null">
resource_url,
</if>
<if test="vodPlatform != null">
vod_platform,
</if>
<if test="resourceSize != null">
resource_size,
</if>
<if test="resourceUrl != null">
resource_url,
</if>
<if test="vodPlatform != null">
vod_platform,
</if>
<if test="videoStatus != null">
video_status,
</if>
......@@ -192,20 +192,20 @@
<if test="resourceType != null">
#{resourceType,jdbcType=TINYINT},
</if>
<if test="resourceSize != null">
#{resourceSize,jdbcType=BIGINT},
</if>
<if test="resourceUrl != null">
#{resourceUrl,jdbcType=VARCHAR},
</if>
<if test="vodPlatform != null">
#{vodPlatform,jdbcType=TINYINT},
</if>
<if test="resourceSize != null">
#{resourceSize,jdbcType=BIGINT},
</if>
<if test="resourceUrl != null">
#{resourceUrl,jdbcType=VARCHAR},
</if>
<if test="vodPlatform != null">
#{vodPlatform,jdbcType=TINYINT},
</if>
<if test="videoStatus != null">
#{videoStatus,jdbcType=TINYINT},
</if>
<if test="videoLength != null">
#{videoLength,jdbcType=VARCHAR},
#{videoLength,jdbcType=INTEGER},
</if>
<if test="videoVid != null">
#{videoVid,jdbcType=VARCHAR},
......@@ -245,20 +245,20 @@
<if test="record.resourceType != null">
resource_type = #{record.resourceType,jdbcType=TINYINT},
</if>
<if test="record.resourceSize != null">
resource_size = #{record.resourceSize,jdbcType=BIGINT},
</if>
<if test="record.resourceUrl != null">
resource_url = #{record.resourceUrl,jdbcType=VARCHAR},
</if>
<if test="record.vodPlatform != null">
vod_platform = #{record.vodPlatform,jdbcType=TINYINT},
</if>
<if test="record.resourceSize != null">
resource_size = #{record.resourceSize,jdbcType=BIGINT},
</if>
<if test="record.resourceUrl != null">
resource_url = #{record.resourceUrl,jdbcType=VARCHAR},
</if>
<if test="record.vodPlatform != null">
vod_platform = #{record.vodPlatform,jdbcType=TINYINT},
</if>
<if test="record.videoStatus != null">
video_status = #{record.videoStatus,jdbcType=TINYINT},
</if>
<if test="record.videoLength != null">
video_length = #{record.videoLength,jdbcType=VARCHAR},
video_length = #{record.videoLength,jdbcType=INTEGER},
</if>
<if test="record.videoVid != null">
video_vid = #{record.videoVid,jdbcType=VARCHAR},
......@@ -284,12 +284,12 @@
resource_url = #{record.resourceUrl,jdbcType=VARCHAR},
vod_platform = #{record.vodPlatform,jdbcType=TINYINT},
video_status = #{record.videoStatus,jdbcType=TINYINT},
video_length = #{record.videoLength,jdbcType=VARCHAR},
video_length = #{record.videoLength,jdbcType=INTEGER},
video_vid = #{record.videoVid,jdbcType=VARCHAR},
doc_page = #{record.docPage,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.roncoo.education.course.dao.impl.mapper.entity.Resource">
update resource
......@@ -312,20 +312,20 @@
<if test="resourceType != null">
resource_type = #{resourceType,jdbcType=TINYINT},
</if>
<if test="resourceSize != null">
resource_size = #{resourceSize,jdbcType=BIGINT},
</if>
<if test="resourceUrl != null">
resource_url = #{resourceUrl,jdbcType=VARCHAR},
</if>
<if test="vodPlatform != null">
vod_platform = #{vodPlatform,jdbcType=TINYINT},
</if>
<if test="resourceSize != null">
resource_size = #{resourceSize,jdbcType=BIGINT},
</if>
<if test="resourceUrl != null">
resource_url = #{resourceUrl,jdbcType=VARCHAR},
</if>
<if test="vodPlatform != null">
vod_platform = #{vodPlatform,jdbcType=TINYINT},
</if>
<if test="videoStatus != null">
video_status = #{videoStatus,jdbcType=TINYINT},
</if>
<if test="videoLength != null">
video_length = #{videoLength,jdbcType=VARCHAR},
video_length = #{videoLength,jdbcType=INTEGER},
</if>
<if test="videoVid != null">
video_vid = #{videoVid,jdbcType=VARCHAR},
......@@ -337,20 +337,20 @@
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.roncoo.education.course.dao.impl.mapper.entity.Resource">
update resource
set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
status_id = #{statusId,jdbcType=TINYINT},
sort = #{sort,jdbcType=INTEGER},
resource_name = #{resourceName,jdbcType=VARCHAR},
resource_type = #{resourceType,jdbcType=TINYINT},
resource_size = #{resourceSize,jdbcType=BIGINT},
resource_url = #{resourceUrl,jdbcType=VARCHAR},
vod_platform = #{vodPlatform,jdbcType=TINYINT},
video_status = #{videoStatus,jdbcType=TINYINT},
video_length = #{videoLength,jdbcType=VARCHAR},
video_vid = #{videoVid,jdbcType=VARCHAR},
doc_page = #{docPage,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
update resource
set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
status_id = #{statusId,jdbcType=TINYINT},
sort = #{sort,jdbcType=INTEGER},
resource_name = #{resourceName,jdbcType=VARCHAR},
resource_type = #{resourceType,jdbcType=TINYINT},
resource_size = #{resourceSize,jdbcType=BIGINT},
resource_url = #{resourceUrl,jdbcType=VARCHAR},
vod_platform = #{vodPlatform,jdbcType=TINYINT},
video_status = #{videoStatus,jdbcType=TINYINT},
video_length = #{videoLength,jdbcType=INTEGER},
video_vid = #{videoVid,jdbcType=VARCHAR},
doc_page = #{docPage,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
......@@ -2,14 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.roncoo.education.course.dao.impl.mapper.UserStudyMapper">
<resultMap id="BaseResultMap" type="com.roncoo.education.course.dao.impl.mapper.entity.UserStudy">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
<result column="course_id" jdbcType="BIGINT" property="courseId" />
<result column="chapter_id" jdbcType="BIGINT" property="chapterId" />
<result column="period_id" jdbcType="BIGINT" property="periodId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="progress" jdbcType="DECIMAL" property="progress" />
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
<result column="course_id" jdbcType="BIGINT" property="courseId"/>
<result column="chapter_id" jdbcType="BIGINT" property="chapterId"/>
<result column="period_id" jdbcType="BIGINT" property="periodId"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="resource_type" jdbcType="TINYINT" property="resourceType"/>
<result column="current_duration" jdbcType="INTEGER" property="currentDuration"/>
<result column="current_page" jdbcType="INTEGER" property="currentPage"/>
<result column="progress" jdbcType="DECIMAL" property="progress"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -70,7 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, gmt_create, gmt_modified, course_id, chapter_id, period_id, user_id, progress
id, gmt_create, gmt_modified, course_id, chapter_id, period_id, user_id, resource_type,
current_duration, current_page, progress
</sql>
<select id="selectByExample" parameterType="com.roncoo.education.course.dao.impl.mapper.entity.UserStudyExample" resultMap="BaseResultMap">
select
......@@ -90,7 +94,7 @@
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
select
<include refid="Base_Column_List" />
from user_study
where id = #{id,jdbcType=BIGINT}
......@@ -106,12 +110,14 @@
</if>
</delete>
<insert id="insert" parameterType="com.roncoo.education.course.dao.impl.mapper.entity.UserStudy">
insert into user_study (id, gmt_create, gmt_modified,
course_id, chapter_id, period_id,
user_id, progress)
values (#{id,jdbcType=BIGINT}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
#{courseId,jdbcType=BIGINT}, #{chapterId,jdbcType=BIGINT}, #{periodId,jdbcType=BIGINT},
#{userId,jdbcType=BIGINT}, #{progress,jdbcType=DECIMAL})
insert into user_study (id, gmt_create, gmt_modified,
course_id, chapter_id, period_id,
user_id, resource_type, current_duration,
current_page, progress)
values (#{id,jdbcType=BIGINT}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
#{courseId,jdbcType=BIGINT}, #{chapterId,jdbcType=BIGINT}, #{periodId,jdbcType=BIGINT},
#{userId,jdbcType=BIGINT}, #{resourceType,jdbcType=TINYINT}, #{currentDuration,jdbcType=INTEGER},
#{currentPage,jdbcType=INTEGER}, #{progress,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.roncoo.education.course.dao.impl.mapper.entity.UserStudy">
insert into user_study
......@@ -126,20 +132,29 @@
gmt_modified,
</if>
<if test="courseId != null">
course_id,
</if>
<if test="chapterId != null">
chapter_id,
</if>
<if test="periodId != null">
period_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="progress != null">
progress,
course_id,
</if>
<if test="chapterId != null">
chapter_id,
</if>
<if test="periodId != null">
period_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="resourceType != null">
resource_type,
</if>
<if test="currentDuration != null">
current_duration,
</if>
<if test="currentPage != null">
current_page,
</if>
<if test="progress != null">
progress,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -152,20 +167,29 @@
#{gmtModified,jdbcType=TIMESTAMP},
</if>
<if test="courseId != null">
#{courseId,jdbcType=BIGINT},
</if>
<if test="chapterId != null">
#{chapterId,jdbcType=BIGINT},
</if>
<if test="periodId != null">
#{periodId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="progress != null">
#{progress,jdbcType=DECIMAL},
#{courseId,jdbcType=BIGINT},
</if>
<if test="chapterId != null">
#{chapterId,jdbcType=BIGINT},
</if>
<if test="periodId != null">
#{periodId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="resourceType != null">
#{resourceType,jdbcType=TINYINT},
</if>
<if test="currentDuration != null">
#{currentDuration,jdbcType=INTEGER},
</if>
<if test="currentPage != null">
#{currentPage,jdbcType=INTEGER},
</if>
<if test="progress != null">
#{progress,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.roncoo.education.course.dao.impl.mapper.entity.UserStudyExample" resultType="java.lang.Integer">
......@@ -187,36 +211,48 @@
gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
</if>
<if test="record.courseId != null">
course_id = #{record.courseId,jdbcType=BIGINT},
</if>
<if test="record.chapterId != null">
chapter_id = #{record.chapterId,jdbcType=BIGINT},
</if>
<if test="record.periodId != null">
period_id = #{record.periodId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.progress != null">
progress = #{record.progress,jdbcType=DECIMAL},
course_id = #{record.courseId,jdbcType=BIGINT},
</if>
<if test="record.chapterId != null">
chapter_id = #{record.chapterId,jdbcType=BIGINT},
</if>
<if test="record.periodId != null">
period_id = #{record.periodId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.resourceType != null">
resource_type = #{record.resourceType,jdbcType=TINYINT},
</if>
<if test="record.currentDuration != null">
current_duration = #{record.currentDuration,jdbcType=INTEGER},
</if>
<if test="record.currentPage != null">
current_page = #{record.currentPage,jdbcType=INTEGER},
</if>
<if test="record.progress != null">
progress = #{record.progress,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update user_study
set id = #{record.id,jdbcType=BIGINT},
update user_study
set id = #{record.id,jdbcType=BIGINT},
gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
course_id = #{record.courseId,jdbcType=BIGINT},
chapter_id = #{record.chapterId,jdbcType=BIGINT},
period_id = #{record.periodId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
resource_type = #{record.resourceType,jdbcType=TINYINT},
current_duration = #{record.currentDuration,jdbcType=INTEGER},
current_page = #{record.currentPage,jdbcType=INTEGER},
progress = #{record.progress,jdbcType=DECIMAL}
<if test="_parameter != null">
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
......@@ -232,30 +268,42 @@
<if test="courseId != null">
course_id = #{courseId,jdbcType=BIGINT},
</if>
<if test="chapterId != null">
chapter_id = #{chapterId,jdbcType=BIGINT},
</if>
<if test="periodId != null">
period_id = #{periodId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="progress != null">
progress = #{progress,jdbcType=DECIMAL},
</if>
<if test="chapterId != null">
chapter_id = #{chapterId,jdbcType=BIGINT},
</if>
<if test="periodId != null">
period_id = #{periodId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="resourceType != null">
resource_type = #{resourceType,jdbcType=TINYINT},
</if>
<if test="currentDuration != null">
current_duration = #{currentDuration,jdbcType=INTEGER},
</if>
<if test="currentPage != null">
current_page = #{currentPage,jdbcType=INTEGER},
</if>
<if test="progress != null">
progress = #{progress,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.roncoo.education.course.dao.impl.mapper.entity.UserStudy">
update user_study
set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
course_id = #{courseId,jdbcType=BIGINT},
chapter_id = #{chapterId,jdbcType=BIGINT},
period_id = #{periodId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
progress = #{progress,jdbcType=DECIMAL}
where id = #{id,jdbcType=BIGINT}
update user_study
set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
course_id = #{courseId,jdbcType=BIGINT},
chapter_id = #{chapterId,jdbcType=BIGINT},
period_id = #{periodId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
resource_type = #{resourceType,jdbcType=TINYINT},
current_duration = #{currentDuration,jdbcType=INTEGER},
current_page = #{currentPage,jdbcType=INTEGER},
progress = #{progress,jdbcType=DECIMAL}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
</mapper>
......@@ -7,7 +7,7 @@ projectPath=D:/ws-opens-roncoo/roncoo-education/roncoo-education-course
projectName=roncoo-education-course-service
packagePrefix=com.roncoo.education
packageName=course
tableNames=resource
tableNames=user_study
#db.url=jdbc:mysql://10.65.3.98:3306/os_system?useUnicode=true&characterEncoding=utf-8&useSSL=false
#db.username=roncoo
#db.password=RonCoo.123
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册