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();


}

相关文章:

  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2022-02-10
猜你喜欢
  • 2022-12-23
  • 2021-10-27
  • 2022-01-20
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案