Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EL-ADMIN
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JiangSN
EL-ADMIN
Commits
593ee9ca
Commit
593ee9ca
authored
Oct 13, 2021
by
JiangSN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
集成mybatis-plus
parent
a53a3e57
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
318 additions
and
13 deletions
+318
-13
main.js
eladmin-web/src/main.js
+2
-1
pom.xml
eladmin/eladmin-business/pom.xml
+20
-12
MybatisPlusConfig.java
...s/src/main/java/me/zhengjie/config/MybatisPlusConfig.java
+24
-0
CommonConstants.java
...s/src/main/java/me/zhengjie/constant/CommonConstants.java
+76
-0
IndexController.java
...src/main/java/me/zhengjie/controller/IndexController.java
+35
-0
IndexMapper.java
...usiness/src/main/java/me/zhengjie/mapper/IndexMapper.java
+11
-0
IndexService.java
...iness/src/main/java/me/zhengjie/service/IndexService.java
+18
-0
IndexServiceImpl.java
...c/main/java/me/zhengjie/serviceimpl/IndexServiceImpl.java
+31
-0
R.java
...in/eladmin-business/src/main/java/me/zhengjie/util/R.java
+72
-0
IndexMapper.xml
...ladmin-business/src/main/resources/mapper/IndexMapper.xml
+11
-0
AppRun.java
eladmin/eladmin-system/src/main/java/me/zhengjie/AppRun.java
+2
-0
application.yml
.../eladmin-system/src/main/resources/config/application.yml
+16
-0
No files found.
eladmin-web/src/main.js
View file @
593ee9ca
...
...
@@ -30,7 +30,8 @@ import router from './router/routers'
import
'./assets/icons'
// icon
import
'./router/index'
// permission control
import
'echarts-gl'
import
VueResource
from
'vue-resource'
;
Vue
.
use
(
VueResource
);
Vue
.
use
(
checkPer
)
Vue
.
use
(
VueHighlightJS
)
Vue
.
use
(
mavonEditor
)
...
...
eladmin/eladmin-business/pom.xml
View file @
593ee9ca
...
...
@@ -34,22 +34,12 @@
<version>3.1.2</version>
</dependency>-->
<!-- MybatisPlus -->
<
!--<
dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.1.2
</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>me.zhengjie</groupId>
<artifactId>eladmin-common</artifactId>
<version>2.6</version>
<scope>compile</scope>
</dependency>-->
<dependency>
<groupId>
me.zhengjie
</groupId>
<artifactId>
eladmin-common
</artifactId>
...
...
@@ -61,4 +51,22 @@
<version>
2.3.1
</version>
</dependency>
</dependencies>
<build>
<resources>
<!-- maven项目中src源代码下的xml等资源文件编译进classes文件夹,
注意:如果没有这个,它会自动搜索resources下是否有mapper.xml文件,
如果没有就会报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.pet.mapper.PetMapper.selectByPrimaryKey-->
<resource>
<directory>
src/main/java
</directory>
<includes>
<include>
**/*.xml
</include>
</includes>
</resource>
<!--将resources目录下的配置文件编译进classes文件 -->
<resource>
<directory>
src/main/resources
</directory>
</resource>
</resources>
</build>
</project>
eladmin/eladmin-business/src/main/java/me/zhengjie/config/MybatisPlusConfig.java
0 → 100644
View file @
593ee9ca
package
me
.
zhengjie
.
config
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* @author JiangHeJia
* @version V1.0
* @Title: MybatisPlusConfig
* @Package el-admin
* @Description: TODO(配置分页插件)
* @date 2021/10/12 21:20
*/
@Configuration
public
class
MybatisPlusConfig
{
/**
* 分页插件
*/
@Bean
public
PaginationInterceptor
paginationInterceptor
()
{
return
new
PaginationInterceptor
();
}
}
eladmin/eladmin-business/src/main/java/me/zhengjie/constant/CommonConstants.java
0 → 100644
View file @
593ee9ca
/*
* Copyright (c) 2019-2020, 冷冷 (wangiegie@gmail.com).
* <p>
* Licensed under the GNU Lesser General Public License 3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* https://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
constant
;
/**
* @author lengleng
* @date 2019/2/1
*/
public
interface
CommonConstants
{
/**
* 删除
*/
String
STATUS_DEL
=
"1"
;
/**
* 正常
*/
String
STATUS_NORMAL
=
"0"
;
/**
* 锁定
*/
String
STATUS_LOCK
=
"9"
;
/**
* 菜单
*/
String
MENU
=
"0"
;
/**
* 编码
*/
String
UTF8
=
"UTF-8"
;
/**
* JSON 资源
*/
String
CONTENT_TYPE
=
"application/json; charset=utf-8"
;
/**
* 前端工程名
*/
String
FRONT_END_PROJECT
=
"pig-ui"
;
/**
* 后端工程名
*/
String
BACK_END_PROJECT
=
"pig"
;
/**
* 成功标记
*/
Integer
SUCCESS
=
0
;
/**
* 失败标记
*/
Integer
FAIL
=
1
;
/**
* 验证码前缀
*/
String
DEFAULT_CODE_KEY
=
"DEFAULT_CODE_KEY_"
;
}
eladmin/eladmin-business/src/main/java/me/zhengjie/controller/IndexController.java
0 → 100644
View file @
593ee9ca
package
me
.
zhengjie
.
controller
;
import
io.swagger.annotations.Api
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.annotation.AnonymousAccess
;
import
me.zhengjie.service.IndexService
;
import
me.zhengjie.util.R
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author JiangHeJia
* @version V1.0
* @Title: IndexController
* @Package el-admin
* @Description: TODO(首页展示信息查询控制器)
* @date 2021/10/12 21:28
*/
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"api/IndexController"
)
@Api
(
tags
=
"查询:首页展示信息查询控制器"
)
public
class
IndexController
{
@Autowired
private
IndexService
indexService
;
@AnonymousAccess
@RequestMapping
(
"/selectDemo"
)
public
R
selectDemo
()
{
return
new
R
<>(
indexService
.
selectDemo
());
}
}
eladmin/eladmin-business/src/main/java/me/zhengjie/mapper/IndexMapper.java
0 → 100644
View file @
593ee9ca
package
me
.
zhengjie
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
import
java.util.Map
;
public
interface
IndexMapper
extends
BaseMapper
<
Map
>
{
List
<
Map
>
selectDemo
();
}
eladmin/eladmin-business/src/main/java/me/zhengjie/service/IndexService.java
0 → 100644
View file @
593ee9ca
package
me
.
zhengjie
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
interface
IndexService
extends
IService
<
Map
>
{
/**
* 领导-管理部贷款逾期情况
* @return
*/
List
<
Map
>
selectDemo
();
}
eladmin/eladmin-business/src/main/java/me/zhengjie/serviceimpl/IndexServiceImpl.java
0 → 100644
View file @
593ee9ca
package
me
.
zhengjie
.
serviceimpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
me.zhengjie.mapper.IndexMapper
;
import
me.zhengjie.service.IndexService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author JiangHeJia
* @version V1.0
* @Title: IndexServiceImpl
* @Package el-admin
* @Description: TODO()
* @date 2021/10/12 21:30
*/
@Service
public
class
IndexServiceImpl
extends
ServiceImpl
<
IndexMapper
,
Map
>
implements
IndexService
{
@Autowired
private
IndexMapper
indexMapper
;
@Override
public
List
<
Map
>
selectDemo
()
{
return
indexMapper
.
selectDemo
();
}
}
eladmin/eladmin-business/src/main/java/me/zhengjie/util/R.java
0 → 100644
View file @
593ee9ca
/*
* Copyright (c) 2019-2020, 冷冷 (wangiegie@gmail.com).
* <p>
* Licensed under the GNU Lesser General Public License 3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* https://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
util
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
import
me.zhengjie.constant.CommonConstants
;
import
java.io.Serializable
;
/**
* 响应信息主体
*
* @param <T>
* @author lengleng
*/
@Builder
@ToString
@Accessors
(
chain
=
true
)
@AllArgsConstructor
public
class
R
<
T
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Getter
@Setter
private
int
code
=
CommonConstants
.
SUCCESS
;
@Getter
@Setter
private
String
msg
=
"success"
;
@Getter
@Setter
private
T
data
;
public
R
()
{
super
();
}
public
R
(
T
data
)
{
super
();
this
.
data
=
data
;
}
public
R
(
T
data
,
String
msg
)
{
super
();
this
.
data
=
data
;
this
.
msg
=
msg
;
}
public
R
(
Throwable
e
)
{
super
();
this
.
msg
=
e
.
getMessage
();
this
.
code
=
CommonConstants
.
FAIL
;
}
}
eladmin/eladmin-business/src/main/resources/mapper/IndexMapper.xml
0 → 100644
View file @
593ee9ca
<?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=
"me.zhengjie.mapper.IndexMapper"
>
<!-- 领导-贷款逾期-->
<select
id=
"selectDemo"
resultType=
"java.util.Map"
>
<![CDATA[
select * from sjgx_sys_log
]]>
</select>
</mapper>
eladmin/eladmin-system/src/main/java/me/zhengjie/AppRun.java
View file @
593ee9ca
...
...
@@ -18,6 +18,7 @@ package me.zhengjie;
import
io.swagger.annotations.Api
;
import
me.zhengjie.annotation.rest.AnonymousGetMapping
;
import
me.zhengjie.utils.SpringContextHolder
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
...
...
@@ -44,6 +45,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@EnableTransactionManagement
@EnableJpaAuditing
(
auditorAwareRef
=
"auditorAware"
)
@ComponentScan
(
basePackages
={
"me.zhengjie.*"
})
@MapperScan
(
basePackages
=
"me.zhengjie.mapper"
)
public
class
AppRun
{
public
static
void
main
(
String
[]
args
)
{
...
...
eladmin/eladmin-system/src/main/resources/config/application.yml
View file @
593ee9ca
...
...
@@ -35,6 +35,7 @@ spring:
password
:
${REDIS_PWD:}
#连接超时时间
timeout
:
5000
logging
:
level
:
org.springframework.security
:
...
...
@@ -45,6 +46,21 @@ logging:
org.hibernate.engine.QueryParameters
:
debug
org.hibernate.engine.query.HQLQueryPlan
:
debug
org.hibernate.type.descriptor.sql.BasicBinder
:
trace
me.zhengjie.mapper
:
debug
# mybaits-plus配置
mybatis-plus
:
mapper-locations
:
classpath:mapper/*.xml
global-config
:
banner
:
false
id-type
:
1
field-strategy
:
1
table-underline
:
true
logic-delete-value
:
1
logic-not-delete-value
:
0
configuration
:
map-underscore-to-camel-case
:
true
jdbc-type-for-null
:
'
null'
task
:
pool
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment