<?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.springmvc.mapper.UserInfoMapper"><!-- 根据用户编号查询用户信息-完整查询--><select id="findUserInfoById" parameterType="int" resultType="UserInfo">
select * from user where id = #{id}</select><!-- 根据用户编号查询用户信息-模糊查询--><select id="findUserInfoByUserName" parameterType="String" resultType="UserInfo">
select * from user where userName like concat(concat('%', #{userName}),'%')</select><!-- 添加用户--><insert id="addUserInfo" parameterType="UserInfo">
insert into user(userName, password)values(#{userName}, #{password});</insert><!-- 修改用户--><update id="updateUserInfo" parameterType="UserInfo">
update user set userName = #{userName}, password = #{password} where id = #{id}</update><delete id="deleteUserInfo" parameterType="int">
delete from user where id = #{id}</delete></mapper>