<?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.PosFeedbackMapper">
    
    <resultMap type="PosFeedback" id="PosFeedbackResult">
        <result property="id"    column="id"    />
        <result property="contentCh"    column="content_ch"    />
        <result property="contentTw"    column="content_tw"    />
        <result property="contentUs"    column="content_us"    />
        <result property="contentVi"    column="content_vi"    />
    </resultMap>

    <sql id="selectPosFeedbackVo">
        select id, content_ch, content_tw, content_us, content_vi from pos_feedback
    </sql>

    <select id="selectPosFeedbackList" parameterType="PosFeedback" resultMap="PosFeedbackResult">
        <include refid="selectPosFeedbackVo"/>
        <where>  
        </where>
    </select>
    
    <select id="selectPosFeedbackById" parameterType="Long" resultMap="PosFeedbackResult">
        <include refid="selectPosFeedbackVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertPosFeedback" parameterType="PosFeedback" useGeneratedKeys="true" keyProperty="id">
        insert into pos_feedback
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="contentCh != null">content_ch,</if>
            <if test="contentTw != null">content_tw,</if>
            <if test="contentUs != null">content_us,</if>
            <if test="contentVi != null">content_vi,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="contentCh != null">#{contentCh},</if>
            <if test="contentTw != null">#{contentTw},</if>
            <if test="contentUs != null">#{contentUs},</if>
            <if test="contentVi != null">#{contentVi},</if>
         </trim>
    </insert>

    <update id="updatePosFeedback" parameterType="PosFeedback">
        update pos_feedback
        <trim prefix="SET" suffixOverrides=",">
            <if test="contentCh != null">content_ch = #{contentCh},</if>
            <if test="contentTw != null">content_tw = #{contentTw},</if>
            <if test="contentUs != null">content_us = #{contentUs},</if>
            <if test="contentVi != null">content_vi = #{contentVi},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deletePosFeedbackById" parameterType="Long">
        delete from pos_feedback where id = #{id}
    </delete>

    <delete id="deletePosFeedbackByIds" parameterType="String">
        delete from pos_feedback where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>