|
@@ -47,6 +47,7 @@
|
|
|
<result property="qwRepeat" column="qw_repeat"/>
|
|
|
<result property="userRepeat" column="user_repeat"/>
|
|
|
<result property="payOrder" column="pay_order"/>
|
|
|
+ <result property="isBecomeMember" column="is_become_member"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFsUserVo">
|
|
@@ -92,7 +93,8 @@
|
|
|
user_code,
|
|
|
qw_repeat,
|
|
|
user_repeat,
|
|
|
- pay_order
|
|
|
+ pay_order,
|
|
|
+ is_become_member
|
|
|
from fs_user
|
|
|
</sql>
|
|
|
|
|
@@ -272,36 +274,38 @@
|
|
|
LEFT JOIN company_user ON company_user.user_id = u.company_user_id
|
|
|
LEFT JOIN company on company.company_id = company_user.company_id
|
|
|
<where>
|
|
|
- 1 = 1
|
|
|
- <if test = "maps.nickname != null and maps.nickname !='' " >
|
|
|
- AND u.nickname LIKE CONCAT("%",#{maps.nickname},"%")
|
|
|
- </if >
|
|
|
- <if test = "maps.phone != null and maps.phone !='' " >
|
|
|
- AND u.phone LIKE CONCAT("%",#{maps.phone},"%")
|
|
|
- </if >
|
|
|
- <if test = "maps.startCreateTime != null and maps.endCreateTime != null" >
|
|
|
- AND (DATE_FORMAT( u.create_time, "%Y-%m-%d" ) >= DATE_FORMAT(#{maps.startCreateTime}, "%Y-%m-%d")
|
|
|
+ <if test = "maps.userId != null" >
|
|
|
+ AND u.user_id = #{maps.userId}
|
|
|
+ </if >
|
|
|
+ <if test = "maps.nickname != null and maps.nickname !='' " >
|
|
|
+ AND u.nickname LIKE CONCAT("%",#{maps.nickname},"%")
|
|
|
+ </if >
|
|
|
+ <if test = "maps.phone != null and maps.phone !='' " >
|
|
|
+ AND u.phone LIKE CONCAT("%",#{maps.phone},"%")
|
|
|
+ </if >
|
|
|
+ <if test = "maps.startCreateTime != null and maps.endCreateTime != null" >
|
|
|
+ AND (DATE_FORMAT( u.create_time, "%Y-%m-%d" ) >= DATE_FORMAT(#{maps.startCreateTime}, "%Y-%m-%d")
|
|
|
and DATE_FORMAT( u.create_time, "%Y-%m-%d" ) <= DATE_FORMAT(#{maps.endCreateTime}, "%Y-%m-%d")
|
|
|
- )
|
|
|
- </if >
|
|
|
- <if test = "maps.registerCode != null and maps.registerCode !='' " >
|
|
|
- AND u.register_code = #{maps.registerCode}
|
|
|
- </if >
|
|
|
- <if test = "maps.status != null" >
|
|
|
- AND u.STATUS = #{maps.status}
|
|
|
- </if >
|
|
|
- <if test = "maps.companyUserNickName != null and maps.companyUserNickName != '' " >
|
|
|
- AND company_user.nick_name like CONCAT ("%",#{maps.companyUserNickName},"%")
|
|
|
- </if >
|
|
|
- <if test = "maps.companyName != null and maps.companyName != '' " >
|
|
|
- AND company.company_name like CONCAT ("%",#{maps.companyName},"%")
|
|
|
- </if >
|
|
|
- <if test = "maps.level != null and maps.level !=''" >
|
|
|
- AND u.LEVEL = #{maps.level}
|
|
|
- </if >
|
|
|
- <if test = "maps.isPromoter != null and maps.isPromoter !=''" >
|
|
|
- AND u.is_promoter = #{maps.isPromoter}
|
|
|
- </if >
|
|
|
+ )
|
|
|
+ </if >
|
|
|
+ <if test = "maps.registerCode != null and maps.registerCode !='' " >
|
|
|
+ AND u.register_code = #{maps.registerCode}
|
|
|
+ </if >
|
|
|
+ <if test = "maps.status != null" >
|
|
|
+ AND u.STATUS = #{maps.status}
|
|
|
+ </if >
|
|
|
+ <if test = "maps.companyUserNickName != null and maps.companyUserNickName != '' " >
|
|
|
+ AND company_user.nick_name like CONCAT ("%",#{maps.companyUserNickName},"%")
|
|
|
+ </if >
|
|
|
+ <if test = "maps.companyName != null and maps.companyName != '' " >
|
|
|
+ AND company.company_name like CONCAT ("%",#{maps.companyName},"%")
|
|
|
+ </if >
|
|
|
+ <if test = "maps.level != null and maps.level !=''" >
|
|
|
+ AND u.LEVEL = #{maps.level}
|
|
|
+ </if >
|
|
|
+ <if test = "maps.isPromoter != null and maps.isPromoter !=''" >
|
|
|
+ AND u.is_promoter = #{maps.isPromoter}
|
|
|
+ </if >
|
|
|
</where>
|
|
|
ORDER BY
|
|
|
user_id DESC
|
|
@@ -426,6 +430,7 @@
|
|
|
<if test="qwRepeat != null">qw_repeat,</if>
|
|
|
<if test="userRepeat != null">user_repeat,</if>
|
|
|
<if test="payOrder != null">pay_order,</if>
|
|
|
+ <if test="isBecomeMember != null">is_become_member,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="username != null">#{username},</if>
|
|
@@ -470,6 +475,7 @@
|
|
|
<if test="qwRepeat != null">#{qwRepeat},</if>
|
|
|
<if test="userRepeat != null">#{userRepeat},</if>
|
|
|
<if test="payOrder != null">#{payOrder},</if>
|
|
|
+ <if test="isBecomeMember != null">#{isBecomeMember},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -518,6 +524,7 @@
|
|
|
<if test="qwRepeat != null">qw_repeat = #{qwRepeat},</if>
|
|
|
<if test="userRepeat != null">user_repeat = #{userRepeat},</if>
|
|
|
<if test="payOrder != null">pay_order = #{payOrder},</if>
|
|
|
+ <if test="isBecomeMember != null">is_become_member = #{isBecomeMember},</if>
|
|
|
</trim>
|
|
|
where user_id = #{userId}
|
|
|
</update>
|
|
@@ -561,6 +568,10 @@
|
|
|
left join fs_user_company_user ucu on ucu.user_id = fs_user.user_id
|
|
|
<where>
|
|
|
fs_user.is_del = 0
|
|
|
+ where fs_user.is_del = 0
|
|
|
+ <if test="userId != null">
|
|
|
+ AND fs_user.user_id = #{userId}
|
|
|
+ </if>
|
|
|
<if test="companyId != null">
|
|
|
AND ucu.company_id = #{companyId}
|
|
|
</if>
|
|
@@ -588,7 +599,6 @@
|
|
|
<if test="projectId != null">
|
|
|
AND ucu.project_id = #{projectId}
|
|
|
</if>
|
|
|
- </where>
|
|
|
limit ${(pageNum-1)*pageSize},${pageSize}
|
|
|
</select>
|
|
|
|
|
@@ -648,10 +658,21 @@
|
|
|
<if test="registerEndTime != null and registerEndTime !='' ">
|
|
|
AND fs_user_company_user.create_time <= #{registerEndTime}
|
|
|
</if>
|
|
|
- <if test="tagIds != null and tagIds.length > 0">
|
|
|
+ <if test="isNullTag">
|
|
|
+ and (upt.tag_id is null
|
|
|
+ <if test="tagIds != null and tagIds.length > 0">
|
|
|
+ or upt.tag_id in
|
|
|
+ <foreach collection="tagIds" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="!isNullTag and tagIds != null and tagIds.length > 0">
|
|
|
AND upt.tag_id in
|
|
|
<foreach collection="tagIds" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
+ #{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="tabValue != null and tabValue !='' ">
|
|
@@ -1825,5 +1846,57 @@
|
|
|
</where>
|
|
|
order by user_id desc
|
|
|
</select>
|
|
|
+ <select id="countUserCourse2" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM
|
|
|
+ fs_course_watch_log l
|
|
|
+ LEFT JOIN company_user ON l.company_user_id = company_user.user_id
|
|
|
+ where
|
|
|
+ l.log_type != 3 and send_type = 1
|
|
|
+ <if test="userId != null and userId != 0 ">
|
|
|
+ and (l.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and userId == 0 ">
|
|
|
+ and l.company_id = #{companyId}
|
|
|
+ </if>
|
|
|
+ <if test="periodId != null and periodId != ''">
|
|
|
+ AND l.period_id = #{periodId}
|
|
|
+ </if>
|
|
|
+ <if test="videoId != null and videoId != ''">
|
|
|
+ AND l.video_id = #{videoId}
|
|
|
+ </if>
|
|
|
+ <if test="companyUserId != null and companyUserId != ''">
|
|
|
+ AND l.user_id = #{companyUserId}
|
|
|
+ </if>
|
|
|
+ ) as courseWatchNum,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM
|
|
|
+ fs_course_watch_log l
|
|
|
+ LEFT JOIN company_user ON l.company_user_id = company_user.user_id
|
|
|
+ where
|
|
|
+ l.log_type = 2 and send_type = 1
|
|
|
+ <if test="userId != null and userId != 0 ">
|
|
|
+ and (l.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and userId == 0 ">
|
|
|
+ and l.company_id = #{companyId}
|
|
|
+ </if>
|
|
|
+ <if test="periodId != null and periodId != ''">
|
|
|
+ AND l.period_id = #{periodId}
|
|
|
+ </if>
|
|
|
+ <if test="videoId != null and videoId != ''">
|
|
|
+ AND l.video_id = #{videoId}
|
|
|
+ </if>
|
|
|
+ -- 单独通过销售id查询
|
|
|
+ <if test="companyUserId != null and companyUserId != ''">
|
|
|
+ AND l.user_id = #{companyUserId}
|
|
|
+ </if>
|
|
|
+ ) as courseCompleteNum
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|