<?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.ThreeSaleGiftMapper">
|
<resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.ThreeSaleGift">
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="rank" property="rank" jdbcType="INTEGER" />
|
<result column="rate" property="rate" jdbcType="DECIMAL" />
|
<result column="money" property="money" jdbcType="DECIMAL" />
|
<result column="state" property="state" jdbcType="INTEGER" />
|
<result column="createTime" property="createTime" jdbcType="BIGINT" />
|
<result column="fanTime" property="fanTime" jdbcType="BIGINT" />
|
<association property="userInfo" column="uid"
|
resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" />
|
<association property="orderItem" column="orderItemId"
|
resultMap="com.yeshi.fanli.dao.mybatis.order.OrderItemMapper.BaseResultMap" />
|
</resultMap>
|
<sql id="Base_Column_List">id,uid,rank,rate,orderItemId,money,state,createTime,fanTime
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_three_sale_gift where id = #{id,jdbcType=BIGINT}
|
</select>
|
|
<select id="selectByOrderItem" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_three_sale_gift where orderItemId = #{0}
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_three_sale_gift where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleGift"
|
useGeneratedKeys="true" keyProperty="id">insert into
|
yeshi_ec_three_sale_gift
|
(id,uid,rank,rate,orderItemId,money,state,createTime,fanTime) values
|
(#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{rank,jdbcType=INTEGER},#{rate,jdbcType=DECIMAL},#{orderItem.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{state,jdbcType=INTEGER},#{createTime,jdbcType=BIGINT},#{fanTime,jdbcType=BIGINT})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleGift"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_three_sale_gift
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="userInfo != null">uid,</if>
|
<if test="rank != null">rank,</if>
|
<if test="rate != null">rate,</if>
|
<if test="orderItem != null">orderItemId,</if>
|
<if test="money != null">money,</if>
|
<if test="state != null">state,</if>
|
<if test="createTime != null">createTime,</if>
|
<if test="fanTime != null">fanTime,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
|
<if test="rank != null">#{rank,jdbcType=INTEGER},</if>
|
<if test="rate != null">#{rate,jdbcType=DECIMAL},</if>
|
<if test="orderItem != null">#{orderItem.id,jdbcType=BIGINT},</if>
|
<if test="money != null">#{money,jdbcType=DECIMAL},</if>
|
<if test="state != null">#{state,jdbcType=INTEGER},</if>
|
<if test="createTime != null">#{createTime,jdbcType=BIGINT},</if>
|
<if test="fanTime != null">#{fanTime,jdbcType=BIGINT},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleGift">update
|
yeshi_ec_three_sale_gift set uid = #{userInfo.id,jdbcType=BIGINT},rank
|
= #{rank,jdbcType=INTEGER},rate = #{rate,jdbcType=DECIMAL},orderItemId
|
= #{orderItem.id,jdbcType=BIGINT},money =
|
#{money,jdbcType=DECIMAL},state = #{state,jdbcType=INTEGER},createTime
|
= #{createTime,jdbcType=BIGINT},fanTime = #{fanTime,jdbcType=BIGINT}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleGift">
|
update yeshi_ec_three_sale_gift
|
<set>
|
<if test="userInfo != null">uid=#{userInfo.id,jdbcType=BIGINT},</if>
|
<if test="rank != null">rank=#{rank,jdbcType=INTEGER},</if>
|
<if test="rate != null">rate=#{rate,jdbcType=DECIMAL},</if>
|
<if test="orderItem != null">orderItemId=#{orderItem.id,jdbcType=BIGINT},</if>
|
<if test="money != null">money=#{money,jdbcType=DECIMAL},</if>
|
<if test="state != null">state=#{state,jdbcType=INTEGER},</if>
|
<if test="createTime != null">createTime=#{createTime,jdbcType=BIGINT},</if>
|
<if test="fanTime != null">fanTime=#{fanTime,jdbcType=BIGINT},</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|