|
@@ -0,0 +1,108 @@
|
|
|
|
+<?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.fs.his.mapper.FsUserComplaintMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="FsUserComplaint" id="FsUserComplaintResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
|
+ <result property="userName" column="user_name" />
|
|
|
|
+ <result property="templateId" column="template_id" />
|
|
|
|
+ <result property="content" column="content" />
|
|
|
|
+ <result property="phone" column="phone" />
|
|
|
|
+ <result property="urls" column="urls" />
|
|
|
|
+ <result property="tradeImage" column="trade_image" />
|
|
|
|
+ <result property="account" column="account" />
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
+ <result property="isHandle" column="is_handle" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectFsUserComplaintVo">
|
|
|
|
+ select id, user_id,user_name template_id, content, phone, urls,trade_image, account, create_time, is_handle, remarks from fs_user_complaint
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectFsUserComplaintList" parameterType="FsUserComplaint" resultType="com.fs.his.vo.FsUserComplaintVo">
|
|
|
|
+ select id, user_name, template_id, content, phone, urls,trade_image, account, create_time, is_handle, remarks
|
|
|
|
+ from fs_user_complaint c
|
|
|
|
+ <where>
|
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
+ <if test="userName != null and userName != ''"> and user_name like concat('%',#{userName},'%') </if>
|
|
|
|
+ <if test="templateId != null "> and template_id = #{templateId}</if>
|
|
|
|
+ <if test="content != null and content != ''"> and content = #{content}</if>
|
|
|
|
+ <if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
|
+ <if test="urls != null and urls != ''"> and urls = #{urls}</if>
|
|
|
|
+ <if test="tradeImage != null and tradeImage != ''"> and trade_image = #{tradeImage}</if>
|
|
|
|
+ <if test="account != null and account != ''"> and account = #{account}</if>
|
|
|
|
+ <if test="isHandle != null "> and is_handle = #{isHandle}</if>
|
|
|
|
+ <if test="complaintsTime != null "> and create_time >= #{complaintsTime}</if>
|
|
|
|
+ <if test="complainteTime != null "> and create_time < date_add(#{complainteTime}, interval 1 day)</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectFsUserComplaintById" parameterType="Long" resultType="com.fs.his.vo.FsUserComplaintVo">
|
|
|
|
+ select c.id, c.user_name, c.template_id, c.content, c.phone, c.urls,c.trade_image, c.account, c.create_time, c.is_handle,t.name,c.remarks
|
|
|
|
+ from fs_user_complaint c
|
|
|
|
+ left join fs_complaint_template t on c.template_id = t.id
|
|
|
|
+ where c.id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertFsUserComplaint" parameterType="FsUserComplaint" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
+ insert into fs_user_complaint
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
|
+ <if test="userName != null">user_name,</if>
|
|
|
|
+ <if test="templateId != null">template_id,</if>
|
|
|
|
+ <if test="content != null">content,</if>
|
|
|
|
+ <if test="phone != null">phone,</if>
|
|
|
|
+ <if test="urls != null">urls,</if>
|
|
|
|
+ <if test="tradeImage != null">trade_image,</if>
|
|
|
|
+ <if test="account != null">account,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="isHandle != null">is_handle,</if>
|
|
|
|
+ <if test="remarks != null">remarks,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
|
+ <if test="userName != null">#{userName},</if>
|
|
|
|
+ <if test="templateId != null">#{templateId},</if>
|
|
|
|
+ <if test="content != null">#{content},</if>
|
|
|
|
+ <if test="phone != null">#{phone},</if>
|
|
|
|
+ <if test="urls != null">#{urls},</if>
|
|
|
|
+ <if test="tradeImage != null">#{tradeImage},</if>
|
|
|
|
+ <if test="account != null">#{account},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="isHandle != null">#{isHandle},</if>
|
|
|
|
+ <if test="remarks != null">#{remarks},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateFsUserComplaint" parameterType="FsUserComplaint">
|
|
|
|
+ update fs_user_complaint
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
|
+ <if test="userName != null and userName !=''">user_name = #{userName},</if>
|
|
|
|
+ <if test="templateId != null">template_id = #{templateId},</if>
|
|
|
|
+ <if test="content != null">content = #{content},</if>
|
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
|
+ <if test="urls != null and urls !=''">urls = #{urls},</if>
|
|
|
|
+ <if test="tradeImage != null and tradeImage !=''">trade_image = #{tradeImage},</if>
|
|
|
|
+ <if test="account != null">account = #{account},</if>
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
+ <if test="isHandle != null">is_handle = #{isHandle},</if>
|
|
|
|
+ <if test="remarks != null">remarks = #{remarks},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteFsUserComplaintById" parameterType="Long">
|
|
|
|
+ delete from fs_user_complaint where id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteFsUserComplaintByIds" parameterType="String">
|
|
|
|
+ delete from fs_user_complaint where id in
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|