Skip to content

Instantly share code, notes, and snippets.

@A-pZ
Created April 6, 2022 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save A-pZ/628ca667ad396a42deab13e1e58d97d4 to your computer and use it in GitHub Desktop.
Save A-pZ/628ca667ad396a42deab13e1e58d97d4 to your computer and use it in GitHub Desktop.
ItemMapper
package com.github.apz.sample.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.github.apz.sample.record.Item;
@Mapper
public interface ItemMapper {
public List<Item> findById(@Param("id") String id);
}
<?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.github.apz.sample.mapper.ItemMapper">
<select id="findById" resultType="com.github.apz.sample.record.Item">
select id, name from item
<where>
id = #{id}
</where>
</select>
</mapper>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment