<?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.dividents.TeamDividentsSourceOrderMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrder">
|
<id column="tdo_id" property="id" jdbcType="BIGINT" />
|
<result column="tdo_uid" property="uid" jdbcType="BIGINT" />
|
<result column="tdo_order_no" property="orderNo" jdbcType="VARCHAR" />
|
<result column="tdo_source_type" property="sourceType"
|
jdbcType="INTEGER" />
|
<result column="tdo_state" property="state" jdbcType="INTEGER" />
|
<result column="tdo_money" property="money" jdbcType="DECIMAL" />
|
<result column="tdo_pre_send_time" property="preSendTime"
|
jdbcType="TIMESTAMP" />
|
<result column="tdo_send_time" property="sendTime" jdbcType="TIMESTAMP" />
|
<result column="tdo_create_time" property="createTime"
|
jdbcType="TIMESTAMP" />
|
<result column="tdo_update_time" property="updateTime"
|
jdbcType="TIMESTAMP" />
|
<result column="tdo_beizhu" property="beiZhu" jdbcType="VARCHAR" />
|
</resultMap>
|
<sql id="Base_Column_List">tdo_id,tdo_uid,tdo_order_no,tdo_source_type,tdo_state,tdo_money,tdo_pre_send_time,tdo_send_time,tdo_create_time,tdo_update_time,tdo_beizhu
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_team_dividents_source_order where tdo_id =
|
#{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_team_dividents_source_order where tdo_id =
|
#{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert"
|
parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrder"
|
useGeneratedKeys="true" keyProperty="id">insert into
|
yeshi_ec_team_dividents_source_order
|
(tdo_id,tdo_uid,tdo_order_no,tdo_source_type,tdo_state,tdo_money,tdo_pre_send_time,tdo_send_time,tdo_create_time,tdo_update_time,tdo_beizhu)
|
values
|
(#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{money,jdbcType=DECIMAL},#{preSendTime,jdbcType=TIMESTAMP},#{sendTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{beiZhu,jdbcType=VARCHAR})
|
</insert>
|
<insert id="insertSelective"
|
parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrder"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_team_dividents_source_order
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">tdo_id,</if>
|
<if test="uid != null">tdo_uid,</if>
|
<if test="orderNo != null">tdo_order_no,</if>
|
<if test="sourceType != null">tdo_source_type,</if>
|
<if test="state != null">tdo_state,</if>
|
<if test="money != null">tdo_money,</if>
|
<if test="preSendTime != null">tdo_pre_send_time,</if>
|
<if test="sendTime != null">tdo_send_time,</if>
|
<if test="createTime != null">tdo_create_time,</if>
|
<if test="updateTime != null">tdo_update_time,</if>
|
<if test="beiZhu != null">tdo_beizhu,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
<if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
|
<if test="sourceType != null">#{sourceType,jdbcType=INTEGER},</if>
|
<if test="state != null">#{state,jdbcType=INTEGER},</if>
|
<if test="money != null">#{money,jdbcType=DECIMAL},</if>
|
<if test="preSendTime != null">#{preSendTime,jdbcType=TIMESTAMP},</if>
|
<if test="sendTime != null">#{sendTime,jdbcType=TIMESTAMP},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR}</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey"
|
parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrder">update yeshi_ec_team_dividents_source_order set tdo_uid
|
= #{uid,jdbcType=BIGINT},tdo_order_no =
|
#{orderNo,jdbcType=VARCHAR},tdo_source_type =
|
#{sourceType,jdbcType=INTEGER},tdo_state =
|
#{state,jdbcType=INTEGER},tdo_money =
|
#{money,jdbcType=DECIMAL},tdo_pre_send_time =
|
#{preSendTime,jdbcType=TIMESTAMP},tdo_send_time =
|
#{sendTime,jdbcType=TIMESTAMP},tdo_create_time =
|
#{createTime,jdbcType=TIMESTAMP},tdo_update_time =
|
#{updateTime,jdbcType=TIMESTAMP} ,tdo_beizhu
|
=#{beiZhu,jdbcType=VARCHAR} where tdo_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective"
|
parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrder">
|
update yeshi_ec_team_dividents_source_order
|
<set>
|
<if test="uid != null">tdo_uid=#{uid,jdbcType=BIGINT},</if>
|
<if test="orderNo != null">tdo_order_no=#{orderNo,jdbcType=VARCHAR},</if>
|
<if test="sourceType != null">tdo_source_type=#{sourceType,jdbcType=INTEGER},</if>
|
<if test="state != null">tdo_state=#{state,jdbcType=INTEGER},</if>
|
<if test="money != null">tdo_money=#{money,jdbcType=DECIMAL},</if>
|
<if test="preSendTime != null">tdo_pre_send_time=#{preSendTime,jdbcType=TIMESTAMP},</if>
|
<if test="sendTime != null">tdo_send_time=#{sendTime,jdbcType=TIMESTAMP},</if>
|
<if test="createTime != null">tdo_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">tdo_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="beiZhu !=null">tdo_beizhu =#{beiZhu,jdbcType=VARCHAR},</if>
|
</set>
|
where tdo_id = #{id,jdbcType=BIGINT}
|
</update>
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_team_dividents_source_order where tdo_id = #{0} for
|
update
|
</select>
|
<select id="lisByUidAndPreSendTimeAndState" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_team_dividents_source_order where tdo_uid=#{uid} and
|
tdo_pre_send_time=#{preSendTime} and tdo_state=#{state} limit
|
#{start},#{count}
|
</select>
|
<select id="countByUidAndPreSendTimeAndState" resultType="java.lang.Long">select
|
count(*) from yeshi_ec_team_dividents_source_order where
|
tdo_uid=#{uid} and tdo_pre_send_time=#{preSendTime} and
|
tdo_state=#{state}
|
</select>
|
|
<select id="listUidByPreSendTimeAndState" resultType="java.lang.Long">select
|
distinct(tdo_uid) from yeshi_ec_team_dividents_source_order where
|
tdo_pre_send_time=#{preSendTime} and
|
tdo_state=#{state} limit
|
#{start},#{count}
|
</select>
|
|
<select id="countUidByPreSendTimeAndState" resultType="java.lang.Long">select
|
count(distinct(tdo_uid)) from yeshi_ec_team_dividents_source_order
|
where tdo_pre_send_time=#{preSendTime} and
|
tdo_state=#{state}
|
</select>
|
|
<update id="setStateByUidAndState">
|
update yeshi_ec_team_dividents_source_order
|
<set>tdo_state=#{targetState}, tdo_update_time=now(),
|
tdo_beizhu=#{beiZhu},
|
</set>
|
where tdo_uid = #{uid} and tdo_state=#{state}
|
</update>
|
<select id="selectByOrderNoAndSourceType" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_team_dividents_source_order where
|
tdo_order_no=#{orderNo} and tdo_source_type=#{sourceType}
|
</select>
|
</mapper>
|