commit
535eae941e
|
@ -32,8 +32,6 @@ public class MiddleController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CarFenceServiceMybaits carFenceServiceMybaits;
|
private CarFenceServiceMybaits carFenceServiceMybaits;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加围栏组 多对多
|
* 添加围栏组 多对多
|
||||||
*/
|
*/
|
||||||
|
@ -57,18 +55,6 @@ public class MiddleController {
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 启动围栏
|
|
||||||
*/
|
|
||||||
@PutMapping("/activate")
|
|
||||||
@Operation(summary = "启动围栏状态",description = "启动围栏状态")
|
|
||||||
public Result activate(@RequestBody FenceGroupUpdateReq fenceGroupUpdateReq){
|
|
||||||
Integer states = 0;
|
|
||||||
FenceGroup fenceGroup = FenceGroup.carFenceUpdateById(states, fenceGroupUpdateReq);
|
|
||||||
boolean b = carFenceServiceMybaits.updateById(fenceGroup);
|
|
||||||
|
|
||||||
return Result.success("成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据围栏组的id查询绑定的围栏的中间表
|
* 根据围栏组的id查询绑定的围栏的中间表
|
||||||
|
|
|
@ -33,17 +33,6 @@ public interface CarFenceServiceMybaitsMapper extends BaseMapper<CarMiddle> {
|
||||||
*/
|
*/
|
||||||
Integer addFenceGroup(@Param("fenceGroupId") Integer fenceGroupId, @Param("id") Integer id);
|
Integer addFenceGroup(@Param("fenceGroupId") Integer fenceGroupId, @Param("id") Integer id);
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改围栏组状态
|
|
||||||
* @param groupId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void updateFenceGroupById(@Param("groupId") Integer groupId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启动围栏
|
|
||||||
*/
|
|
||||||
void activate(@Param("groupId") Integer groupId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据围栏组的id查询绑定的围栏的中间表
|
* 根据围栏组的id查询绑定的围栏的中间表
|
||||||
|
|
|
@ -41,7 +41,7 @@ public interface CarFenceServiceMybaits extends IService<CarMiddle> {
|
||||||
* 启动围栏
|
* 启动围栏
|
||||||
*/
|
*/
|
||||||
Object activate(Integer groupId);
|
Object activate(Integer groupId);
|
||||||
boolean updateById(FenceGroup FenceGroup);
|
|
||||||
/**
|
/**
|
||||||
* 根据围栏组的id查询绑定的围栏的中间表
|
* 根据围栏组的id查询绑定的围栏的中间表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -54,30 +54,8 @@ public class CarFenceServiceMybaitsImpl extends ServiceImpl<CarFenceServiceMybai
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改围栏组状态
|
|
||||||
* @param groupId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Object updateFenceGroupById(Integer groupId) {
|
|
||||||
carFenceServiceMybaitsMapper.updateFenceGroupById(groupId);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启动围栏
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Object activate(Integer groupId) {
|
|
||||||
carFenceServiceMybaitsMapper.activate(groupId);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// @Override
|
|
||||||
// public void updateById(FenceGroup groupId) {
|
|
||||||
//
|
|
||||||
// this.updateById(groupId);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据围栏组的id查询绑定的围栏的中间表
|
* 根据围栏组的id查询绑定的围栏的中间表
|
||||||
|
@ -122,13 +100,7 @@ public class CarFenceServiceMybaitsImpl extends ServiceImpl<CarFenceServiceMybai
|
||||||
return fenceGroups;
|
return fenceGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean updateById(FenceGroup fenceGroup) {
|
|
||||||
Long groupId = fenceGroup.getGroupId();
|
|
||||||
boolean b = this.updateById(fenceGroup);
|
|
||||||
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,7 @@
|
||||||
<insert id="addFenceGroupAddCarMiddle">
|
<insert id="addFenceGroupAddCarMiddle">
|
||||||
insert into car_group_middle values (0,#{id},#{groupId})
|
insert into car_group_middle values (0,#{id},#{groupId})
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateFenceGroupById">
|
|
||||||
update fence_group set group_states = 1 where group_id = #{groupId}
|
|
||||||
</update>
|
|
||||||
<update id="activate">
|
|
||||||
update fence_group set group_states = 0 where group_id = #{groupId}
|
|
||||||
</update>
|
|
||||||
<!--根据围栏组的id查询绑定的围栏的中间表-->
|
<!--根据围栏组的id查询绑定的围栏的中间表-->
|
||||||
<select id="BoundFenceGroup" resultType="com.muyu.domain.CarMiddle">
|
<select id="BoundFenceGroup" resultType="com.muyu.domain.CarMiddle">
|
||||||
select * from car_middle where car_group_id = #{groupId}
|
select * from car_middle where car_group_id = #{groupId}
|
||||||
|
|
Loading…
Reference in New Issue