<update id="updateCheckItem" parameterType="com.pojo.Item">
UPDATE
t_item`
<trim prefix="set" suffixOverrides=",">
<if test="code !=null">
`code` = #{code},
</if>
<if test="name !=null">
`name` = #{name},
</if>
<if test="sex !=null">
`sex` = #{sex},
</if>
<if test="age !=null">
`age` = #{age},
</if>
<if test="price !=null">
`price` = #{price},
</if>
<if test="type !=null">
`type` = #{type},
</if>
<if test="attention !=null">
`attention` = #{attention},
</if>
<if test="remark !=null">
`remark` = #{remark}
</if>
</trim>
WHERE `id` = #{id} ;
</update>
update语句if,test
最新推荐文章于 2024-07-30 03:41:19 发布