<?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.money.TeamEincomeRecordMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.fanli.entity.money.TeamEincomeRecord">
|
<id column="ti_id" property="id" jdbcType="BIGINT" />
|
<result column="ti_uid" property="uid" jdbcType="BIGINT" />
|
<result column="ti_type" property="type" jdbcType="INTEGER" />
|
<result column="ti_money" property="money" jdbcType="DECIMAL" />
|
<result column="ti_state" property="state" jdbcType="INTEGER" />
|
<result column="ti_source_type" property="sourceType" jdbcType="INTEGER" />
|
<result column="ti_pre_recieve_time" property="preRecieveTime"
|
jdbcType="TIMESTAMP" />
|
<result column="ti_recieve_time" property="recieveTime"
|
jdbcType="TIMESTAMP" />
|
<result column="ti_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
<result column="ti_update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="ti_beizhu" property="beiZhu" jdbcType="VARCHAR" />
|
</resultMap>
|
<sql id="Base_Column_List">ti_id,ti_uid,ti_type,ti_money,ti_state,ti_source_type,ti_pre_recieve_time,ti_recieve_time,ti_create_time,ti_update_time,ti_beizhu
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_team_income where ti_id = #{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_team_income where ti_id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.money.TeamEincomeRecord"
|
useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_team_income
|
(ti_id,ti_uid,ti_type,ti_money,ti_state,ti_source_type,ti_pre_recieve_time,ti_recieve_time,ti_create_time,ti_update_time,ti_beizhu)
|
values
|
(#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{type,jdbcType=INTEGER},#{money,jdbcType=DECIMAL},#{state,jdbcType=INTEGER},#{sourceType,jdbcType=INTEGER},#{preRecieveTime,jdbcType=TIMESTAMP},#{recieveTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{beiZhu,jdbcType=VARCHAR})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.money.TeamEincomeRecord"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_team_income
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">ti_id,</if>
|
<if test="uid != null">ti_uid,</if>
|
<if test="type != null">ti_type,</if>
|
<if test="money != null">ti_money,</if>
|
<if test="state != null">ti_state,</if>
|
<if test="sourceType != null">ti_source_type,</if>
|
<if test="preRecieveTime != null">ti_pre_recieve_time,</if>
|
<if test="recieveTime != null">ti_recieve_time,</if>
|
<if test="createTime != null">ti_create_time,</if>
|
<if test="updateTime != null">ti_update_time,</if>
|
<if test="beiZhu != null">ti_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="type != null">#{type,jdbcType=INTEGER},</if>
|
<if test="money != null">#{money,jdbcType=DECIMAL},</if>
|
<if test="state != null">#{state,jdbcType=INTEGER},</if>
|
<if test="sourceType != null">#{sourceType,jdbcType=INTEGER},</if>
|
<if test="preRecieveTime != null">#{preRecieveTime,jdbcType=TIMESTAMP},</if>
|
<if test="recieveTime != null">#{recieveTime,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.money.TeamEincomeRecord">update
|
yeshi_ec_team_income set ti_uid = #{uid,jdbcType=BIGINT},ti_type =
|
#{type,jdbcType=INTEGER},ti_money = #{money,jdbcType=DECIMAL},ti_state
|
= #{state,jdbcType=INTEGER},ti_source_type =
|
#{sourceType,jdbcType=INTEGER},ti_pre_recieve_time =
|
#{preRecieveTime,jdbcType=TIMESTAMP},ti_recieve_time =
|
#{recieveTime,jdbcType=TIMESTAMP},ti_create_time =
|
#{createTime,jdbcType=TIMESTAMP},ti_update_time =
|
#{updateTime,jdbcType=TIMESTAMP},ti_beizhu =
|
#{beiZhu,jdbcType=VARCHAR} where ti_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.money.TeamEincomeRecord">
|
update yeshi_ec_team_income
|
<set>
|
<if test="uid != null">ti_uid=#{uid,jdbcType=BIGINT},</if>
|
<if test="type != null">ti_type=#{type,jdbcType=INTEGER},</if>
|
<if test="money != null">ti_money=#{money,jdbcType=DECIMAL},</if>
|
<if test="state != null">ti_state=#{state,jdbcType=INTEGER},</if>
|
<if test="sourceType != null">ti_source_type=#{sourceType,jdbcType=INTEGER},</if>
|
<if test="preRecieveTime != null">ti_pre_recieve_time=#{preRecieveTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="recieveTime != null">ti_recieve_time=#{recieveTime,jdbcType=TIMESTAMP},</if>
|
<if test="createTime != null">ti_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">ti_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="beiZhu != null">ti_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
|
</set>
|
where ti_id = #{id,jdbcType=BIGINT}
|
</update>
|
|
|
|
<select id="selectByUidAndPreRecieveTimeAndType" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_team_income where ti_uid = #{uid} and ti_type=#{type}
|
and ti_pre_recieve_time=#{preRecieveTime}
|
</select>
|
|
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_team_income where ti_id = #{id,jdbcType=BIGINT} for
|
update
|
</select>
|
|
<select id="listByUidAndPreRecieveTimeAndState" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_team_income where ti_uid = #{uid} and
|
ti_pre_recieve_time=#{preRecieveTime} and ti_state=#{state}
|
|
<if test="typeList!=null">
|
<foreach collection="typeList" item="type" open=" and ("
|
separator=" or " close=")">
|
ti_type=#{type}
|
</foreach>
|
</if>
|
</select>
|
|
|
|
<select id="listCanRecieveUid" resultType="java.lang.Long">
|
select
|
distinct(ti_uid)
|
from yeshi_ec_team_income where
|
ti_pre_recieve_time=#{preRecieveTime}
|
and ti_state=1
|
|
<if test="typeList!=null">
|
<foreach collection="typeList" item="type" open=" and ("
|
separator=" or " close=")">
|
ti_type=#{type}
|
</foreach>
|
</if>
|
|
limit #{start},#{count}
|
</select>
|
|
<select id="countCanRecieveUid" resultType="java.lang.Long">
|
select
|
count( distinct(ti_uid))
|
from yeshi_ec_team_income where
|
ti_pre_recieve_time=#{preRecieveTime} and ti_state=1
|
|
<if test="typeList!=null">
|
<foreach collection="typeList" item="type" open=" and ("
|
separator=" or " close=")">
|
ti_type=#{type}
|
</foreach>
|
</if>
|
</select>
|
|
<select id="sumRecieveByType" resultType="BigDecimal">
|
SELECT SUM(ti_money) FROM yeshi_ec_team_income
|
WHERE ti_uid=#{uid} AND ti_type=#{type} AND ti_state=1
|
</select>
|
|
|
</mapper>
|