Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
znks
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
王夏晖
znks
Commits
141dc28f
Commit
141dc28f
authored
Sep 13, 2018
by
leyboy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.Admin相关接口完成
parent
544e7e95
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1178 additions
and
336 deletions
+1178
-336
workspace.xml
.idea/workspace.xml
+653
-331
adc-da-main.iml
adc-da-main/adc-da-main.iml
+4
-1
pom.xml
adc-da-main/pom.xml
+13
-0
AdcDaApplication.java
adc-da-main/src/main/java/com/adc/da/AdcDaApplication.java
+1
-1
AdminController.java
...main/java/com/adc/da/znks/controller/AdminController.java
+98
-0
AdminDao.java
adc-da-main/src/main/java/com/adc/da/znks/dao/AdminDao.java
+50
-0
Admin.java
adc-da-main/src/main/java/com/adc/da/znks/entity/Admin.java
+82
-0
AdminService.java
...n/src/main/java/com/adc/da/znks/service/AdminService.java
+78
-0
Base64Utils.java
...-main/src/main/java/com/adc/da/znks/util/Base64Utils.java
+35
-0
AdminSearch.java
...da-main/src/main/java/com/adc/da/znks/vo/AdminSearch.java
+37
-0
AdminVO.java
adc-da-main/src/main/java/com/adc/da/znks/vo/AdminVO.java
+43
-0
application-prd.properties
adc-da-main/src/main/resources/application-prd.properties
+1
-1
application.properties
adc-da-main/src/main/resources/application.properties
+5
-0
AdminMapper.xml
...in/src/main/resources/mybatis/mapper/znks/AdminMapper.xml
+47
-0
mybatis-config.xml
adc-da-main/src/main/resources/mybatis/mybatis-config.xml
+6
-0
CodeUtil.java
adc-da-main/src/test/java/com/adc/da/gen/CodeUtil.java
+1
-1
application-prd.properties
adc-da-main/target/classes/application-prd.properties
+1
-1
application.properties
adc-da-main/target/classes/application.properties
+5
-0
mybatis-config.xml
adc-da-main/target/classes/mybatis/mybatis-config.xml
+6
-0
CodeUtil.class
...da-main/target/test-classes/com/adc/da/gen/CodeUtil.class
+0
-0
adc-da.iml
adc-da.iml
+12
-0
No files found.
.idea/workspace.xml
View file @
141dc28f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
adc-da-main/adc-da-main.iml
View file @
141dc28f
...
@@ -85,7 +85,6 @@
...
@@ -85,7 +85,6 @@
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework.boot:spring-boot-test:1.5.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework.boot:spring-boot-test:1.5.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot:1.5.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot:1.5.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.5.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.5.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-autoconfigure:1.5.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: com.jayway.jsonpath:json-path:2.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: com.jayway.jsonpath:json-path:2.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: net.minidev:json-smart:2.2.1"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: net.minidev:json-smart:2.2.1"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: net.minidev:accessors-smart:1.1"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: net.minidev:accessors-smart:1.1"
level=
"project"
/>
...
@@ -145,6 +144,10 @@
...
@@ -145,6 +144,10 @@
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis:mybatis-spring:1.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis:mybatis-spring:1.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.github.pagehelper:pagehelper:5.1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.github.jsqlparser:jsqlparser:1.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.5"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-autoconfigure:1.5.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.sourceforge.javacsv:javacsv:2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.sourceforge.javacsv:javacsv:2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.sf.opencsv:opencsv:2.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.sf.opencsv:opencsv:2.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: commons-fileupload:commons-fileupload:1.3.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: commons-fileupload:commons-fileupload:1.3.3"
level=
"project"
/>
...
...
adc-da-main/pom.xml
View file @
141dc28f
...
@@ -125,6 +125,19 @@
...
@@ -125,6 +125,19 @@
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
1.2.0
</version>
<version>
1.2.0
</version>
</dependency>
</dependency>
<!-- mybatis分页 -->
<!-- pageHelper -->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper
</artifactId>
<version>
5.1.2
</version>
</dependency>
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-autoconfigure
</artifactId>
<version>
1.2.5
</version>
</dependency>
<dependency>
<dependency>
<groupId>
net.sourceforge.javacsv
</groupId>
<groupId>
net.sourceforge.javacsv
</groupId>
...
...
adc-da-main/src/main/java/com/adc/da/AdcDaApplication.java
View file @
141dc28f
...
@@ -17,7 +17,7 @@ import com.codahale.metrics.CsvReporter;
...
@@ -17,7 +17,7 @@ import com.codahale.metrics.CsvReporter;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.ComponentScan
;
/*@MapperScan("com.adc.da.**.dao")*/
@MapperScan
(
"com.adc.da.**.dao"
)
@ComponentScan
(
"com.adc"
)
@ComponentScan
(
"com.adc"
)
@ServletComponentScan
@ServletComponentScan
@SpringBootApplication
(
exclude
=
{
@SpringBootApplication
(
exclude
=
{
...
...
adc-da-main/src/main/java/com/adc/da/znks/controller/AdminController.java
0 → 100644
View file @
141dc28f
package
com
.
adc
.
da
.
znks
.
controller
;
import
com.adc.da.znks.entity.Admin
;
import
com.adc.da.znks.entity.ResponseEntity
;
import
com.adc.da.znks.service.AdminService
;
import
com.adc.da.znks.util.GenResponse
;
import
com.adc.da.znks.vo.AdminSearch
;
import
com.adc.da.znks.vo.AdminVO
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/api"
)
public
class
AdminController
{
@Autowired
private
AdminService
adminService
;
@PostMapping
(
"/admin"
)
public
ResponseEntity
saveOne
(
Admin
admin
)
{
try
{
adminService
.
insertAdmin
(
admin
);
return
GenResponse
.
success
();
}
catch
(
Exception
e
)
{
return
GenResponse
.
fail
(
"保存失败"
);
}
}
@PutMapping
(
"/admin"
)
public
ResponseEntity
updateOne
(
Admin
admin
)
{
try
{
adminService
.
updateAdmin
(
admin
);
return
GenResponse
.
success
();
}
catch
(
Exception
e
)
{
return
GenResponse
.
fail
(
"更新失败"
);
}
}
@DeleteMapping
(
"/admin/{adminId}"
)
public
ResponseEntity
deleteOne
(
@PathVariable
String
adminId
)
{
try
{
adminService
.
deleteAdmin
(
adminId
);
return
GenResponse
.
success
();
}
catch
(
Exception
e
)
{
return
GenResponse
.
fail
(
"删除失败"
);
}
}
@GetMapping
(
"/admin/{adminId}"
)
public
ResponseEntity
<
Admin
>
findOne
(
@PathVariable
String
adminId
)
{
try
{
Admin
admin
=
adminService
.
findAdmin
(
adminId
);
return
GenResponse
.
success
(
String
.
valueOf
(
HttpStatus
.
OK
.
value
()),
"查询成功"
,
admin
);
}
catch
(
Exception
e
)
{
return
GenResponse
.
fail
(
"查询失败"
);
}
}
@GetMapping
(
"/admin/page"
)
public
ResponseEntity
<
PageInfo
>
findByPage
(
AdminSearch
adminSearch
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"8"
)
Integer
pageSize
)
{
try
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
AdminVO
>
adminVOS
=
adminService
.
listAdminsByCondition
(
adminSearch
,
pageNum
,
pageSize
);
PageInfo
<
AdminVO
>
pageInfo
=
new
PageInfo
<
AdminVO
>(
adminVOS
);
return
GenResponse
.
success
(
String
.
valueOf
(
HttpStatus
.
OK
.
value
()),
"查询成功"
,
pageInfo
);
}
catch
(
Exception
e
)
{
return
GenResponse
.
fail
(
"查询失败"
);
}
}
@PostMapping
(
"/admin/login"
)
public
ResponseEntity
login
(
@RequestParam
String
adminName
,
@RequestParam
String
password
)
{
try
{
if
(
adminService
.
login
(
adminName
,
password
))
{
return
GenResponse
.
success
(
String
.
valueOf
(
HttpStatus
.
OK
.
value
()),
"登录成功"
,
true
);
}
else
{
return
GenResponse
.
fail
(
"登录失败"
);
}
}
catch
(
Exception
e
)
{
return
GenResponse
.
fail
(
"登录失败"
);
}
}
}
adc-da-main/src/main/java/com/adc/da/znks/dao/AdminDao.java
0 → 100644
View file @
141dc28f
package
com
.
adc
.
da
.
znks
.
dao
;
import
com.adc.da.znks.entity.Admin
;
import
com.adc.da.znks.vo.AdminSearch
;
import
com.adc.da.znks.vo.AdminVO
;
import
org.apache.ibatis.annotations.*
;
import
java.util.List
;
/**
* @author ley
**/
@Mapper
public
interface
AdminDao
{
@Insert
(
"insert into tb_admin(admin_id,admin_name,admin_password,create_time) "
+
"values(#{id},#{name},#{password},#{createTime})"
)
int
insertAdmin
(
Admin
admin
);
@Delete
(
"delete from tb_admin where admin_id = #{adminId}"
)
int
deleteAdmin
(
@Param
(
"adminId"
)
String
adminId
);
int
updateAdmin
(
Admin
admin
);
List
<
AdminVO
>
listAdminsByCondition
(
@Param
(
"adminSearch"
)
AdminSearch
adminSearch
,
@Param
(
"pageNum"
)
Integer
pageNum
,
@Param
(
"pageSize"
)
Integer
pageSize
);
@Select
(
"select * from tb_admin where admin_name = #{param1}"
)
@Results
({
@Result
(
column
=
"admin_id"
,
property
=
"id"
),
@Result
(
column
=
"create_time"
,
property
=
"createTime"
),
@Result
(
column
=
"admin_name"
,
property
=
"name"
),
@Result
(
column
=
"admin_password"
,
property
=
"password"
)
}
)
Admin
findAdminByAdminName
(
String
adminName
);
@Select
(
"select * from tb_admin where admin_id = #{param1}"
)
@Results
({
@Result
(
column
=
"admin_id"
,
property
=
"id"
),
@Result
(
column
=
"create_time"
,
property
=
"createTime"
),
@Result
(
column
=
"admin_name"
,
property
=
"name"
)}
)
Admin
findAdminByAdminId
(
String
adminId
);
}
adc-da-main/src/main/java/com/adc/da/znks/entity/Admin.java
0 → 100644
View file @
141dc28f
package
com
.
adc
.
da
.
znks
.
entity
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
java.util.Date
;
/**
* @author ley
* **/
public
class
Admin
{
private
String
name
;
private
String
password
;
@org
.
springframework
.
format
.
annotation
.
DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JSONField
(
format
=
"yyyy-MM-dd"
)
private
Date
createTime
;
private
transient
String
plainPassword
;
private
String
id
;
public
Admin
()
{
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getPlainPassword
()
{
return
plainPassword
;
}
public
void
setPlainPassword
(
String
plainPassword
)
{
this
.
plainPassword
=
plainPassword
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
@Override
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
(
"{"
);
sb
.
append
(
"\"name\":\""
)
.
append
(
name
).
append
(
'\"'
);
sb
.
append
(
",\"password\":\""
)
.
append
(
password
).
append
(
'\"'
);
sb
.
append
(
",\"createTime\":\""
)
.
append
(
createTime
).
append
(
'\"'
);
sb
.
append
(
",\"id\":\""
)
.
append
(
id
).
append
(
'\"'
);
sb
.
append
(
'}'
);
return
sb
.
toString
();
}
}
adc-da-main/src/main/java/com/adc/da/znks/service/AdminService.java
0 → 100644
View file @
141dc28f
package
com
.
adc
.
da
.
znks
.
service
;
import
com.adc.da.util.utils.UUID
;
import
com.adc.da.znks.dao.AdminDao
;
import
com.adc.da.znks.entity.Admin
;
import
com.adc.da.znks.util.Base64Utils
;
import
com.adc.da.znks.vo.AdminSearch
;
import
com.adc.da.znks.vo.AdminVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
java.io.IOException
;
import
java.nio.charset.Charset
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author ley
**/
@Service
@Transactional
(
value
=
"transactionManager"
,
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
Throwable
.
class
)
public
class
AdminService
{
@Autowired
(
required
=
false
)
private
AdminDao
adminDao
;
public
List
<
AdminVO
>
listAdminsByCondition
(
AdminSearch
adminSearch
,
Integer
pageNum
,
Integer
pageSize
)
{
return
adminDao
.
listAdminsByCondition
(
adminSearch
,
pageNum
,
pageSize
);
}
public
int
insertAdmin
(
Admin
admin
)
{
admin
.
setCreateTime
(
new
Date
(
System
.
currentTimeMillis
()));
admin
.
setId
(
UUID
.
randomUUID
());
if
(
StringUtils
.
hasText
(
admin
.
getPlainPassword
())){
admin
.
setPassword
(
Base64Utils
.
encode
(
admin
.
getPlainPassword
().
getBytes
(
Charset
.
defaultCharset
())));
}
return
adminDao
.
insertAdmin
(
admin
);
}
public
int
deleteAdmin
(
String
adminId
){
return
adminDao
.
deleteAdmin
(
adminId
);
}
public
int
updateAdmin
(
Admin
admin
){
if
(
StringUtils
.
hasText
(
admin
.
getPlainPassword
())){
admin
.
setPassword
(
Base64Utils
.
encode
(
admin
.
getPlainPassword
().
getBytes
(
Charset
.
defaultCharset
())));
}
return
adminDao
.
updateAdmin
(
admin
);
}
public
Admin
findAdmin
(
String
adminId
){
return
adminDao
.
findAdminByAdminId
(
adminId
);
}
public
boolean
login
(
String
adminName
,
String
plainPassword
)
throws
IOException
{
Admin
admin
=
adminDao
.
findAdminByAdminName
(
adminName
);
if
(
admin
!=
null
)
{
String
adminPassword
=
admin
.
getPassword
();
if
(
StringUtils
.
hasText
(
plainPassword
)
&&
plainPassword
.
equals
(
new
String
(
Base64Utils
.
decode
(
adminPassword
),
Charset
.
defaultCharset
())))
{
return
true
;
}
else
{
//密码验证不成功
return
false
;
}
}
return
false
;
}
}
adc-da-main/src/main/java/com/adc/da/znks/util/Base64Utils.java
0 → 100644
View file @
141dc28f
package
com
.
adc
.
da
.
znks
.
util
;
import
sun.misc.BASE64Decoder
;
import
sun.misc.BASE64Encoder
;
import
java.io.IOException
;
import
java.nio.charset.Charset
;
/**
* @author ley
* **/
public
class
Base64Utils
{
/**
* byte to base64
**/
public
static
String
encode
(
byte
[]
bytes
)
{
BASE64Encoder
base64Encoder
=
new
BASE64Encoder
();
return
base64Encoder
.
encode
(
bytes
);
}
/**
* base64 to byte
**/
public
static
byte
[]
decode
(
String
base64
)
throws
IOException
{
BASE64Decoder
base64Decoder
=
new
BASE64Decoder
();
return
base64Decoder
.
decodeBuffer
(
base64
);
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
final
String
testString
=
"hello,i am chenkangxian,good night!"
;
System
.
out
.
println
(
encode
(
testString
.
getBytes
()));
String
base64Str
=
"aGVsbG8saSBhbSBjaGVua2FuZ3hpYW4sZ29vZCBuaWdodCE="
;
System
.
out
.
println
(
new
String
(
decode
(
base64Str
),
Charset
.
defaultCharset
()));
}
}
adc-da-main/src/main/java/com/adc/da/znks/vo/AdminSearch.java
0 → 100644
View file @
141dc28f
package
com
.
adc
.
da
.
znks
.
vo
;
/**
* @author ley
* **/
public
class
AdminSearch
{
private
String
createTime1
;
private
String
createTime2
;
private
String
adminName
;
public
String
getCreateTime1
()
{
return
createTime1
;
}
public
void
setCreateTime1
(
String
createTime1
)
{
this
.
createTime1
=
createTime1
;
}
public
String
getCreateTime2
()
{
return
createTime2
;
}
public
void
setCreateTime2
(
String
createTime2
)
{
this
.
createTime2
=
createTime2
;
}
public
String
getAdminName
()
{
return
adminName
;
}
public
void
setAdminName
(
String
adminName
)
{
this
.
adminName
=
adminName
;
}
}
adc-da-main/src/main/java/com/adc/da/znks/vo/AdminVO.java
0 → 100644
View file @
141dc28f
package
com
.
adc
.
da
.
znks
.
vo
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
java.util.Date
;
/**
* @author ley
* **/
public
class
AdminVO
{
private
String
adminName
;
@org
.
springframework
.
format
.
annotation
.
DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JSONField
(
format
=
"yyyy-MM-dd"
)
private
Date
createTime
;
private
String
adminId
;
public
String
getAdminId
()
{
return
adminId
;
}
public
void
setAdminId
(
String
adminId
)
{
this
.
adminId
=
adminId
;
}
public
String
getAdminName
()
{
return
adminName
;
}
public
void
setAdminName
(
String
adminName
)
{
this
.
adminName
=
adminName
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
}
adc-da-main/src/main/resources/application-prd.properties
View file @
141dc28f
...
@@ -13,4 +13,4 @@ server.port=8080
...
@@ -13,4 +13,4 @@ server.port=8080
verifyCodeMode
=
1
verifyCodeMode
=
1
#密码Base64加密开关,true为开启,false为关闭
#密码Base64加密开关,true为开启,false为关闭
isPassEncrypted
=
false
isPassEncrypted
=
false
\ No newline at end of file
adc-da-main/src/main/resources/application.properties
View file @
141dc28f
...
@@ -56,6 +56,11 @@ server.port=7777
...
@@ -56,6 +56,11 @@ server.port=7777
mybatis.config-locations
=
classpath:mybatis/mybatis-config.xml
mybatis.config-locations
=
classpath:mybatis/mybatis-config.xml
mybatis.mapper-locations
=
classpath*:mybatis/mapper/**/*.xml
mybatis.mapper-locations
=
classpath*:mybatis/mapper/**/*.xml
# mybatis pagehelper
pagehelper.params
=
pageNum=pageNum;pageSize=pageSize;
pagehelper.reasonable
=
true
pagehelper.support-methods-arguments
=
true
#显示sql
#显示sql
spring.profiles.active
=
dev
spring.profiles.active
=
dev
logging.level.com.adc
=
DEBUG
logging.level.com.adc
=
DEBUG
...
...
adc-da-main/src/main/resources/mybatis/mapper/znks/AdminMapper.xml
0 → 100644
View file @
141dc28f
<?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=
"com.adc.da.znks.dao.AdminDao"
>
<!-- Result Map-->
<resultMap
id=
"BaseResultMap"
type=
"com.adc.da.znks.vo.AdminVO"
>
<result
column=
"admin_id"
property=
"adminId"
/>
<result
column=
"admin_name"
property=
"adminName"
/>
<result
column=
"create_time"
property=
"createTime"
/>
</resultMap>
<!-- tb_position table all fields -->
<sql
id=
"Base_Column_List"
>
a.admin_id,a.admin_name,a.create_time
</sql>
<update
id=
"updateAdmin"
parameterType=
"com.adc.da.znks.entity.Admin"
>
update tb_admin
<set>
<if
test=
"name != null"
>
admin_name = #{name},
</if>
<if
test=
"password != null"
>
admin_password = #{password},
</if>
</set>
where admin_id = #{id}
</update>
<select
id=
"listAdminsByCondition"
parameterType=
"object"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tb_admin a
<where>
<trim
suffixOverrides=
"and"
>
<if
test=
"adminSearch.adminName!=null "
>
a.admin_name = #{adminSearch.adminName} and
</if>
<if
test=
"adminSearch.createTime1!=null"
>
a.create_time >= #{adminSearch.createTime1} and
</if>
<if
test=
"adminSearch.createTime2!=null"
>
a.create_time
<
= #{adminSearch.createTime2} and
</if>
</trim>
</where>
</select>
</mapper>
adc-da-main/src/main/resources/mybatis/mybatis-config.xml
View file @
141dc28f
...
@@ -4,6 +4,11 @@
...
@@ -4,6 +4,11 @@
<configuration>
<configuration>
<!-- 全局参数 -->
<!-- 全局参数 -->
<settings>
<settings>
<!-- 延迟加载的开关,开启时,所有的关联对象都会延迟加载,默认为false -->
<setting
name=
"lazyLoadingEnabled"
value=
"true"
/>
<!-- 属性启用时,会使带有延迟加载属性的对象立即加载,默认为true -->
<setting
name=
"aggressiveLazyLoading"
value=
"false"
/>
<setting
name=
"logImpl"
value=
"STDOUT_LOGGING"
/>
<setting
name=
"callSettersOnNulls"
value=
"true"
/>
<setting
name=
"callSettersOnNulls"
value=
"true"
/>
</settings>
</settings>
<!-- 配置别名用 -->
<!-- 配置别名用 -->
...
@@ -11,4 +16,5 @@
...
@@ -11,4 +16,5 @@
</typeAliases>
</typeAliases>
</configuration>
</configuration>
\ No newline at end of file
adc-da-main/src/test/java/com/adc/da/gen/CodeUtil.java
View file @
141dc28f
...
@@ -22,7 +22,7 @@ public class CodeUtil {
...
@@ -22,7 +22,7 @@ public class CodeUtil {
entityPackage
=
"entity"
;
entityPackage
=
"entity"
;
DbCodeGenerateFactory
.
codeGenerate
(
"tb_
positio
n"
,
entityPackage
);
DbCodeGenerateFactory
.
codeGenerate
(
"tb_
admi
n"
,
entityPackage
);
// DbCodeGenerateFactory.codeGenerate("TS_ROLE", entityPackage);
// DbCodeGenerateFactory.codeGenerate("TS_ROLE", entityPackage);
// DbCodeGenerateFactory.codeGenerate("TS_MENU", entityPackage);
// DbCodeGenerateFactory.codeGenerate("TS_MENU", entityPackage);
...
...
adc-da-main/target/classes/application-prd.properties
View file @
141dc28f
...
@@ -13,4 +13,4 @@ server.port=8080
...
@@ -13,4 +13,4 @@ server.port=8080
verifyCodeMode
=
1
verifyCodeMode
=
1
#密码Base64加密开关,true为开启,false为关闭
#密码Base64加密开关,true为开启,false为关闭
isPassEncrypted
=
false
isPassEncrypted
=
false
\ No newline at end of file
adc-da-main/target/classes/application.properties
View file @
141dc28f
...
@@ -56,6 +56,11 @@ server.port=7777
...
@@ -56,6 +56,11 @@ server.port=7777
mybatis.config-locations
=
classpath:mybatis/mybatis-config.xml
mybatis.config-locations
=
classpath:mybatis/mybatis-config.xml
mybatis.mapper-locations
=
classpath*:mybatis/mapper/**/*.xml
mybatis.mapper-locations
=
classpath*:mybatis/mapper/**/*.xml
# mybatis pagehelper
pagehelper.params
=
pageNum=pageNum;pageSize=pageSize;
pagehelper.reasonable
=
true
pagehelper.support-methods-arguments
=
true
#显示sql
#显示sql
spring.profiles.active
=
dev
spring.profiles.active
=
dev
logging.level.com.adc
=
DEBUG
logging.level.com.adc
=
DEBUG
...
...
adc-da-main/target/classes/mybatis/mybatis-config.xml
View file @
141dc28f
...
@@ -4,6 +4,11 @@
...
@@ -4,6 +4,11 @@
<configuration>
<configuration>
<!-- 全局参数 -->
<!-- 全局参数 -->
<settings>
<settings>
<!-- 延迟加载的开关,开启时,所有的关联对象都会延迟加载,默认为false -->
<setting
name=
"lazyLoadingEnabled"
value=
"true"
/>
<!-- 属性启用时,会使带有延迟加载属性的对象立即加载,默认为true -->
<setting
name=
"aggressiveLazyLoading"
value=
"false"
/>
<setting
name=
"logImpl"
value=
"STDOUT_LOGGING"
/>
<setting
name=
"callSettersOnNulls"
value=
"true"
/>
<setting
name=
"callSettersOnNulls"
value=
"true"
/>
</settings>
</settings>
<!-- 配置别名用 -->
<!-- 配置别名用 -->
...
@@ -11,4 +16,5 @@
...
@@ -11,4 +16,5 @@
</typeAliases>
</typeAliases>
</configuration>
</configuration>
\ No newline at end of file
adc-da-main/target/test-classes/com/adc/da/gen/CodeUtil.class
View file @
141dc28f
No preview for this file type
adc-da.iml
0 → 100644
View file @
141dc28f
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
version=
"4"
>
<component
name=
"NewModuleRootManager"
LANGUAGE_LEVEL=
"JDK_1_7"
>
<output
url=
"file://$MODULE_DIR$/target/classes"
/>
<output-test
url=
"file://$MODULE_DIR$/target/test-classes"
/>
<content
url=
"file://$MODULE_DIR$"
>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
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