UserMapper.xml 888 B

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.example.springboot.mapper.UserMapper">
  4. <update id="update">
  5. update user
  6. <set>
  7. <if test="name != null">
  8. name = #{name},
  9. </if>
  10. <if test="sex != null">
  11. sex = #{sex},
  12. </if>
  13. <if test="stature != null">
  14. stature = #{stature},
  15. </if>
  16. <if test="mail != null">
  17. mail = #{mail},
  18. </if>
  19. <if test="pwd != null">
  20. pwd = #{pwd}
  21. </if>
  22. <if test="phone != null">
  23. phone = #{phone}
  24. </if>
  25. </set>
  26. <where>
  27. id = #{id}
  28. </where>
  29. </update>
  30. </mapper>