|
|
@@ -1,47 +1,77 @@
|
|
|
<?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.jjt.doc.mapper.DocShareMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="DocShare" id="DocShareResult">
|
|
|
- <result property="docId" column="DOC_ID" />
|
|
|
- <result property="docYear" column="DOC_YEAR" />
|
|
|
- <result property="isSecret" column="IS_SECRET" />
|
|
|
- <result property="onlyOneTime" column="ONLY_ONE_TIME" />
|
|
|
- <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" />
|
|
|
+ <result property="docId" column="DOC_ID"/>
|
|
|
+ <result property="docYear" column="DOC_YEAR"/>
|
|
|
+ <result property="isSecret" column="IS_SECRET"/>
|
|
|
+ <result property="onlyOneTime" column="ONLY_ONE_TIME"/>
|
|
|
+ <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="selectDocShareVo">
|
|
|
- select DOC_ID, DOC_YEAR, IS_SECRET, ONLY_ONE_TIME, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK, IS_DEL from doc_share
|
|
|
+ select DOC_ID,
|
|
|
+ DOC_YEAR,
|
|
|
+ IS_SECRET,
|
|
|
+ ONLY_ONE_TIME,
|
|
|
+ CREATE_BY,
|
|
|
+ CREATE_TIME,
|
|
|
+ UPDATE_BY,
|
|
|
+ UPDATE_TIME,
|
|
|
+ REMARK,
|
|
|
+ IS_DEL
|
|
|
+ from doc_share
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectDocShareList" parameterType="DocShare" resultMap="DocShareResult">
|
|
|
<include refid="selectDocShareVo"/>
|
|
|
- <where>
|
|
|
- <if test="docId != null "> and DOC_ID = #{docId}</if>
|
|
|
- <if test="docYear != null "> and DOC_YEAR = #{docYear}</if>
|
|
|
- <if test="isSecret != null and isSecret != ''"> and IS_SECRET = #{isSecret}</if>
|
|
|
- <if test="onlyOneTime != null and onlyOneTime != ''"> and ONLY_ONE_TIME = #{onlyOneTime}</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>
|
|
|
- <if test="isDel != null and isDel != ''"> and IS_DEL = #{isDel}</if>
|
|
|
+ <where>
|
|
|
+ <if test="docId != null ">and DOC_ID = #{docId}</if>
|
|
|
+ <if test="docYear != null ">and DOC_YEAR = #{docYear}</if>
|
|
|
+ <if test="isSecret != null and isSecret != ''">and IS_SECRET = #{isSecret}</if>
|
|
|
+ <if test="onlyOneTime != null and onlyOneTime != ''">and ONLY_ONE_TIME = #{onlyOneTime}</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>
|
|
|
+ <if test="isDel != null and isDel != ''">and IS_DEL = #{isDel}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectDocShareByDocId" parameterType="Long" resultMap="DocShareResult">
|
|
|
<include refid="selectDocShareVo"/>
|
|
|
where DOC_ID = #{docId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
+ <select id="selectDocShareSend" resultType="com.jjt.doc.domain.DocShare">
|
|
|
+ select a.doc_id, a.UPDATE_TIME, b.doc_name, b.doc_type, b.doc_path
|
|
|
+ from doc_share a,
|
|
|
+ doc_info b
|
|
|
+ where a.doc_id = b.doc_id
|
|
|
+ and a.CREATE_BY = #{uid}
|
|
|
+ order by a.update_time desc
|
|
|
+ </select>
|
|
|
+ <select id="selectDocShareReceive" resultType="com.jjt.doc.domain.DocShare">
|
|
|
+ select a.doc_id, a.UPDATE_TIME, b.doc_name, b.doc_type, b.doc_path
|
|
|
+ from (select t.*
|
|
|
+ from doc_share t,
|
|
|
+ doc_share_accepter t1
|
|
|
+ where t.doc_id = t1.doc_id
|
|
|
+ and t1.user_id = #{uid}) a,
|
|
|
+ doc_info b
|
|
|
+ where a.doc_id = b.doc_id
|
|
|
+ order by a.update_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
<insert id="insertDocShare" parameterType="DocShare">
|
|
|
insert into doc_share
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
@@ -55,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null">UPDATE_TIME,</if>
|
|
|
<if test="remark != null">REMARK,</if>
|
|
|
<if test="isDel != null">IS_DEL,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="docId != null">#{docId},</if>
|
|
|
<if test="docYear != null">#{docYear},</if>
|
|
|
@@ -67,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
<if test="isDel != null">#{isDel},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateDocShare" parameterType="DocShare">
|
|
|
@@ -87,11 +117,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteDocShareByDocId" parameterType="Long">
|
|
|
- delete from doc_share where DOC_ID = #{docId}
|
|
|
+ delete
|
|
|
+ from doc_share
|
|
|
+ where DOC_ID = #{docId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteDocShareByDocIds" parameterType="String">
|
|
|
- delete from doc_share where DOC_ID in
|
|
|
+ delete from doc_share where DOC_ID in
|
|
|
<foreach item="docId" collection="array" open="(" separator="," close=")">
|
|
|
#{docId}
|
|
|
</foreach>
|