<?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.xingxi.mq.server.order.mapper.PaymentInfoMqMapper">
    
    <resultMap type="PaymentInfo" id="PaymentInfoResult">
        <result property="payId"    column="payId"    />
        <result property="orderId"    column="orderId"    />
        <result property="orderNo"    column="orderNo"    />
        <result property="orderStatus"    column="orderStatus"    />
        <result property="payTime"    column="payTime"    />
        <result property="payKind"    column="payKind"    />
        <result property="sellerId"    column="sellerId"    />
        <result property="combineAppid"    column="combineAppid"    />
        <result property="combineMchid"    column="combineMchid"    />
        <result property="deviceId"    column="deviceId"    />
        <result property="payerClientIp"    column="payerClientIp"    />
        <result property="mchid"    column="mchid"    />
        <result property="outTradeNo"    column="outTradeNo"    />
        <result property="subMchid"    column="subMchid"    />
        <result property="subAttach"    column="subAttach"    />
        <result property="subDescription"    column="subDescription"    />
        <result property="payAmount"    column="payAmount"    />
        <result property="subCurrency"    column="subCurrency"    />
        <result property="profitSharing"    column="profitSharing"    />
        <result property="wxOpenId"    column="wxOpenId"    />
        <result property="notifyUrl"    column="notifyUrl"    />
        <result property="stateCode"    column="stateCode"    />
        <result property="prepayId"    column="prepayId"    />
        <result property="tradeType"    column="tradeType"    />
        <result property="tradeState"    column="tradeState"    />
        <result property="bankType"    column="bankType"    />
        <result property="successTime"    column="successTime"    />
        <result property="transactionId"    column="transactionId"    />
        <result property="wxOrderId"    column="wxOrderId"    />
        <result property="wxOrderStatus"    column="wxOrderStatus"    />
        <result property="delFlag"    column="delFlag"    />
        <result property="createUser"    column="createUser"    />
        <result property="createTime"    column="createTime"    />
        <result property="updateUser"    column="updateUser"    />
        <result property="updateTime"    column="updateTime"    />
    </resultMap>


    <sql id="selectPaymentInfoVo">
        select
            payId, orderId, orderNo, orderStatus, payTime, payKind, sellerId, combineAppid, combineMchid, deviceId,
            payerClientIp, mchid, outTradeNo, subMchid, subAttach, subDescription, payAmount, subCurrency,
            profitSharing, wxOpenId, notifyUrl, stateCode, prepayId, tradeType, tradeState, bankType, successTime,
            transactionId, wxOrderId, wxOrderStatus, delFlag, createUser, createTime, updateUser, updateTime
        from t_payment_info
    </sql>

    <update id="updateOrderStatusByOrderId" parameterType="PaymentInfo">
        update t_payment_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="orderStatus != null and orderStatus != ''">orderStatus = #{orderStatus},</if>
            <if test="payTime != null">payTime = #{payTime},</if>
            <if test="stateCode != null and stateCode != ''">stateCode = #{stateCode},</if>
            <if test="tradeState != null and tradeState != ''">tradeState = #{tradeState},</if>
            <if test="successTime != null">successTime = #{successTime},</if>
            <if test="updateUser != null and updateUser != ''">updateUser = #{updateUser},</if>
            <if test="updateTime != null">updateTime = #{updateTime},</if>
        </trim>
        where delFlag = '0'
            and orderId = #{orderId}
    </update>
</mapper>