<?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.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanDrawBackMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack">
|
<id column="twd_id" property="id" jdbcType="BIGINT" />
|
<result column="twd_order_id" property="orderId" jdbcType="VARCHAR" />
|
<result column="twd_order_item_id" property="orderItemId"
|
jdbcType="VARCHAR" />
|
<result column="twd_order_drawback_money" property="drawBackMoney"
|
jdbcType="DECIMAL" />
|
<result column="twd_createtime" property="createTime" jdbcType="TIMESTAMP" />
|
<association property="user" column="twd_uid"
|
javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
<id column="twd_uid" property="id" jdbcType="BIGINT" />
|
</association>
|
|
</resultMap>
|
<sql id="Base_Column_List">twd_id,twd_order_id,twd_order_item_id,twd_uid,twd_order_drawback_money,twd_createtime
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_taobao_weiquan_drawback where twd_id =
|
#{id,jdbcType=BIGINT}
|
</select>
|
|
<select id="selectByOrderItemIdAndUid" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_taobao_weiquan_drawback where twd_order_item_id
|
=#{orderItemId} and twd_uid=#{uid}
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_taobao_weiquan_drawback where twd_id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack"
|
useGeneratedKeys="true" keyProperty="id">insert into
|
yeshi_ec_taobao_weiquan_drawback
|
(twd_id,twd_order_id,twd_order_item_id,twd_uid,twd_order_drawback_money,twd_createtime)
|
values
|
(#{id,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{orderItemId,jdbcType=VARCHAR},#{user.id,jdbcType=BIGINT},#{drawBackMoney,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_taobao_weiquan_drawback
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">twd_id,</if>
|
<if test="orderId != null">twd_order_id,</if>
|
<if test="orderItemId != null">twd_order_item_id,</if>
|
<if test="user != null">twd_uid,</if>
|
<if test="drawBackMoney != null">twd_order_drawback_money,</if>
|
<if test="createTime != null">twd_createtime,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
|
<if test="orderItemId != null">#{orderItemId,jdbcType=VARCHAR},</if>
|
<if test="user != null">#{user.id,jdbcType=BIGINT},</if>
|
<if test="drawBackMoney != null">#{drawBackMoney,jdbcType=DECIMAL},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack">update
|
yeshi_ec_taobao_weiquan_drawback set twd_order_id =
|
#{orderId,jdbcType=VARCHAR},twd_order_item_id =
|
#{orderItemId,jdbcType=VARCHAR},twd_uid =
|
#{user.id,jdbcType=BIGINT},twd_order_drawback_money =
|
#{drawBackMoney,jdbcType=DECIMAL},twd_createtime =
|
#{createTime,jdbcType=TIMESTAMP} where twd_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack">
|
update yeshi_ec_taobao_weiquan_drawback
|
<set>
|
<if test="orderId != null">twd_order_id=#{orderId,jdbcType=VARCHAR},</if>
|
<if test="orderItemId != null">twd_order_item_id=#{orderItemId,jdbcType=VARCHAR},</if>
|
<if test="user != null">twd_uid=#{user.id,jdbcType=BIGINT},</if>
|
<if test="drawBackMoney != null">twd_order_drawback_money=#{drawBackMoney,jdbcType=DECIMAL},
|
</if>
|
<if test="createTime != null">twd_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
|
</set>
|
where twd_id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|