From 2f4d58a807ae1d91e43f7d7df33ce6b414c794ad Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期五, 18 十月 2024 11:43:54 +0800
Subject: [PATCH] update

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml        |    6 
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/ComponentInfoMapper.xml         |    5 +
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/ComponentInfoController.java    |  153 ++++++++++++++++++++++++++++++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IComponentInfoService.java         |   14 ++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/ComponentInfo.java                  |   78 +++++++++++++++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/ComponentInfoMapper.java            |   14 ++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/ComponentInfoServiceImpl.java |   18 +++
 7 files changed, 285 insertions(+), 3 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/ComponentInfoController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/ComponentInfoController.java
new file mode 100644
index 0000000..623219f
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/ComponentInfoController.java
@@ -0,0 +1,153 @@
+package org.jeecg.modules.mdc.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.mdc.entity.ComponentInfo;
+import org.jeecg.modules.mdc.service.IComponentInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+
+/**
+ * @Description: 闆朵欢琛�
+ * @Author: lius
+ * @Date: 2024-10-18
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags = "闆朵欢琛�")
+@RestController
+@RequestMapping("/mdc/componentInfo")
+public class ComponentInfoController extends JeecgController<ComponentInfo, IComponentInfoService> {
+    @Resource
+    private IComponentInfoService componentInfoService;
+
+    /**
+     * 鍒嗛〉鍒楄〃鏌ヨ
+     *
+     * @param componentInfo
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "闆朵欢琛�-鍒嗛〉鍒楄〃鏌ヨ")
+    @ApiOperation(value = "闆朵欢琛�-鍒嗛〉鍒楄〃鏌ヨ", notes = "闆朵欢琛�-鍒嗛〉鍒楄〃鏌ヨ")
+    @GetMapping(value = "/list")
+    public Result<?> queryPageList(ComponentInfo componentInfo,
+                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                   HttpServletRequest req) {
+        QueryWrapper<ComponentInfo> queryWrapper = QueryGenerator.initQueryWrapper(componentInfo, req.getParameterMap());
+        Page<ComponentInfo> page = new Page<ComponentInfo>(pageNo, pageSize);
+        IPage<ComponentInfo> pageList = componentInfoService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 娣诲姞
+     *
+     * @param componentInfo
+     * @return
+     */
+    @AutoLog(value = "闆朵欢琛�-娣诲姞")
+    @ApiOperation(value = "闆朵欢琛�-娣诲姞", notes = "闆朵欢琛�-娣诲姞")
+    @PostMapping(value = "/add")
+    public Result<?> add(@RequestBody ComponentInfo componentInfo) {
+        componentInfoService.save(componentInfo);
+        return Result.OK("娣诲姞鎴愬姛锛�");
+    }
+
+    /**
+     * 缂栬緫
+     *
+     * @param componentInfo
+     * @return
+     */
+    @AutoLog(value = "闆朵欢琛�-缂栬緫")
+    @ApiOperation(value = "闆朵欢琛�-缂栬緫", notes = "闆朵欢琛�-缂栬緫")
+    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<?> edit(@RequestBody ComponentInfo componentInfo) {
+        componentInfoService.updateById(componentInfo);
+        return Result.OK("缂栬緫鎴愬姛!");
+    }
+
+    /**
+     * 閫氳繃id鍒犻櫎
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "闆朵欢琛�-閫氳繃id鍒犻櫎")
+    @ApiOperation(value = "闆朵欢琛�-閫氳繃id鍒犻櫎", notes = "闆朵欢琛�-閫氳繃id鍒犻櫎")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        componentInfoService.removeById(id);
+        return Result.OK("鍒犻櫎鎴愬姛!");
+    }
+
+    /**
+     * 鎵归噺鍒犻櫎
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "闆朵欢琛�-鎵归噺鍒犻櫎")
+    @ApiOperation(value = "闆朵欢琛�-鎵归噺鍒犻櫎", notes = "闆朵欢琛�-鎵归噺鍒犻櫎")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.componentInfoService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("鎵归噺鍒犻櫎鎴愬姛锛�");
+    }
+
+    /**
+     * 閫氳繃id鏌ヨ
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "闆朵欢琛�-閫氳繃id鏌ヨ")
+    @ApiOperation(value = "闆朵欢琛�-閫氳繃id鏌ヨ", notes = "闆朵欢琛�-閫氳繃id鏌ヨ")
+    @GetMapping(value = "/queryById")
+    public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
+        ComponentInfo componentInfo = componentInfoService.getById(id);
+        return Result.OK(componentInfo);
+    }
+
+    /**
+     * 瀵煎嚭excel
+     *
+     * @param request
+     * @param componentInfo
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ComponentInfo componentInfo) {
+        return super.exportXls(request, componentInfo, ComponentInfo.class, "闆朵欢琛�");
+    }
+
+    /**
+     * 閫氳繃excel瀵煎叆鏁版嵁
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ComponentInfo.class);
+    }
+
+}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/ComponentInfo.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/ComponentInfo.java
new file mode 100644
index 0000000..f9a864c
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/ComponentInfo.java
@@ -0,0 +1,78 @@
+package org.jeecg.modules.mdc.entity;
+
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 闆朵欢琛�
+ * @Author: lius
+ * @Date: 2024-10-18
+ * @Version: V1.0
+ */
+@Data
+@TableName("Component_Info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "Component_Info瀵硅薄", description = "闆朵欢琛�")
+public class ComponentInfo implements Serializable {
+
+    private static final long serialVersionUID = -9191357592954290074L;
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * componentNo
+     */
+    @Excel(name = "componentNo", width = 15)
+    @ApiModelProperty(value = "componentNo")
+    private String componentNo;
+    /**
+     * componentName
+     */
+    @Excel(name = "componentName", width = 15)
+    @ApiModelProperty(value = "componentName")
+    private String componentName;
+    /**
+     * scheduleNum
+     */
+    @Excel(name = "scheduleNum", width = 15)
+    @ApiModelProperty(value = "scheduleNum")
+    private Integer scheduleNum;
+    /**
+     * dayNum
+     */
+    @Excel(name = "dayNum", width = 15)
+    @ApiModelProperty(value = "dayNum")
+    private Integer dayNum;
+    /**
+     * beltlineid
+     */
+    @Excel(name = "beltlineid", width = 15)
+    @ApiModelProperty(value = "beltlineid")
+    private String beltlineid;
+    /**
+     * overallflag
+     */
+    @Excel(name = "overallflag", width = 15)
+    @ApiModelProperty(value = "overallflag")
+    private Boolean overallflag;
+    /**
+     * equipmentids
+     */
+    @Excel(name = "equipmentids", width = 15)
+    @ApiModelProperty(value = "equipmentids")
+    private String equipmentids;
+}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/ComponentInfoMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/ComponentInfoMapper.java
new file mode 100644
index 0000000..073b154
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/ComponentInfoMapper.java
@@ -0,0 +1,14 @@
+package org.jeecg.modules.mdc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.mdc.entity.ComponentInfo;
+
+/**
+ * @Description: 闆朵欢琛�
+ * @Author: lius
+ * @Date:   2024-10-18
+ * @Version: V1.0
+ */
+public interface ComponentInfoMapper extends BaseMapper<ComponentInfo> {
+
+}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/ComponentInfoMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/ComponentInfoMapper.xml
new file mode 100644
index 0000000..01afb95
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/ComponentInfoMapper.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.mdc.mapper.ComponentInfoMapper">
+
+</mapper>
\ No newline at end of file
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml
index c570ff3..8dd26db 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml
@@ -13,10 +13,10 @@
             EquipmentAlarm t1 LEFT JOIN mdc_equipment t2 ON t1.EquipmentID = t2.equipment_id
         <where>
             <if test="equipmentAlarmVo.equipmentId != null and equipmentAlarmVo.equipmentId != ''">
-                AND t1.EquipmentID  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentId}),'%')
+                AND t1.EquipmentID  LIKE '%' + #{equipmentAlarmVo.equipmentId} + '%'
             </if>
             <if test="equipmentAlarmVo.equipmentName != null and equipmentAlarmVo.equipmentName != ''">
