parent
21a7b0c7e2
commit
91416135f7
@ -0,0 +1,42 @@
|
||||
package com.yingji.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* (AcceptClass)表实体类
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-06-14 14:32:49
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("实体类")
|
||||
@TableName(value = "event_class")
|
||||
public class EventClass implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -34185186253758694L;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 编码AcceptType
|
||||
*/
|
||||
@ApiModelProperty(value = "事件类型编码")
|
||||
private String acceptType;
|
||||
|
||||
/**
|
||||
* 事件类型ai_class
|
||||
*/
|
||||
@ApiModelProperty(value = "事件类型")
|
||||
private String aiClass;
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.yingji.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yingji.entity.EventClass;
|
||||
|
||||
/**
|
||||
* (AcceptClass)表数据库访问层
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-06-14 14:32:49
|
||||
*/
|
||||
public interface EventClassMapper extends BaseMapper<EventClass> {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
package com.yingji.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yingji.entity.EventClass;
|
||||
|
||||
/**
|
||||
* (AcceptClass)表服务接口
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-06-14 14:32:49
|
||||
*/
|
||||
public interface EventClassService extends IService<EventClass> {
|
||||
|
||||
/**
|
||||
* 根据事件类型编码查询事件类型
|
||||
*
|
||||
* @param accidentType 编码
|
||||
* @return 事件类型
|
||||
*/
|
||||
|
||||
EventClass findByAccidentType(String accidentType);
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,32 @@
|
||||
package com.yingji.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yingji.entity.EventClass;
|
||||
import com.yingji.mapper.EventClassMapper;
|
||||
import com.yingji.service.EventClassService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* (AcceptClass)表服务实现类
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-06-14 14:32:49
|
||||
*/
|
||||
@Service("acceptClassService")
|
||||
public class EventClassServiceImpl extends ServiceImpl<EventClassMapper, EventClass> implements EventClassService {
|
||||
|
||||
/**
|
||||
* 根据事件类型编码查询事件类型
|
||||
*
|
||||
* @param accidentType 编码
|
||||
* @return 事件类型
|
||||
*/
|
||||
@Override
|
||||
public EventClass findByAccidentType(String accidentType) {
|
||||
QueryWrapper<EventClass> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("accident_type", accidentType);
|
||||
return baseMapper.selectOne(wrapper);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue