...
|
...
|
@@ -5,6 +5,7 @@ |
|
|
<id column="id" property="id" jdbcType="INTEGER" />
|
|
|
<result column="uid" property="uid" jdbcType="INTEGER" />
|
|
|
<result column="type" property="type" jdbcType="INTEGER" />
|
|
|
<result column="alias" property="alias" jdbcType="VARCHAR" />
|
|
|
<result column="nickname" property="nickname" jdbcType="VARCHAR" />
|
|
|
<result column="image" property="image" jdbcType="VARCHAR" />
|
|
|
<result column="date" property="date" jdbcType="INTEGER" />
|
...
|
...
|
@@ -16,7 +17,7 @@ |
|
|
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
id, uid, type, nickname, image, date, amount, order_amount, extra_amount, order_num,
|
|
|
id, uid, type, alias, nickname, image, date, amount, order_amount, extra_amount, order_num,
|
|
|
create_time, update_time
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
...
|
...
|
@@ -40,19 +41,26 @@ |
|
|
limit 100
|
|
|
</select>
|
|
|
<select id="selectMonthRankList" resultType="com.yoho.service.model.union.bo.UninoShareIncomeBo" >
|
|
|
select amount ,uid,nickname,image,order_num as orderNum
|
|
|
select amount ,uid,alias,nickname,image,order_num as orderNum
|
|
|
from union_share_orders_month
|
|
|
where date=#{date,jdbcType=INTEGER}
|
|
|
order by amount desc
|
|
|
limit #{start},#{size}
|
|
|
</select>
|
|
|
<select id="selectTotalRankList" resultType="com.yoho.service.model.union.bo.UninoShareIncomeBo" >
|
|
|
select sum(amount) as amount ,uid,nickname,image,order_num as orderNum
|
|
|
select sum(amount) as amount ,uid,alias,nickname,image,order_num as orderNum
|
|
|
from union_share_orders_month
|
|
|
group by uid
|
|
|
order by sum(amount) desc
|
|
|
limit #{start},#{size}
|
|
|
</select>
|
|
|
<select id="selectSelective" resultMap="BaseResultMap" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from union_share_orders_month
|
|
|
where type = #{type,jdbcType=INTEGER} and alias = #{alias,jdbcType=VARCHAR} and date = #{date,jdbcType=INTEGER}
|
|
|
limit 10
|
|
|
</select>
|
|
|
<select id="selectAmountByUid" resultType="java.math.BigDecimal" >
|
|
|
select sum(amount)
|
|
|
from union_share_orders_month
|
...
|
...
|
@@ -67,12 +75,12 @@ |
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareOrdersMonth" >
|
|
|
insert into union_share_orders_month (id, uid, type,
|
|
|
nickname, image, date,
|
|
|
alias, nickname, image, date,
|
|
|
amount, order_amount, extra_amount,
|
|
|
order_num, create_time, update_time
|
|
|
)
|
|
|
values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
|
|
|
#{nickname,jdbcType=INTEGER}, #{image,jdbcType=INTEGER}, #{date,jdbcType=INTEGER},
|
|
|
#{alias,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, #{date,jdbcType=INTEGER},
|
|
|
#{amount,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, #{extraAmount,jdbcType=DECIMAL},
|
|
|
#{orderNum,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}
|
|
|
)
|
...
|
...
|
@@ -89,6 +97,9 @@ |
|
|
<if test="type != null" >
|
|
|
type,
|
|
|
</if>
|
|
|
<if test="alias != null" >
|
|
|
alias,
|
|
|
</if>
|
|
|
<if test="nickname != null" >
|
|
|
nickname,
|
|
|
</if>
|
...
|
...
|
@@ -127,11 +138,14 @@ |
|
|
<if test="type != null" >
|
|
|
#{type,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="alias != null" >
|
|
|
#{alias,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="nickname != null" >
|
|
|
#{nickname,jdbcType=INTEGER},
|
|
|
#{nickname,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="image != null" >
|
|
|
#{image,jdbcType=INTEGER},
|
|
|
#{image,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="date != null" >
|
|
|
#{date,jdbcType=INTEGER},
|
...
|
...
|
@@ -159,8 +173,11 @@ |
|
|
<update id="updateByUidAndMonth" parameterType="com.yoho.unions.dal.model.UnionShareOrdersMonth" >
|
|
|
update union_share_orders_month
|
|
|
<set >
|
|
|
<if test="alias != null" >
|
|
|
alias = #{alias,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="nickname != null" >
|
|
|
nickname = #{nickname,jdbcType=INTEGER},
|
|
|
nickname = #{nickname,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="image != null" >
|
|
|
image = #{image,jdbcType=INTEGER},
|
...
|
...
|
@@ -193,11 +210,14 @@ |
|
|
<if test="type != null" >
|
|
|
type = #{type,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="alias != null" >
|
|
|
alias = #{alias,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="nickname != null" >
|
|
|
nickname = #{nickname,jdbcType=INTEGER},
|
|
|
nickname = #{nickname,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="image != null" >
|
|
|
image = #{image,jdbcType=INTEGER},
|
|
|
image = #{image,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="date != null" >
|
|
|
date = #{date,jdbcType=INTEGER},
|
...
|
...
|
@@ -227,8 +247,9 @@ |
|
|
update union_share_orders_month
|
|
|
set uid = #{uid,jdbcType=INTEGER},
|
|
|
type = #{type,jdbcType=INTEGER},
|
|
|
nickname = #{nickname,jdbcType=INTEGER},
|
|
|
image = #{image,jdbcType=INTEGER},
|
|
|
alias = #{alias,jdbcType=VARCHAR},
|
|
|
nickname = #{nickname,jdbcType=VARCHAR},
|
|
|
image = #{image,jdbcType=VARCHAR},
|
|
|
date = #{date,jdbcType=INTEGER},
|
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
|
order_amount = #{orderAmount,jdbcType=DECIMAL},
|
...
|
...
|
@@ -243,6 +264,9 @@ |
|
|
<if test="uid != null">
|
|
|
and uid = #{uid}
|
|
|
</if>
|
|
|
<if test="alias != null">
|
|
|
and alias = #{alias}
|
|
|
</if>
|
|
|
<if test="type != null">
|
|
|
and type = #{type}
|
|
|
</if>
|
...
|
...
|
|