|
@@ -41,29 +41,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
where log_id = #{logId}
|
|
where log_id = #{logId}
|
|
</select>
|
|
</select>
|
|
<select id="selectFsCourseAnswerLogsListVONew" resultType="com.fs.course.vo.FsCourseAnswerLogsListVO">
|
|
<select id="selectFsCourseAnswerLogsListVONew" resultType="com.fs.course.vo.FsCourseAnswerLogsListVO">
|
|
- select cal.*,uc.course_name as course_name,uc.project as project from fs_course_answer_logs cal
|
|
|
|
- left join fs_user_course uc on cal.course_id=uc.course_id
|
|
|
|
|
|
+ SELECT
|
|
|
|
+ cal.*, uc.course_name AS course_name, uc.project AS project
|
|
|
|
+ FROM
|
|
|
|
+ fs_course_answer_logs cal
|
|
|
|
+ INNER JOIN (
|
|
|
|
+ SELECT
|
|
|
|
+ cal_inner.log_id
|
|
|
|
+ FROM
|
|
|
|
+ fs_course_answer_logs cal_inner
|
|
|
|
+ LEFT JOIN fs_user_course uc_inner ON cal_inner.course_id = uc_inner.course_id
|
|
<where>
|
|
<where>
|
|
<if test="courseId != null">
|
|
<if test="courseId != null">
|
|
- cal.course_id = #{courseId}
|
|
|
|
|
|
+ cal_inner.course_id = #{courseId}
|
|
</if>
|
|
</if>
|
|
<if test="companyUserId != null">
|
|
<if test="companyUserId != null">
|
|
- AND cal.company_user_id = #{companyUserId}
|
|
|
|
|
|
+ AND cal_inner.company_user_id = #{companyUserId}
|
|
</if>
|
|
</if>
|
|
<if test="companyId != null">
|
|
<if test="companyId != null">
|
|
- AND cal.company_id = #{companyId}
|
|
|
|
|
|
+ AND cal_inner.company_id = #{companyId}
|
|
</if>
|
|
</if>
|
|
<if test="isRight != null">
|
|
<if test="isRight != null">
|
|
- AND is_right = #{isRight}
|
|
|
|
|
|
+ AND cal_inner.is_right = #{isRight}
|
|
</if>
|
|
</if>
|
|
<if test="project != null">
|
|
<if test="project != null">
|
|
- AND uc.project = #{project}
|
|
|
|
|
|
+ AND uc_inner.project = #{project}
|
|
</if>
|
|
</if>
|
|
<if test="sTime != null and eTime != null">
|
|
<if test="sTime != null and eTime != null">
|
|
- AND cal.create_time BETWEEN #{sTime} AND #{eTime}
|
|
|
|
|
|
+ AND cal_inner.create_time BETWEEN #{sTime} AND #{eTime}
|
|
</if>
|
|
</if>
|
|
-
|
|
|
|
</where>
|
|
</where>
|
|
|
|
+ ORDER BY cal_inner.log_id DESC
|
|
|
|
+ LIMIT ${(pageNum-1)*pageSize}, ${pageSize}
|
|
|
|
+ ) AS paged_ids ON cal.log_id = paged_ids.log_id
|
|
|
|
+ LEFT JOIN fs_user_course uc ON cal.course_id = uc.course_id
|
|
|
|
+ ORDER BY
|
|
|
|
+ cal.log_id DESC
|
|
|
|
|
|
</select>
|
|
</select>
|
|
<select id="selectFsCourseAnswerLogsListVONewCount" resultType="java.lang.Long">
|
|
<select id="selectFsCourseAnswerLogsListVONewCount" resultType="java.lang.Long">
|
|
@@ -91,6 +104,80 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="selectFsCourseAnswerLogsListVO" resultType="com.fs.course.vo.FsCourseAnswerLogsListVO">
|
|
|
|
+ SELECT
|
|
|
|
+ fu.nick_name AS userName,
|
|
|
|
+ fu.avatar AS fsAvatar,
|
|
|
|
+ ucv.title as videoName,
|
|
|
|
+ ucv.course_id as courseId,
|
|
|
|
+ uc.course_name as courseName,
|
|
|
|
+ cu.nick_name as companyUserName,
|
|
|
|
+ qu.qw_user_name as qwUserName,
|
|
|
|
+ c.company_name as companyName,
|
|
|
|
+ cal.*
|
|
|
|
+ FROM
|
|
|
|
+ fs_course_answer_logs cal
|
|
|
|
+ INNER JOIN (
|
|
|
|
+ SELECT cal_inner.log_id
|
|
|
|
+ FROM fs_course_answer_logs cal_inner
|
|
|
|
+ LEFT JOIN fs_user fu_inner ON cal_inner.user_id = fu_inner.user_id
|
|
|
|
+ LEFT JOIN fs_user_course_video ucv_inner on cal_inner.video_id=ucv_inner.video_id
|
|
|
|
+ LEFT JOIN fs_user_course uc_inner on uc_inner.course_id=ucv_inner.course_id
|
|
|
|
+ LEFT JOIN company_user cu_inner on cu_inner.user_id = cal_inner.company_user_id
|
|
|
|
+ <where>
|
|
|
|
+ <if test='map.phone != null '> and fu_inner.phone = #{map.phone}</if>
|
|
|
|
+ <if test='map.courseId != null '> and uc_inner.course_id = #{map.courseId}</if>
|
|
|
|
+ <if test='map.videoId != null '> and cal_inner.video_id = #{map.videoId}</if>
|
|
|
|
+ <if test='map.watchLogId != null '> and cal_inner.watch_log_id = #{map.watchLogId}</if>
|
|
|
|
+ <if test='map.userId != null '> and cal_inner.user_id = #{map.userId}</if>
|
|
|
|
+ <if test='map.isRight != null '> and cal_inner.is_right = #{map.isRight}</if>
|
|
|
|
+ <if test='map.qwUserId != null '> and cal_inner.qw_user_id = #{map.qwUserId}</if>
|
|
|
|
+ <if test='map.companyUserName != null '> and cu_inner.nick_name like concat(#{map.companyUserName}, '%') </if>
|
|
|
|
+ <if test='map.nickName != null '> and fu_inner.nick_name like concat(#{map.nickName}, '%') </if>
|
|
|
|
+ <if test='map.companyId != null '> and cal_inner.company_id = #{map.companyId}</if>
|
|
|
|
+ <if test='map.createTime != null '> and Date(cal_inner.create_time) = #{map.createTime}</if>
|
|
|
|
+ <if test='map.sTime != null '> and DATE(cal_inner.create_time) >= DATE(#{map.sTime})</if>
|
|
|
|
+ <if test='map.eTime != null '> and DATE(cal_inner.create_time) <= DATE(#{map.eTime})</if>
|
|
|
|
+ </where>
|
|
|
|
+ ORDER BY cal_inner.log_id DESC
|
|
|
|
+ LIMIT ${(map.pageNum-1)*map.pageSize}, ${map.pageSize}
|
|
|
|
+ ) AS paged_ids ON cal.log_id = paged_ids.log_id
|
|
|
|
+ LEFT JOIN fs_user fu ON cal.user_id = fu.user_id
|
|
|
|
+ LEFT JOIN fs_user_course_video ucv on cal.video_id=ucv.video_id
|
|
|
|
+ LEFT JOIN fs_user_course uc on uc.course_id=ucv.course_id
|
|
|
|
+ LEFT JOIN company_user cu on cu.user_id = cal.company_user_id
|
|
|
|
+ LEFT JOIN qw_user qu on qu.id=cal.qw_user_id
|
|
|
|
+ LEFT JOIN company c on cal.company_id=c.company_id
|
|
|
|
+ ORDER BY
|
|
|
|
+ cal.log_id DESC
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectFsCourseAnswerLogsListVOCount" resultType="java.lang.Long">
|
|
|
|
+ SELECT
|
|
|
|
+ count(1)
|
|
|
|
+ FROM
|
|
|
|
+ fs_course_answer_logs cal
|
|
|
|
+ LEFT JOIN fs_user fu ON cal.user_id = fu.user_id
|
|
|
|
+ LEFT JOIN fs_user_course_video ucv on cal.video_id=ucv.video_id
|
|
|
|
+ LEFT JOIN fs_user_course uc on uc.course_id=ucv.course_id
|
|
|
|
+ LEFT JOIN company_user cu on cu.user_id = cal.company_user_id
|
|
|
|
+ LEFT JOIN qw_user qu on qu.id=cal.qw_user_id
|
|
|
|
+ LEFT JOIN company c on cal.company_id=c.company_id
|
|
|
|
+ <where>
|
|
|
|
+ <if test='map.phone != null '> and fu.phone = #{map.phone}</if>
|
|
|
|
+ <if test='map.courseId != null '> and uc.course_id = #{map.courseId}</if>
|
|
|
|
+ <if test='map.videoId != null '> and cal.video_id = #{map.videoId}</if>
|
|
|
|
+ <if test='map.watchLogId != null '> and cal.watch_log_id = #{map.watchLogId}</if>
|
|
|
|
+ <if test='map.userId != null '> and cal.user_id = #{map.userId}</if>
|
|
|
|
+ <if test='map.isRight != null '> and cal.is_right = #{map.isRight}</if>
|
|
|
|
+ <if test='map.qwUserId != null '> and cal.qw_user_id = #{map.qwUserId}</if>
|
|
|
|
+ <if test='map.companyUserName != null '> and cu.nick_name like concat(#{map.companyUserName}, '%') </if>
|
|
|
|
+ <if test='map.nickName != null '> and fu.nick_name like concat(#{map.nickName}, '%') </if>
|
|
|
|
+ <if test='map.companyId != null '> and cal.company_id = #{map.companyId}</if>
|
|
|
|
+ <if test='map.createTime != null '> and Date(cal.create_time) = #{map.createTime}</if>
|
|
|
|
+ <if test='map.sTime != null '> and DATE(cal.create_time) >= DATE(#{map.sTime})</if>
|
|
|
|
+ <if test='map.eTime != null '> and DATE(cal.create_time) <= DATE(#{map.eTime})</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
|
|
<insert id="insertFsCourseAnswerLogs" parameterType="FsCourseAnswerLogs" useGeneratedKeys="true" keyProperty="logId">
|
|
<insert id="insertFsCourseAnswerLogs" parameterType="FsCourseAnswerLogs" useGeneratedKeys="true" keyProperty="logId">
|
|
insert into fs_course_answer_logs
|
|
insert into fs_course_answer_logs
|