Commit bdac358f authored by licc's avatar licc

edit sql

parent fca5cfba
......@@ -21,7 +21,7 @@
</sql>
<sql id="cols_exclude_id">
user_id,year_month,growth_rate,award_money,create_time,update_time
user_id,`year_month`,`growth_rate`,award_money,create_time,update_time
</sql>
<sql id="vals">
......@@ -30,8 +30,8 @@
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="yearMonth != null">year_month = #{yearMonth},</if>
<if test="growthRate != null">growth_rate =#{growthRate},</if>
<if test="yearMonth != null">`year_month` = #{yearMonth},</if>
<if test="growthRate != null">`growth_rate` =#{growthRate},</if>
<if test="awardMoney != null">award_money =#{awardMoney},</if>
update_time =now()
</sql>
......@@ -39,8 +39,8 @@
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="yearMonth != null">and year_month = #{yearMonth}</if>
<if test="growthRate != null">and growth_rate =#{growthRate}</if>
<if test="yearMonth != null">and `year_month` = #{yearMonth}</if>
<if test="growthRate != null">and `growth_rate` =#{growthRate}</if>
<if test="awardMoney != null">and award_money =#{awardMoney}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
......@@ -80,24 +80,20 @@
<where>
<if test="yearMonth != null">
AND(
YEAR(year_month) = YEAR(#{yearMonth})
AND MONTH(year_month) = MONTH(#{yearMonth}))
YEAR(`year_month`) = YEAR(#{yearMonth})
AND MONTH(`year_month`) = MONTH(#{yearMonth}))
</if>
</where>
</select>
<select id="getByTime" resultType="cn.wisenergy.model.vo.ProgressPrizeVo">
select p.user_id as userId,p.growth_rate as growthRate, p.award_money as awardMoney
from progress_prize p,user_info u
<where>
p.user_id=u.user_id
<if test="yearMonth != null">
AND(
YEAR(p.year_month) = YEAR(#{yearMonth})
AND MONTH(p.year_month) = MONTH(#{yearMonth}))
</if>
order by p.growth_rate desc,u.create_time desc
</where>
select p.user_id as userId,p.`growth_rate` as growthRate, p.award_money as awardMoney
from
progress_prize p ,user_info u
where
p.user_id=u.user_id
and p.`year_month` = #{yearMonth}
order by p.`growth_rate` desc,u.create_time desc
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment