diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/controller/OilEngineConfigController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/controller/OilEngineConfigController.java new file mode 100644 index 000000000..8c0e6da38 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/controller/OilEngineConfigController.java @@ -0,0 +1,87 @@ +package com.fuint.business.deviceManage.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.deviceManage.entity.OilEngineConfig; +import com.fuint.business.deviceManage.service.OilEngineConfigService; +import com.fuint.framework.web.BaseController; +import com.fuint.framework.web.ResponseObject; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * 油机汽机配置(OilEngineConfig)表控制层 + * + * @author makejava + * @since 2024-07-31 14:59:04 + */ +@RestController +@RequestMapping("oilEngineConfig") +public class OilEngineConfigController extends BaseController { + /** + * 服务对象 + */ + @Resource + private OilEngineConfigService oilEngineConfigService; + + /** + * 根据条件分页查询首页轮播图 + * @param oilEngineConfig + * @param pageNo + * @param pageSize + * @return + */ + @GetMapping + public ResponseObject lists(OilEngineConfig oilEngineConfig, + @RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){ + Page page =new Page(pageNo,pageSize); + return getSuccessResult(oilEngineConfigService.queryPage(page,oilEngineConfig)); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResponseObject queryById(@PathVariable("id") Integer id) { + return getSuccessResult(oilEngineConfigService.queryById(id)); + } + + /** + * 新增数据 + * + * @param oilEngineConfig 实体 + * @return 新增结果 + */ + @PostMapping + public ResponseObject add(@RequestBody OilEngineConfig oilEngineConfig) { + return getSuccessResult(oilEngineConfigService.insert(oilEngineConfig)); + } + + /** + * 编辑数据 + * + * @param oilEngineConfig 实体 + * @return 编辑结果 + */ + @PutMapping + public ResponseObject edit(@RequestBody OilEngineConfig oilEngineConfig) { + return getSuccessResult(oilEngineConfigService.update(oilEngineConfig)); + } + + /** + * 删除数据 + * + * @param id 主键 + * @return 删除是否成功 + */ + @DeleteMapping("{id}") + public ResponseObject deleteById(@PathVariable Integer id) { + return getSuccessResult(oilEngineConfigService.deleteById(id)); + } + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/entity/OilEngineConfig.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/entity/OilEngineConfig.java new file mode 100644 index 000000000..fd7588a68 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/entity/OilEngineConfig.java @@ -0,0 +1,61 @@ +package com.fuint.business.deviceManage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fuint.framework.entity.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.io.Serializable; + +/** + * 油机汽机配置(OilEngineConfig)实体类 + * + * @author makejava + * @since 2024-07-31 14:59:07 + */ +@Data +@TableName("oil_engine_config") +@ApiModel(value = "OilEngineConfig", description = "油机汽机配置") +public class OilEngineConfig extends BaseEntity implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + @ApiModelProperty("自增ID") + @TableId(value = "ID", type = IdType.AUTO) + private Integer id; + /** + * 设备类型: 选项为BY、DD、LY + */ + private String deviceType; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备id + */ + private String deviceId; + /** + * 创建时间 + */ + private Date createTime; + /** + * 创建人 + */ + private String createBy; + /** + * 更新时间 + */ + private Date updateTime; + /** + * 更新人 + */ + private String updateBy; + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/mapper/OilEngineConfigMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/mapper/OilEngineConfigMapper.java new file mode 100644 index 000000000..ef429b7e0 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/mapper/OilEngineConfigMapper.java @@ -0,0 +1,27 @@ +package com.fuint.business.deviceManage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.deviceManage.entity.OilEngineConfig; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.Pageable; +import java.util.List; + +/** + * 油机汽机配置(OilEngineConfig)表数据库访问层 + * + * @author makejava + * @since 2024-07-31 14:59:07 + */ +public interface OilEngineConfigMapper extends BaseMapper { + + /** + * 分页查询订单信息 + * @param page + * @param oilEngineConfig + * @return + */ + IPage queryPage(Page page, @Param("entity") OilEngineConfig oilEngineConfig); +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/mapper/xml/OilEngineConfigMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/mapper/xml/OilEngineConfigMapper.xml new file mode 100644 index 000000000..d91e4edf9 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/mapper/xml/OilEngineConfigMapper.xml @@ -0,0 +1,10 @@ + + + + + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/service/OilEngineConfigService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/service/OilEngineConfigService.java new file mode 100644 index 000000000..06ecb7316 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/service/OilEngineConfigService.java @@ -0,0 +1,56 @@ +package com.fuint.business.deviceManage.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.deviceManage.entity.OilEngineConfig; +import org.springframework.data.domain.PageRequest; + +/** + * 油机汽机配置(OilEngineConfig)表服务接口 + * + * @author makejava + * @since 2024-07-31 14:59:09 + */ +public interface OilEngineConfigService { + + /** + * 分页查询订单信息 + * @param page + * @param oilEngineConfig + * @return + */ + IPage queryPage(Page page,OilEngineConfig oilEngineConfig); + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + OilEngineConfig queryById(Integer id); + + /** + * 新增数据 + * + * @param oilEngineConfig 实例对象 + * @return 实例对象 + */ + int insert(OilEngineConfig oilEngineConfig); + + /** + * 修改数据 + * + * @param oilEngineConfig 实例对象 + * @return 实例对象 + */ + int update(OilEngineConfig oilEngineConfig); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + int deleteById(Integer id); + +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/service/impl/OilEngineConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/service/impl/OilEngineConfigServiceImpl.java new file mode 100644 index 000000000..d480d3aaf --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/deviceManage/service/impl/OilEngineConfigServiceImpl.java @@ -0,0 +1,72 @@ +package com.fuint.business.deviceManage.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.deviceManage.entity.OilEngineConfig; +import com.fuint.business.deviceManage.mapper.OilEngineConfigMapper; +import com.fuint.business.deviceManage.service.OilEngineConfigService; +import org.springframework.stereotype.Service; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; + +import javax.annotation.Resource; + +/** + * 油机汽机配置(OilEngineConfig)表服务实现类 + * + * @author makejava + * @since 2024-07-31 14:59:09 + */ +@Service("oilEngineConfigService") +public class OilEngineConfigServiceImpl extends ServiceImpl implements OilEngineConfigService { + + @Override + public IPage queryPage(Page page, OilEngineConfig oilEngineConfig) { + return baseMapper.queryPage(page,oilEngineConfig); + } + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + @Override + public OilEngineConfig queryById(Integer id) { + return baseMapper.selectById(id); + } + + /** + * 新增数据 + * + * @param oilEngineConfig 实例对象 + * @return 实例对象 + */ + @Override + public int insert(OilEngineConfig oilEngineConfig) { + return baseMapper.insert(oilEngineConfig); + } + + /** + * 修改数据 + * + * @param oilEngineConfig 实例对象 + * @return 实例对象 + */ + @Override + public int update(OilEngineConfig oilEngineConfig) { + return baseMapper.updateById(oilEngineConfig); + } + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + @Override + public int deleteById(Integer id) { + return baseMapper.deleteById(id); + } +} diff --git a/fuintBackend/fuint-repository/src/main/resources/mapper/TPlatformMapper.xml b/fuintBackend/fuint-repository/src/main/resources/mapper/OilEngineConfigMapper.xml similarity index 100% rename from fuintBackend/fuint-repository/src/main/resources/mapper/TPlatformMapper.xml rename to fuintBackend/fuint-repository/src/main/resources/mapper/OilEngineConfigMapper.xml