@@ -416,6 +416,13 @@ public class TestCont {
return Response.ok();
}
+ @ApiOperation("供配电和电梯机房-更新状态")
+ @RequestMapping(value = "/powerDistributionMachine/updateState/{state}", method = RequestMethod.POST)
+ public Response updateState(@PathVariable int state, @RequestBody Long[] ids) {
+ testService.updateState(ids, state);
+ return Response.ok();
+ }
+
@ApiOperation("供配电和电梯机房-详情")
@RequestMapping(value = "/powerDistributionMachine/{id}", method = RequestMethod.GET)
public Response getPowerDistributionMachine(@PathVariable long id) {
@@ -16,4 +16,5 @@ public interface PowerDistributionMachineDao {
PowerDistributionMachine getInfo(long id);
+ int updateState(Long[] ids, int state);
@@ -576,5 +576,9 @@ public class TestService {
return powerDistributionMachineDao.getInfo(id);
+ public int updateState(Long[] ids, int state) {
+ return powerDistributionMachineDao.updateState(ids, state);
@@ -57,6 +57,13 @@
values (#{projectId}, #{projectItemId}, #{projectItemTargetId}, #{projectItemTargetRoomId}, #{name}, #{type}, now(), #{data}, #{state}, #{column1}, #{column2}, #{column3})
</insert>
+ <update id="updateState" parameterType="com.bosshand.virgo.api.test.model.PowerDistributionMachine">
+ UPDATE test_s set state = #{state} where id in
+ <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
+ #{id}
+ </foreach>
+ </update>
<update id="update" parameterType="com.bosshand.virgo.api.test.model.PowerDistributionMachine">
UPDATE test_s
<trim prefix="set" suffixOverrides=",">