1、新增评论、回复功能
2、工具发布权限完善一部分
This commit is contained in:
103
tool-tech-admin/src/main/resources/mapper/DiscussionsMapper.xml
Normal file
103
tool-tech-admin/src/main/resources/mapper/DiscussionsMapper.xml
Normal 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>
|
||||
Reference in New Issue
Block a user