123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <?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.zhongzheng.modules.course.mapper.CourseSectionMapper">
- <resultMap type="com.zhongzheng.modules.course.domain.CourseSection" id="CourseSectionResult">
- <result property="sectionId" column="section_id"/>
- <result property="name" column="name"/>
- <result property="sort" column="sort"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="prefixName" column="prefix_name"/>
- <result property="status" column="status"/>
- <result property="sectionType" column="section_type"/>
- <result property="publishStatus" column="publish_status"/>
- <result property="liveUrl" column="live_url"/>
- <result property="liveStartTime" column="live_start_time"/>
- <result property="liveEndTime" column="live_end_time"/>
- <result property="recordingUrl" column="recording_url"/>
- <result property="durationTime" column="duration_time"/>
- <result property="coverUrl" column="cover_url"/>
- <result property="code" column="code"/>
- <result property="importBy" column="import_by"/>
- <result property="importNo" column="import_no"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.course.vo.CourseSectionVo" id="CourseSectionResultVo">
- <result property="sectionId" column="section_id"/>
- <result property="name" column="name"/>
- <result property="sort" column="sort"/>
- <result property="prefixName" column="prefix_name"/>
- <result property="status" column="status"/>
- <result property="sectionType" column="section_type"/>
- <result property="publishStatus" column="publish_status"/>
- <result property="liveUrl" column="live_url"/>
- <result property="liveStartTime" column="live_start_time"/>
- <result property="liveEndTime" column="live_end_time"/>
- <result property="recordingUrl" column="recording_url"/>
- <result property="durationTime" column="duration_time"/>
- <result property="coverUrl" column="cover_url"/>
- <result property="code" column="code"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <collection property="businessList" column="section_id" select="findBusinessList"/>
- <collection property="chapterList" column="section_id" select="findChapterList"/>
- <!-- <collection property="moduleList" javaType="java.util.List" resultMap="CourseModuleChapterListResult"/>
- <collection property="courseList" javaType="java.util.List" resultMap="CourseSectionListResult"/> -->
- </resultMap>
- <select id="findChapterList" resultMap="CourseChapterSectionListResult">
- SELECT
- ccs.chapter_id,
- cc.NAME AS chapter_name
- FROM
- course_chapter_section ccs
- LEFT JOIN course_chapter cc ON ccs.chapter_id = cc.chapter_id
- WHERE
- ccs.section_id =#{section_id}
- and cc.status =1
- </select>
- <select id="findBusinessList" resultMap="CourseSectionBusiness">
- SELECT
- csb.education_type_id,
- csb.id,
- csb.business_id,
- csb.subject_id,
- csb.project_id,
- cet.education_name,
- cpt.project_name,
- cb.business_name,
- cs.subject_name
- FROM
- course_section_business csb
- LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id AND cet.status =1
- LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id AND cpt.status =1
- LEFT JOIN course_business cb ON csb.business_id = cb.id AND cb.status =1
- LEFT JOIN course_subject cs ON csb.subject_id = cs.id AND cs.status =1
- WHERE
- csb.section_id=#{section_id}
- </select>
- <resultMap type="com.zhongzheng.modules.course.domain.CourseSectionBusiness" id="CourseSectionBusiness">
- <result property="id" column="id"/>
- <result property="subjectId" column="subject_id"/>
- <result property="educationTypeId" column="education_type_id"/>
- <result property="businessId" column="business_id"/>
- <result property="projectId" column="project_id"/>
- <result property="educationName" column="education_name"/>
- <result property="projectName" column="project_name"/>
- <result property="businessName" column="business_name"/>
- <result property="subjectName" column="subject_name"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.course.vo.CourseChapterSectionListVo" id="CourseChapterSectionListResult">
- <result property="chapterName" column="chapter_name"/>
- <result property="chapterId" column="chapter_id"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.course.vo.CourseModuleChapterListVo" id="CourseModuleChapterListResult">
- <result property="moduleId" column="module_id"/>
- <result property="moduleName" column="module_name"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.course.vo.CourseSectionListVo" id="CourseSectionListResult">
- <result property="courseId" column="course_id"/>
- <result property="courseName" column="course_name"/>
- </resultMap>
- <select id="selectSectionList" parameterType="com.zhongzheng.modules.course.bo.CourseSectionQueryBo" resultMap="CourseSectionResultVo">
- SELECT
- c.*
- FROM
- course_section c
- LEFT JOIN course_section_business csb ON csb.section_id = c.section_id
- WHERE
- 1 = 1 AND c.status !=-1
- <if test="name != null and name != ''">
- AND c.name like concat('%', #{name}, '%')
- </if>
- <if test="publishStatus != null ">
- AND c.publish_status = #{publishStatus}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND csb.education_type_id = #{educationTypeId}
- </if>
- <if test="subjectId != null and subjectId != ''">
- AND csb.subject_id = #{subjectId}
- </if>
- <if test="businessId != null and businessId != ''">
- AND csb.business_id = #{businessId}
- </if>
- <if test="sectionType != null and sectionType != ''">
- AND c.section_type = #{sectionType}
- </if>
- <if test="prefixName != null and prefixName != ''">
- AND c.prefix_name like concat('%', #{prefixName}, '%')
- </if>
- <if test="key != null and key != ''">
- AND (c.name like concat('%', #{key}, '%') or c.prefix_name like concat('%', #{key}, '%') or c.code = #{key})
- </if>
- <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>
- GROUP BY
- c.section_id
- ORDER BY c.section_id DESC
- </select>
- <select id="selectSectionList_COUNT" resultType="Long">
- SELECT
- count(distinct c.section_id )
- FROM
- course_section c
- LEFT JOIN course_section_business csb ON c.section_id = csb.section_id
- WHERE
- 1 = 1
- <if test="name != null and name != ''">
- AND c.name like concat('%', #{name}, '%')
- </if>
- <if test="publishStatus != null ">
- AND c.publish_status = #{publishStatus}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND csb.education_type_id = #{educationTypeId}
- </if>
- <if test="subjectId != null and subjectId != ''">
- AND csb.subject_id = #{subjectId}
- </if>
- <if test="businessId != null and businessId != ''">
- AND csb.business_id = #{businessId}
- </if>
- <if test="sectionType != null and sectionType != ''">
- AND c.section_type = #{sectionType}
- </if>
- <if test="prefixName != null and prefixName != ''">
- AND c.prefix_name like concat('%', #{prefixName}, '%')
- </if>
- <if test="key != null and key != ''">
- AND (c.name like concat('%', #{key}, '%') or c.prefix_name like concat('%', #{key}, '%') or c.code = #{key})
- </if>
- <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>
- </select>
- </mapper>
|