feat:故障记录展示
parent
a40653dc4d
commit
1facc25586
|
@ -0,0 +1,48 @@
|
|||
package com.muyu.breakdown.controller;
|
||||
|
||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||
import com.muyu.breakdown.service.SysCarFaultLogService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassDescription:
|
||||
* @JdkVersion: 1.8
|
||||
* @Author: YZL
|
||||
* @Created: 2024/9/22 21:08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/log")
|
||||
public class sysCarFaultLogController extends BaseController {
|
||||
@Autowired
|
||||
private SysCarFaultLogService service;
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<SysCarFaultLog>> list(){
|
||||
startPage();
|
||||
List<SysCarFaultLog> list = service.list();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/listIsReadAlready")
|
||||
public Result<TableDataInfo<SysCarFaultLog>>listIsReadAlready(){
|
||||
startPage();
|
||||
List<SysCarFaultLog> list = service.listIsReadAlready();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/listIsReadNoAlready")
|
||||
public Result<TableDataInfo<SysCarFaultLog>>listIsReadNoAlready(){
|
||||
startPage();
|
||||
List<SysCarFaultLog> list = service.listIsReadNoAlready();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.muyu.breakdown.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassDescription:
|
||||
* @JdkVersion: 1.8
|
||||
* @Author: YZL
|
||||
* @Created: 2024/9/22 20:17
|
||||
*/
|
||||
@Data
|
||||
@Setter
|
||||
@Getter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("sys_car_fault_log")
|
||||
public class SysCarFaultLog extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 参数主键 */
|
||||
@TableId( type = IdType.AUTO)
|
||||
private Long id;
|
||||
/** 故障码编码 */
|
||||
private Integer sysCarFaultId;
|
||||
/**记录时间*/
|
||||
private Date createTime;
|
||||
|
||||
/** 结束时间*/
|
||||
private Date updateTime;
|
||||
|
||||
/** 是否已读 */
|
||||
private Integer isRead;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.muyu.breakdown.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||
import com.muyu.breakdown.domain.SysCarFaultMessage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassDescription:
|
||||
* @JdkVersion: 1.8
|
||||
* @Author: YZL
|
||||
* @Created: 2024/9/22 21:06
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysCarFaultLogMapper extends BaseMapper<SysCarFaultLog> {
|
||||
|
||||
|
||||
@Select("select * from sys_car_fault_log where is_read=1")
|
||||
public List<SysCarFaultLog> listIsReadAlready( );
|
||||
@Select("select * from sys_car_fault_log where is_read=2")
|
||||
public List<SysCarFaultLog>listISReadNotYet( );
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.muyu.breakdown.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||
import com.muyu.breakdown.domain.SysCarFaultMessage;
|
||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassDescription:
|
||||
* @JdkVersion: 1.8
|
||||
* @Author: YZL
|
||||
* @Created: 2024/9/22 21:07
|
||||
*/
|
||||
public interface SysCarFaultLogService extends IService<SysCarFaultLog> {
|
||||
|
||||
public List<SysCarFaultLog> listIsReadAlready( );
|
||||
public List<SysCarFaultLog>listIsReadNoAlready( );
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.breakdown.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||
import com.muyu.breakdown.mapper.SysCarFaultLogMapper;
|
||||
import com.muyu.breakdown.mapper.SysCarFaultMapper;
|
||||
import com.muyu.breakdown.service.SysCarFaultLogService;
|
||||
import com.muyu.breakdown.service.SysCarFaultLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassDescription:
|
||||
* @JdkVersion: 1.8
|
||||
* @Author: YZL
|
||||
* @Created: 2024/9/22 21:07
|
||||
*/
|
||||
@Service
|
||||
public class sysCarFaultLogServiceImpl extends ServiceImpl<SysCarFaultLogMapper, SysCarFaultLog> implements SysCarFaultLogService {
|
||||
|
||||
@Autowired
|
||||
private SysCarFaultLogMapper mapper;
|
||||
@Override
|
||||
public List<SysCarFaultLog> listIsReadAlready() {
|
||||
return mapper.listIsReadAlready();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysCarFaultLog> listIsReadNoAlready() {
|
||||
return mapper.listIsReadAlready();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue