Commit cbf6afa2 by wnb0128

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

1 parent dabbdf88
...@@ -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;
}
} }
...@@ -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;
......
...@@ -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="scenesName"/> <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.scenesName,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.scenesName != null"> <if test="item.sceneName != null">
when id = #{item.id,jdbcType=BIGINT} then when id = #{item.id,jdbcType=BIGINT} then
#{item.scenesName,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.scenesName,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},
#{scenesName,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 = #{scenesName,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="scenesName != null and scenesName != ''"> <if test="sceneName != null and sceneName != ''">
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="scenesName != null and scenesName != ''"> <if test="sceneName != null and sceneName != ''">
#{scenesName,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="scenesName != null and scenesName != ''"> <if test="sceneName != null and sceneName != ''">
scene_name = #{scenesName,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},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!