<?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.ks.app.dao.vip.OrderRecordDao">
|
<resultMap id="BaseResultMap"
|
type="com.ks.app.entity.vip.OrderRecord">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="order_type" property="orderType" jdbcType="VARCHAR"/>
|
<result column="uid" property="uid" jdbcType="BIGINT"/>
|
<result column="state" property="state" jdbcType="INTEGER"/>
|
<result column="money_pay" property="moneyPay" jdbcType="BOOLEAN"/>
|
<result column="gold_corn_pay" property="goldCornPay" jdbcType="BOOLEAN"/>
|
<result column="gold_corn" property="goldCorn" jdbcType="INTEGER"/>
|
<result column="type" property="type" jdbcType="VARCHAR"/>
|
<result column="money" property="money" jdbcType="DECIMAL"/>
|
<result column="pay_way" property="payWay" jdbcType="INTEGER"/>
|
<result column="pay_money" property="payMoney" jdbcType="DECIMAL"/>
|
<result column="ip_info" property="ipInfo" jdbcType="VARCHAR"/>
|
<result column="pay_time" property="payTime" jdbcType="TIMESTAMP"/>
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
<result column="vip_start_time" property="vipStartTime" jdbcType="TIMESTAMP"/>
|
<result column="vip_end_time" property="vipEndTime" jdbcType="TIMESTAMP"/>
|
<result column="remarks" property="remarks" jdbcType="VARCHAR"/>
|
<result column="apple_transaction_id" property="appleTransactionId" jdbcType="VARCHAR"/>
|
<result column="apple_original_transaction_id" property="appleOriginalTransactionId" jdbcType="VARCHAR"/>
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
<trim suffixOverrides=",">
|
id,order_type,uid,state,money_pay,gold_corn_pay,gold_corn,type,money,pay_way,pay_money,ip_info,pay_time,create_time,update_time,vip_start_time,vip_end_time,remarks,apple_transaction_id,apple_original_transaction_id,
|
</trim>
|
</sql>
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List"/>
|
from lt_vip_order_record where id = #{id, jdbcType=BIGINT}
|
</select>
|
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List"/>
|
from lt_vip_order_record where id = #{id,jdbcType=BIGINT} for update
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
delete from
|
lt_vip_order_record where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert"
|
parameterType="com.ks.app.entity.vip.OrderRecord"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into
|
lt_vip_order_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
order_type,
|
uid,
|
state,
|
money_pay,
|
gold_corn_pay,
|
gold_corn,
|
type,
|
money,
|
pay_way,
|
pay_money,
|
ip_info,
|
pay_time,
|
create_time,
|
update_time,
|
vip_start_time,
|
vip_end_time,
|
remarks,
|
apple_transaction_id,
|
apple_original_transaction_id,
|
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
#{orderType},jdbcType=VARCHAR},
|
#{uid},jdbcType=BIGINT},
|
#{state},jdbcType=INTEGER},
|
#{moneyPay},jdbcType=BOOLEAN},
|
#{goldCornPay},jdbcType=BOOLEAN},
|
#{goldCorn},jdbcType=INTEGER},
|
#{type},jdbcType=VARCHAR},
|
#{money},jdbcType=DECIMAL},
|
#{payWay},jdbcType=INTEGER},
|
#{payMoney},jdbcType=DECIMAL},
|
#{ipInfo},jdbcType=VARCHAR},
|
#{payTime},jdbcType=TIMESTAMP},
|
#{createTime},jdbcType=TIMESTAMP},
|
#{updateTime},jdbcType=TIMESTAMP},
|
#{vipStartTime},jdbcType=TIMESTAMP},
|
#{vipEndTime},jdbcType=TIMESTAMP},
|
#{remarks},jdbcType=VARCHAR},
|
#{appleTransactionId},jdbcType=VARCHAR},
|
#{appleOriginalTransactionId},jdbcType=VARCHAR},
|
|
</trim>
|
|
</insert>
|
<insert id="insertSelective"
|
parameterType="com.ks.app.entity.vip.OrderRecord"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into lt_vip_order_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="orderType != null">order_type,</if>
|
<if test="uid != null">uid,</if>
|
<if test="state != null">state,</if>
|
<if test="moneyPay != null">money_pay,</if>
|
<if test="goldCornPay != null">gold_corn_pay,</if>
|
<if test="goldCorn != null">gold_corn,</if>
|
<if test="type != null">type,</if>
|
<if test="money != null">money,</if>
|
<if test="payWay != null">pay_way,</if>
|
<if test="payMoney != null">pay_money,</if>
|
<if test="ipInfo != null">ip_info,</if>
|
<if test="payTime != null">pay_time,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="vipStartTime != null">vip_start_time,</if>
|
<if test="vipEndTime != null">vip_end_time,</if>
|
<if test="remarks != null">remarks,</if>
|
<if test="appleTransactionId != null">apple_transaction_id,</if>
|
<if test="appleOriginalTransactionId != null">apple_original_transaction_id,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="orderType != null">#{orderType,jdbcType=VARCHAR},</if>
|
<if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
<if test="state != null">#{state,jdbcType=INTEGER},</if>
|
<if test="moneyPay != null">#{moneyPay,jdbcType=BOOLEAN},</if>
|
<if test="goldCornPay != null">#{goldCornPay,jdbcType=BOOLEAN},</if>
|
<if test="goldCorn != null">#{goldCorn,jdbcType=INTEGER},</if>
|
<if test="type != null">#{type,jdbcType=VARCHAR},</if>
|
<if test="money != null">#{money,jdbcType=DECIMAL},</if>
|
<if test="payWay != null">#{payWay,jdbcType=INTEGER},</if>
|
<if test="payMoney != null">#{payMoney,jdbcType=DECIMAL},</if>
|
<if test="ipInfo != null">#{ipInfo,jdbcType=VARCHAR},</if>
|
<if test="payTime != null">#{payTime,jdbcType=TIMESTAMP},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="vipStartTime != null">#{vipStartTime,jdbcType=TIMESTAMP},</if>
|
<if test="vipEndTime != null">#{vipEndTime,jdbcType=TIMESTAMP},</if>
|
<if test="remarks != null">#{remarks,jdbcType=VARCHAR},</if>
|
<if test="appleTransactionId != null">#{appleTransactionId,jdbcType=VARCHAR},</if>
|
<if test="appleOriginalTransactionId != null">#{appleOriginalTransactionId,jdbcType=VARCHAR},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey"
|
parameterType="com.ks.app.entity.vip.OrderRecord">
|
update lt_vip_order_record
|
<set>
|
<if test="id != null">id = #{id,jdbcType=BIGINT},</if>
|
<if test="orderType != null">order_type = #{orderType,jdbcType=VARCHAR},</if>
|
<if test="uid != null">uid = #{uid,jdbcType=BIGINT},</if>
|
<if test="state != null">state = #{state,jdbcType=INTEGER},</if>
|
<if test="moneyPay != null">money_pay = #{moneyPay,jdbcType=BOOLEAN},</if>
|
<if test="goldCornPay != null">gold_corn_pay = #{goldCornPay,jdbcType=BOOLEAN},</if>
|
<if test="goldCorn != null">gold_corn = #{goldCorn,jdbcType=INTEGER},</if>
|
<if test="type != null">type = #{type,jdbcType=VARCHAR},</if>
|
<if test="money != null">money = #{money,jdbcType=DECIMAL},</if>
|
<if test="payWay != null">pay_way = #{payWay,jdbcType=INTEGER},</if>
|
<if test="payMoney != null">pay_money = #{payMoney,jdbcType=DECIMAL},</if>
|
<if test="ipInfo != null">ip_info = #{ipInfo,jdbcType=VARCHAR},</if>
|
<if test="payTime != null">pay_time = #{payTime,jdbcType=TIMESTAMP},</if>
|
<if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="vipStartTime != null">vip_start_time = #{vipStartTime,jdbcType=TIMESTAMP},</if>
|
<if test="vipEndTime != null">vip_end_time = #{vipEndTime,jdbcType=TIMESTAMP},</if>
|
<if test="remarks != null">remarks = #{remarks,jdbcType=VARCHAR},</if>
|
<if test="appleTransactionId != null">apple_transaction_id = #{appleTransactionId,jdbcType=VARCHAR},</if>
|
<if test="appleOriginalTransactionId != null">apple_original_transaction_id =
|
#{appleOriginalTransactionId,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective"
|
parameterType="com.ks.app.entity.vip.OrderRecord">
|
update lt_vip_order_record
|
<set>
|
<if test="orderType != null">order_type = #{orderType,jdbcType=VARCHAR},</if>
|
<if test="uid != null">uid = #{uid,jdbcType=BIGINT},</if>
|
<if test="state != null">state = #{state,jdbcType=INTEGER},</if>
|
<if test="moneyPay != null">money_pay = #{moneyPay,jdbcType=BOOLEAN},</if>
|
<if test="goldCornPay != null">gold_corn_pay = #{goldCornPay,jdbcType=BOOLEAN},</if>
|
<if test="goldCorn != null">gold_corn = #{goldCorn,jdbcType=INTEGER},</if>
|
<if test="type != null">type = #{type,jdbcType=VARCHAR},</if>
|
<if test="money != null">money = #{money,jdbcType=DECIMAL},</if>
|
<if test="payWay != null">pay_way = #{payWay,jdbcType=INTEGER},</if>
|
<if test="payMoney != null">pay_money = #{payMoney,jdbcType=DECIMAL},</if>
|
<if test="ipInfo != null">ip_info = #{ipInfo,jdbcType=VARCHAR},</if>
|
<if test="payTime != null">pay_time = #{payTime,jdbcType=TIMESTAMP},</if>
|
<if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="vipStartTime != null">vip_start_time = #{vipStartTime,jdbcType=TIMESTAMP},</if>
|
<if test="vipEndTime != null">vip_end_time = #{vipEndTime,jdbcType=TIMESTAMP},</if>
|
<if test="remarks != null">remarks = #{remarks,jdbcType=VARCHAR},</if>
|
<if test="appleTransactionId != null">apple_transaction_id = #{appleTransactionId,jdbcType=VARCHAR},</if>
|
<if test="appleOriginalTransactionId != null">apple_original_transaction_id =
|
#{appleOriginalTransactionId,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
|
<sql id="listWhere">
|
<if test="query.state!=null">
|
state=#{query.state}
|
</if>
|
|
<if test="query.orderType!=null">
|
order_type=#{query.orderType}
|
</if>
|
|
<if test="query.uid!=null">
|
uid=#{query.uid}
|
</if>
|
|
<if test="query.minCreateTime!=null">
|
create_time>= #{query.minCreateTime}
|
</if>
|
|
<if test="query.maxCreateTime!=null">
|
#{query.maxCreateTime}>create_time
|
</if>
|
|
</sql>
|
|
<select id="list"
|
resultMap="BaseResultMap">
|
SELECT * FROM lt_vip_order_record
|
<where>
|
<include refid="listWhere">
|
</include>
|
</where>
|
<if test="query.sortList!=null">
|
<foreach collection="query.sortList" open=" order by " separator="," item="item">
|
#{item}
|
</foreach>
|
</if>
|
limit #{query.start},#{query.count}
|
</select>
|
|
|
<select id="count"
|
resultType="java.lang.Long">
|
SELECT count(*) FROM lt_vip_order_record
|
<where>
|
<include refid="listWhere">
|
</include>
|
</where>
|
</select>
|
|
<insert id="insertPaySuccess">
|
insert into wk_vip_order_pay_success(id,create_time) value(#{id},now())
|
</insert>
|
|
|
</mapper>
|