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 cbf6afa2
authored
Mar 25, 2021
by
wnb0128
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
车家智能数据服务开发 用户场景更新功能--think.wang
1 parent
dabbdf88
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
src/main/java/com/glsx/smart/controller/SceneController.java
src/main/java/com/glsx/smart/dao/entity/SmartScene.java
src/main/resources/mapper/SmartSceneMapper.xml
src/main/java/com/glsx/smart/controller/SceneController.java
View file @
cbf6afa
...
@@ -61,4 +61,11 @@ public class SceneController {
...
@@ -61,4 +61,11 @@ public class SceneController {
log
.
info
(
"用户更新调用/scene/update param: {}"
,
JSON
.
toJSONString
(
scene
));
log
.
info
(
"用户更新调用/scene/update param: {}"
,
JSON
.
toJSONString
(
scene
));
return
sceneService
.
update
(
scene
)
>
0
?
true
:
false
;
return
sceneService
.
update
(
scene
)
>
0
?
true
:
false
;
}
}
@RequestMapping
(
value
=
"/updateStatus"
,
method
=
{
RequestMethod
.
POST
})
public
boolean
updateStatus
(
@RequestBody
SmartScene
scene
)
{
scene
.
setUpdateTime
(
new
Date
());
log
.
info
(
"用户更新调用/scene/updateStatus param: {}"
,
JSON
.
toJSONString
(
scene
));
return
sceneService
.
updateByPrimaryKeySelective
(
scene
)
>
0
?
true
:
false
;
}
}
}
src/main/java/com/glsx/smart/dao/entity/SmartScene.java
View file @
cbf6afa
...
@@ -88,7 +88,7 @@ public class SmartScene implements Serializable {
...
@@ -88,7 +88,7 @@ public class SmartScene implements Serializable {
private
Byte
executeCycle
;
private
Byte
executeCycle
;
/**
/**
*
状态:0下线 1上线
*
开关说明:-1 无开关 0开关关 1开关开
*/
*/
private
Byte
status
;
private
Byte
status
;
...
...
src/main/resources/mapper/SmartSceneMapper.xml
View file @
cbf6afa
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<!--@Table smart_scene-->
<!--@Table smart_scene-->
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"scene_name"
jdbcType=
"VARCHAR"
property=
"scene
s
Name"
/>
<result
column=
"scene_name"
jdbcType=
"VARCHAR"
property=
"sceneName"
/>
<result
column=
"type_key"
jdbcType=
"VARCHAR"
property=
"typeKey"
/>
<result
column=
"type_key"
jdbcType=
"VARCHAR"
property=
"typeKey"
/>
<result
column=
"icon"
jdbcType=
"BIGINT"
property=
"icon"
/>
<result
column=
"icon"
jdbcType=
"BIGINT"
property=
"icon"
/>
<result
column=
"back_pic"
jdbcType=
"BIGINT"
property=
"backPic"
/>
<result
column=
"back_pic"
jdbcType=
"BIGINT"
property=
"backPic"
/>
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
</trim>
</trim>
<trim
prefix=
"scene_name = case"
suffix=
"end,"
>
<trim
prefix=
"scene_name = 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.scene
s
Name,jdbcType=VARCHAR}
when id = #{item.id,jdbcType=BIGINT} then #{item.sceneName,jdbcType=VARCHAR}
</foreach>
</foreach>
</trim>
</trim>
<trim
prefix=
"type_key = case"
suffix=
"end,"
>
<trim
prefix=
"type_key = case"
suffix=
"end,"
>
...
@@ -121,9 +121,9 @@
...
@@ -121,9 +121,9 @@
</trim>
</trim>
<trim
prefix=
"scene_name = case"
suffix=
"end,"
>
<trim
prefix=
"scene_name = case"
suffix=
"end,"
>
<foreach
collection=
"list"
index=
"index"
item=
"item"
>
<foreach
collection=
"list"
index=
"index"
item=
"item"
>
<if
test=
"item.scene
s
Name != null"
>
<if
test=
"item.sceneName != null"
>
when id = #{item.id,jdbcType=BIGINT} then
when id = #{item.id,jdbcType=BIGINT} then
#{item.scene
s
Name,jdbcType=VARCHAR}
#{item.sceneName,jdbcType=VARCHAR}
</if>
</if>
</foreach>
</foreach>
</trim>
</trim>
...
@@ -223,7 +223,7 @@
...
@@ -223,7 +223,7 @@
execute_cycle, `status`, remark, create_time, update_time)
execute_cycle, `status`, remark, create_time, update_time)
values
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.userId,jdbcType=BIGINT}, #{item.scene
s
Name,jdbcType=VARCHAR},
(#{item.userId,jdbcType=BIGINT}, #{item.sceneName,jdbcType=VARCHAR},
#{item.typeKey,jdbcType=VARCHAR},
#{item.typeKey,jdbcType=VARCHAR},
#{item.icon,jdbcType=BIGINT}, #{item.backPic,jdbcType=BIGINT},
#{item.icon,jdbcType=BIGINT}, #{item.backPic,jdbcType=BIGINT},
#{item.viewTimes,jdbcType=BIGINT},
#{item.viewTimes,jdbcType=BIGINT},
...
@@ -262,7 +262,7 @@
...
@@ -262,7 +262,7 @@
#{id,jdbcType=BIGINT},
#{id,jdbcType=BIGINT},
</if>
</if>
#{userId,jdbcType=BIGINT},
#{userId,jdbcType=BIGINT},
#{scene
s
Name,jdbcType=VARCHAR},
#{sceneName,jdbcType=VARCHAR},
#{typeKey,jdbcType=VARCHAR},
#{typeKey,jdbcType=VARCHAR},
#{icon,jdbcType=BIGINT},
#{icon,jdbcType=BIGINT},
#{backPic,jdbcType=BIGINT},
#{backPic,jdbcType=BIGINT},
...
@@ -281,7 +281,7 @@
...
@@ -281,7 +281,7 @@
id = #{id,jdbcType=BIGINT},
id = #{id,jdbcType=BIGINT},
</if>
</if>
user_id = #{userId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
scene_name = #{scene
s
Name,jdbcType=VARCHAR},
scene_name = #{sceneName,jdbcType=VARCHAR},
type_key = #{typeKey,jdbcType=VARCHAR},
type_key = #{typeKey,jdbcType=VARCHAR},
icon = #{icon,jdbcType=BIGINT},
icon = #{icon,jdbcType=BIGINT},
back_pic = #{backPic,jdbcType=BIGINT},
back_pic = #{backPic,jdbcType=BIGINT},
...
@@ -306,7 +306,7 @@
...
@@ -306,7 +306,7 @@
<if
test=
"userId != null"
>
<if
test=
"userId != null"
>
user_id,
user_id,
</if>
</if>
<if
test=
"scene
sName != null and scenes
Name != ''"
>
<if
test=
"scene
Name != null and scene
Name != ''"
>
scene_name,
scene_name,
</if>
</if>
<if
test=
"typeKey != null and typeKey != ''"
>
<if
test=
"typeKey != null and typeKey != ''"
>
...
@@ -351,8 +351,8 @@
...
@@ -351,8 +351,8 @@
<if
test=
"userId != null"
>
<if
test=
"userId != null"
>
#{userId,jdbcType=BIGINT},
#{userId,jdbcType=BIGINT},
</if>
</if>
<if
test=
"scene
sName != null and scenes
Name != ''"
>
<if
test=
"scene
Name != null and scene
Name != ''"
>
#{scene
s
Name,jdbcType=VARCHAR},
#{sceneName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"typeKey != null and typeKey != ''"
>
<if
test=
"typeKey != null and typeKey != ''"
>
#{typeKey,jdbcType=VARCHAR},
#{typeKey,jdbcType=VARCHAR},
...
@@ -396,8 +396,8 @@
...
@@ -396,8 +396,8 @@
<if
test=
"userId != null"
>
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
</if>
</if>
<if
test=
"scene
sName != null and scenes
Name != ''"
>
<if
test=
"scene
Name != null and scene
Name != ''"
>
scene_name = #{scene
s
Name,jdbcType=VARCHAR},
scene_name = #{sceneName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"typeKey != null and typeKey != ''"
>
<if
test=
"typeKey != null and typeKey != ''"
>
type_key = #{typeKey,jdbcType=VARCHAR},
type_key = #{typeKey,jdbcType=VARCHAR},
...
...
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