package com.cesgroup.homwork.mybatis.sample.mapper;

import com.cesgroup.homwork.mybatis.sample.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

  @Insert("INSERT INTO USER (id, name, context) VALUES(#{id}, #{name}, #{context})")
  void insert(User user);

  @Select("SELECT id, name, context FROM USER WHERE id = #{id}")
  User findById(String id);

}