-                AND t1.EquipmentID  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentName}),'%')
+                AND t2.equipment_name  LIKE '%' + #{equipmentAlarmVo.equipmentName} + '%'
             </if>
             <if test="equipmentAlarmVo.startTime != null and equipmentAlarmVo.endTime != null">
                 AND t1.collectTime BETWEEN #{equipmentAlarmVo.startTime} AND #{equipmentAlarmVo.endTime}
@@ -49,7 +49,7 @@
                 AND t1.EquipmentID  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentId}),'%')
             </if>
             <if test="equipmentAlarmVo.equipmentName != null and equipmentAlarmVo.equipmentName != ''">
-                AND t1.EquipmentID  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentName}),'%')
+                AND t2.equipment_name  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentName}),'%')
             </if>
             <if test="equipmentAlarmVo.startTime != null and equipmentAlarmVo.endTime != null">
                 AND t1.collectTime BETWEEN #{equipmentAlarmVo.startTime} AND #{equipmentAlarmVo.endTime}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IComponentInfoService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IComponentInfoService.java
new file mode 100644
index 0000000..1f80149
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IComponentInfoService.java
@@ -0,0 +1,14 @@
+package org.jeecg.modules.mdc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.mdc.entity.ComponentInfo;
+
+/**
+ * @Description: 闆朵欢琛�
+ * @Author: lius
+ * @Date: 2024-10-18
+ * @Version: V1.0
+ */
+public interface IComponentInfoService extends IService<ComponentInfo> {
+
+}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/ComponentInfoServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/ComponentInfoServiceImpl.java
new file mode 100644
index 0000000..3d7f927
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/ComponentInfoServiceImpl.java
@@ -0,0 +1,18 @@
+package org.jeecg.modules.mdc.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.mdc.entity.ComponentInfo;
+import org.jeecg.modules.mdc.mapper.ComponentInfoMapper;
+import org.jeecg.modules.mdc.service.IComponentInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @Description: 闆朵欢琛�
+ * @Author: lius
+ * @Date: 2024-10-18
+ * @Version: V1.0
+ */
+@Service
+public class ComponentInfoServiceImpl extends ServiceImpl<ComponentInfoMapper, ComponentInfo> implements IComponentInfoService {
+
+}

--
Gitblit v1.9.3