TOrderFeedbackMapper.xml 5.36 KB
Newer Older
1 2 3 4 5 6 7 8 9
<?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.zehong.system.mapper.TOrderFeedbackMapper">
    
    <resultMap type="TOrderFeedback" id="TOrderFeedbackResult">
        <result property="feedbackId"    column="feedback_id"    />
        <result property="orderId"    column="order_id"    />
10
        <result property="deviceId"    column="device_id"    />
11 12 13 14 15 16 17 18 19 20
        <result property="contents"    column="contents"    />
        <result property="feedbackTime"    column="feedback_time"    />
        <result property="isHiddenDanger"    column="is_hidden_danger"    />
        <result property="dealStatus"    column="deal_status"    />
        <result property="pictureUrl1"    column="picture_url_1"    />
        <result property="pictureUrl2"    column="picture_url_2"    />
        <result property="pictureUrl3"    column="picture_url_3"    />
    </resultMap>

    <sql id="selectTOrderFeedbackVo">
21
        select feedback_id, order_id, device_id, contents, feedback_time, is_hidden_danger, deal_status, picture_url_1, picture_url_2, picture_url_3 from t_order_feedback
22 23 24 25 26 27
    </sql>

    <select id="selectTOrderFeedbackList" parameterType="TOrderFeedback" resultMap="TOrderFeedbackResult">
        <include refid="selectTOrderFeedbackVo"/>
        <where>  
            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
28
            <if test="deviceId != null "> and device_id = #{deviceId}</if>
29 30 31 32 33 34 35 36 37 38
            <if test="contents != null  and contents != ''"> and contents = #{contents}</if>
            <if test="feedbackTime != null "> and feedback_time = #{feedbackTime}</if>
            <if test="isHiddenDanger != null  and isHiddenDanger != ''"> and is_hidden_danger = #{isHiddenDanger}</if>
            <if test="dealStatus != null  and dealStatus != ''"> and deal_status = #{dealStatus}</if>
            <if test="pictureUrl1 != null  and pictureUrl1 != ''"> and picture_url_1 = #{pictureUrl1}</if>
            <if test="pictureUrl2 != null  and pictureUrl2 != ''"> and picture_url_2 = #{pictureUrl2}</if>
            <if test="pictureUrl3 != null  and pictureUrl3 != ''"> and picture_url_3 = #{pictureUrl3}</if>
        </where>
    </select>
    
王晓倩's avatar
王晓倩 committed
39
    <select id="selectTOrderFeedbackById" parameterType="int" resultMap="TOrderFeedbackResult">
40 41 42
        <include refid="selectTOrderFeedbackVo"/>
        where feedback_id = #{feedbackId}
    </select>
王晓倩's avatar
王晓倩 committed
43 44 45 46 47 48 49

    <select id="selectTOrderFeedbackByOrderId" parameterType="String" resultMap="TOrderFeedbackResult">
        <include refid="selectTOrderFeedbackVo"/>
        where order_id = #{orderId}
        order by feedback_time desc
    </select>

50 51 52 53
    <insert id="insertTOrderFeedback" parameterType="TOrderFeedback">
        insert into t_order_feedback
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="orderId != null">order_id,</if>
54
            <if test="deviceId != null">device_id,</if>
55 56 57 58 59 60 61 62 63 64
            <if test="contents != null">contents,</if>
            <if test="feedbackTime != null">feedback_time,</if>
            <if test="isHiddenDanger != null">is_hidden_danger,</if>
            <if test="dealStatus != null">deal_status,</if>
            <if test="pictureUrl1 != null">picture_url_1,</if>
            <if test="pictureUrl2 != null">picture_url_2,</if>
            <if test="pictureUrl3 != null">picture_url_3,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="orderId != null">#{orderId},</if>
65
            <if test="deviceId != null">#{deviceId},</if>
66 67 68 69 70 71 72 73 74 75 76 77 78 79
            <if test="contents != null">#{contents},</if>
            <if test="feedbackTime != null">#{feedbackTime},</if>
            <if test="isHiddenDanger != null">#{isHiddenDanger},</if>
            <if test="dealStatus != null">#{dealStatus},</if>
            <if test="pictureUrl1 != null">#{pictureUrl1},</if>
            <if test="pictureUrl2 != null">#{pictureUrl2},</if>
            <if test="pictureUrl3 != null">#{pictureUrl3},</if>
         </trim>
    </insert>

    <update id="updateTOrderFeedback" parameterType="TOrderFeedback">
        update t_order_feedback
        <trim prefix="SET" suffixOverrides=",">
            <if test="orderId != null">order_id = #{orderId},</if>
80
            <if test="deviceId != null">device_id = #{deviceId},</if>
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
            <if test="contents != null">contents = #{contents},</if>
            <if test="feedbackTime != null">feedback_time = #{feedbackTime},</if>
            <if test="isHiddenDanger != null">is_hidden_danger = #{isHiddenDanger},</if>
            <if test="dealStatus != null">deal_status = #{dealStatus},</if>
            <if test="pictureUrl1 != null">picture_url_1 = #{pictureUrl1},</if>
            <if test="pictureUrl2 != null">picture_url_2 = #{pictureUrl2},</if>
            <if test="pictureUrl3 != null">picture_url_3 = #{pictureUrl3},</if>
        </trim>
        where feedback_id = #{feedbackId}
    </update>

    <delete id="deleteTOrderFeedbackById" parameterType="Long">
        delete from t_order_feedback where feedback_id = #{feedbackId}
    </delete>

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