Commit d9411a87 authored by co_dengxiongwen's avatar co_dengxiongwen

接口调整

parent 8c721552
...@@ -60,4 +60,7 @@ public class TimedTask implements Serializable { ...@@ -60,4 +60,7 @@ public class TimedTask implements Serializable {
/** 类型(1 上升 2 下降) */ /** 类型(1 上升 2 下降) */
@ApiModelProperty(value="类型(1 上升 2 下降)",name="type") @ApiModelProperty(value="类型(1 上升 2 下降)",name="type")
private Integer type; private Integer type;
/** 温度 */
@ApiModelProperty(value="温度",name="temperature")
private java.lang.String temperature;
} }
...@@ -177,7 +177,7 @@ public class EquipmentController extends AbstractController { ...@@ -177,7 +177,7 @@ public class EquipmentController extends AbstractController {
timedTaskService.save(timedTask); timedTaskService.save(timedTask);
}else { }else {
timedTask = timedTaskService.getOne(new LambdaQueryWrapper<TimedTask>().eq(TimedTask::getBusinessType,businessType) timedTask = timedTaskService.getOne(new LambdaQueryWrapper<TimedTask>().eq(TimedTask::getBusinessType,businessType)
.eq(type == null,TimedTask::getType,type).last("limit 1")); .eq(type != null,TimedTask::getType,type).last("limit 1"));
timedTask.setStartTime(startTime); timedTask.setStartTime(startTime);
timedTask.setBusinessType(businessType); timedTask.setBusinessType(businessType);
timedTask.setType(type); timedTask.setType(type);
...@@ -300,8 +300,7 @@ public class EquipmentController extends AbstractController { ...@@ -300,8 +300,7 @@ public class EquipmentController extends AbstractController {
@GetMapping("/getAllHcdt") @GetMapping("/getAllHcdt")
public R getAllHcdt() { public R getAllHcdt() {
SysSystemParams sysSystemParams = sysSystemParamsService.getById(Constants.STRING_1); SysSystemParams sysSystemParams = sysSystemParamsService.getById(Constants.STRING_1);
TimedTask timedTask = timedTaskService.getOne(new LambdaQueryWrapper<TimedTask>().eq(TimedTask::getBusinessType,Constants.INT_1).last("limit 1")); return R.ok().put("sysSystemParams", sysSystemParams);
return R.ok().put("sysSystemParams", sysSystemParams).put("timedTask",timedTask);
} }
@ApiOperation(value = "切换模式", notes = "切换模式") @ApiOperation(value = "切换模式", notes = "切换模式")
...@@ -327,13 +326,24 @@ public class EquipmentController extends AbstractController { ...@@ -327,13 +326,24 @@ public class EquipmentController extends AbstractController {
return R.ok(); return R.ok();
} }
/**
* 查询定时温控里面的数据
* @return
*/
@ApiOperation(value="查询定时温控里面的数据", notes="查询定时温控里面的数据")
@GetMapping("/getAllDswk")
public R getAllDswk() {
TimedTask timedTask = timedTaskService.getOne(new LambdaQueryWrapper<TimedTask>().eq(TimedTask::getBusinessType,Constants.INT_1).last("limit 1"));
return R.ok().put("timedTask", timedTask);
}
@ApiOperation(value = "温度设定", notes = "温度设定") @ApiOperation(value = "温度设定", notes = "温度设定")
@PostMapping("/changeTemperature") @PostMapping("/changeTemperature")
public R changeTemperature(String temperature) { public R changeTemperature(String temperature) {
SysSystemParams sysSystemParams = sysSystemParamsService.getById(Constants.STRING_1); TimedTask timedTask = timedTaskService.getOne(new LambdaQueryWrapper<TimedTask>().eq(TimedTask::getBusinessType,Constants.INT_1).last("limit 1"));
sysSystemParams.setTemperature(temperature); timedTask.setTemperature(temperature);
sysSystemParamsService.update(sysSystemParams,new LambdaQueryWrapper<SysSystemParams>() timedTaskService.update(timedTask,new LambdaQueryWrapper<TimedTask>()
.eq(SysSystemParams::getId,sysSystemParams.getId())); .eq(TimedTask::getId,timedTask.getId()));
return R.ok(); return R.ok();
} }
} }
...@@ -41,4 +41,6 @@ public class TimedTaskModel extends BaseModel { ...@@ -41,4 +41,6 @@ public class TimedTaskModel extends BaseModel {
private Integer businessType; private Integer businessType;
/** 类型(1 上升 2 下降) */ /** 类型(1 上升 2 下降) */
private Integer type; private Integer type;
/** 温度 */
private java.lang.String temperature;
} }
...@@ -18,11 +18,12 @@ ...@@ -18,11 +18,12 @@
<result column="byx3" property="byx3"/> <result column="byx3" property="byx3"/>
<result column="business_type" property="businessType"/> <result column="business_type" property="businessType"/>
<result column="type" property="type"/> <result column="type" property="type"/>
<result column="temperature" property="temperature"/>
</resultMap> </resultMap>
<!-- timed_task table all fields --> <!-- timed_task table all fields -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,start_time,end_time,create_user_id,create_time,update_user_id,update_time,status,deleted,station_id,byx1,byx2,byx3,business_type,type id,start_time,end_time,create_user_id,create_time,update_user_id,update_time,status,deleted,station_id,byx1,byx2,byx3,business_type,type,temperature
</sql> </sql>
<!-- 公共查询条件 --> <!-- 公共查询条件 -->
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
<if test="byx3!=null and byx3!=''">and t.byx3 = #{byx3}</if> <if test="byx3!=null and byx3!=''">and t.byx3 = #{byx3}</if>
<if test="businessType!=null ">and t.business_type = #{businessType}</if> <if test="businessType!=null ">and t.business_type = #{businessType}</if>
<if test="type!=null ">and t.type = #{type}</if> <if test="type!=null ">and t.type = #{type}</if>
<if test="temperature!=null and temperature!=''">and t.temperature = #{temperature}</if>
</sql> </sql>
<select id="queryPageByCount" parameterType="Object" resultType="java.lang.Integer"> <select id="queryPageByCount" parameterType="Object" resultType="java.lang.Integer">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment