|
@@ -0,0 +1,130 @@
|
|
|
+<?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.jjt.doc.mapper.DocInfoMapper">
|
|
|
+
|
|
|
+ <resultMap type="DocInfo" id="DocInfoResult">
|
|
|
+ <result property="docId" column="DOC_ID" />
|
|
|
+ <result property="docName" column="DOC_NAME" />
|
|
|
+ <result property="docType" column="DOC_TYPE" />
|
|
|
+ <result property="docSize" column="DOC_SIZE" />
|
|
|
+ <result property="classifyId" column="CLASSIFY_ID" />
|
|
|
+ <result property="docDesc" column="DOC_DESC" />
|
|
|
+ <result property="docPath" column="DOC_PATH" />
|
|
|
+ <result property="allowEdit" column="ALLOW_EDIT" />
|
|
|
+ <result property="docOf" column="DOC_OF" />
|
|
|
+ <result property="owner" column="OWNER" />
|
|
|
+ <result property="createYear" column="CREATE_YEAR" />
|
|
|
+ <result property="createBy" column="CREATE_BY" />
|
|
|
+ <result property="createTime" column="CREATE_TIME" />
|
|
|
+ <result property="updateBy" column="UPDATE_BY" />
|
|
|
+ <result property="updateTime" column="UPDATE_TIME" />
|
|
|
+ <result property="remark" column="REMARK" />
|
|
|
+ <result property="isDel" column="IS_DEL" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectDocInfoVo">
|
|
|
+ select DOC_ID, DOC_NAME, DOC_TYPE, DOC_SIZE, CLASSIFY_ID, DOC_DESC, DOC_PATH, ALLOW_EDIT, DOC_OF, OWNER, CREATE_YEAR, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK, IS_DEL from doc_info
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectDocInfoList" parameterType="DocInfo" resultMap="DocInfoResult">
|
|
|
+ <include refid="selectDocInfoVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="docName != null and docName != ''"> and DOC_NAME like concat('%', #{docName}, '%')</if>
|
|
|
+ <if test="docType != null and docType != ''"> and DOC_TYPE = #{docType}</if>
|
|
|
+ <if test="docSize != null "> and DOC_SIZE = #{docSize}</if>
|
|
|
+ <if test="classifyId != null "> and CLASSIFY_ID = #{classifyId}</if>
|
|
|
+ <if test="docDesc != null and docDesc != ''"> and DOC_DESC = #{docDesc}</if>
|
|
|
+ <if test="docPath != null and docPath != ''"> and DOC_PATH = #{docPath}</if>
|
|
|
+ <if test="allowEdit != null and allowEdit != ''"> and ALLOW_EDIT = #{allowEdit}</if>
|
|
|
+ <if test="docOf != null and docOf != ''"> and DOC_OF = #{docOf}</if>
|
|
|
+ <if test="owner != null "> and OWNER = #{owner}</if>
|
|
|
+ <if test="createYear != null "> and CREATE_YEAR = #{createYear}</if>
|
|
|
+ <if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
|
|
|
+ <if test="createTime != null "> and CREATE_TIME = #{createTime}</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
|
|
|
+ <if test="updateTime != null "> and UPDATE_TIME = #{updateTime}</if>
|
|
|
+ <if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDocInfoByDocId" parameterType="Long" resultMap="DocInfoResult">
|
|
|
+ <include refid="selectDocInfoVo"/>
|
|
|
+ where DOC_ID = #{docId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertDocInfo" parameterType="DocInfo" useGeneratedKeys="true" keyProperty="docId">
|
|
|
+ insert into doc_info
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="docName != null">DOC_NAME,</if>
|
|
|
+ <if test="docType != null">DOC_TYPE,</if>
|
|
|
+ <if test="docSize != null">DOC_SIZE,</if>
|
|
|
+ <if test="classifyId != null">CLASSIFY_ID,</if>
|
|
|
+ <if test="docDesc != null">DOC_DESC,</if>
|
|
|
+ <if test="docPath != null">DOC_PATH,</if>
|
|
|
+ <if test="allowEdit != null">ALLOW_EDIT,</if>
|
|
|
+ <if test="docOf != null">DOC_OF,</if>
|
|
|
+ <if test="owner != null">OWNER,</if>
|
|
|
+ <if test="createYear != null">CREATE_YEAR,</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">UPDATE_TIME,</if>
|
|
|
+ <if test="remark != null">REMARK,</if>
|
|
|
+ <if test="isDel != null">IS_DEL,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="docName != null">#{docName},</if>
|
|
|
+ <if test="docType != null">#{docType},</if>
|
|
|
+ <if test="docSize != null">#{docSize},</if>
|
|
|
+ <if test="classifyId != null">#{classifyId},</if>
|
|
|
+ <if test="docDesc != null">#{docDesc},</if>
|
|
|
+ <if test="docPath != null">#{docPath},</if>
|
|
|
+ <if test="allowEdit != null">#{allowEdit},</if>
|
|
|
+ <if test="docOf != null">#{docOf},</if>
|
|
|
+ <if test="owner != null">#{owner},</if>
|
|
|
+ <if test="createYear != null">#{createYear},</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>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="isDel != null">#{isDel},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateDocInfo" parameterType="DocInfo">
|
|
|
+ update doc_info
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="docName != null">DOC_NAME = #{docName},</if>
|
|
|
+ <if test="docType != null">DOC_TYPE = #{docType},</if>
|
|
|
+ <if test="docSize != null">DOC_SIZE = #{docSize},</if>
|
|
|
+ <if test="classifyId != null">CLASSIFY_ID = #{classifyId},</if>
|
|
|
+ <if test="docDesc != null">DOC_DESC = #{docDesc},</if>
|
|
|
+ <if test="docPath != null">DOC_PATH = #{docPath},</if>
|
|
|
+ <if test="allowEdit != null">ALLOW_EDIT = #{allowEdit},</if>
|
|
|
+ <if test="docOf != null">DOC_OF = #{docOf},</if>
|
|
|
+ <if test="owner != null">OWNER = #{owner},</if>
|
|
|
+ <if test="createYear != null">CREATE_YEAR = #{createYear},</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">UPDATE_TIME = #{updateTime},</if>
|
|
|
+ <if test="remark != null">REMARK = #{remark},</if>
|
|
|
+ <if test="isDel != null">IS_DEL = #{isDel},</if>
|
|
|
+ </trim>
|
|
|
+ where DOC_ID = #{docId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteDocInfoByDocId" parameterType="Long">
|
|
|
+ delete from doc_info where DOC_ID = #{docId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteDocInfoByDocIds" parameterType="String">
|
|
|
+ delete from doc_info where DOC_ID in
|
|
|
+ <foreach item="docId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{docId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|