用传对象方式修改sql

sql

<update id="updateDate" resultType="com.entity.User">
updateset 
    <if test ="id !=null and id !=' ' " >
        id =#{id}
    </if>
    <if test ="name!=null and name!=' ' " >
       , name =#{name}
    </if>
    <if test ="sex!=null and sex!=' ' " >
       , sex=#{sex}
    </if>
where
    id = #{id}
</update>    

 

posted @ 2021-11-17 20:45  贩卖长江水  阅读(52)  评论(0编辑  收藏  举报