Commit cbf6afa2 by wnb0128

车家智能数据服务开发 用户场景更新功能--think.wang

1 parent dabbdf88
......@@ -61,4 +61,11 @@ public class SceneController {
log.info("用户更新调用/scene/update param: {}", JSON.toJSONString(scene));
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;
}
}
......@@ -88,7 +88,7 @@ public class SmartScene implements Serializable {
private Byte executeCycle;
/**
* 状态:0下线 1上线
* 开关说明:-1 无开关 0开关关 1开关开
*/
private Byte status;
......
......@@ -7,7 +7,7 @@
<!--@Table smart_scene-->
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="scene_name" jdbcType="VARCHAR" property="scenesName"/>
<result column="scene_name" jdbcType="VARCHAR" property="sceneName"/>
<result column="type_key" jdbcType="VARCHAR" property="typeKey"/>
<result column="icon" jdbcType="BIGINT" property="icon"/>
<result column="back_pic" jdbcType="BIGINT" property="backPic"/>
......@@ -44,7 +44,7 @@
</trim>
<trim prefix="scene_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.scenesName,jdbcType=VARCHAR}
when id = #{item.id,jdbcType=BIGINT} then #{item.sceneName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="type_key = case" suffix="end,">
......@@ -121,9 +121,9 @@
</trim>
<trim prefix="scene_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.scenesName != null">
<if test="item.sceneName != null">
when id = #{item.id,jdbcType=BIGINT} then
#{item.scenesName,jdbcType=VARCHAR}
#{item.sceneName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
......@@ -223,7 +223,7 @@
execute_cycle, `status`, remark, create_time, update_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.userId,jdbcType=BIGINT}, #{item.scenesName,jdbcType=VARCHAR},
(#{item.userId,jdbcType=BIGINT}, #{item.sceneName,jdbcType=VARCHAR},
#{item.typeKey,jdbcType=VARCHAR},
#{item.icon,jdbcType=BIGINT}, #{item.backPic,jdbcType=BIGINT},
#{item.viewTimes,jdbcType=BIGINT},
......@@ -262,7 +262,7 @@
#{id,jdbcType=BIGINT},
</if>
#{userId,jdbcType=BIGINT},
#{scenesName,jdbcType=VARCHAR},
#{sceneName,jdbcType=VARCHAR},
#{typeKey,jdbcType=VARCHAR},
#{icon,jdbcType=BIGINT},
#{backPic,jdbcType=BIGINT},
......@@ -281,7 +281,7 @@
id = #{id,jdbcType=BIGINT},
</if>
user_id = #{userId,jdbcType=BIGINT},
scene_name = #{scenesName,jdbcType=VARCHAR},
scene_name = #{sceneName,jdbcType=VARCHAR},
type_key = #{typeKey,jdbcType=VARCHAR},
icon = #{icon,jdbcType=BIGINT},
back_pic = #{backPic,jdbcType=BIGINT},
......@@ -306,7 +306,7 @@
<if test="userId != null">
user_id,
</if>
<if test="scenesName != null and scenesName != ''">
<if test="sceneName != null and sceneName != ''">
scene_name,
</if>
<if test="typeKey != null and typeKey != ''">
......@@ -351,8 +351,8 @@
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="scenesName != null and scenesName != ''">
#{scenesName,jdbcType=VARCHAR},
<if test="sceneName != null and sceneName != ''">
#{sceneName,jdbcType=VARCHAR},
</if>
<if test="typeKey != null and typeKey != ''">
#{typeKey,jdbcType=VARCHAR},
......@@ -396,8 +396,8 @@
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="scenesName != null and scenesName != ''">
scene_name = #{scenesName,jdbcType=VARCHAR},
<if test="sceneName != null and sceneName != ''">
scene_name = #{sceneName,jdbcType=VARCHAR},
</if>
<if test="typeKey != null and typeKey != ''">
type_key = #{typeKey,jdbcType=VARCHAR},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!