|
|
@@ -1,5 +1,6 @@
|
|
|
package com.fs.course.mapper;
|
|
|
|
|
|
+import com.fs.course.domain.CompanyCourseRedpacket;
|
|
|
import com.fs.course.domain.FsUserCourseVideo;
|
|
|
import com.fs.course.domain.FsVideoResource;
|
|
|
import com.fs.course.param.CourseVideoUpdates;
|
|
|
@@ -11,10 +12,7 @@ import com.fs.course.vo.*;
|
|
|
import com.fs.course.vo.newfs.FsUserCourseVideoPageListVO;
|
|
|
import com.fs.his.vo.OptionsVO;
|
|
|
import com.fs.qw.param.FsUserCourseRedPageParam;
|
|
|
-import org.apache.ibatis.annotations.MapKey;
|
|
|
-import org.apache.ibatis.annotations.Param;
|
|
|
-import org.apache.ibatis.annotations.Select;
|
|
|
-import org.apache.ibatis.annotations.Update;
|
|
|
+import org.apache.ibatis.annotations.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
@@ -147,12 +145,12 @@ public interface FsUserCourseVideoMapper
|
|
|
Long selectFsUserCourseVideoByCourseSort(@Param("courseId")Long courseId, @Param("courseSort")Long courseSort);
|
|
|
|
|
|
|
|
|
- @Select("select video_id dict_value, title dict_label from fs_user_course_video where course_id=#{id} and is_del = 0 order by course_sort")
|
|
|
+ @Select("select video_id dict_value, title dict_label,remark from fs_user_course_video where course_id=#{id} and is_del = 0 order by course_sort")
|
|
|
List<OptionsVO> selectFsUserCourseVodeAllList(Long id);
|
|
|
|
|
|
@Select({"<script> " +
|
|
|
- "select v.*,p.red_packet_money company_red_packet_money from fs_user_course_video v " +
|
|
|
- "LEFT JOIN fs_user_course_video_red_package p on p.video_id= v.video_id and p.company_id =#{maps.companyId} and p.data_type = 1 " +
|
|
|
+ "select v.*,p.red_packet_money companyRedPacketMoney from fs_user_course_video v " +
|
|
|
+ "LEFT JOIN company_course_redpacket p on p.video_id= v.video_id and p.company_id =#{maps.companyId} and p.status = 1 " +
|
|
|
"where v.is_del = 0 and v.course_id = #{maps.courseId} " +
|
|
|
"<if test = ' maps.title!=null and maps.title != \"\" '> " +
|
|
|
"and v.title = #{maps.title} " +
|
|
|
@@ -161,6 +159,38 @@ public interface FsUserCourseVideoMapper
|
|
|
"</script>"})
|
|
|
List<FsUserCourseVideoVO> selectFsUserCourseVideoListByCourseIdAndCompany(@Param("maps") FsUserCourseVideoParam fsUserCourseVideo);
|
|
|
|
|
|
+ @Select("SELECT * FROM company_course_redpacket WHERE company_id = #{companyId} AND video_id = #{videoId}")
|
|
|
+ CompanyCourseRedpacket selectByCompanyAndSection(@Param("companyId") Long companyId,
|
|
|
+ @Param("videoId") Long videoId);
|
|
|
+
|
|
|
+ @Select("SELECT * FROM company_course_redpacket WHERE company_id = #{companyId} AND video_id = #{videoId} AND status = 1")
|
|
|
+ CompanyCourseRedpacket getOpenRedpacket(@Param("companyId") Long companyId,
|
|
|
+ @Param("videoId") Long videoId);
|
|
|
+ /**
|
|
|
+ * 新增企业课程红包配置
|
|
|
+ */
|
|
|
+ @Insert("INSERT INTO company_course_redpacket (company_id, video_id, red_packet_money, status, created_time, updated_time) " +
|
|
|
+ "VALUES (#{entity.companyId}, #{entity.videoId}, #{entity.redPacketMoney}, #{entity.status}, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)")
|
|
|
+ int insertCompanyCourseRedpacket(@Param("entity") CompanyCourseRedpacket entity);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新企业课程红包配置
|
|
|
+ */
|
|
|
+ @Update("UPDATE company_course_redpacket SET " +
|
|
|
+ "red_packet_money = #{entity.redPacketMoney}, " +
|
|
|
+ "status = #{entity.status}, " +
|
|
|
+ "updated_time = CURRENT_TIMESTAMP " +
|
|
|
+ "WHERE company_id = #{entity.companyId} AND video_id = #{entity.videoId}")
|
|
|
+ int updateCompanyCourseRedpacket(@Param("entity") CompanyCourseRedpacket entity);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Select("select v.* from fs_user_course_video v " +
|
|
|
"left join fs_user_course c on c.course_id = v.course_id " +
|
|
|
"where c.is_private = 1 and v.is_del = 0 ")
|