|
|
@@ -0,0 +1,215 @@
|
|
|
+<?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.xunmei.system.mapper.SysLearningMaterialsMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.xunmei.system.domain.SysLearningMaterials" id="SysLearningMaterialsResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="title" column="title"/>
|
|
|
+ <result property="content" column="content"/>
|
|
|
+ <result property="knowledgeId" column="knowledge_id"/>
|
|
|
+ <result property="orgId" column="org_id"/>
|
|
|
+ <result property="orgName" column="org_name"/>
|
|
|
+ <result property="orgPath" column="org_path"/>
|
|
|
+ <result property="isOpen" column="is_open"/>
|
|
|
+ <result property="file" column="file"/>
|
|
|
+ <result property="deleted" column="deleted"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="updateTime"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectSysLearningMaterialsVo">
|
|
|
+ select id,
|
|
|
+ title,
|
|
|
+ content,
|
|
|
+ knowledge_id,
|
|
|
+ org_id,
|
|
|
+ org_name,
|
|
|
+ org_path,
|
|
|
+ is_open,
|
|
|
+ file,
|
|
|
+ remark,
|
|
|
+ deleted,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ updateTime
|
|
|
+ from sys_learning_materials
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectSysLearningMaterialsList" parameterType="com.xunmei.system.domain.SysLearningMaterials"
|
|
|
+ resultMap="SysLearningMaterialsResult">
|
|
|
+ <include refid="selectSysLearningMaterialsVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="title != null and title != ''">
|
|
|
+ and title like concat('%', #{title}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ and title like concat('%', #{title}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="knowledgeId != null ">
|
|
|
+ and knowledge_id = #{knowledgeId}
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null ">
|
|
|
+ and org_id = #{orgId}
|
|
|
+ </if>
|
|
|
+ <if test="orgName != null and orgName != ''">
|
|
|
+ and org_name like concat('%', #{orgName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="orgPath != null and orgPath != ''">
|
|
|
+ and org_path = #{orgPath}
|
|
|
+ </if>
|
|
|
+ <if test="isOpen != null ">
|
|
|
+ and is_open = #{isOpen}
|
|
|
+ </if>
|
|
|
+ <if test="file != null and file != ''">
|
|
|
+ and file = #{file}
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null ">
|
|
|
+ and deleted = #{deleted}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null ">
|
|
|
+ and updateTime = #{updateTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectSysLearningMaterialsById" parameterType="Long"
|
|
|
+ resultMap="SysLearningMaterialsResult">
|
|
|
+ <include refid="selectSysLearningMaterialsVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertSysLearningMaterials" parameterType="com.xunmei.system.domain.SysLearningMaterials">
|
|
|
+ insert into sys_learning_materials
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,
|
|
|
+ </if>
|
|
|
+ <if test="title != null">title,
|
|
|
+ </if>
|
|
|
+ <if test="content != null">content,
|
|
|
+ </if>
|
|
|
+ <if test="knowledgeId != null">knowledge_id,
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null">org_id,
|
|
|
+ </if>
|
|
|
+ <if test="orgName != null">org_name,
|
|
|
+ </if>
|
|
|
+ <if test="orgPath != null">org_path,
|
|
|
+ </if>
|
|
|
+ <if test="isOpen != null">is_open,
|
|
|
+ </if>
|
|
|
+ <if test="file != null">file,
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">remark,
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">deleted,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">updateTime,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">#{title},
|
|
|
+ </if>
|
|
|
+ <if test="content != null">#{content},
|
|
|
+ </if>
|
|
|
+ <if test="knowledgeId != null">#{knowledgeId},
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null">#{orgId},
|
|
|
+ </if>
|
|
|
+ <if test="orgName != null">#{orgName},
|
|
|
+ </if>
|
|
|
+ <if test="orgPath != null">#{orgPath},
|
|
|
+ </if>
|
|
|
+ <if test="isOpen != null">#{isOpen},
|
|
|
+ </if>
|
|
|
+ <if test="file != null">#{file},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">#{remark},
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">#{deleted},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">#{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">#{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">#{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">#{updateTime},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateSysLearningMaterials" parameterType="com.xunmei.system.domain.SysLearningMaterials">
|
|
|
+ update sys_learning_materials
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="title != null">title =
|
|
|
+ #{title},
|
|
|
+ </if>
|
|
|
+ <if test="content != null">content =
|
|
|
+ #{content},
|
|
|
+ </if>
|
|
|
+ <if test="knowledgeId != null">knowledge_id =
|
|
|
+ #{knowledgeId},
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null">org_id =
|
|
|
+ #{orgId},
|
|
|
+ </if>
|
|
|
+ <if test="orgName != null">org_name =
|
|
|
+ #{orgName},
|
|
|
+ </if>
|
|
|
+ <if test="orgPath != null">org_path =
|
|
|
+ #{orgPath},
|
|
|
+ </if>
|
|
|
+ <if test="isOpen != null">is_open =
|
|
|
+ #{isOpen},
|
|
|
+ </if>
|
|
|
+ <if test="file != null">file =
|
|
|
+ #{file},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">remark =
|
|
|
+ #{remark},
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">deleted =
|
|
|
+ #{deleted},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by =
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time =
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by =
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">updateTime =
|
|
|
+ #{updateTime},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteSysLearningMaterialsById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from sys_learning_materials
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteSysLearningMaterialsByIds" parameterType="String">
|
|
|
+ delete from sys_learning_materials where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|