You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
3.3 KiB
75 lines
3.3 KiB
<?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.zdxt.knowledge.mapper.UserFeedbackMapper">
|
|
|
|
<resultMap type="com.zdxt.knowledge.domain.UserFeedback" id="UserFeedbackResult">
|
|
<result property="guid" column="guid"/>
|
|
<result property="content" column="content"/>
|
|
<result property="userId" column="user_id"/>
|
|
<result property="nickname" column="nickname"/>
|
|
<result property="city" column="city"/>
|
|
<result property="mobile" column="mobile"/>
|
|
<result property="creator" column="creator"/>
|
|
<result property="createTime" column="create_time"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectUserFeedbackVo">
|
|
select guid,
|
|
content,
|
|
user_id,
|
|
nickname,
|
|
city,
|
|
mobile,
|
|
creator,
|
|
create_time
|
|
from user_feedback
|
|
</sql>
|
|
|
|
<select id="selectUserFeedbackList" parameterType="UserFeedback" resultMap="UserFeedbackResult">
|
|
<include refid="selectUserFeedbackVo"/>
|
|
<where>
|
|
<if test="content != null and content != ''">and `content` like concat('%', #{content}, '%')</if>
|
|
<if test="nickname != null and nickname != ''">and nickname = #{nickname}</if>
|
|
<if test="mobile != null and mobile != ''">and mobile = #{mobile}</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="selectUserFeedbackById" parameterType="String" resultMap="UserFeedbackResult">
|
|
<include refid="selectUserFeedbackVo"/>
|
|
where guid = #{guid}
|
|
</select>
|
|
|
|
<insert id="insertUserFeedback" parameterType="UserFeedback">
|
|
insert into user_feedback
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="guid != null ">guid,</if>
|
|
<if test="content != null and content != ''">`content`,</if>
|
|
<if test="userId != null and userId != ''">`user_id`,</if>
|
|
<if test="nickname != null and nickname != ''">`nickname`,</if>
|
|
<if test="city != null and city != ''">`city`,</if>
|
|
<if test="mobile != null and mobile != ''">`mobile`,</if>
|
|
<if test="creator != null and creator != ''">creator,</if>
|
|
<if test="createTime != null ">create_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="guid != null ">#{guid},</if>
|
|
<if test="content != null and content != ''">#{content},</if>
|
|
<if test="userId != null and userId != ''">#{userId},</if>
|
|
<if test="nickname != null and nickname != ''">#{nickname},</if>
|
|
<if test="city != null and city != ''">#{city},</if>
|
|
<if test="mobile != null and mobile != ''">#{mobile},</if>
|
|
<if test="creator != null and creator != ''">#{creator},</if>
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<delete id="deleteUserFeedbackByIds" parameterType="String">
|
|
delete from user_feedback where guid in
|
|
<foreach item="guid" collection="array" open="(" separator="," close=")">
|
|
#{guid}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper>
|