<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.example.springboot.mapper.UserMapper"> <update id="update"> update biyesheji <set> <if test="username != null"> username=#{username}, </if> <!-- <if test="password != null">--> <!-- password=#{password},--> <!-- </if>--> <if test="nickname != null"> nickname=#{nickname}, </if> <if test="email != null"> email=#{email}, </if> <if test="phone != null"> phone=#{phone}, </if> <if test="address != null"> address=#{address} </if> </set> <where> id= #{id} </where> </update> </mapper>
mapper的xml格式(内含动态sql语句)
于 2023-11-15 16:08:19 首次发布