<update id=”updateCardMoney” parameterType=”com.abc.model.Card”>
update card
<set>
<if test=”frozen_money==0″>
frozen_money = 200,wallet_money -= 200
</if>
<if test=”200>frozen_money and frozen_money>0″>
frozen_money = 200,wallet_money -= 200-frozen_money
</if>
</set>
where card_code=#{card_code}
</update>
报错信息:
### SQL: update card SET frozen_money = 200,wallet_money -= 200-frozen_money where card_code=?
### Cause: java.sql.SQLException: ORA-00927: 缺失等号
update card
<set>
<if test=”frozen_money==0″>
frozen_money = 200,wallet_money -= 200
</if>
<if test=”200>frozen_money and frozen_money>0″>
frozen_money = 200,wallet_money -= 200-frozen_money
</if>
</set>
where card_code=#{card_code}
</update>
报错信息:
### SQL: update card SET frozen_money = 200,wallet_money -= 200-frozen_money where card_code=?
### Cause: java.sql.SQLException: ORA-00927: 缺失等号
解决方案
10
<if test=”frozen_money==0″>
frozen_money = 200,wallet_money -= 200
</if>
<if test=”200>frozen_money and frozen_money>0″>
frozen_money = 200,wallet_money -= 200-frozen_money
</if>
是这里的原因吗
frozen_money = 200,wallet_money -= 200
</if>
<if test=”200>frozen_money and frozen_money>0″>
frozen_money = 200,wallet_money -= 200-frozen_money
</if>
是这里的原因吗
10
你等号前面怎么有个横线
10
数据库里面没有-=这个符号