<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cxyxiaomo.epp.user.dao.UserDao">
    <insert id="addUser" parameterType="com.cxyxiaomo.epp.common.pojo.User">
        INSERT INTO user (username, password)
        VALUES (#{username}, #{password})
    </insert>
    <select id="getUserById" parameterType="java.lang.Long" resultType="com.cxyxiaomo.epp.common.pojo.User">
        SELECT * FROM user
        WHERE id = #{id}
    </select>
    <select id="getUserByUsername" resultType="com.cxyxiaomo.epp.common.pojo.User">
        select * from user where username = #{username}
    </select>
</mapper>
