增加信息反馈

This commit is contained in:
menxipeng
2025-08-21 12:29:41 +08:00
parent d74bc93b2c
commit 3f2de012ec
11 changed files with 1046 additions and 4 deletions

View File

@@ -0,0 +1,62 @@
package com.ruoyi.system.mapper;
import com.ruoyi.common.core.domain.entity.UserFeedback;
import java.util.List;
/**
* 用户反馈Mapper接口
*
* @author ruoyi
* @date 2025-08-21
*/
public interface UserFeedbackMapper
{
/**
* 查询用户反馈
*
* @param id 用户反馈主键
* @return 用户反馈
*/
public UserFeedback selectUserFeedbackById(String id);
/**
* 查询用户反馈列表
*
* @param userFeedback 用户反馈
* @return 用户反馈集合
*/
public List<UserFeedback> selectUserFeedbackList(UserFeedback userFeedback);
/**
* 新增用户反馈
*
* @param userFeedback 用户反馈
* @return 结果
*/
public int insertUserFeedback(UserFeedback userFeedback);
/**
* 修改用户反馈
*
* @param userFeedback 用户反馈
* @return 结果
*/
public int updateUserFeedback(UserFeedback userFeedback);
/**
* 删除用户反馈
*
* @param id 用户反馈主键
* @return 结果
*/
public int deleteUserFeedbackById(String id);
/**
* 批量删除用户反馈
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteUserFeedbackByIds(String[] ids);
}

View File

@@ -0,0 +1,62 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.UserFeedback;
import java.util.List;
/**
* 用户反馈Service接口
*
* @author ruoyi
* @date 2025-08-21
*/
public interface IUserFeedbackService
{
/**
* 查询用户反馈
*
* @param id 用户反馈主键
* @return 用户反馈
*/
public UserFeedback selectUserFeedbackById(String id);
/**
* 查询用户反馈列表
*
* @param userFeedback 用户反馈
* @return 用户反馈集合
*/
public List<UserFeedback> selectUserFeedbackList(UserFeedback userFeedback);
/**
* 新增用户反馈
*
* @param userFeedback 用户反馈
* @return 结果
*/
public int insertUserFeedback(UserFeedback userFeedback);
/**
* 修改用户反馈
*
* @param userFeedback 用户反馈
* @return 结果
*/
public int updateUserFeedback(UserFeedback userFeedback);
/**
* 批量删除用户反馈
*
* @param ids 需要删除的用户反馈主键集合
* @return 结果
*/
public int deleteUserFeedbackByIds(String[] ids);
/**
* 删除用户反馈信息
*
* @param id 用户反馈主键
* @return 结果
*/
public int deleteUserFeedbackById(String id);
}

View File

@@ -0,0 +1,94 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.domain.entity.UserFeedback;
import com.ruoyi.system.mapper.UserFeedbackMapper;
import com.ruoyi.system.service.IUserFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 用户反馈Service业务层处理
*
* @author ruoyi
* @date 2025-08-21
*/
@Service
public class UserFeedbackServiceImpl implements IUserFeedbackService
{
@Autowired
private UserFeedbackMapper userFeedbackMapper;
/**
* 查询用户反馈
*
* @param id 用户反馈主键
* @return 用户反馈
*/
@Override
public UserFeedback selectUserFeedbackById(String id)
{
return userFeedbackMapper.selectUserFeedbackById(id);
}
/**
* 查询用户反馈列表
*
* @param userFeedback 用户反馈
* @return 用户反馈
*/
@Override
public List<UserFeedback> selectUserFeedbackList(UserFeedback userFeedback)
{
return userFeedbackMapper.selectUserFeedbackList(userFeedback);
}
/**
* 新增用户反馈
*
* @param userFeedback 用户反馈
* @return 结果
*/
@Override
public int insertUserFeedback(UserFeedback userFeedback)
{
return userFeedbackMapper.insertUserFeedback(userFeedback);
}
/**
* 修改用户反馈
*
* @param userFeedback 用户反馈
* @return 结果
*/
@Override
public int updateUserFeedback(UserFeedback userFeedback)
{
return userFeedbackMapper.updateUserFeedback(userFeedback);
}
/**
* 批量删除用户反馈
*
* @param ids 需要删除的用户反馈主键
* @return 结果
*/
@Override
public int deleteUserFeedbackByIds(String[] ids)
{
return userFeedbackMapper.deleteUserFeedbackByIds(ids);
}
/**
* 删除用户反馈信息
*
* @param id 用户反馈主键
* @return 结果
*/
@Override
public int deleteUserFeedbackById(String id)
{
return userFeedbackMapper.deleteUserFeedbackById(id);
}
}

View File

@@ -0,0 +1,101 @@
<?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.ruoyi.system.mapper.UserFeedbackMapper">
<resultMap type="UserFeedback" id="UserFeedbackResult">
<result property="id" column="id" />
<result property="feedbackContent" column="feedback_content" />
<result property="userName" column="user_name" />
<result property="contactType" column="contact_type" />
<result property="contactInfo" column="contact_info" />
<result property="status" column="status" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="ipAddress" column="ip_address" />
<result property="userAgent" column="user_agent" />
<result property="attachmentPath" column="attachment_path" />
</resultMap>
<sql id="selectUserFeedbackVo">
select id, feedback_content, user_name, contact_type, contact_info, status, created_at, updated_at, ip_address, user_agent, attachment_path from user_feedback
</sql>
<select id="selectUserFeedbackList" parameterType="UserFeedback" resultMap="UserFeedbackResult">
<include refid="selectUserFeedbackVo"/>
<where>
<if test="feedbackContent != null and feedbackContent != ''"> and feedback_content = #{feedbackContent}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="contactType != null and contactType != ''"> and contact_type = #{contactType}</if>
<if test="contactInfo != null and contactInfo != ''"> and contact_info = #{contactInfo}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
<if test="userAgent != null and userAgent != ''"> and user_agent = #{userAgent}</if>
<if test="attachmentPath != null and attachmentPath != ''"> and attachment_path = #{attachmentPath}</if>
</where>
</select>
<select id="selectUserFeedbackById" parameterType="String" resultMap="UserFeedbackResult">
<include refid="selectUserFeedbackVo"/>
where id = #{id}
</select>
<insert id="insertUserFeedback" parameterType="UserFeedback" useGeneratedKeys="true" keyProperty="id">
insert into user_feedback
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="feedbackContent != null and feedbackContent != ''">feedback_content,</if>
<if test="userName != null">user_name,</if>
<if test="contactType != null">contact_type,</if>
<if test="contactInfo != null">contact_info,</if>
<if test="status != null">status,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="ipAddress != null">ip_address,</if>
<if test="userAgent != null">user_agent,</if>
<if test="attachmentPath != null">attachment_path,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="feedbackContent != null and feedbackContent != ''">#{feedbackContent},</if>
<if test="userName != null">#{userName},</if>
<if test="contactType != null">#{contactType},</if>
<if test="contactInfo != null">#{contactInfo},</if>
<if test="status != null">#{status},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="ipAddress != null">#{ipAddress},</if>
<if test="userAgent != null">#{userAgent},</if>
<if test="attachmentPath != null">#{attachmentPath},</if>
</trim>
</insert>
<update id="updateUserFeedback" parameterType="UserFeedback">
update user_feedback
<trim prefix="SET" suffixOverrides=",">
<if test="feedbackContent != null and feedbackContent != ''">feedback_content = #{feedbackContent},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="contactType != null">contact_type = #{contactType},</if>
<if test="contactInfo != null">contact_info = #{contactInfo},</if>
<if test="status != null">status = #{status},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
<if test="userAgent != null">user_agent = #{userAgent},</if>
<if test="attachmentPath != null">attachment_path = #{attachmentPath},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserFeedbackById" parameterType="String">
delete from user_feedback where id = #{id}
</delete>
<delete id="deleteUserFeedbackByIds" parameterType="String">
delete from user_feedback where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>