123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
- "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
- <mapper namespace="org.example.mapper.UserMapper">
- <!--用户添加-->
- <!-- Integer insert(User user) -->
- <insert id="insert" useGeneratedKeys="true"
- keyProperty="id">
- INSERT INTO users(
- id,username,
- password
- )VALUES(
- #{id},#{username},
- #{password}
- )
- </insert>
- <!--查找用户名-->
- <!--User findByUsername(String username)-->
- <select id="findByUsername" resultType="org.example.entity.User">
- SELECT
- id,username,
- password
- FROM
- users
- WHERE
- username=#{username}
- </select>
- <!-- id查找用户 -->
- <!-- User findById(Integer id) -->
- <select id="findById" resultType="org.example.entity.User">
- SELECT
- id,username,
- password
- FROM
- users
- WHERE
- id=#{id}
- </select>
- </mapper>
|