注解开发
<mappers>
<!-- 直接读取映射文件 -->
<!-- <mapper resource="kong/UserMapper.xml"/>-->
<!-- 获取dao文件 xml文件存放的路径和dao接口的包名要对应 -->
<package name="com.kong.dao"/>
</mappers>
直接写在dao文件@Select()即可
public interface UserMapper {
@Select("select * from t_user")
public List<User> findAll();
public User findUser(Integer id);
public List<User> getUserList(Map map);
public List<User> getByMap(Map map);
public List<User> getUserWhere(Integer id, String name);
public int insert(User user);
public boolean deleteUserById(Integer id);
public int updateBathUserByIds(@Param("ids") Integer[] ids);
}
以上方式不推荐。了解即可
标签:int,List,id,开发,Integer,mybatis,注解,public From: https://www.cnblogs.com/jichenghui/p/17909646.html