|
|
@@ -0,0 +1,110 @@
|
|
|
+<?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="vip.xiaonuo.disk.mapper.CourseStudentCollectMapper">
|
|
|
+
|
|
|
+ <select id="queryList" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ csc.ID as id,
|
|
|
+ ci.COURSE_ID as courseId,
|
|
|
+ IFNULL(ci.COURSE_NAME,'') as courseName,
|
|
|
+ IFNULL(ci.COURSE_TYPE,'') as courseType,
|
|
|
+ IFNULL(( SELECT dd1.DICT_LABEL FROM (SELECT d1.DICT_LABEL,d1.DICT_VALUE FROM DEV_DICT d1 WHERE PARENT_ID = (SELECT d2.ID FROM DEV_DICT d2 WHERE d2.DICT_VALUE='COURSE_TYPE') )dd1 WHERE dd1.DICT_VALUE = TRIM(ci.COURSE_TYPE) ),'') AS courseTypeName,
|
|
|
+ IFNULL(ci.COURSE_DESC,'') as courseDesc,
|
|
|
+ IFNULL(ci.TEACHER_ID,'') as teacherId,
|
|
|
+ IFNULL(su.NAME,'') AS teacherIdName,
|
|
|
+ IFNULL(ci.COLLEGE_ID,'') AS collegeId,
|
|
|
+ IFNULL(co.NAME,'') AS collegeIdName,
|
|
|
+ IFNULL (ci.COLLEGE_TWO_ID,'') AS collegeTwoId,
|
|
|
+ IFNULL (co2.NAME,'') AS collegeTwoIdName,
|
|
|
+ IFNULL (ci.COLLEGE_THREE_ID,'') AS collegeThreeId,
|
|
|
+ IFNULL (co3.NAME,'') AS collegeThreeIdName,
|
|
|
+ CONCAT(ci.COLLEGE_ID,',',ci.COLLEGE_TWO_ID,',',ci.COLLEGE_THREE_ID) AS collegeAllId,
|
|
|
+ CONCAT(co.NAME,',',co2.NAME,',',co3.NAME) AS collegeAllIdName,
|
|
|
+ IFNULL(ci.MAJOR_ID,'') AS majorId,
|
|
|
+ IFNULL(ma.major_name,'') AS majorIdName,
|
|
|
+ IFNULL(ci.PUTAWAY_STATUS,'') as putawayStatus,
|
|
|
+ IFNULL(( SELECT dd1.DICT_LABEL FROM (SELECT d1.DICT_LABEL,d1.DICT_VALUE FROM DEV_DICT d1 WHERE PARENT_ID = (SELECT d2.ID FROM DEV_DICT d2 WHERE d2.DICT_VALUE='COURSE_PUTAWAY_STATUS') )dd1 WHERE dd1.DICT_VALUE = TRIM(ci.PUTAWAY_STATUS) ),'') AS putawayStatusName,
|
|
|
+ IFNULL(ci.PUBLISH_TIME,'') as publishTime,
|
|
|
+ IFNULL(ci.TIME_LIMIT_TYPE,'') as timeLimitType,
|
|
|
+ IFNULL(ci.START_TIME,'') as startTime,
|
|
|
+ IFNULL(ci.END_TIME,'') as endTime
|
|
|
+ FROM COURSE_STUDENT_COLLECT csc
|
|
|
+ LEFT JOIN COURSE_INFO ci ON ci.COURSE_ID = csc.COURSE_ID AND ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN SYS_ORG co ON ci.COLLEGE_ID=co.ID AND co.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN SYS_ORG co2 ON ci.COLLEGE_TWO_ID=co2.id AND co2.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN SYS_ORG co3 ON ci.COLLEGE_THREE_ID=co3.id AND co3.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN major ma ON ci.MAJOR_ID=ma.id AND ma.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN SYS_USER su ON su.ID=ci.TEACHER_ID AND su.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ WHERE csc.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ AND ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ <if test="param.userId !=null and param.userId != ''">
|
|
|
+ AND csc.USER_ID =#{param.userId}
|
|
|
+ </if>
|
|
|
+ <if test="param.collegeId !=null and param.collegeId != ''">
|
|
|
+ and ci.COLLEGE_ID=#{param.courseId}
|
|
|
+ </if>
|
|
|
+ <if test="param.collegeTwoId!=null and param.collegeTwoId != ''">
|
|
|
+ and ci.COLLEGE_TWO_ID=#{param.collegeTwoId}
|
|
|
+ </if>
|
|
|
+ <if test="param.collegeThreeId!=null and param.collegeThreeId != ''">
|
|
|
+ and ci.COLLEGE_THREE_ID=#{param.collegeThreeId}
|
|
|
+ </if>
|
|
|
+ <if test="param.majorId !=null and param.majorId != ''">
|
|
|
+ and ci.MAJOR_ID=#{param.majorId}
|
|
|
+ </if>
|
|
|
+ <if test="param.courseType !=null and param.courseType != ''">
|
|
|
+ and ci.COURSE_TYPE=#{param.courseType}
|
|
|
+ </if>
|
|
|
+ <if test="param.courseName !=null and param.courseName != ''">
|
|
|
+ and ci.COURSE_NAME like CONCAT('%', #{param.courseName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="param.sortflag !=null and param.sortflag != ''">
|
|
|
+ <if test=" param.sortflag == 0">
|
|
|
+ order by ci.CREATE_TIME desc
|
|
|
+ </if>
|
|
|
+ <if test=" param.sortflag == 1">
|
|
|
+ order by ci.VIEW_COUNT desc
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryInfo" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ csc.ID as id,
|
|
|
+ ci.COURSE_ID as courseId,
|
|
|
+ IFNULL(ci.COURSE_NAME,'') as courseName,
|
|
|
+ IFNULL(ci.COURSE_TYPE,'') as courseType,
|
|
|
+ IFNULL(( SELECT dd1.DICT_LABEL FROM (SELECT d1.DICT_LABEL,d1.DICT_VALUE FROM DEV_DICT d1 WHERE PARENT_ID = (SELECT d2.ID FROM DEV_DICT d2 WHERE d2.DICT_VALUE='COURSE_TYPE') )dd1 WHERE dd1.DICT_VALUE = TRIM(ci.COURSE_TYPE) ),'') AS courseTypeName,
|
|
|
+ IFNULL(ci.COURSE_DESC,'') as courseDesc,
|
|
|
+ IFNULL(ci.TEACHER_ID,'') as teacherId,
|
|
|
+ IFNULL(su.NAME,'') AS teacherIdName,
|
|
|
+ IFNULL(ci.COLLEGE_ID,'') AS collegeId,
|
|
|
+ IFNULL(co.NAME,'') AS collegeIdName,
|
|
|
+ IFNULL (ci.COLLEGE_TWO_ID,'') AS collegeTwoId,
|
|
|
+ IFNULL (co2.NAME,'') AS collegeTwoIdName,
|
|
|
+ IFNULL (ci.COLLEGE_THREE_ID,'') AS collegeThreeId,
|
|
|
+ IFNULL (co3.NAME,'') AS collegeThreeIdName,
|
|
|
+ CONCAT(ci.COLLEGE_ID,',',ci.COLLEGE_TWO_ID,',',ci.COLLEGE_THREE_ID) AS collegeAllId,
|
|
|
+ CONCAT(co.NAME,',',co2.NAME,',',co3.NAME) AS collegeAllIdName,
|
|
|
+ IFNULL(ci.MAJOR_ID,'') AS majorId,
|
|
|
+ IFNULL(ma.major_name,'') AS majorIdName,
|
|
|
+ IFNULL(ci.PUTAWAY_STATUS,'') as putawayStatus,
|
|
|
+ IFNULL(( SELECT dd1.DICT_LABEL FROM (SELECT d1.DICT_LABEL,d1.DICT_VALUE FROM DEV_DICT d1 WHERE PARENT_ID = (SELECT d2.ID FROM DEV_DICT d2 WHERE d2.DICT_VALUE='COURSE_PUTAWAY_STATUS') )dd1 WHERE dd1.DICT_VALUE = TRIM(ci.PUTAWAY_STATUS) ),'') AS putawayStatusName,
|
|
|
+ IFNULL(ci.PUBLISH_TIME,'') as publishTime,
|
|
|
+ IFNULL(ci.TIME_LIMIT_TYPE,'') as timeLimitType,
|
|
|
+ IFNULL(ci.START_TIME,'') as startTime,
|
|
|
+ IFNULL(ci.END_TIME,'') as endTime
|
|
|
+ FROM COURSE_STUDENT_COLLECT csc
|
|
|
+ LEFT JOIN COURSE_INFO ci ON ci.COURSE_ID = csc.COURSE_ID AND ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN SYS_ORG co ON ci.COLLEGE_ID=co.ID AND co.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN SYS_ORG co2 ON ci.COLLEGE_TWO_ID=co2.id AND co2.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN SYS_ORG co3 ON ci.COLLEGE_THREE_ID=co3.id AND co3.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN major ma ON ci.MAJOR_ID=ma.id AND ma.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ LEFT JOIN SYS_USER su ON su.ID=ci.TEACHER_ID AND su.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ WHERE csc.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ AND ci.DELETE_FLAG ='NOT_DELETE'
|
|
|
+ <if test="id !=null and id != ''">
|
|
|
+ AND csc.ID =#{id}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+</mapper>
|