yangdamao 1 жил өмнө
parent
commit
e8d952e956

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeUserQueryBo.java

@@ -321,4 +321,6 @@ public class ClassGradeUserQueryBo extends BaseEntity {
 
 	private List<Long> projectIds;
 
+	private Long educationId;
+
 }

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -46,6 +46,9 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
     @InterceptorIgnore(tenantLine = "true")
     List<ClassPeriodStudentVo> listUserVideoRecordNew(ClassGradeUserQueryBo bo);
 
+    @InterceptorIgnore(tenantLine = "true")
+    Long listUserVideoRecordNew_COUNT(ClassGradeUserQueryBo bo);
+
     List<ClassPeriodStudentVo> listUserPeriodExport(ClassGradeUserQueryBo bo);
 
     List<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo);
@@ -70,8 +73,14 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     List<Long> selectStart(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
 
+    @InterceptorIgnore(tenantLine = "true")
+    List<Long> selectStartNew(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
+
     Long selectStartNoPhoto(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
 
+    @InterceptorIgnore(tenantLine = "true")
+    Long selectStartNoPhotoNew(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
+
     List<Long> selectEnd(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId);
 
     List<ClassGradeUserGoodsVo> sendClassGradeUser();
@@ -138,6 +147,9 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
     @InterceptorIgnore(tenantLine = "true")
     List<ClassPeriodStudentNewVo> listUserPeriodNew(ClassGradeUserQueryBo bo);
 
+    @InterceptorIgnore(tenantLine = "true")
+    Long listUserPeriodNew_COUNT(ClassGradeUserQueryBo bo);
+
     @InterceptorIgnore(tenantLine = "true")
     Long getEduIdByTenant(@Param("tenantId") Long tenantId,@Param("eduName") String eduName);
 

+ 10 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -1013,6 +1013,10 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 bo.setEducationTypeIds(educationTypeIds);
                 bo.setProjectIds(projectIds);
             }
+        }else {
+            bo.setTenantIds(Arrays.asList(Long.valueOf(tenantId)));
+            bo.setEducationTypeIds(Arrays.asList(bo.getEducationId()));
+            bo.setProjectIds(Arrays.asList(bo.getProjectId()));
         }
         //查询班级学员信息
         List<ClassPeriodStudentNewVo> classPeriodStudentVos = baseMapper.listUserPeriodNew(bo);
@@ -1020,12 +1024,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         for (ClassPeriodStudentNewVo classPeriodStudentVo : classPeriodStudentVos) {
             classPeriodStudentVo.setIdCard(EncryptHandler.decrypt(classPeriodStudentVo.getIdCard()));
             classPeriodStudentVo.setTelPhone(EncryptHandler.decrypt(classPeriodStudentVo.getTelPhone()));
-            List<Long> timeList = baseMapper.selectStart(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId());
+            List<Long> timeList = baseMapper.selectStartNew(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId());
             if (!CollectionUtils.isEmpty(timeList)) {
                 //查找开始学习时间
                 classPeriodStudentVo.setStartTime(timeList.get(0));
             }else{
-                classPeriodStudentVo.setStartTime(baseMapper.selectStartNoPhoto(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId())
+                classPeriodStudentVo.setStartTime(baseMapper.selectStartNoPhotoNew(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId())
                 );
             }
         }
@@ -1061,6 +1065,10 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 bo.setEducationTypeIds(educationTypeIds);
                 bo.setProjectIds(projectIds);
             }
+        }else {
+            bo.setTenantIds(Arrays.asList(Long.valueOf(tenantId)));
+            bo.setEducationTypeIds(Arrays.asList(bo.getEducationId()));
+            bo.setProjectIds(Arrays.asList(bo.getProjectId()));
         }
         //查询班级学员信息
         List<ClassPeriodStudentVo> classPeriodStudentVos = baseMapper.listUserVideoRecordNew(bo);

+ 135 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -472,6 +472,56 @@
     </select>
 
 
+    <select id="listUserVideoRecordNew_COUNT" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
+            resultType="java.lang.Long">
+        SELECT
+        count(up.id)
+        FROM
+        user_period up
+        LEFT JOIN user_period_status ups ON up.id = ups.period_id
+        LEFT JOIN class_grade cg on up.grade_id = cg.grade_id
+        LEFT JOIN  goods g ON up.goods_id = g.goods_id
+        LEFT JOIN course_section cs ON up.section_id = cs.section_id
+        LEFT JOIN `user` u ON up.user_id = u.user_id
+        WHERE
+        up.grade_id > 0  and up.type = 1
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="projectIds != null and projectIds.size()!=0 ">
+            AND g.project_id in
+            <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
+            AND g.education_type_id in
+            <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="realname != null and realname != ''">
+            AND u.realname like concat('%', #{realname}, '%')
+        </if>
+        <if test="telphone != null and telphone != ''">
+            AND u.telphone = #{telphone`,typeHandler=com.zhongzheng.common.type.EncryptHandler`}
+        </if>
+        <if test="idCard != null and idCard != ''">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="companyName != null and companyName != ''">
+            AND u.company_name like concat('%', #{companyName}, '%')
+        </if>
+        <if test="tenantIds != null and tenantIds.size()!=0 ">
+            AND up.tenant_id in
+            <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        order by up.create_time desc
+    </select>
+
+
     <select id="listUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
             resultMap="ClassPeriodStudentVo">
         SELECT
@@ -626,6 +676,53 @@
     </select>
 
 
+    <select id="listUserPeriodNew_COUNT" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
+            resultType="java.lang.Long">
+        SELECT
+        count(cgu.id)
+        FROM
+        class_grade_user cgu
+        LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
+        LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
+        LEFT JOIN `user` u ON u.user_id = cgu.user_id
+        LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = og.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
+        LEFT JOIN goods g on og.goods_id = g.goods_id
+        LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
+        LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN course_business cb ON g.business_id = cb.id
+        where 1=1
+        and cgu.`status` =1
+        and cb.`period_check_sign` = 1
+        <if test="projectIds != null and projectIds.size()!=0 ">
+            AND g.project_id in
+            <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
+            AND g.education_type_id in
+            <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="periodStatus != null ">
+            and cgu.period_status = #{periodStatus}
+        </if>
+        <if test="searchKey != null and searchKey != '' ">
+            and u.realname like concat('%', #{searchKey}, '%')
+        </if>
+        <if test="idCard != null and idCard !='' ">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="tenantIds != null and tenantIds.size()!=0 ">
+            AND cgu.tenant_id in
+            <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        order by cgu.update_time desc
+    </select>
+
     <select id="listUserPeriodNew" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
             resultType="com.zhongzheng.modules.grade.vo.ClassPeriodStudentNewVo">
         SELECT
@@ -1711,6 +1808,25 @@
             rp.create_time ASC
     </select>
 
+    <select id="selectStartNew" parameterType="map" resultType="long">
+        SELECT
+        rp.create_time
+        FROM
+        user_study_record_photo rp
+        LEFT JOIN user_period_status ups ON rp.period_id = ups.id
+        LEFT JOIN user_period up ON up.id = ups.period_id
+        WHERE
+        1=1
+        <if test="orderGoodsId != null ">
+            AND (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
+        </if>
+        AND ups.period_status = 1
+        AND up.grade_id = #{gradeId}
+        AND up.user_id = #{userId}
+        ORDER BY
+        rp.create_time ASC
+    </select>
+
     <select id="selectStartNoPhoto" parameterType="map" resultType="long">
         SELECT
         ups.record_start_time
@@ -1730,6 +1846,25 @@
         limit 1
     </select>
 
+    <select id="selectStartNoPhotoNew" parameterType="map" resultType="long">
+        SELECT
+        ups.record_start_time
+        FROM
+        user_period_status ups
+        LEFT JOIN user_period up ON up.id = ups.period_id
+        WHERE
+        1=1
+        <if test="orderGoodsId != null ">
+            AND (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
+        </if>
+        AND ups.period_status = 1
+        AND up.grade_id = #{gradeId}
+        AND up.user_id = #{userId}
+        ORDER BY
+        ups.record_start_time ASC
+        limit 1
+    </select>
+
     <select id="selectEnd" parameterType="map" resultType="long">
         SELECT
             usr.end_time