diff --git a/wisenergy-mapper/src/main/resources/mapper/ProgressPrizeMapper.xml b/wisenergy-mapper/src/main/resources/mapper/ProgressPrizeMapper.xml index d1ef4aee7a8611cb9d2d08e7ace8d456f4a5a43d..48cc122d96fc931c7e3ac8ee834a033292433202 100644 --- a/wisenergy-mapper/src/main/resources/mapper/ProgressPrizeMapper.xml +++ b/wisenergy-mapper/src/main/resources/mapper/ProgressPrizeMapper.xml @@ -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 >= #{createTime}</if> <if test="updateTime != null">and #{updateTime} >= 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