Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 62c502ac
authored
Mar 16, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
产品列表功能开发
1 parent
586fc239
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
159 additions
and
106 deletions
src/main/java/com/glsx/smart/controller/ProductController.java
src/main/java/com/glsx/smart/controller/ProductTypeController.java
src/main/java/com/glsx/smart/controller/SceneController.java
src/main/java/com/glsx/smart/controller/SceneTemplateController.java
src/main/java/com/glsx/smart/controller/SysCodeController.java
src/main/java/com/glsx/smart/controller/SysFileController.java
src/main/java/com/glsx/smart/dao/entity/SmartSceneData.java
src/main/java/com/glsx/smart/dao/mapper/SmartSysCodeMapper.java
src/main/java/com/glsx/smart/exception/BusinessExceptionHandler.java → src/main/java/com/glsx/smart/exception/GlobalExceptionHandler.java
src/main/java/com/glsx/smart/pojo/SmartSysCodeReq.java
src/main/java/com/glsx/smart/service/BaseService.java
src/main/java/com/glsx/smart/service/DemoService.java
src/main/java/com/glsx/smart/service/impl/SmartDevideStatusServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartProductTypeParamServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartProductTypeServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartSceneDataServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartSceneServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartSceneTemplateServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartSysCodeServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartSysFileServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartTemplateParamServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartUserRelationServiceImpl.java
src/main/resources/mapper/SmartSceneDataMapper.xml
src/main/resources/mapper/SmartSysCodeMapper.xml
src/main/java/com/glsx/smart/controller/ProductController.java
View file @
62c502a
...
@@ -2,11 +2,13 @@ package com.glsx.smart.controller;
...
@@ -2,11 +2,13 @@ package com.glsx.smart.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.pojo.SmartProductReq
;
import
com.glsx.smart.pojo.SmartProductReq
;
import
com.glsx.smart.service.SmartProductService
;
import
com.glsx.smart.service.SmartProductService
;
import
org.slf4j.Logger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -20,17 +22,16 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -20,17 +22,16 @@ import org.springframework.web.bind.annotation.RestController;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/product"
)
@RequestMapping
(
"/product"
)
public
class
ProductController
{
public
class
ProductController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
@Autowired
private
SmartProductService
productService
;
private
SmartProductService
productService
;
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
PageInfo
<
SmartProduct
>
getList
(
SmartProductReq
req
)
{
public
PageInfo
<
SmartProduct
>
getList
(
SmartProductReq
req
)
{
log
ger
.
info
(
"/product/getList param: {}"
,
JSON
.
toJSONString
(
req
));
log
.
info
(
"/product/getList param: {}"
,
JSON
.
toJSONString
(
req
));
return
productService
.
getList
(
req
);
return
productService
.
getList
(
req
);
}
}
...
@@ -41,6 +42,31 @@ public class ProductController {
...
@@ -41,6 +42,31 @@ public class ProductController {
@RequestMapping
(
value
=
"/save"
,
method
=
{
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/save"
,
method
=
{
RequestMethod
.
POST
})
public
void
save
(
@RequestBody
SmartProduct
product
)
{
public
void
save
(
@RequestBody
SmartProduct
product
)
{
log
.
info
(
"$$$$ /product/save param: {}"
,
JSON
.
toJSONString
(
product
));
productService
.
save
(
product
);
productService
.
save
(
product
);
}
}
@RequestMapping
(
value
=
"/getCommandSetById"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
void
getCommandSetById
(
Long
id
)
{
if
(
id
==
null
)
{
throw
new
BusinessException
(
ResultEnum
.
PARAM_ERROR
);
}
productService
.
getCommandSetById
(
id
);
}
@RequestMapping
(
value
=
"/checkShopProductId"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
void
checkShopProductId
(
String
shopProductId
)
{
if
(
StringUtils
.
isBlank
(
shopProductId
))
{
throw
new
BusinessException
(
ResultEnum
.
PARAM_ERROR
);
}
productService
.
checkShopProductId
(
shopProductId
);
}
@RequestMapping
(
value
=
"/putOnOff"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
void
putOnOff
(
Long
id
)
{
if
(
id
==
null
)
{
throw
new
BusinessException
(
ResultEnum
.
PARAM_ERROR
);
}
productService
.
putOnOff
(
id
);
}
}
}
src/main/java/com/glsx/smart/controller/ProductTypeController.java
View file @
62c502a
...
@@ -3,8 +3,7 @@ package com.glsx.smart.controller;
...
@@ -3,8 +3,7 @@ package com.glsx.smart.controller;
import
java.util.List
;
import
java.util.List
;
import
com.glsx.smart.dao.entity.SmartProductType
;
import
com.glsx.smart.dao.entity.SmartProductType
;
import
com.glsx.smart.service.SmartProductTypeService
;
import
com.glsx.smart.service.SmartProductTypeService
;
import
org.slf4j.Logger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -18,11 +17,10 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -18,11 +17,10 @@ import org.springframework.web.bind.annotation.RestController;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/productType"
)
@RequestMapping
(
"/productType"
)
public
class
ProductTypeController
{
public
class
ProductTypeController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
@Autowired
private
SmartProductTypeService
productTypeService
;
private
SmartProductTypeService
productTypeService
;
...
...
src/main/java/com/glsx/smart/controller/SceneController.java
View file @
62c502a
...
@@ -3,8 +3,7 @@ package com.glsx.smart.controller;
...
@@ -3,8 +3,7 @@ package com.glsx.smart.controller;
import
java.util.List
;
import
java.util.List
;
import
com.glsx.smart.dao.entity.SmartScene
;
import
com.glsx.smart.dao.entity.SmartScene
;
import
com.glsx.smart.service.SmartSceneService
;
import
com.glsx.smart.service.SmartSceneService
;
import
org.slf4j.Logger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -18,11 +17,10 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -18,11 +17,10 @@ import org.springframework.web.bind.annotation.RestController;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/scene"
)
@RequestMapping
(
"/scene"
)
public
class
SceneController
{
public
class
SceneController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
@Autowired
private
SmartSceneService
sceneService
;
private
SmartSceneService
sceneService
;
...
...
src/main/java/com/glsx/smart/controller/SceneTemplateController.java
View file @
62c502a
...
@@ -3,8 +3,7 @@ package com.glsx.smart.controller;
...
@@ -3,8 +3,7 @@ package com.glsx.smart.controller;
import
java.util.List
;
import
java.util.List
;
import
com.glsx.smart.dao.entity.SmartSceneTemplate
;
import
com.glsx.smart.dao.entity.SmartSceneTemplate
;
import
com.glsx.smart.service.SmartSceneTemplateService
;
import
com.glsx.smart.service.SmartSceneTemplateService
;
import
org.slf4j.Logger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -18,10 +17,10 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -18,10 +17,10 @@ import org.springframework.web.bind.annotation.RestController;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/sceneTemplate"
)
public
class
SceneTemplateController
{
public
class
SceneTemplateController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
@Autowired
private
SmartSceneTemplateService
sceneTemplateService
;
private
SmartSceneTemplateService
sceneTemplateService
;
...
...
src/main/java/com/glsx/smart/controller/SysCodeController.java
View file @
62c502a
...
@@ -5,8 +5,7 @@ import com.github.pagehelper.PageInfo;
...
@@ -5,8 +5,7 @@ import com.github.pagehelper.PageInfo;
import
com.glsx.smart.dao.entity.SmartSysCode
;
import
com.glsx.smart.dao.entity.SmartSysCode
;
import
com.glsx.smart.pojo.SmartSysCodeReq
;
import
com.glsx.smart.pojo.SmartSysCodeReq
;
import
com.glsx.smart.service.SmartSysCodeService
;
import
com.glsx.smart.service.SmartSysCodeService
;
import
org.slf4j.Logger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
@@ -19,17 +18,16 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -19,17 +18,16 @@ import org.springframework.web.bind.annotation.RestController;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/sysCode"
)
@RequestMapping
(
"/sysCode"
)
public
class
SysCodeController
{
public
class
SysCodeController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
@Autowired
private
SmartSysCodeService
sysCodeService
;
private
SmartSysCodeService
sysCodeService
;
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
PageInfo
<
SmartSysCode
>
getList
(
SmartSysCodeReq
req
)
{
public
PageInfo
<
SmartSysCode
>
getList
(
SmartSysCodeReq
req
)
{
this
.
logger
.
info
(
"$$$$ /sysCode/getList param: {}"
,
JSON
.
toJSONString
(
req
));
log
.
info
(
"$$$$ /sysCode/getList param: {}"
,
JSON
.
toJSONString
(
req
));
return
sysCodeService
.
getList
(
req
);
return
sysCodeService
.
getList
(
req
);
}
}
}
}
src/main/java/com/glsx/smart/controller/SysFileController.java
View file @
62c502a
...
@@ -2,8 +2,7 @@ package com.glsx.smart.controller;
...
@@ -2,8 +2,7 @@ package com.glsx.smart.controller;
import
com.glsx.smart.dao.entity.SmartSysFile
;
import
com.glsx.smart.dao.entity.SmartSysFile
;
import
com.glsx.smart.service.SmartSysFileService
;
import
com.glsx.smart.service.SmartSysFileService
;
import
org.slf4j.Logger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
@@ -18,11 +17,10 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -18,11 +17,10 @@ import org.springframework.web.multipart.MultipartFile;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/sysFile"
)
@RequestMapping
(
"/sysFile"
)
public
class
SysFileController
{
public
class
SysFileController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
@Autowired
private
SmartSysFileService
sysFileService
;
private
SmartSysFileService
sysFileService
;
...
...
src/main/java/com/glsx/smart/dao/entity/SmartSceneData.java
View file @
62c502a
...
@@ -29,7 +29,7 @@ public class SmartSceneData {
...
@@ -29,7 +29,7 @@ public class SmartSceneData {
/**
/**
* 场景ID 关联smart_scene中id
* 场景ID 关联smart_scene中id
*/
*/
private
Long
templat
eId
;
private
Long
scen
eId
;
/**
/**
* 类型 1触发条件 2执行内容
* 类型 1触发条件 2执行内容
...
@@ -59,12 +59,12 @@ public class SmartSceneData {
...
@@ -59,12 +59,12 @@ public class SmartSceneData {
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
Long
get
Templat
eId
()
{
public
Long
get
Scen
eId
()
{
return
templat
eId
;
return
scen
eId
;
}
}
public
void
set
TemplateId
(
Long
templat
eId
)
{
public
void
set
SceneId
(
Long
scen
eId
)
{
this
.
templateId
=
templat
eId
;
this
.
sceneId
=
scen
eId
;
}
}
public
Byte
getType
()
{
public
Byte
getType
()
{
...
@@ -101,17 +101,13 @@ public class SmartSceneData {
...
@@ -101,17 +101,13 @@ public class SmartSceneData {
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
return
"SmartSceneData{"
+
sb
.
append
(
getClass
().
getSimpleName
());
"id="
+
id
+
sb
.
append
(
" ["
);
", sceneId="
+
sceneId
+
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
", type="
+
type
+
sb
.
append
(
", id="
).
append
(
id
);
", sort="
+
sort
+
sb
.
append
(
", templateId="
).
append
(
templateId
);
", paramKey='"
+
paramKey
+
'\''
+
sb
.
append
(
", type="
).
append
(
type
);
", paramValue='"
+
paramValue
+
'\''
+
sb
.
append
(
", sort="
).
append
(
sort
);
'}'
;
sb
.
append
(
", paramKey="
).
append
(
paramKey
);
sb
.
append
(
", paramValue="
).
append
(
paramValue
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
}
}
}
src/main/java/com/glsx/smart/dao/mapper/SmartSysCodeMapper.java
View file @
62c502a
...
@@ -18,6 +18,7 @@ import org.apache.ibatis.annotations.Param;
...
@@ -18,6 +18,7 @@ import org.apache.ibatis.annotations.Param;
public
interface
SmartSysCodeMapper
extends
tk
.
mybatis
.
mapper
.
common
.
Mapper
<
SmartSysCode
>
{
public
interface
SmartSysCodeMapper
extends
tk
.
mybatis
.
mapper
.
common
.
Mapper
<
SmartSysCode
>
{
List
<
SmartSysCode
>
getList
(
SmartSysCodeReq
req
);
List
<
SmartSysCode
>
getList
(
SmartSysCodeReq
req
);
int
insertOrUpdate
(
SmartSysCode
record
);
int
insertOrUpdate
(
SmartSysCode
record
);
int
insertOrUpdateSelective
(
SmartSysCode
record
);
int
insertOrUpdateSelective
(
SmartSysCode
record
);
...
...
src/main/java/com/glsx/smart/exception/
Business
ExceptionHandler.java
→
src/main/java/com/glsx/smart/exception/
Global
ExceptionHandler.java
View file @
62c502a
...
@@ -13,11 +13,16 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
...
@@ -13,11 +13,16 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
* @date 2021-03-16
* @date 2021-03-16
*/
*/
@RestControllerAdvice
@RestControllerAdvice
public
class
Business
ExceptionHandler
{
public
class
Global
ExceptionHandler
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@ExceptionHandler
(
BusinessException
.
class
)
@ExceptionHandler
(
BusinessException
.
class
)
public
void
handleBusinessException
(
BusinessException
e
)
{
public
void
handleBusinessException
(
BusinessException
e
)
{
logger
.
error
(
"!!!! ERROR"
,
e
);
logger
.
error
(
"!!!! 业务异常"
,
e
);
}
@ExceptionHandler
(
Exception
.
class
)
public
void
handleException
(
Exception
e
)
{
logger
.
error
(
"!!!! 未知异常"
,
e
);
}
}
}
}
src/main/java/com/glsx/smart/pojo/SmartSysCodeReq.java
View file @
62c502a
...
@@ -28,6 +28,21 @@ public class SmartSysCodeReq extends BaseDTO {
...
@@ -28,6 +28,21 @@ public class SmartSysCodeReq extends BaseDTO {
*/
*/
private
String
parentKey
;
private
String
parentKey
;
/**
* 排序
*/
private
Byte
sort
;
/**
* 状态:0下线 1上线
*/
private
Byte
status
;
/**
* 分级
*/
private
Byte
level
;
public
String
getDictType
()
{
public
String
getDictType
()
{
return
dictType
;
return
dictType
;
}
}
...
@@ -60,6 +75,30 @@ public class SmartSysCodeReq extends BaseDTO {
...
@@ -60,6 +75,30 @@ public class SmartSysCodeReq extends BaseDTO {
this
.
parentKey
=
parentKey
;
this
.
parentKey
=
parentKey
;
}
}
public
Byte
getSort
()
{
return
sort
;
}
public
void
setSort
(
Byte
sort
)
{
this
.
sort
=
sort
;
}
public
Byte
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Byte
status
)
{
this
.
status
=
status
;
}
public
Byte
getLevel
()
{
return
level
;
}
public
void
setLevel
(
Byte
level
)
{
this
.
level
=
level
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"SmartSysCodeReq{"
+
return
"SmartSysCodeReq{"
+
...
@@ -67,6 +106,9 @@ public class SmartSysCodeReq extends BaseDTO {
...
@@ -67,6 +106,9 @@ public class SmartSysCodeReq extends BaseDTO {
", dictKey='"
+
dictKey
+
'\''
+
", dictKey='"
+
dictKey
+
'\''
+
", dictValue='"
+
dictValue
+
'\''
+
", dictValue='"
+
dictValue
+
'\''
+
", parentKey='"
+
parentKey
+
'\''
+
", parentKey='"
+
parentKey
+
'\''
+
", sort="
+
sort
+
", status="
+
status
+
", level="
+
level
+
"} "
+
super
.
toString
();
"} "
+
super
.
toString
();
}
}
}
}
src/main/java/com/glsx/smart/service/BaseService.java
View file @
62c502a
...
@@ -2,8 +2,6 @@ package com.glsx.smart.service;
...
@@ -2,8 +2,6 @@ package com.glsx.smart.service;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.glsx.smart.pojo.BaseDTO
;
import
com.glsx.smart.pojo.BaseDTO
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
/**
* <p>Description: 公共 Service 业务
* <p>Description: 公共 Service 业务
...
@@ -13,8 +11,6 @@ import org.slf4j.LoggerFactory;
...
@@ -13,8 +11,6 @@ import org.slf4j.LoggerFactory;
* @date 2021-03-15
* @date 2021-03-15
*/
*/
public
abstract
class
BaseService
{
public
abstract
class
BaseService
{
protected
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
/**
/**
* 按需开启分页,调用此方法后需紧跟查询 sql,否则分页将不生效
* 按需开启分页,调用此方法后需紧跟查询 sql,否则分页将不生效
*
*
...
...
src/main/java/com/glsx/smart/service/DemoService.java
deleted
100644 → 0
View file @
586fc23
package
com
.
glsx
.
smart
.
service
;
import
org.springframework.stereotype.Service
;
/**
* @author deployer name
* @version V1.0
* @Title: DemoService.java
* @Description:
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Service
public
class
DemoService
{
}
src/main/java/com/glsx/smart/service/impl/SmartDevideStatusServiceImpl.java
View file @
62c502a
...
@@ -5,6 +5,7 @@ import java.util.List;
...
@@ -5,6 +5,7 @@ import java.util.List;
import
com.glsx.smart.dao.entity.SmartDevideStatus
;
import
com.glsx.smart.dao.entity.SmartDevideStatus
;
import
com.glsx.smart.dao.mapper.SmartDevideStatusMapper
;
import
com.glsx.smart.dao.mapper.SmartDevideStatusMapper
;
import
com.glsx.smart.service.SmartDevideStatusService
;
import
com.glsx.smart.service.SmartDevideStatusService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -14,10 +15,9 @@ import org.springframework.stereotype.Service;
...
@@ -14,10 +15,9 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartDevideStatusServiceImpl
implements
SmartDevideStatusService
{
public
class
SmartDevideStatusServiceImpl
implements
SmartDevideStatusService
{
@Resource
@Resource
private
SmartDevideStatusMapper
smartDevideStatusMapper
;
private
SmartDevideStatusMapper
smartDevideStatusMapper
;
...
...
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
View file @
62c502a
...
@@ -10,6 +10,7 @@ import com.glsx.smart.exception.ResultEnum;
...
@@ -10,6 +10,7 @@ import com.glsx.smart.exception.ResultEnum;
import
com.glsx.smart.pojo.SmartProductReq
;
import
com.glsx.smart.pojo.SmartProductReq
;
import
com.glsx.smart.service.BaseService
;
import
com.glsx.smart.service.BaseService
;
import
com.glsx.smart.service.SmartProductService
;
import
com.glsx.smart.service.SmartProductService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -20,7 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -20,7 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartProductServiceImpl
extends
BaseService
implements
SmartProductService
{
public
class
SmartProductServiceImpl
extends
BaseService
implements
SmartProductService
{
@Resource
@Resource
...
@@ -61,10 +62,8 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
...
@@ -61,10 +62,8 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
@Transactional
@Transactional
public
void
save
(
SmartProduct
product
)
{
public
void
save
(
SmartProduct
product
)
{
if
(
product
.
getId
()
==
null
)
{
if
(
product
.
getId
()
==
null
)
{
super
.
logger
.
info
(
"$$$$ Starting inserting..."
);
productMapper
.
insertSelective
(
product
);
productMapper
.
insertSelective
(
product
);
}
else
{
}
else
{
super
.
logger
.
info
(
"$$$$ Starting updating..."
);
SmartProduct
record
=
productMapper
.
selectByPrimaryKey
(
product
.
getId
());
SmartProduct
record
=
productMapper
.
selectByPrimaryKey
(
product
.
getId
());
if
(
record
!=
null
)
{
if
(
record
!=
null
)
{
productMapper
.
updateByPrimaryKeySelective
(
product
);
productMapper
.
updateByPrimaryKeySelective
(
product
);
...
@@ -86,6 +85,11 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
...
@@ -86,6 +85,11 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
@Override
@Override
public
void
putOnOff
(
Long
id
)
{
public
void
putOnOff
(
Long
id
)
{
SmartProduct
product
=
productMapper
.
selectByPrimaryKey
(
id
);
if
(
product
==
null
)
{
throw
new
BusinessException
(
ResultEnum
.
PRODUCT_NOT_FOUND
);
}
product
.
setStatus
((
byte
)
(
product
.
getStatus
()
^
0b00000001
));
productMapper
.
updateByPrimaryKeySelective
(
product
);
}
}
}
}
src/main/java/com/glsx/smart/service/impl/SmartProductTypeParamServiceImpl.java
View file @
62c502a
...
@@ -5,6 +5,7 @@ import java.util.List;
...
@@ -5,6 +5,7 @@ import java.util.List;
import
com.glsx.smart.dao.entity.SmartProductTypeParam
;
import
com.glsx.smart.dao.entity.SmartProductTypeParam
;
import
com.glsx.smart.dao.mapper.SmartProductTypeParamMapper
;
import
com.glsx.smart.dao.mapper.SmartProductTypeParamMapper
;
import
com.glsx.smart.service.SmartProductTypeParamService
;
import
com.glsx.smart.service.SmartProductTypeParamService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -14,10 +15,9 @@ import org.springframework.stereotype.Service;
...
@@ -14,10 +15,9 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartProductTypeParamServiceImpl
implements
SmartProductTypeParamService
{
public
class
SmartProductTypeParamServiceImpl
implements
SmartProductTypeParamService
{
@Resource
@Resource
private
SmartProductTypeParamMapper
smartProductTypeParamMapper
;
private
SmartProductTypeParamMapper
smartProductTypeParamMapper
;
...
...
src/main/java/com/glsx/smart/service/impl/SmartProductTypeServiceImpl.java
View file @
62c502a
...
@@ -8,6 +8,7 @@ import com.glsx.smart.dao.mapper.SmartProductTypeMapper;
...
@@ -8,6 +8,7 @@ import com.glsx.smart.dao.mapper.SmartProductTypeMapper;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.service.SmartProductTypeService
;
import
com.glsx.smart.service.SmartProductTypeService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -17,7 +18,7 @@ import org.springframework.stereotype.Service;
...
@@ -17,7 +18,7 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartProductTypeServiceImpl
implements
SmartProductTypeService
{
public
class
SmartProductTypeServiceImpl
implements
SmartProductTypeService
{
@Resource
@Resource
...
...
src/main/java/com/glsx/smart/service/impl/SmartSceneDataServiceImpl.java
View file @
62c502a
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartSceneDataMapper;
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartSceneDataMapper;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.service.SmartSceneDataService
;
import
com.glsx.smart.service.SmartSceneDataService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartSceneDataServiceImpl
implements
SmartSceneDataService
{
public
class
SmartSceneDataServiceImpl
implements
SmartSceneDataService
{
@Resource
@Resource
private
SmartSceneDataMapper
smartSceneDataMapper
;
private
SmartSceneDataMapper
smartSceneDataMapper
;
...
...
src/main/java/com/glsx/smart/service/impl/SmartSceneServiceImpl.java
View file @
62c502a
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartSceneMapper;
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartSceneMapper;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.service.SmartSceneService
;
import
com.glsx.smart.service.SmartSceneService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartSceneServiceImpl
implements
SmartSceneService
{
public
class
SmartSceneServiceImpl
implements
SmartSceneService
{
@Resource
@Resource
private
SmartSceneMapper
smartSceneMapper
;
private
SmartSceneMapper
smartSceneMapper
;
...
...
src/main/java/com/glsx/smart/service/impl/SmartSceneTemplateServiceImpl.java
View file @
62c502a
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartSceneTemplateMapper;
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartSceneTemplateMapper;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.service.SmartSceneTemplateService
;
import
com.glsx.smart.service.SmartSceneTemplateService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartSceneTemplateServiceImpl
implements
SmartSceneTemplateService
{
public
class
SmartSceneTemplateServiceImpl
implements
SmartSceneTemplateService
{
@Resource
@Resource
private
SmartSceneTemplateMapper
smartSceneTemplateMapper
;
private
SmartSceneTemplateMapper
smartSceneTemplateMapper
;
...
...
src/main/java/com/glsx/smart/service/impl/SmartSysCodeServiceImpl.java
View file @
62c502a
...
@@ -10,6 +10,7 @@ import com.glsx.smart.exception.ResultEnum;
...
@@ -10,6 +10,7 @@ import com.glsx.smart.exception.ResultEnum;
import
com.glsx.smart.pojo.SmartSysCodeReq
;
import
com.glsx.smart.pojo.SmartSysCodeReq
;
import
com.glsx.smart.service.BaseService
;
import
com.glsx.smart.service.BaseService
;
import
com.glsx.smart.service.SmartSysCodeService
;
import
com.glsx.smart.service.SmartSysCodeService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -19,10 +20,9 @@ import org.springframework.stereotype.Service;
...
@@ -19,10 +20,9 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartSysCodeServiceImpl
extends
BaseService
implements
SmartSysCodeService
{
public
class
SmartSysCodeServiceImpl
extends
BaseService
implements
SmartSysCodeService
{
@Resource
@Resource
private
SmartSysCodeMapper
sysCodeMapper
;
private
SmartSysCodeMapper
sysCodeMapper
;
...
...
src/main/java/com/glsx/smart/service/impl/SmartSysFileServiceImpl.java
View file @
62c502a
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartSysFileMapper;
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartSysFileMapper;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.service.SmartSysFileService
;
import
com.glsx.smart.service.SmartSysFileService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartSysFileServiceImpl
implements
SmartSysFileService
{
public
class
SmartSysFileServiceImpl
implements
SmartSysFileService
{
@Resource
@Resource
private
SmartSysFileMapper
smartSysFileMapper
;
private
SmartSysFileMapper
smartSysFileMapper
;
...
...
src/main/java/com/glsx/smart/service/impl/SmartTemplateParamServiceImpl.java
View file @
62c502a
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartTemplateParamMapper;
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartTemplateParamMapper;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.service.SmartTemplateParamService
;
import
com.glsx.smart.service.SmartTemplateParamService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartTemplateParamServiceImpl
implements
SmartTemplateParamService
{
public
class
SmartTemplateParamServiceImpl
implements
SmartTemplateParamService
{
@Resource
@Resource
private
SmartTemplateParamMapper
smartTemplateParamMapper
;
private
SmartTemplateParamMapper
smartTemplateParamMapper
;
...
...
src/main/java/com/glsx/smart/service/impl/SmartUserRelationServiceImpl.java
View file @
62c502a
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartUserRelationMapper;
...
@@ -7,6 +7,7 @@ import com.glsx.smart.dao.mapper.SmartUserRelationMapper;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.service.SmartUserRelationService
;
import
com.glsx.smart.service.SmartUserRelationService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
...
@@ -16,10 +17,9 @@ import org.springframework.stereotype.Service;
* @author wbh
* @author wbh
* @date 2021-03-15
* @date 2021-03-15
*/
*/
@Slf4j
@Service
@Service
public
class
SmartUserRelationServiceImpl
implements
SmartUserRelationService
{
public
class
SmartUserRelationServiceImpl
implements
SmartUserRelationService
{
@Resource
@Resource
private
SmartUserRelationMapper
smartUserRelationMapper
;
private
SmartUserRelationMapper
smartUserRelationMapper
;
...
...
src/main/resources/mapper/SmartSceneDataMapper.xml
View file @
62c502a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<!--@mbg.generated-->
<!--@mbg.generated-->
<!--@Table smart_scene_data-->
<!--@Table smart_scene_data-->
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"
template_id"
jdbcType=
"BIGINT"
property=
"templat
eId"
/>
<result
column=
"
scene_id"
jdbcType=
"BIGINT"
property=
"scen
eId"
/>
<result
column=
"type"
jdbcType=
"TINYINT"
property=
"type"
/>
<result
column=
"type"
jdbcType=
"TINYINT"
property=
"type"
/>
<result
column=
"sort"
jdbcType=
"TINYINT"
property=
"sort"
/>
<result
column=
"sort"
jdbcType=
"TINYINT"
property=
"sort"
/>
<result
column=
"param_key"
jdbcType=
"VARCHAR"
property=
"paramKey"
/>
<result
column=
"param_key"
jdbcType=
"VARCHAR"
property=
"paramKey"
/>
...
@@ -14,15 +14,15 @@
...
@@ -14,15 +14,15 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated-->
<!--@mbg.generated-->
id,
templat
e_id, `type`, sort, param_key, param_value
id,
scen
e_id, `type`, sort, param_key, param_value
</sql>
</sql>
<update
id=
"updateBatch"
parameterType=
"java.util.List"
>
<update
id=
"updateBatch"
parameterType=
"java.util.List"
>
<!--@mbg.generated-->
<!--@mbg.generated-->
update smart_scene_data
update smart_scene_data
<trim
prefix=
"set"
suffixOverrides=
","
>
<trim
prefix=
"set"
suffixOverrides=
","
>
<trim
prefix=
"
templat
e_id = case"
suffix=
"end,"
>
<trim
prefix=
"
scen
e_id = case"
suffix=
"end,"
>
<foreach
collection=
"list"
index=
"index"
item=
"item"
>
<foreach
collection=
"list"
index=
"index"
item=
"item"
>
when id = #{item.id,jdbcType=BIGINT} then #{item.
templat
eId,jdbcType=BIGINT}
when id = #{item.id,jdbcType=BIGINT} then #{item.
scen
eId,jdbcType=BIGINT}
</foreach>
</foreach>
</trim>
</trim>
<trim
prefix=
"`type` = case"
suffix=
"end,"
>
<trim
prefix=
"`type` = case"
suffix=
"end,"
>
...
@@ -55,10 +55,10 @@
...
@@ -55,10 +55,10 @@
<!--@mbg.generated-->
<!--@mbg.generated-->
update smart_scene_data
update smart_scene_data
<trim
prefix=
"set"
suffixOverrides=
","
>
<trim
prefix=
"set"
suffixOverrides=
","
>
<trim
prefix=
"
templat
e_id = case"
suffix=
"end,"
>
<trim
prefix=
"
scen
e_id = case"
suffix=
"end,"
>
<foreach
collection=
"list"
index=
"index"
item=
"item"
>
<foreach
collection=
"list"
index=
"index"
item=
"item"
>
<if
test=
"item.
templat
eId != null"
>
<if
test=
"item.
scen
eId != null"
>
when id = #{item.id,jdbcType=BIGINT} then #{item.
templat
eId,jdbcType=BIGINT}
when id = #{item.id,jdbcType=BIGINT} then #{item.
scen
eId,jdbcType=BIGINT}
</if>
</if>
</foreach>
</foreach>
</trim>
</trim>
...
@@ -101,10 +101,10 @@
...
@@ -101,10 +101,10 @@
useGeneratedKeys=
"true"
>
useGeneratedKeys=
"true"
>
<!--@mbg.generated-->
<!--@mbg.generated-->
insert into smart_scene_data
insert into smart_scene_data
(
templat
e_id, `type`, sort, param_key, param_value)
(
scen
e_id, `type`, sort, param_key, param_value)
values
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.
templat
eId,jdbcType=BIGINT}, #{item.type,jdbcType=TINYINT},
(#{item.
scen
eId,jdbcType=BIGINT}, #{item.type,jdbcType=TINYINT},
#{item.sort,jdbcType=TINYINT},
#{item.sort,jdbcType=TINYINT},
#{item.paramKey,jdbcType=VARCHAR}, #{item.paramValue,jdbcType=VARCHAR})
#{item.paramKey,jdbcType=VARCHAR}, #{item.paramValue,jdbcType=VARCHAR})
</foreach>
</foreach>
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
<if
test=
"id != null"
>
<if
test=
"id != null"
>
id,
id,
</if>
</if>
templat
e_id,
scen
e_id,
`type`,
`type`,
sort,
sort,
param_key,
param_key,
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
<if
test=
"id != null"
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
#{id,jdbcType=BIGINT},
</if>
</if>
#{
templat
eId,jdbcType=BIGINT},
#{
scen
eId,jdbcType=BIGINT},
#{type,jdbcType=TINYINT},
#{type,jdbcType=TINYINT},
#{sort,jdbcType=TINYINT},
#{sort,jdbcType=TINYINT},
#{paramKey,jdbcType=VARCHAR},
#{paramKey,jdbcType=VARCHAR},
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
<if
test=
"id != null"
>
<if
test=
"id != null"
>
id = #{id,jdbcType=BIGINT},
id = #{id,jdbcType=BIGINT},
</if>
</if>
template_id = #{templat
eId,jdbcType=BIGINT},
scene_id = #{scen
eId,jdbcType=BIGINT},
`type` = #{type,jdbcType=TINYINT},
`type` = #{type,jdbcType=TINYINT},
sort = #{sort,jdbcType=TINYINT},
sort = #{sort,jdbcType=TINYINT},
param_key = #{paramKey,jdbcType=VARCHAR},
param_key = #{paramKey,jdbcType=VARCHAR},
...
@@ -154,8 +154,8 @@
...
@@ -154,8 +154,8 @@
<if
test=
"id != null"
>
<if
test=
"id != null"
>
id,
id,
</if>
</if>
<if
test=
"
templat
eId != null"
>
<if
test=
"
scen
eId != null"
>
templat
e_id,
scen
e_id,
</if>
</if>
<if
test=
"type != null"
>
<if
test=
"type != null"
>
`type`,
`type`,
...
@@ -175,8 +175,8 @@
...
@@ -175,8 +175,8 @@
<if
test=
"id != null"
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
#{id,jdbcType=BIGINT},
</if>
</if>
<if
test=
"
templat
eId != null"
>
<if
test=
"
scen
eId != null"
>
#{
templat
eId,jdbcType=BIGINT},
#{
scen
eId,jdbcType=BIGINT},
</if>
</if>
<if
test=
"type != null"
>
<if
test=
"type != null"
>
#{type,jdbcType=TINYINT},
#{type,jdbcType=TINYINT},
...
@@ -196,8 +196,8 @@
...
@@ -196,8 +196,8 @@
<if
test=
"id != null"
>
<if
test=
"id != null"
>
id = #{id,jdbcType=BIGINT},
id = #{id,jdbcType=BIGINT},
</if>
</if>
<if
test=
"
templat
eId != null"
>
<if
test=
"
scen
eId != null"
>
template_id = #{templat
eId,jdbcType=BIGINT},
scene_id = #{scen
eId,jdbcType=BIGINT},
</if>
</if>
<if
test=
"type != null"
>
<if
test=
"type != null"
>
`type` = #{type,jdbcType=TINYINT},
`type` = #{type,jdbcType=TINYINT},
...
...
src/main/resources/mapper/SmartSysCodeMapper.xml
View file @
62c502a
...
@@ -32,6 +32,13 @@
...
@@ -32,6 +32,13 @@
<if
test=
"dictType != null and dictType != ''"
>
<if
test=
"dictType != null and dictType != ''"
>
and ssc.dict_type = #{dictType,jdbcType=VARCHAR}
and ssc.dict_type = #{dictType,jdbcType=VARCHAR}
</if>
</if>
<if
test=
"parentKey != null and parentKey != ''"
>
and ssc.parent_key = #{parentKey,jdbcType=VARCHAR}
</if>
<if
test=
"level != null"
>
and ssc.level = #{level,jdbcType=TINYINT}
</if>
and ssc.status = 1
</where>
</where>
order by ssc.create_time desc, ssc.sort asc
order by ssc.create_time desc, ssc.sort asc
</select>
</select>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment