Commit f4aaad83 by “Kongxiangkun”

修改小e主题活动提醒bug

parent 52c8f832
......@@ -15,7 +15,7 @@ import java.util.Date;
@ApiModel(value = "我的--培训项目列表查询参数vo")
public class TrainingProjectMyParamVo {
@ApiModelProperty(value = "列表类型,1:未开始,2:进行中,3:已完成,4.已过期", notes = "必传")
@ApiModelProperty(value = "列表类型,1:未开始,2:进行中,3:已完成,4.已过期 5. 小e主题活动提醒数量", notes = "必传")
private Integer type;
@ApiModelProperty(value = "当前时间,必传")
......
......@@ -120,6 +120,10 @@ public interface TrainingProjectMapper extends BaseMapper<TrainingProject> {
@Param("visiableTpIds") List<Long> visiableTpIds,
@Param("finishedTpIds") List<Long> finishedTpIds);
Integer selectMyJoinedPageNumByEnrollDate(@Param("now") Date now, @Param("siteId") Long siteId, @Param("keyword") String keyword,
@Param("visiableTpIds") List<Long> visiableTpIds,
@Param("finishedTpIds") List<Long> finishedTpIds);
/**
* 我的培训项目列表 已结束
*
......
......@@ -285,7 +285,7 @@
</select>
<select id="apiPageListCount" resultType="com.yizhi.training.application.vo.domain.TrainingProjectVo">
select en.start_time as startTime,en.end_time as endTime
select tb.start_time as startTime,tb.end_time as endTime
from training_project tb
left join tr_enroll en on tb.id = en.training_project_id
where
......@@ -411,6 +411,32 @@
</select>
<select id="selectMyJoinedPageNumByEnrollDate" resultType="java.lang.Integer">
select COUNT (tb.id)
from training_project tb
left join tr_enroll en on tb.id = en.training_project_id
where
-- 首先用站点 id 和上架状态缩小范围
(tb.site_id = #{siteId} and tb.status = 1 and tb.deleted = 0 and
<![CDATA[ DATE_FORMAT(en.start_time, '%Y-%m-%d') <= DATE_FORMAT(#{now}, '%Y-%m-%d')
and DATE_FORMAT(en.end_time, '%Y-%m-%d') >= DATE_FORMAT(#{now}, '%Y-%m-%d') ]]>)
and
(tb.visible_range = 1
<if test="visiableTpIds != null and visiableTpIds.size > 0">
or
(tb.visible_range = 0
and tb.id in <foreach collection="visiableTpIds" open="(" close=")" separator="," item="item">#{item}</foreach>)
</if>
)
<if test="finishedTpIds != null and finishedTpIds.size > 0">
and (tb.id not in <foreach collection="finishedTpIds" open="(" close=")" separator="," item="item">#{item}</foreach>)
</if>
<if test="keyword != null">
and (tb.key_words like concat('%', #{keyword}, '%') or tb.name like concat('%', #{keyword}, '%'))
</if>
</select>
<!-- 我的培训项目列表 已结束 -->
<select id="selectMyFinishedPage" resultMap="BaseResultMap">
select <include refid="Base_Column_List_simple"/>
......
......@@ -728,6 +728,11 @@ public class TrainingProjectServiceImpl extends ServiceImpl<TrainingProjectMappe
// 已过期
else if (vo.getType() == 4) {
trainingProjects = trainingProjectMapper.selectMyExpiredPage(siteId, now, visiableTpIds, finishedIds, new RowBounds(page.getOffset(), page.getLimit()));
}
//特殊查询小e主题活动提醒数量
else if (vo.getType() == 5) {
//trainingProjects = trainingProjectMapper.selectMyJoinedPage(now, siteId, vo.getKeyword(), visiableTpIds, finishedIds, new RowBounds(page.getOffset(), page.getLimit()));
page.setTotal(trainingProjectMapper.selectMyJoinedPageNumByEnrollDate(now, siteId, vo.getKeyword(), visiableTpIds, finishedIds));
} else {
throw new Exception("未知的列表类型 - " + vo.getType() + ",请检查:列表类型,1:未开始,2:已开始,3:已完成");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment