通用mapper集成 90%
This commit is contained in:
@ -1,18 +1,19 @@
|
||||
package com.ruoyi;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import tk.mybatis.spring.annotation.MapperScan;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author
|
||||
*/
|
||||
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@MapperScan(basePackages = "com.ruoyi.bookmark.mapper")
|
||||
public class RuoYiApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
@ -36,6 +36,15 @@ public class SqBookmarkController extends BaseController
|
||||
private ISqBookmarkService sqBookmarkService;
|
||||
|
||||
|
||||
/**
|
||||
* 测试通用mapper
|
||||
*/
|
||||
@GetMapping("/selectByID")
|
||||
public TableDataInfo selectByID(Long userID) {
|
||||
List<SqBookmark> list = sqBookmarkService.selectByID(userID);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户栏目下的书签
|
||||
|
@ -94,6 +94,13 @@ mybatis:
|
||||
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||
# 加载全局的配置文件
|
||||
configLocation: classpath:mybatis/mybatis-config.xml
|
||||
#通用mapper的所在接口名称 不只是包名
|
||||
#mappers 多个接口时逗号隔开
|
||||
|
||||
mapper:
|
||||
mappers: com.ruoyi.common.mybatisMapper.MyMapper
|
||||
not-empty: false
|
||||
identity: MYSQL
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
|
Reference in New Issue
Block a user