1、发布工具流程-关联工具细节调整

2、文档资源管理调整
This commit is contained in:
pan
2024-08-29 22:01:03 +08:00
parent f1b84cb823
commit f0a14bcd3c
19 changed files with 995 additions and 53 deletions

View File

@@ -0,0 +1,161 @@
<?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.rzdata.web.mapper.AttachmentMapper">
<resultMap type="Attachment" id="AttachmentResult">
<result property="id" column="id" />
<result property="bizType" column="biz_type" />
<result property="fileUrl" column="file_url" />
<result property="fileOldName" column="file_old_name" />
<result property="fileNewName" column="file_new_name" />
<result property="suffixType" column="suffix_type" />
<result property="fileSize" column="file_size" />
<result property="businessId" column="business_id" />
<result property="sorts" column="sorts" />
<result property="remark" column="remark" />
<result property="del" column="del" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="failureTime" column="failure_time" />
</resultMap>
<sql id="selectAttachmentVo">
select id, biz_type, file_url, file_old_name, file_new_name, suffix_type, file_size, business_id, sorts, remark, del, create_by, create_date, update_by, update_date, failure_time from t_attachment
</sql>
<select id="selectAttachmentList" parameterType="Attachment" resultMap="AttachmentResult">
<include refid="selectAttachmentVo"/>
<where>
<if test="bizType != null and bizType != ''"> and biz_type = #{bizType}</if>
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
<if test="fileOldName != null and fileOldName != ''"> and file_old_name like concat('%', #{fileOldName}, '%')</if>
<if test="fileNewName != null and fileNewName != ''"> and file_new_name like concat('%', #{fileNewName}, '%')</if>
<if test="suffixType != null and suffixType != ''"> and suffix_type = #{suffixType}</if>
<if test="fileSize != null "> and file_size = #{fileSize}</if>
<if test="businessId != null and businessId != ''"> and business_id = #{businessId}</if>
<if test="sorts != null "> and sorts = #{sorts}</if>
<if test="del != null "> and del = #{del}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="failureTime != null "> and failure_time = #{failureTime}</if>
<if test="businessIds != null and businessIds.size() > 0">
and business_id in
<foreach item="id" index="index" collection="businessIds" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>
<select id="selectAttachmentById" parameterType="String" resultMap="AttachmentResult">
<include refid="selectAttachmentVo"/>
where id = #{id}
</select>
<insert id="insertAttachment" parameterType="Attachment">
insert into t_attachment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="bizType != null">biz_type,</if>
<if test="fileUrl != null">file_url,</if>
<if test="fileOldName != null">file_old_name,</if>
<if test="fileNewName != null">file_new_name,</if>
<if test="suffixType != null">suffix_type,</if>
<if test="fileSize != null">file_size,</if>
<if test="businessId != null">business_id,</if>
<if test="sorts != null">sorts,</if>
<if test="remark != null">remark,</if>
<if test="del != null">del,</if>
<if test="createBy != null">create_by,</if>
<if test="createDate != null">create_date,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateDate != null">update_date,</if>
<if test="failureTime != null">failure_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="bizType != null">#{bizType},</if>
<if test="fileUrl != null">#{fileUrl},</if>
<if test="fileOldName != null">#{fileOldName},</if>
<if test="fileNewName != null">#{fileNewName},</if>
<if test="suffixType != null">#{suffixType},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="businessId != null">#{businessId},</if>
<if test="sorts != null">#{sorts},</if>
<if test="remark != null">#{remark},</if>
<if test="del != null">#{del},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createDate != null">#{createDate},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateDate != null">#{updateDate},</if>
<if test="failureTime != null">#{failureTime},</if>
</trim>
</insert>
<update id="updateAttachment" parameterType="Attachment">
update t_attachment
<trim prefix="SET" suffixOverrides=",">
<if test="bizType != null">biz_type = #{bizType},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="fileOldName != null">file_old_name = #{fileOldName},</if>
<if test="fileNewName != null">file_new_name = #{fileNewName},</if>
<if test="suffixType != null">suffix_type = #{suffixType},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="businessId != null">business_id = #{businessId},</if>
<if test="sorts != null">sorts = #{sorts},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="del != null">del = #{del},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createDate != null">create_date = #{createDate},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateDate != null">update_date = #{updateDate},</if>
<if test="failureTime != null">failure_time = #{failureTime},</if>
</trim>
where id = #{id}
</update>
<update id="updateAttachmentByBusinessId" parameterType="Attachment">
update t_attachment
<trim prefix="SET" suffixOverrides=",">
<if test="bizType != null">biz_type = #{bizType},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="fileOldName != null">file_old_name = #{fileOldName},</if>
<if test="fileNewName != null">file_new_name = #{fileNewName},</if>
<if test="suffixType != null">suffix_type = #{suffixType},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="sorts != null">sorts = #{sorts},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="del != null">del = #{del},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createDate != null">create_date = #{createDate},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateDate != null">update_date = #{updateDate},</if>
<if test="failureTime != null">failure_time = #{failureTime},</if>
</trim>
where business_id = #{businessId}
</update>
<delete id="deleteAttachmentById" parameterType="String">
delete from t_attachment where id = #{id}
</delete>
<delete id="deleteAttachmentByIds" parameterType="String">
delete from t_attachment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteAttachmentByBusinessId" parameterType="java.util.List">
delete from t_attachment where business_id in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -20,26 +20,36 @@
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="docCategoryId" column="doc_category_id" />
<result property="isDeleted" column="is_deleted" />
<result property="toolId" column="tool_id" />
<result property="toolName" column="tool_name" />
<result property="docRespDeptName" column="doc_resp_dept_name" />
</resultMap>
<sql id="selectDocumentVo">
select doc_id, doc_code, doc_name, doc_type, doc_principals, doc_resp_dept,
doc_source, doc_status, doc_url, create_by, create_time,
update_by, update_time, remark, doc_category_id from t_document
update_by, update_time, remark, doc_category_id,is_deleted,tool_id from t_document
</sql>
<select id="selectDocumentList" parameterType="Document" resultMap="DocumentResult">
<include refid="selectDocumentVo"/>
select td.*, t_tool.tool_name as tool_name,sys_dept.dept_name as doc_resp_dept_name
from t_document td
left join t_tool on t_tool.tool_id = td.tool_id
left join sys_dept on sys_dept.dept_id = td.doc_resp_dept
<where>
<if test="docCode != null and docCode != ''"> and doc_code = #{docCode}</if>
<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="docPrincipals != null and docPrincipals != ''"> and doc_principals = #{docPrincipals}</if>
<if test="docRespDept != null and docRespDept != ''"> and doc_resp_dept = #{docRespDept}</if>
<if test="docSource != null and docSource != ''"> and doc_source = #{docSource}</if>
<if test="docStatus != null and docStatus != ''"> and doc_status = #{docStatus}</if>
<if test="docCategoryId != null and docCategoryId != ''"> and doc_category_id = #{docCategoryId}</if>
<if test="docCode != null and docCode != ''"> and td.doc_code = #{docCode}</if>
<if test="docName != null and docName != ''"> and td.doc_name like concat('%', #{docName}, '%')</if>
<if test="docType != null and docType != ''"> and td.doc_type = #{docType}</if>
<if test="docPrincipals != null and docPrincipals != ''"> and td.doc_principals = #{docPrincipals}</if>
<if test="docRespDept != null and docRespDept != ''"> and td.doc_resp_dept = #{docRespDept}</if>
<if test="docSource != null and docSource != ''"> and td.doc_source = #{docSource}</if>
<if test="docStatus != null and docStatus != ''"> and td.doc_status = #{docStatus}</if>
<if test="toolId != null and toolId != ''"> and td.tool_id = #{toolId}</if>
<if test="docCategoryId != null and docCategoryId != ''"> and td.doc_category_id = #{docCategoryId}</if>
and td.is_deleted = '0'
</where>
order by td.create_time desc
</select>
<select id="selectDocumentById" parameterType="String" resultMap="DocumentResult">
@@ -65,6 +75,10 @@
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="docCategoryId != null">doc_category_id,</if>
<if test="createById != null and createById != ''">create_by_id,</if>
<if test="updateById != null">update_by_id,</if>
<if test="isDeleted != null">is_deleted,</if>
<if test="toolId != null">tool_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="docId != null">#{docId},</if>
@@ -81,7 +95,11 @@
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="docCategoryId != null">#{doc_category_id},</if>
<if test="docCategoryId != null">#{docCategoryId},</if>
<if test="createById != null and createById != ''">#{createById},</if>
<if test="updateById != null">#{updateById},</if>
<if test="isDeleted != null">#{isDeleted},</if>
<if test="toolId != null">#{toolId},</if>
</trim>
</insert>
@@ -101,7 +119,11 @@
<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="docCategoryId != null">docCategoryId = #{doc_category_id},</if>
<if test="docCategoryId != null">doc_category_id = #{docCategoryId},</if>
<if test="isDeleted != null">is_deleted = #{isDeleted},</if>
<if test="updateById != null">update_by_id = #{updateById},</if>
<if test="createById != null">create_by_id = #{createById},</if>
<if test="toolId != null">tool_id = #{toolId},</if>
</trim>
where doc_id = #{docId}
</update>
@@ -110,10 +132,29 @@
delete from t_document where doc_id = #{id}
</delete>
<delete id="deleteDocumentByIds" parameterType="String">
<delete id="isDeleteDocumentByIds" parameterType="Document">
<if test="ids != null and ids.size() > 0">
update t_document set is_deleted = '1' ,update_by_id = #{updateById},update_by = #{updateBy},update_time = #{updateTime} where doc_id in
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</delete>
<update id="updatePushDoc" parameterType="Document">
<if test="ids != null and ids.size() > 0">
update t_document set doc_status = #{docStatus} ,update_by_id = #{updateById},update_by = #{updateBy},update_time = #{updateTime} where doc_id in
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</update>
<delete id="batchDeleteById" parameterType="java.util.List">
delete from t_document where doc_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>