|
@@ -0,0 +1,91 @@
|
|
|
|
+<?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.system.mapper.DcDocumentMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="DcDocument" id="DcDocumentResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="title" column="title" />
|
|
|
|
+ <result property="data" column="data" />
|
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
+ <result property="status" column="status" />
|
|
|
|
+ <result property="categoryId" column="category_id" />
|
|
|
|
+ <result property="isTemplate" column="is_template" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectDcDocumentVo">
|
|
|
|
+ select id, title, data, user_id, create_time, update_time, status, category_id, is_template from dc_document
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectDcDocumentList" parameterType="DcDocument" resultMap="DcDocumentResult">
|
|
|
|
+ <include refid="selectDcDocumentVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="title != null and title != ''"> and title = #{title}</if>
|
|
|
|
+ <if test="data != null and data != ''"> and data = #{data}</if>
|
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
|
+ <if test="categoryId != null "> and category_id = #{categoryId}</if>
|
|
|
|
+ <if test="isTemplate != null "> and is_template = #{isTemplate}</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectDcDocumentById" parameterType="Long" resultMap="DcDocumentResult">
|
|
|
|
+ <include refid="selectDcDocumentVo"/>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertDcDocument" parameterType="DcDocument">
|
|
|
|
+ insert into dc_document
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">id,</if>
|
|
|
|
+ <if test="title != null">title,</if>
|
|
|
|
+ <if test="data != null">data,</if>
|
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
+ <if test="status != null">status,</if>
|
|
|
|
+ <if test="categoryId != null">category_id,</if>
|
|
|
|
+ <if test="isTemplate != null">is_template,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
|
+ <if test="title != null">#{title},</if>
|
|
|
|
+ <if test="data != null">#{data},</if>
|
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
|
+ <if test="categoryId != null">#{categoryId},</if>
|
|
|
|
+ <if test="isTemplate != null">#{isTemplate},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateDcDocument" parameterType="DcDocument">
|
|
|
|
+ update dc_document
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="title != null">title = #{title},</if>
|
|
|
|
+ <if test="data != null">data = #{data},</if>
|
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
|
+ <if test="categoryId != null">category_id = #{categoryId},</if>
|
|
|
|
+ <if test="isTemplate != null">is_template = #{isTemplate},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteDcDocumentById" parameterType="Long">
|
|
|
|
+ delete from dc_document where id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteDcDocumentByIds" parameterType="String">
|
|
|
|
+ delete from dc_document where id in
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|