<?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.order.OrderItemMapper">
|
<resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.OrderItem">
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="picture" property="picture" jdbcType="VARCHAR" />
|
<result column="auctionId" property="auctionId" jdbcType="BIGINT" />
|
<result column="title" property="title" jdbcType="VARCHAR" />
|
<result column="orderId" property="orderId" jdbcType="VARCHAR" />
|
<result column="type" property="type" jdbcType="INTEGER" />
|
<result column="state" property="state" jdbcType="INTEGER" />
|
<result column="payMoney" property="payMoney" jdbcType="DECIMAL" />
|
<result column="fanMoney" property="fanMoney" jdbcType="DECIMAL" />
|
<result column="createTime" property="createTime" jdbcType="BIGINT" />
|
<result column="settlementTime" property="settlementTime"
|
jdbcType="BIGINT" />
|
<result column="refundTime" property="refundTime" jdbcType="BIGINT" />
|
<result column="fanTime" property="fanTime" jdbcType="BIGINT" />
|
<result column="isGift" property="isGift" jdbcType="BOOLEAN" />
|
<result column="version" property="version" jdbcType="INTEGER" />
|
<association property="userInfo" column="uid"
|
resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" />
|
<association property="order" column="oid"
|
resultMap="com.yeshi.fanli.dao.mybatis.order.OrderMapper.BaseResultMap" />
|
</resultMap>
|
<sql id="Base_Column_List">id,picture,auctionId,title,orderId,type,state,payMoney,fanMoney,createTime,settlementTime,refundTime,fanTime,isGift,uid,oid,version
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_order_item where id = #{id,jdbcType=BIGINT}
|
</select>
|
|
<select id="selectByUid" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_order_item where uid = #{0}
|
</select>
|
|
|
<select id="findOrderByOrderIdAndTypeAndVersion" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_order_item where orderId = #{orderId} and type=#{type}
|
and version=#{version}
|
</select>
|
|
|
<select id="selectCanBalanceOrderItem" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_order_item where state=2 and oi.settlementTime>0 and
|
<![CDATA[
|
oi.settlementTime <
|
]]>
|
#{mintTime,jdbcType=BIGINT} and version=2
|
</select>
|
|
|
<select id="selectByOrderIdSortWithAucationIdAndPayMoney"
|
resultMap="BaseResultMap" parameterType="java.lang.String">
|
SELECT i.* FROM
|
yeshi_ec_order_item i LEFT JOIN yeshi_ec_order o ON o.`id`=i.oid WHERE
|
o.`orderid`=#{0} ORDER BY i.auctionId,i.payMoney
|
</select>
|
|
<select id="getOrderItemByOrderId" resultMap="BaseResultMap"
|
parameterType="java.lang.String">
|
SELECT i.* FROM yeshi_ec_order_item i WHERE
|
i.`orderid`=${orderId} ORDER BY i.auctionId,i.payMoney
|
</select>
|
|
|
<select id="selectOrderItemByOrder" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
SELECT i.* FROM yeshi_ec_order_item i WHERE
|
oid=#{0}
|
</select>
|
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_order_item where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.OrderItem"
|
useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_order_item
|
(id,picture,auctionId,title,orderId,type,state,payMoney,fanMoney,createTime,settlementTime,refundTime,fanTime,isGift,uid,oid,version)
|
values
|
(#{id,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{payMoney,jdbcType=DECIMAL},#{fanMoney,jdbcType=DECIMAL},#{createTime,jdbcType=BIGINT},#{settlementTime,jdbcType=BIGINT},#{refundTime,jdbcType=BIGINT},#{fanTime,jdbcType=BIGINT},#{isGift,jdbcType=BOOLEAN},#{userInfo.id,jdbcType=BIGINT},#{order.id,jdbcType=BIGINT},#{version,jdbcType=INTEGER})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.OrderItem"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_order_item
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="picture != null">picture,</if>
|
<if test="auctionId != null">auctionId,</if>
|
<if test="title != null">title,</if>
|
<if test="orderId != null">orderId,</if>
|
<if test="type != null">type,</if>
|
<if test="state != null">state,</if>
|
<if test="payMoney != null">payMoney,</if>
|
<if test="fanMoney != null">fanMoney,</if>
|
<if test="createTime != null">createTime,</if>
|
<if test="settlementTime != null">settlementTime,</if>
|
<if test="refundTime != null">refundTime,</if>
|
<if test="fanTime != null">fanTime,</if>
|
<if test="isGift != null">isGift,</if>
|
<if test="userInfo != null">uid,</if>
|
<if test="order != null">oid,</if>
|
<if test="version != null">version,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
|
<if test="auctionId != null">#{auctionId,jdbcType=BIGINT},</if>
|
<if test="title != null">#{title,jdbcType=VARCHAR},</if>
|
<if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
|
<if test="type != null">#{type,jdbcType=INTEGER},</if>
|
<if test="state != null">#{state,jdbcType=INTEGER},</if>
|
<if test="payMoney != null">#{payMoney,jdbcType=DECIMAL},</if>
|
<if test="fanMoney != null">#{fanMoney,jdbcType=DECIMAL},</if>
|
<if test="createTime != null">#{createTime,jdbcType=BIGINT},</if>
|
<if test="settlementTime != null">#{settlementTime,jdbcType=BIGINT},</if>
|
<if test="refundTime != null">#{refundTime,jdbcType=BIGINT},</if>
|
<if test="fanTime != null">#{fanTime,jdbcType=BIGINT},</if>
|
<if test="isGift != null">#{isGift,jdbcType=BOOLEAN},</if>
|
<if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
|
<if test="order != null">#{order.id,jdbcType=BIGINT},</if>
|
<if test="version != null">#{version,jdbcType=INTEGER},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.OrderItem">update
|
yeshi_ec_order_item set picture =
|
#{picture,jdbcType=VARCHAR},auctionId =
|
#{auctionId,jdbcType=BIGINT},title = #{title,jdbcType=VARCHAR},orderId
|
= #{orderId,jdbcType=VARCHAR},type = #{type,jdbcType=INTEGER},state =
|
#{state,jdbcType=INTEGER},payMoney =
|
#{payMoney,jdbcType=DECIMAL},fanMoney =
|
#{fanMoney,jdbcType=DECIMAL},createTime =
|
#{createTime,jdbcType=BIGINT},settlementTime =
|
#{settlementTime,jdbcType=BIGINT},refundTime =
|
#{refundTime,jdbcType=BIGINT},fanTime =
|
#{fanTime,jdbcType=BIGINT},isGift = #{isGift,jdbcType=BOOLEAN},uid =
|
#{userInfo.id,jdbcType=BIGINT},oid =
|
#{order.id,jdbcType=BIGINT},version = #{version,jdbcType=INTEGER}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.OrderItem">
|
update yeshi_ec_order_item
|
<set>
|
<if test="picture != null">picture=#{picture,jdbcType=VARCHAR},</if>
|
<if test="auctionId != null">auctionId=#{auctionId,jdbcType=BIGINT},</if>
|
<if test="title != null">title=#{title,jdbcType=VARCHAR},</if>
|
<if test="orderId != null">orderId=#{orderId,jdbcType=VARCHAR},</if>
|
<if test="type != null">type=#{type,jdbcType=INTEGER},</if>
|
<if test="state != null">state=#{state,jdbcType=INTEGER},</if>
|
<if test="payMoney != null">payMoney=#{payMoney,jdbcType=DECIMAL},</if>
|
<if test="fanMoney != null">fanMoney=#{fanMoney,jdbcType=DECIMAL},</if>
|
<if test="createTime != null">createTime=#{createTime,jdbcType=BIGINT},</if>
|
<if test="settlementTime != null">settlementTime=#{settlementTime,jdbcType=BIGINT},</if>
|
<if test="refundTime != null">refundTime=#{refundTime,jdbcType=BIGINT},</if>
|
<if test="fanTime != null">fanTime=#{fanTime,jdbcType=BIGINT},</if>
|
<if test="isGift != null">isGift=#{isGift,jdbcType=BOOLEAN},</if>
|
<if test="userInfo != null">uid=#{userInfo.id,jdbcType=BIGINT},</if>
|
<if test="order != null">oid=#{order.id,jdbcType=BIGINT},</if>
|
<if test="version != null">version=#{version,jdbcType=INTEGER},</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|