1、新增评论、回复功能

2、工具发布权限完善一部分
This commit is contained in:
pan
2024-08-30 19:47:45 +08:00
parent f0a14bcd3c
commit d732771032
24 changed files with 1069 additions and 32 deletions

View File

@@ -0,0 +1,103 @@
<?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.DiscussionsMapper">
<resultMap type="Discussions" id="DiscussionsResult">
<result property="id" column="id" />
<result property="businessId" column="business_id" />
<result property="type" column="type" />
<result property="content" column="content" />
<result property="isDelete" column="is_delete" />
<result property="createBy" column="create_by" />
<result property="createById" column="create_by_id" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateById" column="update_by_id" />
<result property="updateTime" column="update_time" />
<result property="nickName" column="nick_name" />
</resultMap>
<sql id="selectDiscussionsVo">
select id, business_id, type, content, is_delete, create_by, create_by_id, create_time, update_by, update_by_id, update_time from t_discussions
</sql>
<select id="selectDiscussionsList" parameterType="Discussions" resultMap="DiscussionsResult">
select td.*,su.nick_name
from t_discussions td
left join sys_user su on su.user_id = td.create_by_id
<where>
<if test="businessId != null and businessId != ''"> and td.business_id = #{businessId}</if>
<if test="type != null and type != ''"> and td.type = #{type}</if>
<if test="content != null and content != ''"> and td.content = #{content}</if>
<if test="isDelete != null and isDelete != ''"> and td.is_delete = #{isDelete}</if>
<if test="createById != null and createById != ''"> and td.create_by_id = #{createById}</if>
<if test="updateById != null and updateById != ''"> and td.update_by_id = #{updateById}</if>
and td.is_delete = '0'
</where>
</select>
<select id="selectDiscussionsById" parameterType="String" resultMap="DiscussionsResult">
<include refid="selectDiscussionsVo"/>
where id = #{id}
</select>
<insert id="insertDiscussions" parameterType="Discussions">
insert into t_discussions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="businessId != null">business_id,</if>
<if test="type != null">type,</if>
<if test="content != null">content,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createById != null">create_by_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateById != null">update_by_id,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="businessId != null">#{businessId},</if>
<if test="type != null">#{type},</if>
<if test="content != null">#{content},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createById != null">#{createById},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateById != null">#{updateById},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDiscussions" parameterType="Discussions">
update t_discussions
<trim prefix="SET" suffixOverrides=",">
<if test="businessId != null">business_id = #{businessId},</if>
<if test="type != null">type = #{type},</if>
<if test="content != null">content = #{content},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createById != null">create_by_id = #{createById},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateById != null">update_by_id = #{updateById},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDiscussionsById" parameterType="String">
delete from t_discussions where id = #{id}
</delete>
<delete id="deleteDiscussionsByIds" parameterType="String">
delete from t_discussions where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -38,15 +38,21 @@
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 td.doc_code = #{docCode}</if>
<if test="docCode != null and docCode != ''"> and td.doc_code like concat('%', #{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="docPrincipals != null and docPrincipals != ''"> and td.doc_principals like concat('%', #{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>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(td.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(td.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
and td.is_deleted = '0'
</where>
order by td.create_time desc

View File

@@ -0,0 +1,103 @@
<?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.RepliesMapper">
<resultMap type="Replies" id="RepliesResult">
<result property="id" column="id" />
<result property="discussionId" column="discussion_id" />
<result property="content" column="content" />
<result property="isDelete" column="is_delete" />
<result property="createBy" column="create_by" />
<result property="createById" column="create_by_id" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateById" column="update_by_id" />
<result property="updateTime" column="update_time" />
<result property="nickName" column="nick_name" />
</resultMap>
<sql id="selectRepliesVo">
select id, discussion_id, content, is_delete, create_by, create_by_id, create_time, update_by, update_by_id, update_time from t_replies
</sql>
<select id="selectRepliesList" parameterType="Replies" resultMap="RepliesResult">
select tr.*,su.nick_name
from t_replies tr
left join sys_user su on su.user_id = tr.create_by_id
<where>
<if test="discussionId != null and discussionId != ''"> and tr.discussion_id = #{discussionId}</if>
<if test="content != null and content != ''"> and tr.content = #{content}</if>
<if test="createById != null and createById != ''"> and tr.create_by_id = #{createById}</if>
<if test="updateById != null and updateById != ''"> and tr.update_by_id = #{updateById}</if>
<if test="discussionIdList != null and discussionIdList.size() > 0">
and tr.discussion_id in
<foreach item="id" index="index" collection="discussionIdList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
and tr.is_delete = '0'
</where>
</select>
<select id="selectRepliesById" parameterType="String" resultMap="RepliesResult">
<include refid="selectRepliesVo"/>
where id = #{id}
</select>
<insert id="insertReplies" parameterType="Replies">
insert into t_replies
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="discussionId != null">discussion_id,</if>
<if test="content != null">content,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createById != null">create_by_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateById != null">update_by_id,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="discussionId != null">#{discussionId},</if>
<if test="content != null">#{content},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createById != null">#{createById},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateById != null">#{updateById},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateReplies" parameterType="Replies">
update t_replies
<trim prefix="SET" suffixOverrides=",">
<if test="discussionId != null">discussion_id = #{discussionId},</if>
<if test="content != null">content = #{content},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createById != null">create_by_id = #{createById},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateById != null">update_by_id = #{updateById},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRepliesById" parameterType="String">
delete from t_replies where id = #{id}
</delete>
<delete id="deleteRepliesByIds" parameterType="String">
delete from t_replies where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -145,8 +145,11 @@
<select id="selectToolList" parameterType="Tool" resultMap="ToolResult">
select u.tool_id, u.tool_code, u.tool_name, u.tool_type, u.tool_source, u.tool_use, u.test_situation, u.function_desc, u.apply_condition, u.operate_explain,u.record_status,u.proc_inst_id,
u.tool_principals, u.tool_principals_name, u.tool_resp_dept, u.status, u.create_by, u.create_time, u.remark, d.dept_name as tool_resp_dept_name,u.association from t_tool u
left join sys_dept d on u.tool_resp_dept = d.dept_id
u.tool_principals, u.tool_principals_name, u.tool_resp_dept, u.status, u.create_by, u.create_time, u.remark, sd.dept_name as tool_resp_dept_name,u.association
from t_tool u
left join sys_user su on u.create_by = su.user_id
left join sys_dept d on d.dept_id = su.dept_Id
left join sys_dept sd on u.tool_resp_dept = sd.dept_id
where 1=1
and u.record_status != 'cancel'
<if test="toolId != null and toolId != ''">
@@ -176,6 +179,7 @@
<if test="recordStatus != null and recordStatus != ''">
AND u.record_status = #{recordStatus}
</if>
${params.dataScope}
order by create_time desc
</select>