Browse Source

memberorder

albertshaw 8 years ago
parent
commit
da6c4f2f7a

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

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

+ 177 - 0
src/main/java/com/goafanti/common/mapper/MemberOrderMapper.xml

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

+ 162 - 0
src/main/java/com/goafanti/common/model/MemberOrder.java

@@ -0,0 +1,162 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+
+public class MemberOrder {
+    private Long id;
+
+    /**
+    * 付费会员类型
+    */
+    private Integer menberType;
+
+    /**
+    * 价格
+    */
+    private Double price;
+
+    /**
+    * 会员月类型
+    */
+    private Integer validMonth;
+
+    /**
+    * 付款状态  0:未付款 1:已付款
+    */
+    private Integer orderState;
+
+    /**
+    * 下单时间
+    */
+    private Date orderTime;
+
+    /**
+    * 用户ID 外键
+    */
+    private String userId;
+
+    /**
+    * 支付时间
+    */
+    private Date paymentTime;
+
+    /**
+    * 实际支付金额
+    */
+    private Double paymentValue;
+
+    /**
+    * 支付方式
+    */
+    private String paymentType;
+
+    /**
+    * 支付流水号
+    */
+    private String paymentId;
+
+    /**
+    * 有效时间
+    */
+    private Date validTime;
+
+    @JsonFormat(shape = Shape.STRING)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getMenberType() {
+        return menberType;
+    }
+
+    public void setMenberType(Integer menberType) {
+        this.menberType = menberType;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Integer getValidMonth() {
+        return validMonth;
+    }
+
+    public void setValidMonth(Integer validMonth) {
+        this.validMonth = validMonth;
+    }
+
+    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 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;
+    }
+
+    public Date getValidTime() {
+        return validTime;
+    }
+
+    public void setValidTime(Date validTime) {
+        this.validTime = validTime;
+    }
+}