|
@@ -440,61 +440,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectStudyRecord" parameterType="com.zhongzheng.modules.user.domain.UserStudyRecord" resultType="Long">
|
|
|
SELECT
|
|
|
- COUNT( 1 )
|
|
|
+ COUNT( 1 )
|
|
|
FROM
|
|
|
- user_study_record usr
|
|
|
+ user_period up
|
|
|
+ LEFT JOIN user_period_status ups on up.id = ups.period_id
|
|
|
WHERE
|
|
|
- 1 =1
|
|
|
- AND usr.record_id != #{recordId}
|
|
|
+ 1 =1
|
|
|
<choose>
|
|
|
<when test="chapterId != null and chapterId !=''">
|
|
|
- AND usr.chapter_id = #{chapterId}
|
|
|
+ AND up.chapter_id = #{chapterId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.chapter_id = 0
|
|
|
+ AND up.chapter_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="sectionId != null and sectionId !=''">
|
|
|
- AND usr.section_id = #{sectionId}
|
|
|
+ AND up.section_id = #{sectionId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.section_id = 0
|
|
|
+ AND up.section_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="moduleId != null and moduleId !=''">
|
|
|
- AND usr.module_id = #{moduleId}
|
|
|
+ AND up.module_id = #{moduleId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.module_id = 0
|
|
|
+ AND up.module_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="courseId != null and courseId !=''">
|
|
|
- AND usr.course_id = #{courseId}
|
|
|
+ AND up.course_id = #{courseId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.course_id = 0
|
|
|
+ AND up.course_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="gradeId != null and gradeId !=''">
|
|
|
- AND usr.grade_id = #{gradeId}
|
|
|
+ AND up.grade_id = #{gradeId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.grade_id = 0
|
|
|
+ AND up.grade_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="goodsId != null and goodsId !=''">
|
|
|
- AND usr.goods_id = #{gradeId}
|
|
|
+ AND up.goods_id = #{goodsId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.goods_id = 0
|
|
|
+ AND up.goods_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
- AND usr.user_id = #{userId}
|
|
|
+ AND up.user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPeriod" parameterType="com.zhongzheng.modules.user.domain.UserStudyRecord" resultType="Long">
|
|
@@ -507,72 +507,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
1 =1
|
|
|
<choose>
|
|
|
<when test="chapterId != null and chapterId !=''">
|
|
|
- AND usr.chapter_id = #{chapterId}
|
|
|
+ AND up.chapter_id = #{chapterId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.chapter_id = 0
|
|
|
+ AND up.chapter_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="sectionId != null and sectionId !=''">
|
|
|
- AND usr.section_id = #{sectionId}
|
|
|
+ AND up.section_id = #{sectionId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.section_id = 0
|
|
|
+ AND up.section_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="moduleId != null and moduleId !=''">
|
|
|
- AND usr.module_id = #{moduleId}
|
|
|
+ AND up.module_id = #{moduleId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.module_id = 0
|
|
|
+ AND up.module_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="courseId != null and courseId !=''">
|
|
|
- AND usr.course_id = #{courseId}
|
|
|
+ AND up.course_id = #{courseId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.course_id = 0
|
|
|
+ AND up.course_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="gradeId != null and gradeId !=''">
|
|
|
- AND usr.grade_id = #{gradeId}
|
|
|
+ AND up.grade_id = #{gradeId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.grade_id = 0
|
|
|
+ AND up.grade_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="goodsId != null and goodsId !=''">
|
|
|
- AND usr.goods_id = #{gradeId}
|
|
|
+ AND up.goods_id = #{goodsId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.goods_id = 0
|
|
|
+ AND up.goods_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
- AND usr.user_id = #{userId}
|
|
|
+ AND up.user_id = #{userId}
|
|
|
AND ups.period_status = 1
|
|
|
AND ups.`status` =2
|
|
|
AND ups.record_end_time is NOT NULL
|
|
|
</select>
|
|
|
|
|
|
- <resultMap type="com.zhongzheng.modules.grade.vo.UserPeriodStatusVo" id="UserPeriodStatusVo">
|
|
|
+ <resultMap type="com.zhongzheng.modules.grade.domain.UserPeriodStatus" id="UserPeriodStatus">
|
|
|
<result property="status" column="status"/>
|
|
|
<result property="recordStartTime" column="record_start_time"/>
|
|
|
<result property="recordEndTime" column="record_end_time"/>
|
|
|
<result property="id" column="id"/>
|
|
|
<result property="periodId" column="period_id"/>
|
|
|
<result property="periodStatus" column="period_status"/>
|
|
|
- <result property="auditTime" column="audit_time"/>
|
|
|
- <result property="type" column="type"/>
|
|
|
- <result property="typeName" column="type_name"/>
|
|
|
- <result property="realName" column="realname"/>
|
|
|
</resultMap>
|
|
|
|
|
|
- <select id="selectPeriodCount" parameterType="com.zhongzheng.modules.user.domain.UserStudyRecord" resultMap="UserPeriodStatusVo">
|
|
|
+ <select id="selectPeriodCount" parameterType="com.zhongzheng.modules.user.domain.UserStudyRecord" resultMap="UserPeriodStatus">
|
|
|
SELECT
|
|
|
ups.*
|
|
|
FROM
|
|
@@ -582,53 +578,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
1 =1
|
|
|
<choose>
|
|
|
<when test="chapterId != null and chapterId !=''">
|
|
|
- AND usr.chapter_id = #{chapterId}
|
|
|
+ AND up.chapter_id = #{chapterId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.chapter_id = 0
|
|
|
+ AND up.chapter_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="sectionId != null and sectionId !=''">
|
|
|
- AND usr.section_id = #{sectionId}
|
|
|
+ AND up.section_id = #{sectionId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.section_id = 0
|
|
|
+ AND up.section_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="moduleId != null and moduleId !=''">
|
|
|
- AND usr.module_id = #{moduleId}
|
|
|
+ AND up.module_id = #{moduleId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.module_id = 0
|
|
|
+ AND up.module_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="courseId != null and courseId !=''">
|
|
|
- AND usr.course_id = #{courseId}
|
|
|
+ AND up.course_id = #{courseId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.course_id = 0
|
|
|
+ AND up.course_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="gradeId != null and gradeId !=''">
|
|
|
- AND usr.grade_id = #{gradeId}
|
|
|
+ AND up.grade_id = #{gradeId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.grade_id = 0
|
|
|
+ AND up.grade_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<choose>
|
|
|
<when test="goodsId != null and goodsId !=''">
|
|
|
- AND usr.goods_id = #{gradeId}
|
|
|
+ AND up.goods_id = #{goodsId}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- AND usr.goods_id = 0
|
|
|
+ AND up.goods_id = 0
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
- AND usr.user_id = #{userId}
|
|
|
+ AND up.user_id = #{userId}
|
|
|
AND ups.period_status = 1
|
|
|
</select>
|
|
|
</mapper>
|