Commit 1a261c95 by 魏文甫

init

1 parent b3b97660
......@@ -10,6 +10,7 @@ public interface CourseMapper {
List<Map<String,Object>> recordCourse(Map<String, Object> param);
List<Map<String,Object>> livingCourse(Map<String, Object> param);
List<Map<String,Object>> hotCourse(Map<String, Object> param);
List<Map<String,Object>> livingCourseToday(Map<String, Object> param);
}
......@@ -2,6 +2,7 @@ package com.server.web.common.service.Impl;
import com.server.web.common.mapper.TBaseBannerMapper;
import com.server.web.common.mapper.TBaseFirstClassMapper;
import com.server.web.common.mapping.CourseMapper;
import com.server.web.common.mapping.InformationMapper;
import com.server.web.common.model.TBaseBanner;
import com.server.web.common.model.TBaseBannerExample;
......@@ -11,10 +12,8 @@ import com.server.web.common.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.server.utils.ResultMapUtil.returnMap;
......@@ -30,6 +29,8 @@ public class IndexServiceImpl implements IndexService {
private TBaseFirstClassMapper tBaseFirstClassMapper;
@Autowired
private InformationMapper informationMapper;
@Autowired
private CourseMapper courseMapper;
@Override
public Map<String, Object> banner() {
......@@ -78,4 +79,13 @@ public class IndexServiceImpl implements IndexService {
}
return returnMap("1", "", resultList);
}
@Override
public Map<String, Object> livingCourseToday() {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Map<String, Object> param = new HashMap<>();
param.put("today",simpleDateFormat.format(new Date()));
List<Map<String, Object>> list = courseMapper.livingCourseToday(param);
return returnMap("1", "", list);
}
}
......@@ -121,7 +121,7 @@ public class TKzyCourseServiceImpl implements TKzyCourseService {
Map<String, Object> param = new HashMap<>();
param.put("start", (pageNo - 1) * pageSize);
param.put("pageSize", pageSize);
param.put("typeId", typeId);
// param.put("typeId", typeId);
List<Map<String, Object>> list = courseMapper.recordCourse(param);
resultMap.put("data", list);
return resultMap;
......
......@@ -11,4 +11,6 @@ public interface IndexService {
Map<String,Object> categoryList();
Map<String,Object> categoryDetail();
Map<String,Object> livingCourseToday();
}
......@@ -48,5 +48,15 @@ public class IndexController {
return indexService.categoryDetail();
}
/**
* 首页直播课
*
* @return
*/
@RequestMapping("/livingCourseToday")
public Map<String, Object> livingCourseToday() {
return indexService.livingCourseToday();
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.server.web.common.mapping.CourseMapper" >
<mapper namespace="com.server.web.common.mapping.CourseMapper">
<select id="livingCourse" parameterType="java.util.HashMap" resultType="java.util.HashMap">
SELECT
t.`pic_url` as picUrl,
......@@ -17,4 +17,39 @@
ORDER BY t.`start_dt`
</select>
<select id="livingCourseToday" parameterType="java.util.HashMap" resultType="java.util.HashMap">
SELECT
t.`pic_url` as picUrl,
t.`course_name` as courseName,
t.`start_dt` AS startDt,
t.`end_dt` AS endDt,
t.id
FROM
t_kzy_course t
WHERE t.`is_delete` = 0
AND t.`is_up` = 1
AND t.`course_type`=1
AND (t.end_dt is null or date_format(t.end_dt,'%Y-%m-%d') = #{today,jdbcType=VARCHAR})
ORDER BY t.`start_dt`
</select>
<select id="recordCourse" parameterType="java.util.HashMap" resultType="java.util.HashMap">
SELECT
t.`pic_url` as picUrl,
t.`course_name` as courseName,
t.`start_dt` AS startDt,
t.`end_dt` AS endDt,
t.id
FROM
t_kzy_course t
WHERE t.`is_delete` = 0
AND t.`is_up` = 1
AND t.`course_type`=2
AND (t.end_dt is null or date_format(t.end_dt,'%Y-%m-%d') = #{today,jdbcType=VARCHAR})
ORDER BY t.`start_dt`
</select>
</mapper>
\ No newline at end of file
......@@ -53,6 +53,6 @@ upyun.bucket=yxvzb
upyun.username=liuruichao
upyun.password=liuruichao123
upyun.baseDir=/images/
wx.tocken=12324432342
wx.tocken=64be1d2d249a460bb5c39d565f013d90
wx.http.danmu.url=http://192.168.0.105:8383
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!