|
@@ -1,36 +1,45 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.doc.biz.mapper.DocVersionMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="DocVersion" id="DocVersionResult">
|
|
|
- <result property="versionId" column="VERSION_ID" />
|
|
|
- <result property="docId" column="DOC_ID" />
|
|
|
- <result property="fileId" column="FILE_ID" />
|
|
|
- <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="versionId" column="VERSION_ID"/>
|
|
|
+ <result property="docId" column="DOC_ID"/>
|
|
|
+ <result property="fileId" column="FILE_ID"/>
|
|
|
+ <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"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectDocVersionVo">
|
|
|
- select VERSION_ID, DOC_ID, FILE_ID, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK from doc_version
|
|
|
+ select VERSION_ID,
|
|
|
+ DOC_ID,
|
|
|
+ FILE_ID,
|
|
|
+ CREATE_BY,
|
|
|
+ CREATE_TIME,
|
|
|
+ UPDATE_BY,
|
|
|
+ UPDATE_TIME,
|
|
|
+ REMARK
|
|
|
+ from doc_version
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectDocVersionList" parameterType="DocVersion" resultMap="DocVersionResult">
|
|
|
<include refid="selectDocVersionVo"/>
|
|
|
- <where>
|
|
|
- <if test="fileId != null and fileId != ''"> and FILE_ID = #{fileId}</if>
|
|
|
+ <where>
|
|
|
+ <if test="docId != null and docId != ''">and DOC_ID = #{docId}</if>
|
|
|
+ <if test="fileId != null and fileId != ''">and FILE_ID = #{fileId}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectDocVersionByVersionId" parameterType="Long" resultMap="DocVersionResult">
|
|
|
<include refid="selectDocVersionVo"/>
|
|
|
where VERSION_ID = #{versionId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertDocVersion" parameterType="DocVersion" useGeneratedKeys="true" keyProperty="versionId">
|
|
|
insert into doc_version
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -41,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateBy != null">UPDATE_BY,</if>
|
|
|
<if test="updateTime != null">UPDATE_TIME,</if>
|
|
|
<if test="remark != null">REMARK,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="docId != null">#{docId},</if>
|
|
|
<if test="fileId != null">#{fileId},</if>
|
|
@@ -50,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateDocVersion" parameterType="DocVersion">
|
|
@@ -68,11 +77,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteDocVersionByVersionId" parameterType="Long">
|
|
|
- delete from doc_version where VERSION_ID = #{versionId}
|
|
|
+ delete
|
|
|
+ from doc_version
|
|
|
+ where VERSION_ID = #{versionId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteDocVersionByVersionIds" parameterType="String">
|
|
|
- delete from doc_version where VERSION_ID in
|
|
|
+ delete from doc_version where VERSION_ID in
|
|
|
<foreach item="versionId" collection="array" open="(" separator="," close=")">
|
|
|
#{versionId}
|
|
|
</foreach>
|