pom.xml配置:
这个配置还有不足请在下方给出建议
I: 我这里测试三个 : 分别是有@的
DemoMapper(接口):
package com.test; import com.pojo.Demo; import org.apache.ibatis.annotations.Select; import java.util.List; public interface DemoMapper { /** * 查询数量 count(1) */ int getCount(); /** * 查询demo01表的 id,name信息 */ @Select("SELECT * FROM demo01") List<Demo> getDemoList(); /** * 添加信息 */ @Select("INSERT INTO demo01(id,`name`) VALUES(#{id},#{name})") int addDemo(Demo demo); /** * 删除信息 按照id */ int delectDemo(int id); /** * 模糊查询 name */ @Select("SELECT * FROM demo01 WHERE `name` LIKE concat('%',#{name},'%')") List<Demo> getDemoListByLikeName(String name); /** * 多表查询 */ List<Double> getGradeByMuchTable(); }