Skip to main content
Glama
UserMapper.xml1.56 kB
<?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="ink.openmind.springbootsamplemybatisproject.dao.UserMapper"> <!-- 检索所有用户信息--> <select id="list" resultType="ink.openmind.springbootsamplemybatisproject.entity.User"> SELECT * FROM user_tb WHERE 1 = 1; </select> <!-- 根据id检索用户信息--> <select id="findById" parameterType="int" resultType="ink.openmind.springbootsamplemybatisproject.entity.User"> SELECT * FROM user_tb WHERE id = #{value} </select> <!-- 根据id更新用户信息--> <update id="update" parameterType="ink.openmind.springbootsamplemybatisproject.entity.User"> UPDATE user_tb <set> <if test="username != null and username != ''"> username = #{username,jdbcType=VARCHAR} </if> <if test="password != null and password != ''"> ,password = #{password} </if> </set> WHERE id=#{id} </update> <!-- 根据id删除用户信息--> <delete id="delete" parameterType="int"> DELETE FROM user_tb WHERE id = #{id} </delete> <!-- 保存用户信息 --> <insert id="save" parameterType="ink.openmind.springbootsamplemybatisproject.entity.User"> INSERT INTO user_tb(username, password) VALUES (#{username},#{password}) </insert> </mapper>

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yuwencheng0212/ppt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server