Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
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
李丛阳
education
Commits
bf60ebce
Commit
bf60ebce
authored
Sep 16, 2019
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
course label
parent
9762209c
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
576 additions
and
4 deletions
+576
-4
BBannerController.java
...cisoft/business/bbanner/controller/BBannerController.java
+1
-1
BBannerRepository.java
...a/org/rcisoft/business/bbanner/dao/BBannerRepository.java
+1
-1
BBanner.java
...ain/java/org/rcisoft/business/bbanner/entity/BBanner.java
+1
-1
BBannerServiceImpl.java
...oft/business/bbanner/service/impl/BBannerServiceImpl.java
+1
-1
BCourseController.java
...cisoft/business/bcourse/controller/BCourseController.java
+108
-0
BCourseRepository.java
...a/org/rcisoft/business/bcourse/dao/BCourseRepository.java
+37
-0
BCourse.java
...ain/java/org/rcisoft/business/bcourse/entity/BCourse.java
+32
-0
BCourseService.java
.../org/rcisoft/business/bcourse/service/BCourseService.java
+26
-0
BCourseServiceImpl.java
...oft/business/bcourse/service/impl/BCourseServiceImpl.java
+99
-0
BLabelController.java
.../rcisoft/business/blabel/controller/BLabelController.java
+81
-0
BLabelRepository.java
...ava/org/rcisoft/business/blabel/dao/BLabelRepository.java
+43
-0
BLabel.java
src/main/java/org/rcisoft/business/blabel/entity/BLabel.java
+35
-0
BLabelService.java
...va/org/rcisoft/business/blabel/service/BLabelService.java
+18
-0
BLabelServiceImpl.java
...isoft/business/blabel/service/impl/BLabelServiceImpl.java
+58
-0
BCourseMapper.xml
...esources/mapper/business/bcourse.mapper/BCourseMapper.xml
+18
-0
BLabelMapper.xml
.../resources/mapper/business/blabel.mapper/BLabelMapper.xml
+17
-0
No files found.
src/main/java/org/rcisoft/business/bbanner/controller/BBannerController.java
View file @
bf60ebce
...
...
@@ -20,7 +20,7 @@ import org.rcisoft.core.result.Result;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author
ZhangQingle
* @author
* @date 2019/9/11
*/
...
...
src/main/java/org/rcisoft/business/bbanner/dao/BBannerRepository.java
View file @
bf60ebce
...
...
@@ -11,7 +11,7 @@ import java.util.List;
import
java.util.Map
;
/**
* @author
ZhangQingle
* @author
* @date 2019/9/10
*/
@Repository
...
...
src/main/java/org/rcisoft/business/bbanner/entity/BBanner.java
View file @
bf60ebce
...
...
@@ -13,7 +13,7 @@ import javax.persistence.Table;
/**
* @author
ZhangQingle
* @author
* @date 2019/9/10
*/
@Entity
...
...
src/main/java/org/rcisoft/business/bbanner/service/impl/BBannerServiceImpl.java
View file @
bf60ebce
...
...
@@ -18,7 +18,7 @@ import java.util.List;
/**
* @author
ZhangQingle
* @author
* @date 2019/9/10
*/
@Service
...
...
src/main/java/org/rcisoft/business/bcourse/controller/BCourseController.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
bcourse
.
controller
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.bcourse.entity.BCourse
;
import
org.rcisoft.business.bcourse.service.BCourseService
;
import
org.rcisoft.common.controller.PaginationController
;
import
org.rcisoft.common.model.GridModel
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.core.util.UserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
@RestController
@RequestMapping
(
"/BCourse"
)
public
class
BCourseController
extends
PaginationController
<
BCourse
>
{
@Autowired
private
BCourseService
bCourseServiceImpl
;
@ApiOperation
(
value
=
"查询课程分类"
,
notes
=
"查询课程分类生成json数组"
)
@PostMapping
(
value
=
"/selectCourse"
)
public
String
queryCourse
(
BCourse
bCourse
){
return
bCourseServiceImpl
.
getCourse
(
bCourse
);
}
@ApiOperation
(
value
=
"查询课程分类"
,
notes
=
"查询课程分类"
)
@PostMapping
(
value
=
"/queryCourse"
)
public
Result
queryBCourse
(
BCourse
bCourse
){
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCourseServiceImpl
.
queryBCourse
(
bCourse
));
}
@ApiOperation
(
value
=
"根据条件分页查询"
,
notes
=
"根据条件分页查询标签"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"condition"
,
value
=
"模糊查询条件"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"cName"
,
value
=
"课程名"
,
required
=
false
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/queryBCourseByPagination"
)
public
GridModel
queryBCourseByPagination
(
BCourse
bCourse
){
bCourse
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
bCourseServiceImpl
.
queryBCourseByPagination
(
getPaginationUtility
(),
bCourse
);
GridModel
gridModel
=
getGridModelResponse
();
return
gridModel
;
}
@ApiOperation
(
value
=
"物理删除"
,
notes
=
"根据ID删除一条记录"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"ID"
,
required
=
true
,
dataType
=
"varchar"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/remove"
)
public
Result
remove
(
HttpServletRequest
request
)
{
String
id
=
request
.
getParameter
(
"ID"
);
PersistModel
data
=
bCourseServiceImpl
.
removeCourse
(
id
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
}
@ApiOperation
(
value
=
"更新课程名"
,
notes
=
"根据ID更新课程名"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"cName"
,
required
=
true
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/update"
)
public
Result
update
(
BCourse
bCourse
){
PersistModel
data
=
bCourseServiceImpl
.
updateCourse
(
bCourse
,
getToken
());
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCourse
.
getBusinessId
());
}
@ApiOperation
(
value
=
"插入课程分类"
,
notes
=
"插入课程分类"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"parentId"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"cName"
,
required
=
true
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/insert"
)
public
Result
insert
(
BCourse
bCourse
){
PersistModel
data
=
bCourseServiceImpl
.
insertCourse
(
bCourse
,
getToken
());
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCourse
.
getParentId
());
}
@ApiOperation
(
value
=
"插入课程分类"
,
notes
=
"插入一级课程分类"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"order_by"
,
value
=
"orderBy"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"cName"
,
required
=
true
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/insertTop"
)
public
Result
insertTop
(
BCourse
bCourse
){
PersistModel
data
=
bCourseServiceImpl
.
insertTopCourse
(
bCourse
,
getToken
());
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCourse
.
getParentId
());
}
}
src/main/java/org/rcisoft/business/bcourse/dao/BCourseRepository.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
bcourse
.
dao
;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.bcourse.entity.BCourse
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
BCourseRepository
extends
BaseMapper
<
BCourse
>
{
// @Select("SELECT * from t_course WHERE del_flag='0' AND flag='1'")
// @ResultMap(value = "BaseResultMap")
// List<TCourse> selectCourse();
@Select
(
"<script>SELECT * FROM b_course where del_flag != 1 and flag = 1 "
+
"<if test=\"condition!=null and condition != ''\"> and c_name like CONCAT('%',#{condition},'%') </if>"
+
"ORDER BY order_by</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BCourse
>
selectCourses
(
BCourse
bCourse
);
@Select
(
"SELECT * from b_course WHERE del_flag='0' AND flag='1'AND c_name=#{cName}"
)
List
<
BCourse
>
selectOneByName
(
@Param
(
"cName"
)
String
id
);
@Update
(
"UPDATE b_course SET del_flag='1' WHERE business_id = #{businessId}"
)
int
removeCourse
(
@Param
(
"businessId"
)
String
id
);
// 编辑只改名字不该父节点
@Update
(
"UPDATE b_course SET c_name = #{cName} WHERE business_id = #{businessId}"
)
int
updateCourse
(
BCourse
bCourse
);
}
src/main/java/org/rcisoft/business/bcourse/entity/BCourse.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
bcourse
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.validator.constraints.Length
;
import
org.rcisoft.core.entity.IdEntity
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
@Entity
@Table
(
name
=
"b_course"
)
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
BCourse
extends
IdEntity
<
BCourse
>
{
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
String
cName
;
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
String
parentId
;
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
String
orderBy
;
@Transient
private
String
condition
;
//模糊查询条件
}
src/main/java/org/rcisoft/business/bcourse/service/BCourseService.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
bcourse
.
service
;
import
org.rcisoft.business.bcourse.entity.BCourse
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
java.util.List
;
public
interface
BCourseService
{
String
getCourse
(
BCourse
bCourse
);
List
<
BCourse
>
queryBCourse
(
BCourse
bCourse
);
List
<
BCourse
>
queryBCourseByPagination
(
PageUtil
pageUtil
,
BCourse
bCourse
);
PersistModel
insertCourse
(
BCourse
bCourse
,
String
token
);
PersistModel
insertTopCourse
(
BCourse
bCourse
,
String
token
);
PersistModel
removeCourse
(
String
id
);
PersistModel
updateCourse
(
BCourse
bCourse
,
String
token
);
}
src/main/java/org/rcisoft/business/bcourse/service/impl/BCourseServiceImpl.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
bcourse
.
service
.
impl
;
import
org.rcisoft.business.bcourse.dao.BCourseRepository
;
import
org.rcisoft.business.bcourse.entity.BCourse
;
import
org.rcisoft.business.bcourse.service.BCourseService
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.rcisoft.core.util.UserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
BCourseServiceImpl
implements
BCourseService
{
@Autowired
private
BCourseRepository
bCourseRepository
;
@Override
public
String
getCourse
(
BCourse
bCourse
)
{
List
<
BCourse
>
list
=
bCourseRepository
.
selectCourses
(
bCourse
);
String
json
=
"["
+
getCourseJson
(
"00000000"
,
list
)
+
"]"
;
return
json
;
}
@Override
public
List
<
BCourse
>
queryBCourse
(
BCourse
bCourse
)
{
List
<
BCourse
>
list
=
bCourseRepository
.
selectCourses
(
bCourse
);
return
list
;
}
@Override
public
List
<
BCourse
>
queryBCourseByPagination
(
PageUtil
pageUtil
,
BCourse
bCourse
)
{
return
bCourseRepository
.
selectCourses
(
bCourse
);
}
@Override
public
PersistModel
insertCourse
(
BCourse
bCourse
,
String
token
)
{
List
<
BCourse
>
list
=
bCourseRepository
.
selectOneByName
(
bCourse
.
getCName
());
if
(
list
.
size
()>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
}
UserUtil
.
setCurrentPersistOperation
(
bCourse
);
return
new
PersistModel
(
bCourseRepository
.
insert
(
bCourse
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
)
;
}
@Override
public
PersistModel
insertTopCourse
(
BCourse
bCourse
,
String
token
)
{
bCourse
.
setParentId
(
"00000000"
);
List
<
BCourse
>
list
=
bCourseRepository
.
selectOneByName
(
bCourse
.
getCName
());
if
(
list
.
size
()>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
}
UserUtil
.
setCurrentPersistOperation
(
bCourse
);
return
new
PersistModel
(
bCourseRepository
.
insert
(
bCourse
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
@Override
public
PersistModel
removeCourse
(
String
id
)
{
return
new
PersistModel
(
bCourseRepository
.
removeCourse
(
id
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
@Override
public
PersistModel
updateCourse
(
BCourse
bCourse
,
String
token
)
{
List
<
BCourse
>
list
=
bCourseRepository
.
selectOneByName
(
bCourse
.
getCName
());
if
(
list
.
size
()>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
}
UserUtil
.
setCurrentMergeOperation
(
bCourse
);
return
new
PersistModel
(
bCourseRepository
.
updateByPrimaryKeySelective
(
bCourse
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
private
String
getCourseJson
(
String
treeid
,
List
<
BCourse
>
list
)
{
String
str
=
""
;
try
{
StringBuffer
sb
=
new
StringBuffer
();
for
(
BCourse
t
:
list
)
{
if
(
t
.
getParentId
().
equals
(
treeid
))
{
sb
.
append
(
"{\"business_id\":"
+
t
.
getBusinessId
()
+
",\"c_name:\""
+
t
.
getCName
()
+
",\"nodes\":["
+
getCourseJson
(
t
.
getBusinessId
(),
list
)
+
"]},"
);
}
}
str
=
sb
.
toString
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
str
.
endsWith
(
","
))
{
str
=
str
.
substring
(
0
,
str
.
length
()
-
1
);
}
return
str
;
}
}
src/main/java/org/rcisoft/business/blabel/controller/BLabelController.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
blabel
.
controller
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.blabel.entity.BLabel
;
import
org.rcisoft.business.blabel.service.BLabelService
;
import
org.rcisoft.common.controller.PaginationController
;
import
org.rcisoft.common.model.GridModel
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.core.util.UserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
@RestController
@RequestMapping
(
"/BLabel"
)
public
class
BLabelController
extends
PaginationController
<
BLabel
>
{
@Autowired
private
BLabelService
bLabelService
;
@ApiOperation
(
value
=
"根据条件分页查询"
,
notes
=
"根据条件分页查询标签"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"condition"
,
value
=
"模糊查询条件"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"lName"
,
value
=
"标签名"
,
required
=
false
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/queryBlabelsByPagination"
)
public
GridModel
queryBlabelsByPagination
(
BLabel
param
){
param
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
bLabelService
.
queryBlabelsByPagination
(
getPaginationUtility
(),
param
);
GridModel
gridModel
=
getGridModelResponse
();
return
gridModel
;
}
@ApiOperation
(
value
=
"物理删除"
,
notes
=
"根据ID删除一条记录"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"ID"
,
required
=
true
,
dataType
=
"varchar"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/remove"
)
public
Result
remove
(
HttpServletRequest
request
)
{
String
id
=
request
.
getParameter
(
"ID"
);
PersistModel
data
=
bLabelService
.
removeLabel
(
id
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
}
@ApiOperation
(
value
=
"更新标签名"
,
notes
=
"根据ID更新标签名"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"lName"
,
required
=
true
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/update"
)
public
Result
update
(
BLabel
bLabel
){
PersistModel
data
=
bLabelService
.
updateLabel
(
bLabel
,
getToken
());
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bLabel
.
getBusinessId
());
}
@ApiOperation
(
value
=
"插入新标签"
,
notes
=
"插入新标签"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"lName"
,
required
=
true
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/insert"
)
public
Result
insert
(
BLabel
bLabel
){
PersistModel
data
=
bLabelService
.
insertLabel
(
bLabel
,
getToken
());
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
null
);
}
}
src/main/java/org/rcisoft/business/blabel/dao/BLabelRepository.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
blabel
.
dao
;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.blabel.entity.BLabel
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
BLabelRepository
extends
BaseMapper
<
BLabel
>
{
// 查询所有数据
// @Select("SELECT * from t_label where del_flag='0' and flag='1'")
@Select
(
"<script>SELECT * FROM b_label where del_flag != 1 and flag = 1 "
+
"<if test=\"condition!=null and condition != ''\"> and l_name like CONCAT('%',#{condition},'%') </if>"
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BLabel
>
queryBlabels
(
BLabel
bLabel
);
// 增加标签是检查标签名重复
@Select
(
"SELECT * from b_label where l_name=#{lName} AND del_flag='0' and flag='1'"
)
List
<
BLabel
>
checknameByName
(
BLabel
bLabel
);
// 新增标签
@Insert
(
"INSERT INTO b_label VALUES(UUID(),'',NOW(),'',NOW(),'0','1',#{lName})"
)
//@Insert("<script>INSERT INTO b_label" +
// "(create_date,update_date,create_by,update_by,remarks,del_flag,flag,business_id,l_name)VALUES" +
// "<foreach collection=\"list\" item=\"item\" separator=\",\">" +
// "( #{item.createDate},#{item.updateDate},#{item.createBy},#{item.updateBy},#{item.remarks},#{item.delFlag},#{item.flag},#{item.businessId},#{item.l_name})" +
// "</foreach></script>")
int
insertLabel
(
BLabel
bLabel
);
// 修改标签
@Update
(
"UPDATE b_label SET l_name=#{lName} where business_id = #{businessId}"
)
int
updateLabel
(
BLabel
bLabel
);
// 逻辑删除标签
@Update
(
"UPDATE b_label SET del_flag='1' where business_id = #{businessId}"
)
int
removeLabel
(
@Param
(
"businessId"
)
String
id
);
}
src/main/java/org/rcisoft/business/blabel/entity/BLabel.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
blabel
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.validator.constraints.Length
;
import
org.rcisoft.core.entity.IdEntity
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
@Entity
@Table
(
name
=
"b_label"
)
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
BLabel
extends
IdEntity
<
BLabel
>
{
// private static final long serialVersionUID = 4660799781307219222L;//
// /*标签id*/
// @Length(min = 1,max = 64,message = "长度最小为1,最大为50")
// private String businessId;
/*标签名称*/
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
String
lName
;
@Transient
private
String
condition
;
//模糊查询条件
}
src/main/java/org/rcisoft/business/blabel/service/BLabelService.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
blabel
.
service
;
import
org.rcisoft.business.blabel.entity.BLabel
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
java.util.List
;
public
interface
BLabelService
{
List
<
BLabel
>
queryBlabelsByPagination
(
PageUtil
pageUtil
,
BLabel
model
);
PersistModel
insertLabel
(
BLabel
bLabel
,
String
token
);
PersistModel
updateLabel
(
BLabel
bLabel
,
String
token
);
PersistModel
removeLabel
(
String
id
);
}
src/main/java/org/rcisoft/business/blabel/service/impl/BLabelServiceImpl.java
0 → 100644
View file @
bf60ebce
package
org
.
rcisoft
.
business
.
blabel
.
service
.
impl
;
import
org.rcisoft.business.blabel.dao.BLabelRepository
;
import
org.rcisoft.business.blabel.entity.BLabel
;
import
org.rcisoft.business.blabel.service.BLabelService
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.rcisoft.core.util.UserUtil
;
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
java.util.List
;
@Service
public
class
BLabelServiceImpl
implements
BLabelService
{
@Autowired
private
BLabelRepository
bLabelRepository
;
@Override
public
List
<
BLabel
>
queryBlabelsByPagination
(
PageUtil
pageUtil
,
BLabel
bLabel
)
{
return
bLabelRepository
.
queryBlabels
(
bLabel
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
insertLabel
(
BLabel
bLabel
,
String
token
)
{
List
<
BLabel
>
line
=
bLabelRepository
.
checknameByName
(
bLabel
);
if
(
line
.
size
()>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
}
UserUtil
.
setCurrentPersistOperation
(
bLabel
);
return
new
PersistModel
(
bLabelRepository
.
insert
(
bLabel
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
)
;
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
updateLabel
(
BLabel
bLabel
,
String
token
)
{
List
<
BLabel
>
line
=
bLabelRepository
.
checknameByName
(
bLabel
);
if
(
line
.
size
()>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
}
UserUtil
.
setCurrentMergeOperation
(
bLabel
);
return
new
PersistModel
(
bLabelRepository
.
updateByPrimaryKeySelective
(
bLabel
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeLabel
(
String
id
)
{
int
line
=
bLabelRepository
.
removeLabel
(
id
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
}
src/main/resources/mapper/business/bcourse.mapper/BCourseMapper.xml
0 → 100644
View file @
bf60ebce
<?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=
"org.rcisoft.business.bcourse.dao.BCourseRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.bcourse.entity.BCourse"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"c_name"
jdbcType=
"VARCHAR"
property=
"cName"
/>
<result
column=
"parent_id"
jdbcType=
"VARCHAR"
property=
"parentId"
/>
<result
column=
"order_by"
jdbcType=
"VARCHAR"
property=
"orderBy"
/>
</resultMap>
</mapper>
\ No newline at end of file
src/main/resources/mapper/business/blabel.mapper/BLabelMapper.xml
0 → 100644
View file @
bf60ebce
<?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=
"org.rcisoft.business.blabel.dao.BLabelRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.blabel.entity.BLabel"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"l_name"
jdbcType=
"VARCHAR"
property=
"lName"
/>
</resultMap>
</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