Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
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
haoban3.0
haoban-manage3.0
Commits
b1fd4e2d
Commit
b1fd4e2d
authored
Mar 18, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
b0185bf8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
157 additions
and
25 deletions
+157
-25
DictDTO.java
.../src/main/java/com/gic/haoban/manage/api/dto/DictDTO.java
+68
-0
DictApiService.java
...ava/com/gic/haoban/manage/api/service/DictApiService.java
+16
-0
DictMapper.java
.../com/gic/haoban/manage/service/dao/mapper/DictMapper.java
+5
-2
DictServiceImpl.java
...oban/manage/service/service/out/impl/DictServiceImpl.java
+52
-0
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+1
-0
DictMapper.xml
...-manage3-service/src/main/resources/mapper/DictMapper.xml
+15
-23
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/DictDTO.java
0 → 100644
View file @
b1fd4e2d
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
public
class
DictDTO
implements
Serializable
{
private
String
dictId
;
private
String
dictName
;
private
String
dictKey
;
private
String
dictTitle
;
private
String
dictDesc
;
private
String
dictContent
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getDictId
()
{
return
dictId
;
}
public
void
setDictId
(
String
dictId
)
{
this
.
dictId
=
dictId
==
null
?
null
:
dictId
.
trim
();
}
public
String
getDictName
()
{
return
dictName
;
}
public
void
setDictName
(
String
dictName
)
{
this
.
dictName
=
dictName
==
null
?
null
:
dictName
.
trim
();
}
public
String
getDictKey
()
{
return
dictKey
;
}
public
void
setDictKey
(
String
dictKey
)
{
this
.
dictKey
=
dictKey
==
null
?
null
:
dictKey
.
trim
();
}
public
String
getDictTitle
()
{
return
dictTitle
;
}
public
void
setDictTitle
(
String
dictTitle
)
{
this
.
dictTitle
=
dictTitle
==
null
?
null
:
dictTitle
.
trim
();
}
public
String
getDictDesc
()
{
return
dictDesc
;
}
public
void
setDictDesc
(
String
dictDesc
)
{
this
.
dictDesc
=
dictDesc
==
null
?
null
:
dictDesc
.
trim
();
}
public
String
getDictContent
()
{
return
dictContent
;
}
public
void
setDictContent
(
String
dictContent
)
{
this
.
dictContent
=
dictContent
==
null
?
null
:
dictContent
.
trim
();
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DictApiService.java
0 → 100644
View file @
b1fd4e2d
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.api.dto.DictDTO
;
/**
* Created by tgs on 2020/2/9.
*/
public
interface
DictApiService
{
void
saveDict
(
DictDTO
dto
);
DictDTO
findOneDict
(
String
dictId
);
Page
<
DictDTO
>
pageList
(
BasePageInfo
pageInfo
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DictMapper.java
View file @
b1fd4e2d
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanDict
;
import
com.github.pagehelper.Page
;
public
interface
DictMapper
{
int
deleteByPrimaryKey
(
String
dictId
);
...
...
@@ -13,7 +14,8 @@ public interface DictMapper {
int
updateByPrimaryKeySelective
(
TabHaobanDict
record
);
int
updateByPrimaryKeyWithBLOBs
(
TabHaobanDict
record
);
int
updateByPrimaryKey
(
TabHaobanDict
record
);
Page
<
TabHaobanDict
>
pageList
();
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DictServiceImpl.java
0 → 100644
View file @
b1fd4e2d
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DictDTO
;
import
com.gic.haoban.manage.api.service.DictApiService
;
import
com.gic.haoban.manage.service.dao.mapper.DictMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanDict
;
import
com.github.pagehelper.PageHelper
;
/**
* Created by tgs on 2020/2/9.
*/
public
class
DictServiceImpl
implements
DictApiService
{
@Autowired
private
DictMapper
dictMapper
;
@Override
public
void
saveDict
(
DictDTO
dto
)
{
if
(
StringUtils
.
isBlank
(
dto
.
getDictId
())){
//空,则新增
dto
.
setDictId
(
UuidUtil
.
randomUUID
());
TabHaobanDict
tab
=
EntityUtil
.
changeEntity
(
TabHaobanDict
.
class
,
dto
);
dictMapper
.
insert
(
tab
);
}
else
{
TabHaobanDict
tab
=
EntityUtil
.
changeEntity
(
TabHaobanDict
.
class
,
dto
);
dictMapper
.
updateByPrimaryKey
(
tab
);
}
}
@Override
public
DictDTO
findOneDict
(
String
dictId
)
{
TabHaobanDict
tab
=
dictMapper
.
selectByPrimaryKey
(
dictId
);
if
(
tab
==
null
){
return
null
;
}
DictDTO
dto
=
EntityUtil
.
changeEntity
(
DictDTO
.
class
,
tab
);
return
dto
;
}
@Override
public
Page
<
DictDTO
>
pageList
(
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
return
PageUtil
.
changePageHelperToCurrentPage
(
dictMapper
.
pageList
(),
DictDTO
.
class
);
}
}
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
b1fd4e2d
...
...
@@ -34,6 +34,7 @@
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.BindApiService"
ref=
"bindApiServiceImpl"
timeout=
"10000"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.ApplicationSettingApiService"
ref=
"applicationSettingApiServiceImpl"
timeout=
"10000"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.AuditSettingApiService"
ref=
"auditSettingApiServiceImpl"
timeout=
"10000"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.DictApiService"
ref=
"dictApiServiceImpl"
timeout=
"10000"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.DepartmentService"
id=
"gicDepartmentService"
/>
...
...
haoban-manage3-service/src/main/resources/mapper/DictMapper.xml
View file @
b1fd4e2d
...
...
@@ -7,21 +7,14 @@
<result
column=
"dict_key"
property=
"dictKey"
jdbcType=
"VARCHAR"
/>
<result
column=
"dict_title"
property=
"dictTitle"
jdbcType=
"VARCHAR"
/>
<result
column=
"dict_desc"
property=
"dictDesc"
jdbcType=
"VARCHAR"
/>
</resultMap>
<resultMap
id=
"ResultMapWithBLOBs"
type=
"com.gic.haoban.manage.service.entity.TabHaobanDict"
extends=
"BaseResultMap"
>
<result
column=
"dict_content"
property=
"dictContent"
jdbcType=
"LONGVARCHAR"
/>
<result
column=
"dict_content"
property=
"dictContent"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
dict_id, dict_name, dict_key, dict_title, dict_desc
</sql>
<sql
id=
"Blob_Column_List"
>
dict_content
dict_id, dict_name, dict_key, dict_title, dict_desc, dict_content
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"
ResultMapWithBLOBs
"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"
BaseResultMap
"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
,
<include
refid=
"Blob_Column_List"
/>
from tab_haoban_dict
where dict_id = #{dictId,jdbcType=VARCHAR}
</select>
...
...
@@ -34,7 +27,7 @@
dict_title, dict_desc, dict_content
)
values (#{dictId,jdbcType=VARCHAR}, #{dictName,jdbcType=VARCHAR}, #{dictKey,jdbcType=VARCHAR},
#{dictTitle,jdbcType=VARCHAR}, #{dictDesc,jdbcType=VARCHAR}, #{dictContent,jdbcType=
LONG
VARCHAR}
#{dictTitle,jdbcType=VARCHAR}, #{dictDesc,jdbcType=VARCHAR}, #{dictContent,jdbcType=VARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanDict"
>
...
...
@@ -76,7 +69,7 @@
#{dictDesc,jdbcType=VARCHAR},
</if>
<if
test=
"dictContent != null"
>
#{dictContent,jdbcType=
LONG
VARCHAR},
#{dictContent,jdbcType=VARCHAR},
</if>
</trim>
</insert>
...
...
@@ -96,26 +89,24 @@
dict_desc = #{dictDesc,jdbcType=VARCHAR},
</if>
<if
test=
"dictContent != null"
>
dict_content = #{dictContent,jdbcType=
LONG
VARCHAR},
dict_content = #{dictContent,jdbcType=VARCHAR},
</if>
</set>
where dict_id = #{dictId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKeyWithBLOBs"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanDict"
>
update tab_haoban_dict
set dict_name = #{dictName,jdbcType=VARCHAR},
dict_key = #{dictKey,jdbcType=VARCHAR},
dict_title = #{dictTitle,jdbcType=VARCHAR},
dict_desc = #{dictDesc,jdbcType=VARCHAR},
dict_content = #{dictContent,jdbcType=LONGVARCHAR}
where dict_id = #{dictId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanDict"
>
update tab_haoban_dict
set dict_name = #{dictName,jdbcType=VARCHAR},
dict_key = #{dictKey,jdbcType=VARCHAR},
dict_title = #{dictTitle,jdbcType=VARCHAR},
dict_desc = #{dictDesc,jdbcType=VARCHAR}
dict_desc = #{dictDesc,jdbcType=VARCHAR},
dict_content = #{dictContent,jdbcType=VARCHAR}
where dict_id = #{dictId,jdbcType=VARCHAR}
</update>
<select
id=
"pageList"
resultMap=
"ResultMapWithBLOBs"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_dict
</select>
</mapper>
\ 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