|
@@ -3,7 +3,6 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.xunmei.core.edu.mapper.SysLearningMaterialsMapper">
|
|
<mapper namespace="com.xunmei.core.edu.mapper.SysLearningMaterialsMapper">
|
|
|
-
|
|
|
|
|
<resultMap type="com.xunmei.common.core.domain.edu.domain.SysLearningMaterials" id="SysLearningMaterialsResult">
|
|
<resultMap type="com.xunmei.common.core.domain.edu.domain.SysLearningMaterials" id="SysLearningMaterialsResult">
|
|
|
<result property="id" column="id"/>
|
|
<result property="id" column="id"/>
|
|
|
<result property="title" column="title"/>
|
|
<result property="title" column="title"/>
|
|
@@ -107,7 +106,7 @@
|
|
|
u.id as createId,
|
|
u.id as createId,
|
|
|
m.create_time,
|
|
m.create_time,
|
|
|
m.update_time as updateTime,
|
|
m.update_time as updateTime,
|
|
|
- m.file_names as fileNames
|
|
|
|
|
|
|
+ m.file_names as fileNames
|
|
|
from sys_learning_materials m
|
|
from sys_learning_materials m
|
|
|
inner join sys_knowledge k on m.knowledge_id = k.id
|
|
inner join sys_knowledge k on m.knowledge_id = k.id
|
|
|
inner join sys_user u on u.id=m.create_by
|
|
inner join sys_user u on u.id=m.create_by
|
|
@@ -116,7 +115,8 @@
|
|
|
and m.create_by=#{request.userId}
|
|
and m.create_by=#{request.userId}
|
|
|
<include refid="pageRequest"/>
|
|
<include refid="pageRequest"/>
|
|
|
<if test="request.checkSub==true">
|
|
<if test="request.checkSub==true">
|
|
|
- or ( m.org_path like concat(#{request.orgPath},'%') and m.is_open = 1 <!--and m.org_path !=#{request.orgPath}-->
|
|
|
|
|
|
|
+ or ( m.org_path like concat(#{request.orgPath},'%') and m.is_open =
|
|
|
|
|
+ 1 <!--and m.org_path !=#{request.orgPath}-->
|
|
|
<include refid="pageRequest"/>)
|
|
<include refid="pageRequest"/>)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="request.checkSub==false">
|
|
<if test="request.checkSub==false">
|
|
@@ -149,7 +149,7 @@
|
|
|
u.id as createId,
|
|
u.id as createId,
|
|
|
m.create_time,
|
|
m.create_time,
|
|
|
m.update_time as updateTime,
|
|
m.update_time as updateTime,
|
|
|
- m.file_names as fileNames
|
|
|
|
|
|
|
+ m.file_names as fileNames
|
|
|
from sys_learning_materials m
|
|
from sys_learning_materials m
|
|
|
inner join sys_knowledge k on m.knowledge_id = k.id
|
|
inner join sys_knowledge k on m.knowledge_id = k.id
|
|
|
inner join sys_user u on u.id=m.create_by
|
|
inner join sys_user u on u.id=m.create_by
|
|
@@ -172,69 +172,97 @@
|
|
|
parameterType="com.xunmei.common.core.domain.edu.domain.SysLearningMaterials">
|
|
parameterType="com.xunmei.common.core.domain.edu.domain.SysLearningMaterials">
|
|
|
insert into sys_learning_materials
|
|
insert into sys_learning_materials
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">id,
|
|
|
|
|
|
|
+ <if test="id != null">
|
|
|
|
|
+ id,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="title != null">title,
|
|
|
|
|
|
|
+ <if test="title != null">
|
|
|
|
|
+ title,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="content != null">content,
|
|
|
|
|
|
|
+ <if test="content != null">
|
|
|
|
|
+ content,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="knowledgeId != null">knowledge_id,
|
|
|
|
|
|
|
+ <if test="knowledgeId != null">
|
|
|
|
|
+ knowledge_id,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orgId != null">org_id,
|
|
|
|
|
|
|
+ <if test="orgId != null">
|
|
|
|
|
+ org_id,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orgName != null">org_name,
|
|
|
|
|
|
|
+ <if test="orgName != null">
|
|
|
|
|
+ org_name,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orgPath != null">org_path,
|
|
|
|
|
|
|
+ <if test="orgPath != null">
|
|
|
|
|
+ org_path,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="isOpen != null">is_open,
|
|
|
|
|
|
|
+ <if test="isOpen != null">
|
|
|
|
|
+ is_open,
|
|
|
</if>
|
|
</if>
|
|
|
<if test="fileList != null">
|
|
<if test="fileList != null">
|
|
|
file_list,
|
|
file_list,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="remark != null">remark,
|
|
|
|
|
|
|
+ <if test="remark != null">
|
|
|
|
|
+ remark,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="deleted != null">deleted,
|
|
|
|
|
|
|
+ <if test="deleted != null">
|
|
|
|
|
+ deleted,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="createBy != null">create_by,
|
|
|
|
|
|
|
+ <if test="createBy != null">
|
|
|
|
|
+ create_by,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="createTime != null">create_time,
|
|
|
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
|
+ create_time,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="updateBy != null">update_by,
|
|
|
|
|
|
|
+ <if test="updateBy != null">
|
|
|
|
|
+ update_by,
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="updateTime != null">updateTime,
|
|
|
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
|
+ updateTime,
|
|
|
</if>
|
|
</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">#{id},
|
|
|
|
|
|
|
+ <if test="id != null">
|
|
|
|
|
+ #{id},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="title != null">#{title},
|
|
|
|
|
|
|
+ <if test="title != null">
|
|
|
|
|
+ #{title},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="content != null">#{content},
|
|
|
|
|
|
|
+ <if test="content != null">
|
|
|
|
|
+ #{content},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="knowledgeId != null">#{knowledgeId},
|
|
|
|
|
|
|
+ <if test="knowledgeId != null">
|
|
|
|
|
+ #{knowledgeId},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orgId != null">#{orgId},
|
|
|
|
|
|
|
+ <if test="orgId != null">
|
|
|
|
|
+ #{orgId},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orgName != null">#{orgName},
|
|
|
|
|
|
|
+ <if test="orgName != null">
|
|
|
|
|
+ #{orgName},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orgPath != null">#{orgPath},
|
|
|
|
|
|
|
+ <if test="orgPath != null">
|
|
|
|
|
+ #{orgPath},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="isOpen != null">#{isOpen},
|
|
|
|
|
|
|
+ <if test="isOpen != null">
|
|
|
|
|
+ #{isOpen},
|
|
|
</if>
|
|
</if>
|
|
|
<if test="fileList != null">
|
|
<if test="fileList != null">
|
|
|
#{fileList},
|
|
#{fileList},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="remark != null">#{remark},
|
|
|
|
|
|
|
+ <if test="remark != null">
|
|
|
|
|
+ #{remark},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="deleted != null">#{deleted},
|
|
|
|
|
|
|
+ <if test="deleted != null">
|
|
|
|
|
+ #{deleted},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="createBy != null">#{createBy},
|
|
|
|
|
|
|
+ <if test="createBy != null">
|
|
|
|
|
+ #{createBy},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="createTime != null">#{createTime},
|
|
|
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
|
+ #{createTime},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="updateBy != null">#{updateBy},
|
|
|
|
|
|
|
+ <if test="updateBy != null">
|
|
|
|
|
+ #{updateBy},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="updateTime != null">#{updateTime},
|
|
|
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
|
+ #{updateTime},
|
|
|
</if>
|
|
</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
</insert>
|
|
</insert>
|
|
@@ -243,16 +271,20 @@
|
|
|
parameterType="com.xunmei.common.core.domain.edu.domain.SysLearningMaterials">
|
|
parameterType="com.xunmei.common.core.domain.edu.domain.SysLearningMaterials">
|
|
|
update sys_learning_materials
|
|
update sys_learning_materials
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="title != null">title =
|
|
|
|
|
|
|
+ <if test="title != null">
|
|
|
|
|
+ title =
|
|
|
#{title},
|
|
#{title},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="content != null">content =
|
|
|
|
|
|
|
+ <if test="content != null">
|
|
|
|
|
+ content =
|
|
|
#{content},
|
|
#{content},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="knowledgeId != null">knowledge_id =
|
|
|
|
|
|
|
+ <if test="knowledgeId != null">
|
|
|
|
|
+ knowledge_id =
|
|
|
#{knowledgeId},
|
|
#{knowledgeId},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orgId != null">org_id =
|
|
|
|
|
|
|
+ <if test="orgId != null">
|
|
|
|
|
+ org_id =
|
|
|
#{orgId},
|
|
#{orgId},
|
|
|
</if>
|
|
</if>
|
|
|
<if test="orgName != null">
|
|
<if test="orgName != null">
|
|
@@ -283,13 +315,16 @@
|
|
|
create_by =
|
|
create_by =
|
|
|
#{createBy},
|
|
#{createBy},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="createTime != null">create_time =
|
|
|
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
|
+ create_time =
|
|
|
#{createTime},
|
|
#{createTime},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="updateBy != null">update_by =
|
|
|
|
|
|
|
+ <if test="updateBy != null">
|
|
|
|
|
+ update_by =
|
|
|
#{updateBy},
|
|
#{updateBy},
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="updateTime != null">updateTime =
|
|
|
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
|
+ updateTime =
|
|
|
#{updateTime},
|
|
#{updateTime},
|
|
|
</if>
|
|
</if>
|
|
|
</trim>
|
|
</trim>
|
|
@@ -308,12 +343,7 @@
|
|
|
#{id}
|
|
#{id}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</delete>
|
|
</delete>
|
|
|
-
|
|
|
|
|
- <select id="selectFilePageList" resultType="com.xunmei.common.core.domain.edu.vo.SysLearningMaterialsFileListVo">
|
|
|
|
|
- select id,org_id as orgId,title as title,org_name as orgName,file_list as file
|
|
|
|
|
-
|
|
|
|
|
- from sys_learning_materials m
|
|
|
|
|
- where m.deleted = 0
|
|
|
|
|
|
|
+ <sql id="filePageList">
|
|
|
and m.is_open = 1
|
|
and m.is_open = 1
|
|
|
and m.file_list is not null
|
|
and m.file_list is not null
|
|
|
<if test="request.title != null and request.title != '' ">
|
|
<if test="request.title != null and request.title != '' ">
|
|
@@ -322,11 +352,24 @@
|
|
|
<if test="request.fileName != null and request.fileName != '' ">
|
|
<if test="request.fileName != null and request.fileName != '' ">
|
|
|
and m.file_names like concat('%', #{request.fileName}, '%')
|
|
and m.file_names like concat('%', #{request.fileName}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFilePageList" resultType="com.xunmei.common.core.domain.edu.vo.SysLearningMaterialsFileListVo">
|
|
|
|
|
+ select id,org_id as orgId,title as title,org_name as orgName,file_list as file
|
|
|
|
|
+
|
|
|
|
|
+ from sys_learning_materials m
|
|
|
|
|
+ where m.deleted = 0
|
|
|
|
|
+ <include refid="filePageList"/>
|
|
|
|
|
+ <if test="request.orgPath != null and request.orgPath != '' ">
|
|
|
|
|
+ and m.org_path like concat(#{request.orgPath}, '%')
|
|
|
|
|
+ </if>
|
|
|
<if test="request.orgIdList.size>0">
|
|
<if test="request.orgIdList.size>0">
|
|
|
- and m.org_id in
|
|
|
|
|
|
|
+ or ( m.org_id in
|
|
|
<foreach collection="request.orgIdList" item="item" open="(" separator="," close=")">
|
|
<foreach collection="request.orgIdList" item="item" open="(" separator="," close=")">
|
|
|
#{item}
|
|
#{item}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
|
|
+ <include refid="filePageList"/>
|
|
|
|
|
+ )
|
|
|
</if>
|
|
</if>
|
|
|
order by m.org_id, m.create_time desc
|
|
order by m.org_id, m.create_time desc
|
|
|
</select>
|
|
</select>
|