|
|
@@ -2,11 +2,7 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="cn.iocoder.byzs.module.bjdx.dal.mysql.course.CourseMapper">
|
|
|
|
|
|
- <select id="selectCoursePage" parameterType="cn.iocoder.byzs.module.bjdx.controller.admin.course.vo.CoursePageReqVO"
|
|
|
- resultType="cn.iocoder.byzs.module.bjdx.controller.admin.course.vo.CoursePageReqVO">
|
|
|
-
|
|
|
- SELECT c.tenant_id as tenantId,c.id, c.course_name courseName, c.course_image_path courseImagePath, c.course_music_path courseMusicPath, c.course_video_path courseVideoPath, c.course_content_type courseContentType, c.course_author courseAuthor, c.course_teacher courseTeacher, c.course_size courseSize,
|
|
|
- c.course_time courseTime, c.course_is_inspect courseIsInspect, c.course_label courseLabel, c.course_order courseOrder, c.course_status courseStatus, ct.ct_type courseTypeName
|
|
|
+ <sql id="selectCourseList">
|
|
|
FROM bjdx_course c
|
|
|
LEFT JOIN bjdx_course_type ct ON c.course_type = ct.id
|
|
|
<where>
|
|
|
@@ -28,33 +24,25 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
ORDER BY ct.ct_type_sort, c.course_order
|
|
|
- limit #{pageNo}, #{pageSize}
|
|
|
+ </sql>
|
|
|
+ <select id="selectCoursePageCount" parameterType="cn.iocoder.byzs.module.bjdx.controller.admin.course.vo.CoursePageReqVO"
|
|
|
+ resultType="int">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ <include refid="selectCourseList"/>
|
|
|
+ </select>
|
|
|
+ <select id="selectCoursePage" parameterType="cn.iocoder.byzs.module.bjdx.controller.admin.course.vo.CoursePageReqVO"
|
|
|
+ resultType="cn.iocoder.byzs.module.bjdx.controller.admin.course.vo.CoursePageReqVO">
|
|
|
+ SELECT c.tenant_id as tenantId,c.id, c.course_name courseName, c.course_image_path courseImagePath, c.course_music_path courseMusicPath, c.course_video_path courseVideoPath, c.course_content_type courseContentType, c.course_author courseAuthor, c.course_teacher courseTeacher, c.course_size courseSize,
|
|
|
+ c.course_time courseTime, c.course_is_inspect courseIsInspect, c.course_label courseLabel, c.course_order courseOrder, c.course_status courseStatus, ct.ct_type courseTypeName
|
|
|
+ <include refid="selectCourseList"/>
|
|
|
+ <if test="pageSize != null and pageSize != -1">
|
|
|
+ limit #{pageNo}, #{pageSize}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="selectCourseList" parameterType="cn.iocoder.byzs.module.bjdx.controller.admin.course.vo.CoursePageReqVO"
|
|
|
resultType="cn.iocoder.byzs.module.bjdx.controller.admin.course.vo.CoursePageReqVO">
|
|
|
-
|
|
|
SELECT c.tenant_id as tenantId,c.id, c.course_name courseName, c.course_image_path courseImagePath, c.course_music_path courseMusicPath, c.course_video_path courseVideoPath, c.course_content_type courseContentType, c.course_author courseAuthor, c.course_teacher courseTeacher, c.course_size courseSize,
|
|
|
c.course_time courseTime, c.course_is_inspect courseIsInspect, c.course_label courseLabel, c.course_order courseOrder, c.course_status courseStatus, ct.ct_type courseTypeName
|
|
|
- FROM bjdx_course c
|
|
|
- LEFT JOIN bjdx_course_type ct ON c.course_type = ct.id
|
|
|
- <where>
|
|
|
- c.deleted = 0
|
|
|
- <if test="courseName != null and courseName != ''">
|
|
|
- AND c.course_name LIKE CONCAT('%', #{courseName}, '%')
|
|
|
- </if>
|
|
|
- <if test="courseTeacher!= null and courseTeacher!= ''">
|
|
|
- AND c.course_teacher LIKE CONCAT('%', #{courseTeacher}, '%')
|
|
|
- </if>
|
|
|
- <if test="courseStatus!= null and courseStatus!= ''">
|
|
|
- AND c.course_status = #{courseStatus}
|
|
|
- </if>
|
|
|
- <if test="courseType!= null and courseType!= ''">
|
|
|
- AND c.course_type = #{courseType}
|
|
|
- </if>
|
|
|
- <if test="courseContentType!= null and courseContentType!= ''">
|
|
|
- AND c.course_content_type = #{courseContentType}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY ct.ct_type_sort, c.course_order
|
|
|
+ <include refid="selectCourseList"/>
|
|
|
</select>
|
|
|
</mapper>
|