|
@@ -435,6 +435,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
ORDER BY l.log_id DESC
|
|
ORDER BY l.log_id DESC
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsCourseRedPacketLogListVO" resultType="com.fs.course.vo.FsCourseRedPacketLogListPVO">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ l.log_id, l.course_id, l.user_id, l.video_id, l.company_user_id, l.company_id,
|
|
|
|
|
+ l.amount, l.create_time, l.qw_user_id, l.out_batch_no, l.status, l.update_time,
|
|
|
|
|
+ l.watch_log_id, l.remark, l.period_id, l.batch_id, l.app_id,
|
|
|
|
|
+ u.nick_name AS fsNickName, u.avatar AS fsAvatar, u.phone,
|
|
|
|
|
+ cu.nick_name AS company_user_name, cu.dept_id,
|
|
|
|
|
+ (SELECT company_name FROM company WHERE company_id = l.company_id) AS company_name,
|
|
|
|
|
+ (SELECT qw_user_name FROM qw_user WHERE id = l.qw_user_id) AS qw_user_name,
|
|
|
|
|
+ (SELECT title FROM fs_user_course_video WHERE video_id = l.video_id) AS video_name,
|
|
|
|
|
+ (SELECT period_name FROM fs_user_course_period WHERE period_id = l.period_id) AS period_name,
|
|
|
|
|
+ (SELECT dept_name FROM company_dept WHERE dept_id = cu.dept_id) AS dept_name,
|
|
|
|
|
+ (SELECT course_name FROM fs_user_course WHERE course_id = l.course_id) AS course_name
|
|
|
|
|
+ FROM fs_course_red_packet_log l
|
|
|
|
|
+ INNER JOIN (
|
|
|
|
|
+ SELECT log_id FROM fs_course_red_packet_log
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="maps.userId != null"> AND user_id = #{maps.userId} </if>
|
|
|
|
|
+ <if test="maps.logId != null"> AND log_id = #{maps.logId} </if>
|
|
|
|
|
+ <if test="maps.watchLogId != null"> AND watch_log_id = #{maps.watchLogId} </if>
|
|
|
|
|
+ <if test="maps.companyId != null"> AND company_id = #{maps.companyId} </if>
|
|
|
|
|
+ <if test="maps.companyUserId != null"> AND company_user_id = #{maps.companyUserId} </if>
|
|
|
|
|
+ <if test="maps.courseId != null"> AND course_id = #{maps.courseId} </if>
|
|
|
|
|
+ <if test="maps.videoId != null"> AND video_id = #{maps.videoId} </if>
|
|
|
|
|
+ <if test="maps.periodId != null"> AND period_id = #{maps.periodId} </if>
|
|
|
|
|
+ <if test="maps.status != null"> AND status = #{maps.status} </if>
|
|
|
|
|
+ <if test="maps.qwUserId != null"> AND qw_user_id = #{maps.qwUserId} </if>
|
|
|
|
|
+ <if test="maps.sTime != null"> AND create_time >= #{maps.sTime} </if>
|
|
|
|
|
+ <if test="maps.eTime != null"> AND create_time <= #{maps.eTime} </if>
|
|
|
|
|
+ <if test="maps.userIdsConverted != null and maps.userIdsConverted.size() > 0">
|
|
|
|
|
+ AND company_user_id IN
|
|
|
|
|
+ <foreach collection="maps.userIdsConverted" open="(" close=")" separator="," item="item">#{item}</foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ORDER BY log_id DESC
|
|
|
|
|
+ ) AS t ON t.log_id = l.log_id
|
|
|
|
|
+ LEFT JOIN fs_user u ON u.user_id = l.user_id
|
|
|
|
|
+ LEFT JOIN company_user cu ON cu.user_id = l.company_user_id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="maps.companyUserName != null"> AND cu.nick_name LIKE concat('%', #{maps.companyUserName}, '%') </if>
|
|
|
|
|
+ <if test="maps.nickName != null"> AND u.nick_name LIKE concat('%', #{maps.nickName}, '%') </if>
|
|
|
|
|
+ <if test="maps.phone != null and maps.phone != ''"> AND u.phone = #{maps.phone} </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ORDER BY l.log_id DESC
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<!-- 快速COUNT:仅查主表,不JOIN,走索引 -->
|
|
<!-- 快速COUNT:仅查主表,不JOIN,走索引 -->
|
|
|
<select id="selectFsCourseRedPacketLogListVOCount" resultType="long">
|
|
<select id="selectFsCourseRedPacketLogListVOCount" resultType="long">
|
|
|
SELECT COUNT(1) FROM fs_course_red_packet_log
|
|
SELECT COUNT(1) FROM fs_course_red_packet_log
|