|
@@ -369,7 +369,7 @@
|
|
|
group by smcr.user_id_, DATE_FORMAT(create_time_, '%Y-%m-%d')) mprs ON mprs.user_id_ = st.user_id_
|
|
|
left join sys_user su ON st.user_id_ = su.id_
|
|
|
left join subject sb ON sb.id_ = st.subject_id_
|
|
|
- where st.membership_end_time_ >= NOW() AND mprs.user_id_ = st.user_id_
|
|
|
+ where mprs.user_id_ = st.user_id_
|
|
|
<if test="search != null and search != ''">
|
|
|
AND su.username_ LIKE CONCAT('%',#{keyword},'%')
|
|
|
</if>
|
|
@@ -384,32 +384,34 @@
|
|
|
from student st
|
|
|
left join sys_user su ON st.user_id_ = su.id_
|
|
|
LEFT JOIN sys_music_compare_record smcr ON smcr.user_id_ = st.user_id_
|
|
|
- where st.membership_end_time_ >= NOW()
|
|
|
- <if test="tenantId != null">
|
|
|
- AND smcr.tenant_id_ = #{tenantId}
|
|
|
- </if>
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- AND smcr.create_time_ BETWEEN #{startTime} AND #{endTime}
|
|
|
- </if>
|
|
|
- <if test="search != null and search != ''">
|
|
|
- AND su.username_ LIKE CONCAT('%',#{keyword},'%')
|
|
|
- </if>
|
|
|
+ <where>
|
|
|
+ <if test="tenantId != null">
|
|
|
+ AND smcr.tenant_id_ = #{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND smcr.create_time_ BETWEEN #{startTime} AND #{endTime}
|
|
|
+ </if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND su.username_ LIKE CONCAT('%',#{keyword},'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
<select id="wechatCompareRecordSum"
|
|
|
resultType="com.yonge.cooleshow.biz.dal.queryInfo.SysMusicCompareRecordQueryInfo$WechatCompareRecordSumDto">
|
|
|
select COUNT(st.user_id_) studentNum,COUNT(DISTINCT DATE_FORMAT(smcr.create_time_,'%Y-%m-%d')) trainDays,SUM(smcr.play_time_) trainTimes
|
|
|
from student st
|
|
|
LEFT JOIN sys_music_compare_record smcr ON smcr.user_id_ = st.user_id_
|
|
|
- where st.membership_end_time_ >= NOW()
|
|
|
- <if test="queryInfo.startTime != null and queryInfo.startTime != ''">
|
|
|
- AND smcr.create_time_ BETWEEN #{queryInfo.startTime} AND #{queryInfo.endTime}
|
|
|
- </if>
|
|
|
- <if test="queryInfo.tenantId != null">
|
|
|
- AND smcr.tenant_id_ = #{queryInfo.tenantId}
|
|
|
- </if>
|
|
|
- <if test="queryInfo.tenantId != null">
|
|
|
- AND st.tenant_id_ = #{queryInfo.tenantId}
|
|
|
- </if>
|
|
|
+ <where>
|
|
|
+ <if test="queryInfo.startTime != null and queryInfo.startTime != ''">
|
|
|
+ AND smcr.create_time_ BETWEEN #{queryInfo.startTime} AND #{queryInfo.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="queryInfo.tenantId != null">
|
|
|
+ AND smcr.tenant_id_ = #{queryInfo.tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="queryInfo.tenantId != null">
|
|
|
+ AND st.tenant_id_ = #{queryInfo.tenantId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
<select id="queryStudentTrain"
|
|
|
resultType="com.yonge.cooleshow.biz.dal.queryInfo.SysMusicCompareRecordQueryInfo$StudentMusicCompareRecord">
|