Browse Source

consult order

albertshaw 8 years ago
parent
commit
d17275af15

+ 17 - 0
src/main/java/com/goafanti/common/dao/ConsultOrderMapper.java

@@ -0,0 +1,17 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.ConsultOrder;
+
+public interface ConsultOrderMapper {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(ConsultOrder record);
+
+    int insertSelective(ConsultOrder record);
+
+    ConsultOrder selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(ConsultOrder record);
+
+    int updateByPrimaryKey(ConsultOrder record);
+}

+ 153 - 0
src/main/java/com/goafanti/common/mapper/ConsultOrderMapper.xml

@@ -0,0 +1,153 @@
+<?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.goafanti.common.dao.ConsultOrderMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.ConsultOrder">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="price" jdbcType="DOUBLE" property="price" />
+    <result column="order_state" jdbcType="INTEGER" property="orderState" />
+    <result column="order_time" jdbcType="TIMESTAMP" property="orderTime" />
+    <result column="user_id" jdbcType="VARCHAR" property="userId" />
+    <result column="to_user_id" jdbcType="VARCHAR" property="toUserId" />
+    <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime" />
+    <result column="payment_value" jdbcType="DOUBLE" property="paymentValue" />
+    <result column="payment_type" jdbcType="VARCHAR" property="paymentType" />
+    <result column="payment_id" jdbcType="VARCHAR" property="paymentId" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, price, order_state, order_time, user_id, to_user_id, payment_time, payment_value, 
+    payment_type, payment_id
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from consult_order
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from consult_order
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.ConsultOrder">
+    insert into consult_order (id, price, order_state, 
+      order_time, user_id, to_user_id, 
+      payment_time, payment_value, payment_type, 
+      payment_id)
+    values (#{id,jdbcType=BIGINT}, #{price,jdbcType=DOUBLE}, #{orderState,jdbcType=INTEGER}, 
+      #{orderTime,jdbcType=TIMESTAMP}, #{userId,jdbcType=VARCHAR}, #{toUserId,jdbcType=VARCHAR}, 
+      #{paymentTime,jdbcType=TIMESTAMP}, #{paymentValue,jdbcType=DOUBLE}, #{paymentType,jdbcType=VARCHAR}, 
+      #{paymentId,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.ConsultOrder">
+    insert into consult_order
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="price != null">
+        price,
+      </if>
+      <if test="orderState != null">
+        order_state,
+      </if>
+      <if test="orderTime != null">
+        order_time,
+      </if>
+      <if test="userId != null">
+        user_id,
+      </if>
+      <if test="toUserId != null">
+        to_user_id,
+      </if>
+      <if test="paymentTime != null">
+        payment_time,
+      </if>
+      <if test="paymentValue != null">
+        payment_value,
+      </if>
+      <if test="paymentType != null">
+        payment_type,
+      </if>
+      <if test="paymentId != null">
+        payment_id,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="price != null">
+        #{price,jdbcType=DOUBLE},
+      </if>
+      <if test="orderState != null">
+        #{orderState,jdbcType=INTEGER},
+      </if>
+      <if test="orderTime != null">
+        #{orderTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="userId != null">
+        #{userId,jdbcType=VARCHAR},
+      </if>
+      <if test="toUserId != null">
+        #{toUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="paymentTime != null">
+        #{paymentTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="paymentValue != null">
+        #{paymentValue,jdbcType=DOUBLE},
+      </if>
+      <if test="paymentType != null">
+        #{paymentType,jdbcType=VARCHAR},
+      </if>
+      <if test="paymentId != null">
+        #{paymentId,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ConsultOrder">
+    update consult_order
+    <set>
+      <if test="price != null">
+        price = #{price,jdbcType=DOUBLE},
+      </if>
+      <if test="orderState != null">
+        order_state = #{orderState,jdbcType=INTEGER},
+      </if>
+      <if test="orderTime != null">
+        order_time = #{orderTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="userId != null">
+        user_id = #{userId,jdbcType=VARCHAR},
+      </if>
+      <if test="toUserId != null">
+        to_user_id = #{toUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="paymentTime != null">
+        payment_time = #{paymentTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="paymentValue != null">
+        payment_value = #{paymentValue,jdbcType=DOUBLE},
+      </if>
+      <if test="paymentType != null">
+        payment_type = #{paymentType,jdbcType=VARCHAR},
+      </if>
+      <if test="paymentId != null">
+        payment_id = #{paymentId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ConsultOrder">
+    update consult_order
+    set price = #{price,jdbcType=DOUBLE},
+      order_state = #{orderState,jdbcType=INTEGER},
+      order_time = #{orderTime,jdbcType=TIMESTAMP},
+      user_id = #{userId,jdbcType=VARCHAR},
+      to_user_id = #{toUserId,jdbcType=VARCHAR},
+      payment_time = #{paymentTime,jdbcType=TIMESTAMP},
+      payment_value = #{paymentValue,jdbcType=DOUBLE},
+      payment_type = #{paymentType,jdbcType=VARCHAR},
+      payment_id = #{paymentId,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 132 - 0
src/main/java/com/goafanti/common/model/ConsultOrder.java

@@ -0,0 +1,132 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class ConsultOrder {
+    private Long id;
+
+    /**
+    * 价格
+    */
+    private Double price;
+
+    /**
+    * 付款状态  0:未付款 1:已付款
+    */
+    private Integer orderState;
+
+    /**
+    * 下单时间
+    */
+    private Date orderTime;
+
+    /**
+    * 用户ID 外键
+    */
+    private String userId;
+
+    /**
+    * 专家用户ID 外键
+    */
+    private String toUserId;
+
+    /**
+    * 支付时间
+    */
+    private Date paymentTime;
+
+    /**
+    * 实际支付金额
+    */
+    private Double paymentValue;
+
+    /**
+    * 支付方式
+    */
+    private String paymentType;
+
+    /**
+    * 支付流水号
+    */
+    private String paymentId;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Integer getOrderState() {
+        return orderState;
+    }
+
+    public void setOrderState(Integer orderState) {
+        this.orderState = orderState;
+    }
+
+    public Date getOrderTime() {
+        return orderTime;
+    }
+
+    public void setOrderTime(Date orderTime) {
+        this.orderTime = orderTime;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getToUserId() {
+        return toUserId;
+    }
+
+    public void setToUserId(String toUserId) {
+        this.toUserId = toUserId;
+    }
+
+    public Date getPaymentTime() {
+        return paymentTime;
+    }
+
+    public void setPaymentTime(Date paymentTime) {
+        this.paymentTime = paymentTime;
+    }
+
+    public Double getPaymentValue() {
+        return paymentValue;
+    }
+
+    public void setPaymentValue(Double paymentValue) {
+        this.paymentValue = paymentValue;
+    }
+
+    public String getPaymentType() {
+        return paymentType;
+    }
+
+    public void setPaymentType(String paymentType) {
+        this.paymentType = paymentType;
+    }
+
+    public String getPaymentId() {
+        return paymentId;
+    }
+
+    public void setPaymentId(String paymentId) {
+        this.paymentId = paymentId;
+    }
+}