123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <?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.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"/>
- </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
- </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>
- </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.*, 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" parameterType="DocShare" resultType="com.jjt.doc.domain.DocShare">
- select a.*, b.doc_name, b.doc_type, b.doc_path, b.create_by user
- from (select t.*
- from doc_share t,
- doc_share_accepter t1
- where t.doc_id = t1.doc_id
- and t1.user_id = #{searchValue}) a,
- doc_info b
- <where>
- a.doc_id = b.doc_id
- <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="createBy != null ">and CREATE_BY = #{createBy}</if>
- <if test="params.tagId!=null and params.tagId!=''">and b.doc_id in(select doc_id from DOC_TAG_RELA where
- tag_id=#{params.tagId})
- </if>
- </where>
- order by a.update_time desc
- </select>
- <insert id="insertDocShare" parameterType="DocShare">
- insert into doc_share
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="docId != null">DOC_ID,</if>
- <if test="docYear != null">DOC_YEAR,</if>
- <if test="isSecret != null">IS_SECRET,</if>
- <if test="onlyOneTime != null">ONLY_ONE_TIME,</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="docId != null">#{docId},</if>
- <if test="docYear != null">#{docYear},</if>
- <if test="isSecret != null">#{isSecret},</if>
- <if test="onlyOneTime != null">#{onlyOneTime},</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="updateDocShare" parameterType="DocShare">
- update doc_share
- <trim prefix="SET" suffixOverrides=",">
- <if test="docYear != null">DOC_YEAR = #{docYear},</if>
- <if test="isSecret != null">IS_SECRET = #{isSecret},</if>
- <if test="onlyOneTime != null">ONLY_ONE_TIME = #{onlyOneTime},</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="deleteDocShareByDocId" parameterType="Long">
- delete
- from doc_share
- where DOC_ID = #{docId}
- </delete>
- <delete id="deleteDocShareByDocIds" parameterType="String">
- delete from doc_share where DOC_ID in
- <foreach item="docId" collection="array" open="(" separator="," close=")">
- #{docId}
- </foreach>
- </delete>
- </mapper>
|