|
@@ -0,0 +1,199 @@
|
|
|
+<?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.mofangchuxing.aska.dao.mapper.PayRequestMapper">
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.PayRequest">
|
|
|
+ <id property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="requestBody" column="request_body" jdbcType="VARCHAR"/>
|
|
|
+ <result property="orderSn" column="order_sn" jdbcType="VARCHAR"/>
|
|
|
+ <result property="openId" column="open_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
|
|
|
+ <result property="orderId" column="order_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="amount" column="amount" jdbcType="DECIMAL"/>
|
|
|
+ <result property="itemId" column="item_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="itemName" column="item_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="itemType" column="item_type" jdbcType="INTEGER"/>
|
|
|
+ <result property="itemChannel" column="item_channel" jdbcType="VARCHAR"/>
|
|
|
+ <result property="payChannel" column="pay_channel" jdbcType="INTEGER"/>
|
|
|
+ <result property="payStatus" column="pay_status" jdbcType="BIGINT"/>
|
|
|
+ <result property="payAmount" column="pay_amount" jdbcType="DECIMAL"/>
|
|
|
+ <result property="payTime" column="pay_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="callbackUrl" column="callback_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="modifiedTime" column="modified_time" jdbcType="TIMESTAMP"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id,request_body,order_sn,
|
|
|
+ open_id,mobile,order_id,
|
|
|
+ amount,item_id,item_name,item_type,
|
|
|
+ item_channel,pay_channel,pay_status,pay_amount,pay_time,callback_url,create_time,
|
|
|
+ modified_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from pay_request
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <select id="selectByOrderSn" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from pay_request
|
|
|
+ where order_sn = #{orderSn} limit 1
|
|
|
+ </select>
|
|
|
+ <select id="selectPaySuccessByOrderId" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from pay_request
|
|
|
+ where order_id = #{orderId} and pay_status = 1 limit 1
|
|
|
+ </select>
|
|
|
+ <select id="selectByUser" resultMap="BaseResultMap">
|
|
|
+ select order_sn, order_id, item_id, item_name, pay_status
|
|
|
+ from pay_request
|
|
|
+ where mobile = #{phoneNo} and item_type = #{itemType}
|
|
|
+ <if test="payStatus != null">
|
|
|
+ and pay_status = #{payStatus}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByOrderId" resultMap="BaseResultMap">
|
|
|
+ select order_sn, order_id, item_id, item_name, pay_status
|
|
|
+ from pay_request
|
|
|
+ where mobile = #{phoneNo} and order_id = #{orderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
+ delete from pay_request
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest" useGeneratedKeys="true">
|
|
|
+ insert into pay_request
|
|
|
+ ( id,request_body,order_sn
|
|
|
+ ,open_id,mobile,order_id
|
|
|
+ ,amount,item_id,item_type
|
|
|
+ ,item_channel,pay_channel,create_time
|
|
|
+ ,modified_time)
|
|
|
+ values (#{id,jdbcType=INTEGER},#{requestBody,jdbcType=VARCHAR},#{orderSn,jdbcType=VARCHAR}
|
|
|
+ ,#{openId,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR}
|
|
|
+ ,#{amount,jdbcType=DECIMAL},#{itemId,jdbcType=VARCHAR},#{itemType,jdbcType=INTEGER}
|
|
|
+ ,#{itemChannel,jdbcType=VARCHAR},#{payChannel,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP}
|
|
|
+ ,#{modifiedTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest" useGeneratedKeys="true">
|
|
|
+ insert into pay_request
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="requestBody != null">request_body,</if>
|
|
|
+ <if test="orderSn != null">order_sn,</if>
|
|
|
+ <if test="openId != null">open_id,</if>
|
|
|
+ <if test="mobile != null">mobile,</if>
|
|
|
+ <if test="orderId != null">order_id,</if>
|
|
|
+ <if test="amount != null">amount,</if>
|
|
|
+ <if test="itemId != null">item_id,</if>
|
|
|
+ <if test="itemType != null">item_type,</if>
|
|
|
+ <if test="itemChannel != null">item_channel,</if>
|
|
|
+ <if test="payChannel != null">pay_channel,</if>
|
|
|
+ <if test="itemName != null">item_name,</if>
|
|
|
+ <if test="responseBody != null">response_body,</if>
|
|
|
+ <if test="payStatus != null">pay_status,</if>
|
|
|
+ <if test="callbackUrl != null">callback_url,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="modifiedTime != null">modified_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id,jdbcType=INTEGER},</if>
|
|
|
+ <if test="requestBody != null">#{requestBody,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="orderSn != null">#{orderSn,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="openId != null">#{openId,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="mobile != null">#{mobile,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="amount != null">#{amount,jdbcType=DECIMAL},</if>
|
|
|
+ <if test="itemId != null">#{itemId,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="itemType != null">#{itemType,jdbcType=INTEGER},</if>
|
|
|
+ <if test="itemChannel != null">#{itemChannel,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="payChannel != null">#{payChannel,jdbcType=INTEGER},</if>
|
|
|
+ <if test="itemName != null">#{itemName,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="responseBody != null">#{responseBody,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="payStatus != null">#{payStatus,jdbcType=BIGINT},</if>
|
|
|
+ <if test="callbackUrl != null">#{callbackUrl,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
|
|
+ <if test="modifiedTime != null">#{modifiedTime,jdbcType=TIMESTAMP},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest">
|
|
|
+ update pay_request
|
|
|
+ <set>
|
|
|
+ <if test="requestBody != null">
|
|
|
+ request_body = #{requestBody,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="orderSn != null">
|
|
|
+ order_sn = #{orderSn,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="openId != null">
|
|
|
+ open_id = #{openId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="mobile != null">
|
|
|
+ mobile = #{mobile,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ order_id = #{orderId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="amount != null">
|
|
|
+ amount = #{amount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="itemId != null">
|
|
|
+ item_id = #{itemId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="itemType != null">
|
|
|
+ item_type = #{itemType,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="itemChannel != null">
|
|
|
+ item_channel = #{itemChannel,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="payChannel != null">
|
|
|
+ pay_channel = #{payChannel,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="responseBody != null">
|
|
|
+ response_body = #{responseBody,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="payStatus != null">
|
|
|
+ pay_status = #{payStatus,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="payAmount != null">
|
|
|
+ pay_amount = #{payAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="payTime != null">
|
|
|
+ pay_time = #{payTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="modifiedTime != null">
|
|
|
+ modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest">
|
|
|
+ update pay_request
|
|
|
+ set
|
|
|
+ request_body = #{requestBody,jdbcType=VARCHAR},
|
|
|
+ order_sn = #{orderSn,jdbcType=VARCHAR},
|
|
|
+ open_id = #{openId,jdbcType=VARCHAR},
|
|
|
+ mobile = #{mobile,jdbcType=VARCHAR},
|
|
|
+ order_id = #{orderId,jdbcType=VARCHAR},
|
|
|
+ amount = #{amount,jdbcType=DECIMAL},
|
|
|
+ item_id = #{itemId,jdbcType=VARCHAR},
|
|
|
+ item_type = #{itemType,jdbcType=INTEGER},
|
|
|
+ item_channel = #{itemChannel,jdbcType=VARCHAR},
|
|
|
+ pay_channel = #{payChannel,jdbcType=INTEGER},
|
|
|
+ response_body = #{responseBody,jdbcType=VARCHAR},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+</mapper>
|