|
@@ -0,0 +1,134 @@
|
|
|
|
+<?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.ruoyi.okc.mapper.DocTreeMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="DocTree" id="DocTreeResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="parentId" column="parent_id" />
|
|
|
|
+ <result property="docId" column="doc_id" />
|
|
|
|
+ <result property="treeName" column="tree_name" />
|
|
|
|
+ <result property="orderNum" column="order_num" />
|
|
|
|
+ <result property="ancestors" column="ancestors" />
|
|
|
|
+ <result property="content" column="content" />
|
|
|
|
+ <result property="css" column="css" />
|
|
|
|
+ <result property="remark" column="remark" />
|
|
|
|
+ <result property="createTimeStr" column="create_time_str" />
|
|
|
|
+ <result property="createUserId" column="create_user_id" />
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
+ <result property="createUserType" column="create_user_type" />
|
|
|
|
+ <result property="createUnit" column="create_unit" />
|
|
|
|
+ <result property="createUnitName" column="create_unit_name" />
|
|
|
|
+ <result property="updateTimeStr" column="update_time_str" />
|
|
|
|
+ <result property="updateUserId" column="update_user_id" />
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
+ <result property="updateUnit" column="update_unit" />
|
|
|
|
+ <result property="updateUnitName" column="update_unit_name" />
|
|
|
|
+ <result property="status" column="status" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectDocTreeVo">
|
|
|
|
+ select id, parent_id, doc_id, tree_name, order_num, ancestors, content, css, remark, create_time_str, create_user_id, create_by, create_user_type, create_unit, create_unit_name, update_time_str, update_user_id, update_by, update_unit, update_unit_name, status from doc_tree
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectDocTreeList" parameterType="DocTree" resultMap="DocTreeResult">
|
|
|
|
+ <include refid="selectDocTreeVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="treeName != null and treeName != ''"> and tree_name like concat('%', #{treeName}, '%')</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectDocTreeById" parameterType="String" resultMap="DocTreeResult">
|
|
|
|
+ <include refid="selectDocTreeVo"/>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertDocTree" parameterType="DocTree">
|
|
|
|
+ insert into doc_tree
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">id,</if>
|
|
|
|
+ <if test="parentId != null and parentId != ''">parent_id,</if>
|
|
|
|
+ <if test="docId != null and docId != ''">doc_id,</if>
|
|
|
|
+ <if test="treeName != null and treeName != ''">tree_name,</if>
|
|
|
|
+ <if test="orderNum != null">order_num,</if>
|
|
|
|
+ <if test="ancestors != null">ancestors,</if>
|
|
|
|
+ <if test="content != null">content,</if>
|
|
|
|
+ <if test="css != null">css,</if>
|
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
|
+ <if test="createTimeStr != null">create_time_str,</if>
|
|
|
|
+ <if test="createUserId != null">create_user_id,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ <if test="createUserType != null">create_user_type,</if>
|
|
|
|
+ <if test="createUnit != null">create_unit,</if>
|
|
|
|
+ <if test="createUnitName != null">create_unit_name,</if>
|
|
|
|
+ <if test="updateTimeStr != null">update_time_str,</if>
|
|
|
|
+ <if test="updateUserId != null">update_user_id,</if>
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
+ <if test="updateUnit != null">update_unit,</if>
|
|
|
|
+ <if test="updateUnitName != null">update_unit_name,</if>
|
|
|
|
+ <if test="status != null and status != ''">status,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
|
+ <if test="parentId != null and parentId != ''">#{parentId},</if>
|
|
|
|
+ <if test="docId != null and docId != ''">#{docId},</if>
|
|
|
|
+ <if test="treeName != null and treeName != ''">#{treeName},</if>
|
|
|
|
+ <if test="orderNum != null">#{orderNum},</if>
|
|
|
|
+ <if test="ancestors != null">#{ancestors},</if>
|
|
|
|
+ <if test="content != null">#{content},</if>
|
|
|
|
+ <if test="css != null">#{css},</if>
|
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
|
+ <if test="createTimeStr != null">#{createTimeStr},</if>
|
|
|
|
+ <if test="createUserId != null">#{createUserId},</if>
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
+ <if test="createUserType != null">#{createUserType},</if>
|
|
|
|
+ <if test="createUnit != null">#{createUnit},</if>
|
|
|
|
+ <if test="createUnitName != null">#{createUnitName},</if>
|
|
|
|
+ <if test="updateTimeStr != null">#{updateTimeStr},</if>
|
|
|
|
+ <if test="updateUserId != null">#{updateUserId},</if>
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
+ <if test="updateUnit != null">#{updateUnit},</if>
|
|
|
|
+ <if test="updateUnitName != null">#{updateUnitName},</if>
|
|
|
|
+ <if test="status != null and status != ''">#{status},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateDocTree" parameterType="DocTree">
|
|
|
|
+ update doc_tree
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
|
|
|
|
+ <if test="docId != null and docId != ''">doc_id = #{docId},</if>
|
|
|
|
+ <if test="treeName != null and treeName != ''">tree_name = #{treeName},</if>
|
|
|
|
+ <if test="orderNum != null">order_num = #{orderNum},</if>
|
|
|
|
+ <if test="ancestors != null">ancestors = #{ancestors},</if>
|
|
|
|
+ <if test="content != null">content = #{content},</if>
|
|
|
|
+ <if test="css != null">css = #{css},</if>
|
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
|
+ <if test="createTimeStr != null">create_time_str = #{createTimeStr},</if>
|
|
|
|
+ <if test="createUserId != null">create_user_id = #{createUserId},</if>
|
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
+ <if test="createUserType != null">create_user_type = #{createUserType},</if>
|
|
|
|
+ <if test="createUnit != null">create_unit = #{createUnit},</if>
|
|
|
|
+ <if test="createUnitName != null">create_unit_name = #{createUnitName},</if>
|
|
|
|
+ <if test="updateTimeStr != null">update_time_str = #{updateTimeStr},</if>
|
|
|
|
+ <if test="updateUserId != null">update_user_id = #{updateUserId},</if>
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
+ <if test="updateUnit != null">update_unit = #{updateUnit},</if>
|
|
|
|
+ <if test="updateUnitName != null">update_unit_name = #{updateUnitName},</if>
|
|
|
|
+ <if test="status != null and status != ''">status = #{status},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteDocTreeById" parameterType="String">
|
|
|
|
+ delete from doc_tree where id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteDocTreeByIds" parameterType="String">
|
|
|
|
+ delete from doc_tree where id in
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|