Browse Source

修改用户积分为空时加不上积分问题

feature/screenDataPush
liuchuang 4 years ago
parent
commit
ff99c35e9e
  1. 4
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

4
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

@ -7,9 +7,9 @@
select ID,POINTS,now() from epdc_user where DEL_FLAG = '0' select ID,POINTS,now() from epdc_user where DEL_FLAG = '0'
</insert> </insert>
<update id="updateUserPoints"> <update id="updateUserPoints">
update epdc_user set POINTS = POINTS + #{points} update epdc_user set POINTS = IFNULL(POINTS,0) + #{points}
<if test="points &gt; 0"> <if test="points &gt; 0">
,POINTS_TOTLE = POINTS_TOTLE + #{points} ,POINTS_TOTLE = IFNULL(POINTS_TOTLE,0) + #{points}
</if> </if>
where ID = #{userId} where ID = #{userId}
</update> </update>

Loading…
Cancel
Save