浏览代码

目录列表

he2802 4 年之前
父节点
当前提交
f33a0ad3d4

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -50,7 +50,7 @@ public class CourseController extends BaseController {
     @GetMapping("/list")
     @GetMapping("/list")
     public TableDataInfo<CourseVo> list(CourseQueryBo bo) {
     public TableDataInfo<CourseVo> list(CourseQueryBo bo) {
         startPage();
         startPage();
-        List<CourseVo> list = iCourseService.queryList(bo);
+        List<CourseVo> list = iCourseService.selectList(bo);
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java

@@ -20,6 +20,8 @@ public interface CourseMapper extends BaseMapper<Course> {
 
 
     CourseVo selectDetailById(Long id);
     CourseVo selectDetailById(Long id);
 
 
+    List<CourseVo> selectList(CourseQueryBo bo);
+
 
 
 
 
 
 

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java

@@ -31,6 +31,8 @@ public interface ICourseService extends IService<Course> {
 	 */
 	 */
 	List<CourseVo> queryList(CourseQueryBo bo);
 	List<CourseVo> queryList(CourseQueryBo bo);
 
 
+	List<CourseVo> selectList(CourseQueryBo bo);
+
 	/**
 	/**
 	 * 根据新增业务对象插入课程
 	 * 根据新增业务对象插入课程
 	 * @param bo 课程新增业务对象
 	 * @param bo 课程新增业务对象

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -69,6 +69,11 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return entity2Vo(this.list(lqw));
         return entity2Vo(this.list(lqw));
     }
     }
 
 
+    @Override
+    public List<CourseVo> selectList(CourseQueryBo bo) {
+        return courseMapper.selectList(bo);
+    }
+
     /**
     /**
     * 实体类转化成视图对象
     * 实体类转化成视图对象
     *
     *

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseVo.java

@@ -1,5 +1,7 @@
 package com.zhongzheng.modules.course.vo;
 package com.zhongzheng.modules.course.vo;
 
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.zhongzheng.common.annotation.Excel;
 import com.zhongzheng.common.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
@@ -104,4 +106,8 @@ public class CourseVo {
 	private String categoryName;
 	private String categoryName;
 	@ApiModelProperty("科目名称")
 	@ApiModelProperty("科目名称")
 	private String subjectName;
 	private String subjectName;
+	@ApiModelProperty("添加时间")
+	private Long createTime;
+	@ApiModelProperty("修改时间")
+	private Long updateTime;
 }
 }

+ 42 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -46,7 +46,8 @@
         <result property="code" column="code"/>
         <result property="code" column="code"/>
         <result property="subjectId" column="subject_id"/>
         <result property="subjectId" column="subject_id"/>
         <result property="projectId" column="project_id"/>
         <result property="projectId" column="project_id"/>
-
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
         <result property="educationName" column="education_name"/>
         <result property="educationName" column="education_name"/>
         <result property="projectName" column="project_name"/>
         <result property="projectName" column="project_name"/>
         <result property="businessName" column="business_name"/>
         <result property="businessName" column="business_name"/>
@@ -55,6 +56,46 @@
         <result property="subjectName" column="subject_name"/>
         <result property="subjectName" column="subject_name"/>
     </resultMap>
     </resultMap>
 
 
+    <select id="selectList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultMap="CourseResultVo">
+        SELECT
+        c.*,
+        cet.education_name,
+        cpt.project_name,
+        cb.business_name,
+        s.school_name,
+        m.category_name,
+        cs.subject_name
+        FROM
+        course c
+        LEFT JOIN course_education_type cet ON c.education_type_id = cet.id
+        LEFT JOIN course_project_type cpt ON c.project_id = cpt.id
+        LEFT JOIN course_business cb ON c.business_id = cb.id
+        LEFT JOIN school s ON s.id = c.school_id
+        LEFT JOIN major m ON c.major_id = m.id
+        LEFT JOIN course_subject cs ON cs.id = c.subject_id
+        WHERE
+        1 = 1
+        <if test="status != null and status.size()!=0 ">
+            AND c.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND c.education_type_id = #{educationTypeId}
+        </if>
+        <if test="subjectId != null and subjectId != ''">
+            AND c.subject_id = #{subjectId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND c.business_id = #{businessId}
+        </if>
+        <if test="prefixName != null and prefixName != ''">
+            AND c.prefix_name like concat('%', #{prefixName}, '%')
+        </if>
+    </select>
+
     <select id="selectDetailById" parameterType="Long"  resultMap="CourseResultVo">
     <select id="selectDetailById" parameterType="Long"  resultMap="CourseResultVo">
         SELECT
         SELECT
             c.*,
             c.*,