|
@@ -1,36 +1,50 @@
|
|
|
<?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.DocInfoMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="DocInfo" id="DocInfoResult">
|
|
|
- <result property="docId" column="DOC_ID" />
|
|
|
- <result property="spaceId" column="SPACE_ID" />
|
|
|
- <result property="dirId" column="DIR_ID" />
|
|
|
- <result property="fileName" column="FILE_NAME" />
|
|
|
- <result property="fileId" column="FILE_ID" />
|
|
|
- <result property="fileSize" column="FILE_SIZE" />
|
|
|
- <result property="fileType" column="FILE_TYPE" />
|
|
|
- <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="docId" column="DOC_ID"/>
|
|
|
+ <result property="spaceId" column="SPACE_ID"/>
|
|
|
+ <result property="dirId" column="DIR_ID"/>
|
|
|
+ <result property="fileName" column="FILE_NAME"/>
|
|
|
+ <result property="fileId" column="FILE_ID"/>
|
|
|
+ <result property="fileSize" column="FILE_SIZE"/>
|
|
|
+ <result property="fileType" column="FILE_TYPE"/>
|
|
|
+ <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="selectDocInfoVo">
|
|
|
- select DOC_ID, SPACE_ID, DIR_ID, FILE_NAME, FILE_ID, FILE_SIZE, FILE_TYPE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK from doc_info
|
|
|
+ select DOC_ID,
|
|
|
+ SPACE_ID,
|
|
|
+ DIR_ID,
|
|
|
+ FILE_NAME,
|
|
|
+ FILE_ID,
|
|
|
+ FILE_SIZE,
|
|
|
+ FILE_TYPE,
|
|
|
+ CREATE_BY,
|
|
|
+ CREATE_TIME,
|
|
|
+ UPDATE_BY,
|
|
|
+ UPDATE_TIME,
|
|
|
+ REMARK
|
|
|
+ from doc_info
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectDocInfoList" parameterType="DocInfo" resultMap="DocInfoResult">
|
|
|
<include refid="selectDocInfoVo"/>
|
|
|
<where>
|
|
|
- <if test="dirId != null and dirId != ''"> and DIR_ID like concat('%', #{dirId}, '%')</if>
|
|
|
- <if test="spaceId != null and spaceId != ''"> and SPACE_ID like concat('%', #{spaceId}, '%')</if>
|
|
|
- <if test="fileName != null and fileName != ''"> and FILE_NAME like concat('%', #{fileName}, '%')</if>
|
|
|
- <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and CREATE_TIME between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
|
|
- <if test="params.dirIds!=null">
|
|
|
+ <if test="dirId != null and dirId != ''">and DIR_ID like concat('%', #{dirId}, '%')</if>
|
|
|
+ <if test="spaceId != null and spaceId != ''">and SPACE_ID like concat('%', #{spaceId}, '%')</if>
|
|
|
+ <if test="fileName != null and fileName != ''">and FILE_NAME like concat('%', #{fileName}, '%')</if>
|
|
|
+ <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
|
|
+ and CREATE_TIME between #{params.beginCreateTime} and #{params.endCreateTime}
|
|
|
+ </if>
|
|
|
+ <if test="params.dirIds!=null and params.dirIds!=''">
|
|
|
AND DIR_ID IN
|
|
|
<foreach collection="params.dirIds" open="(" separator="," close=")" item="id">
|
|
|
#{id}
|
|
@@ -39,12 +53,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
|
order by FILE_NAME
|
|
|
</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=",">
|
|
@@ -59,7 +73,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="spaceId != null">#{spaceId},</if>
|
|
|
<if test="dirId != null">#{dirId},</if>
|
|
@@ -72,7 +86,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="updateDocInfo" parameterType="DocInfo">
|
|
@@ -94,11 +108,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteDocInfoByDocId" parameterType="Long">
|
|
|
- delete from doc_info where DOC_ID = #{docId}
|
|
|
+ delete
|
|
|
+ from doc_info
|
|
|
+ where DOC_ID = #{docId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteDocInfoByDocIds" parameterType="String">
|
|
|
- delete from doc_info where DOC_ID in
|
|
|
+ delete from doc_info where DOC_ID in
|
|
|
<foreach item="docId" collection="array" open="(" separator="," close=")">
|
|
|
#{docId}
|
|
|
</foreach>
|