故障日志更新
parent
02f71d7baf
commit
46639b77a0
|
@ -3,7 +3,9 @@ package com.zhilian.business.controller;
|
||||||
import com.zhilian.business.domain.BreakLog;
|
import com.zhilian.business.domain.BreakLog;
|
||||||
import com.zhilian.business.service.BreakLogService;
|
import com.zhilian.business.service.BreakLogService;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
@ -60,4 +62,13 @@ public class BreakLogController {
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("logDel/{breakLogId}")
|
||||||
|
public Result logDel(@PathVariable Integer breakLogId){
|
||||||
|
int del = breakLogService.logDel(breakLogId);
|
||||||
|
Result<Integer> success = Result.success(del);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@ public class BreakLog {
|
||||||
private String breakTime;
|
private String breakTime;
|
||||||
/** 开始报警时间 */
|
/** 开始报警时间 */
|
||||||
private String breakDate;
|
private String breakDate;
|
||||||
/** 是否报警 */
|
/** 故障状态 */
|
||||||
private String breakState;
|
private String breakState;
|
||||||
|
/** 逻辑删除 */
|
||||||
|
private Integer breakDel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,6 @@ public interface BreakLogMapper {
|
||||||
int logAdd(BreakLog breakLog);
|
int logAdd(BreakLog breakLog);
|
||||||
|
|
||||||
int updLog(BreakLog breakLog);
|
int updLog(BreakLog breakLog);
|
||||||
|
|
||||||
|
int logDel(Integer breakLogId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,4 +16,6 @@ public interface BreakLogService {
|
||||||
int logAdd(BreakLog breakLog);
|
int logAdd(BreakLog breakLog);
|
||||||
|
|
||||||
int updLog(BreakLog breakLog);
|
int updLog(BreakLog breakLog);
|
||||||
|
|
||||||
|
int logDel(Integer breakLogId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,4 +74,9 @@ public class BreakLogServiceImpl implements BreakLogService {
|
||||||
public int updLog(BreakLog breakLog) {
|
public int updLog(BreakLog breakLog) {
|
||||||
return breakLogMapper.updLog(breakLog);
|
return breakLogMapper.updLog(breakLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int logDel(Integer breakLogId) {
|
||||||
|
return breakLogMapper.logDel(breakLogId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,18 +6,23 @@
|
||||||
<insert id="logAdd">
|
<insert id="logAdd">
|
||||||
|
|
||||||
INSERT INTO `zhilian-business`.`business_break_log`
|
INSERT INTO `zhilian-business`.`business_break_log`
|
||||||
( `break_code`, `break_vin`, `break_time`, `break_type`, `break_date`, `break_state`)
|
( `break_code`, `break_vin`, `break_time`, `break_type`, `break_date`, `break_state`,`break_del`)
|
||||||
VALUES
|
VALUES
|
||||||
(#{breakCode}, #{breakVin}, NOW(), #{breakType}, NOW(), #{breakState});
|
(#{breakCode}, #{breakVin},#{breakTime}, #{breakType},DATE_ADD(NOW(),INTERVAL 8 HOUR), #{breakState},0);
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updLog">
|
<update id="updLog">
|
||||||
UPDATE `zhilian-business`.`business_break_log`
|
UPDATE `zhilian-business`.`business_break_log`
|
||||||
SET `break_code` = #{breakCode}, `break_vin` = #{breakVin}, `break_time` = NOW(), `break_type` = #{breakType}, `break_date` = NOW(), `break_state` = #{breakState}
|
SET `break_code` = #{breakCode}, `break_vin` = #{breakVin}, `break_time` = NOW(), `break_type` = #{breakType}, `break_date` = NOW(), `break_state` = #{breakState}, `break_del` = #{breakDel}
|
||||||
WHERE `break_log_id` = #{breakLogId};
|
WHERE `break_log_id` = #{breakLogId};
|
||||||
|
|
||||||
</update>
|
</update>
|
||||||
|
<update id="logDel">
|
||||||
|
UPDATE `zhilian-business`.`business_break_log`
|
||||||
|
SET break_del = 1
|
||||||
|
WHERE break_log_id = #{breakLogId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="breakLog" resultType="com.zhilian.business.domain.BreakLog">
|
<select id="breakLog" resultType="com.zhilian.business.domain.BreakLog">
|
||||||
select * from business_break_log
|
select * from business_break_log where break_del = 0
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue