故障日志更新
parent
7abd6f6523
commit
9433dcb66d
|
@ -5,13 +5,14 @@ import com.zhilian.business.service.BreakLogService;
|
|||
import com.zhilian.common.core.domain.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName BreakLogController
|
||||
* @Description TODO
|
||||
* @Description 故障日志业务实现
|
||||
* @Author YuanYongH
|
||||
* @Date 2024/4/8 20:48
|
||||
*/
|
||||
|
@ -21,6 +22,11 @@ public class BreakLogController {
|
|||
@Autowired
|
||||
private BreakLogService breakLogService;
|
||||
|
||||
/**
|
||||
* @Description //故障日志列表
|
||||
* @Date 2024/4/10
|
||||
* @return com.zhilian.common.core.domain.Result<java.util.List<com.zhilian.business.domain.BreakLog>>
|
||||
**/
|
||||
@PostMapping("log")
|
||||
public Result<List<BreakLog>> breakLog() {
|
||||
List<BreakLog> list = breakLogService.breakLog();
|
||||
|
@ -28,4 +34,30 @@ public class BreakLogController {
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description //故障日志添加
|
||||
* @Date 2024/4/10
|
||||
* @param breakLog
|
||||
* @return com.zhilian.common.core.domain.Result
|
||||
**/
|
||||
@PostMapping("logAdd")
|
||||
public Result logAdd(@RequestBody BreakLog breakLog){
|
||||
int i = breakLogService.logAdd(breakLog);
|
||||
Result<Integer> success = Result.success(i);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description // 故障日志修改
|
||||
* @Date 2024/4/10
|
||||
* @param breakLog
|
||||
* @return com.zhilian.common.core.domain.Result
|
||||
**/
|
||||
@PostMapping("updLog")
|
||||
public Result updLog(@RequestBody BreakLog breakLog){
|
||||
int i = breakLogService.updLog(breakLog);
|
||||
Result<Integer> success = Result.success(i);
|
||||
return success;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,4 +15,7 @@ import java.util.List;
|
|||
public interface BreakLogMapper {
|
||||
List<BreakLog> breakLog();
|
||||
|
||||
int logAdd(BreakLog breakLog);
|
||||
|
||||
int updLog(BreakLog breakLog);
|
||||
}
|
||||
|
|
|
@ -13,4 +13,7 @@ import java.util.List;
|
|||
public interface BreakLogService {
|
||||
List<BreakLog> breakLog();
|
||||
|
||||
int logAdd(BreakLog breakLog);
|
||||
|
||||
int updLog(BreakLog breakLog);
|
||||
}
|
||||
|
|
|
@ -64,4 +64,14 @@ public class BreakLogServiceImpl implements BreakLogService {
|
|||
// 返回故障日志
|
||||
return breakLogMapper.breakLog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int logAdd(BreakLog breakLog) {
|
||||
return breakLogMapper.logAdd(breakLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updLog(BreakLog breakLog) {
|
||||
return breakLogMapper.updLog(breakLog);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,19 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhilian.business.mapper.BreakLogMapper">
|
||||
<insert id="logAdd">
|
||||
|
||||
INSERT INTO `zhilian-business`.`business_break_log`
|
||||
( `break_code`, `break_vin`, `break_time`, `break_type`, `break_date`, `break_state`)
|
||||
VALUES
|
||||
(#{breakCode}, #{breakVin}, NOW(), #{breakType}, NOW(), #{breakState});
|
||||
</insert>
|
||||
<update id="updLog">
|
||||
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}
|
||||
WHERE `break_log_id` = #{breakLogId};
|
||||
|
||||
</update>
|
||||
|
||||
<select id="breakLog" resultType="com.zhilian.business.domain.BreakLog">
|
||||
select * from business_break_log
|
||||
|
|
Loading…
Reference in New Issue