sql
<update id="updateDate" resultType="com.entity.User"> update 表 set <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>