mybatis条件判断 5
传过来的参数是device,is_discount没有传过来,现在想问问没有传参数能不能像下面那样判断。<updateid="updateCar"parameterTyp...
传过来的参数是device,is_discount没有传过来,现在想问问没有传参数能不能像下面那样判断。
<update id="updateCar" parameterType="java.lang.String">
update wap_shiwu_car set changenumber=changenumber+1
<if test="is_discount=='1'">totalscore=totalscore+shiwu_discount_points</if>
<if test="is_discount=='0'">totalscore=totalscore+shiwu_points</if>
where isvalid=1 and user_device = #{device}
</update>
wap_shiwu_car包含字段:changenumber、is_discount、user_device、totalscore、shiwu_discount_points、shiwu_points 展开
<update id="updateCar" parameterType="java.lang.String">
update wap_shiwu_car set changenumber=changenumber+1
<if test="is_discount=='1'">totalscore=totalscore+shiwu_discount_points</if>
<if test="is_discount=='0'">totalscore=totalscore+shiwu_points</if>
where isvalid=1 and user_device = #{device}
</update>
wap_shiwu_car包含字段:changenumber、is_discount、user_device、totalscore、shiwu_discount_points、shiwu_points 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询