wukai 7 месяцев назад
Родитель
Сommit
2fa43e1879
27 измененных файлов с 1934 добавлено и 5 удалено
  1. 20 0
      jjt-admin/src/test/java/com/jjt/rziot/DataTest.java
  2. 131 0
      jjt-admin/src/test/java/com/jjt/rziot/DingxingjiTest.java
  3. 1 1
      jjt-admin/src/test/java/com/jjt/rziot/PrintingTest.java
  4. 1 1
      jjt-admin/src/test/java/com/jjt/rziot/QiMaoJiTest.java
  5. 1 1
      jjt-admin/src/test/java/com/jjt/rziot/SgtgjTest.java
  6. 1 1
      jjt-admin/src/test/java/com/jjt/rziot/TangJianJiTest.java
  7. 27 0
      jjt-admin/src/test/java/com/jjt/rziot/TimeUtils.java
  8. 1 1
      jjt-admin/src/test/java/com/jjt/wk/EmpCalcTest.java
  9. 113 0
      jjt-biz/src/main/java/com/jjt/rz/controller/TwinCalcHourRzController.java
  10. 113 0
      jjt-biz/src/main/java/com/jjt/rz/controller/TwinDeviceRzController.java
  11. 113 0
      jjt-biz/src/main/java/com/jjt/rz/controller/TwinDeviceTypeController.java
  12. 79 0
      jjt-biz/src/main/java/com/jjt/rz/domain/TwinCalcHourRz.java
  13. 87 0
      jjt-biz/src/main/java/com/jjt/rz/domain/TwinDeviceRz.java
  14. 65 0
      jjt-biz/src/main/java/com/jjt/rz/domain/TwinDeviceType.java
  15. 154 0
      jjt-biz/src/main/java/com/jjt/rz/domain/TwinDeviceTypeData.java
  16. 62 0
      jjt-biz/src/main/java/com/jjt/rz/mapper/TwinCalcHourRzMapper.java
  17. 62 0
      jjt-biz/src/main/java/com/jjt/rz/mapper/TwinDeviceRzMapper.java
  18. 88 0
      jjt-biz/src/main/java/com/jjt/rz/mapper/TwinDeviceTypeMapper.java
  19. 60 0
      jjt-biz/src/main/java/com/jjt/rz/service/ITwinCalcHourRzService.java
  20. 60 0
      jjt-biz/src/main/java/com/jjt/rz/service/ITwinDeviceRzService.java
  21. 60 0
      jjt-biz/src/main/java/com/jjt/rz/service/ITwinDeviceTypeService.java
  22. 86 0
      jjt-biz/src/main/java/com/jjt/rz/service/impl/TwinCalcHourRzServiceImpl.java
  23. 86 0
      jjt-biz/src/main/java/com/jjt/rz/service/impl/TwinDeviceRzServiceImpl.java
  24. 123 0
      jjt-biz/src/main/java/com/jjt/rz/service/impl/TwinDeviceTypeServiceImpl.java
  25. 101 0
      jjt-biz/src/main/resources/mapper/rz/TwinCalcHourRzMapper.xml
  26. 111 0
      jjt-biz/src/main/resources/mapper/rz/TwinDeviceRzMapper.xml
  27. 128 0
      jjt-biz/src/main/resources/mapper/rz/TwinDeviceTypeMapper.xml

+ 20 - 0
jjt-admin/src/test/java/com/jjt/rziot/DataTest.java

@@ -0,0 +1,20 @@
+package com.jjt.rziot;
+
+import com.jjt.JjtApplication;
+import com.jjt.utils.IotService;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import javax.annotation.Resource;
+
+/**
+ * DataTest$
+ *
+ * @author wukai
+ * @date 2025/5/22 17:27
+ */
+@SpringBootTest(classes = JjtApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+public class DataTest {
+    @Resource
+    private IotService iotService;
+
+}

+ 131 - 0
jjt-admin/src/test/java/com/jjt/rziot/DingxingjiTest.java

@@ -0,0 +1,131 @@
+package com.jjt.rziot;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import com.jjt.JjtApplication;
+import com.jjt.common.utils.StringUtils;
+import com.jjt.utils.IotService;
+import javafx.util.Pair;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import javax.annotation.Resource;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * 4节定型机设备数据
+ */
+@SpringBootTest(classes = JjtApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+public class DingxingjiTest {
+    @Resource
+    private IotService iotService;
+
+    /**
+     * 印花设备数据
+     */
+    @Test
+    void test() {
+        iotService.setToken();
+        Pair<Long, Long> time = TimeUtils.time();
+        List<Pair<String, String>> list = new ArrayList<>();
+        Long startTime = time.getKey();
+        Long endTime = time.getValue();
+        String sql = "select Capacity_data_3 from root.tl.suxi.dingxingji4** where time>%s and time <=%s";
+        sql = String.format(sql, startTime, endTime);
+        iotService.query(sql);
+        JSONObject jsonObject = iotService.query(sql);
+        JSONObject data = jsonObject.getJSONObject("data");
+        JSONArray values = data.getJSONArray("values");
+        JSONArray columnNames = data.getJSONArray("columnNames");
+        JSONArray timestamps = data.getJSONArray("timestamps");
+        if (values.size() == 1) {
+            JSONArray da = values.getJSONArray(0);
+            for (int i = 0; i < da.size(); i++) {
+                Pair<String, String> pair = new Pair<>(columnNames.getStr(i), da.getStr(i));
+                list.add(pair);
+            }
+        }
+
+
+        try (Workbook workbook = new XSSFWorkbook(); FileOutputStream outputStream = new FileOutputStream("D:\\SYSTEM\\Desktop\\temp\\excel\\4节定型机-明细" + System.currentTimeMillis() + ".xlsx")) {
+            Sheet sheet = workbook.createSheet();
+
+            String[] names = {"总产量(米)", "设备名", "设备类型", "设备线路", "设备编号", "设备路径"};
+
+            Row title = sheet.createRow(0);
+            for (int i = 0; i < names.length; i++) {
+                Cell cell = title.createCell(i);
+                cell.setCellValue(names[i]);
+            }
+            AtomicInteger index = new AtomicInteger(1);
+            list.forEach(pair -> {
+                Row row = sheet.createRow(index.get());
+                Cell[] cells = new Cell[names.length];
+                for (int i = 0; i < names.length; i++) {
+                    cells[i] = row.createCell(i);
+                }
+                cells[5].setCellValue(getPath(pair.getKey()));
+                if (StringUtils.isNotEmpty(pair.getValue())) {
+                    cells[0].setCellValue(Double.parseDouble(pair.getValue()));
+                }
+                cells[1].setCellValue(getName(pair.getKey()));
+                cells[2].setCellValue(getType(pair.getKey()));
+                cells[3].setCellValue(Integer.parseInt(getLine(pair.getKey())));
+                cells[4].setCellValue(Integer.parseInt(getNo(pair.getKey())));
+                index.getAndIncrement();
+            });
+            workbook.write(outputStream);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public String getPath(String key) {
+        key = key.replace("SUM(DIFF(", "");
+        key = key.replace(".Capacity_data_2))", "");
+        return key;
+    }
+
+    public String getName(String key) {
+        key = getPath(key);
+        key = key.replace("root.tl.suxi.sgtgjLine", "");
+        key = key.replace("ForwardNo", "线-前整");
+        key = key.replace("BackNo", "线-后整");
+        key = key.replace("_PLC1", "号");
+        return key;
+    }
+
+    public String getType(String key) {
+        if (key.contains("ForwardNo")) {
+            return "前整";
+        } else {
+            return "后整";
+        }
+    }
+
+    public String getLine(String key) {
+        key = getPath(key);
+        key = key.replace("root.tl.suxi.sgtgjLine", "");
+        if (key.contains("ForwardNo")) {
+            key = key.substring(0, key.indexOf("ForwardNo"));
+        } else {
+            key = key.substring(0, key.indexOf("BackNo"));
+        }
+        return key;
+    }
+
+    public String getNo(String key) {
+        key = getPath(key);
+        key = key.substring(key.indexOf("No") + 2, key.indexOf("_PLC1"));
+        return key;
+    }
+}

+ 1 - 1
jjt-admin/src/test/java/com/jjt/data/PrintingTest.java → jjt-admin/src/test/java/com/jjt/rziot/PrintingTest.java

@@ -1,4 +1,4 @@
-package com.jjt.data;
+package com.jjt.rziot;
 
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;

+ 1 - 1
jjt-admin/src/test/java/com/jjt/data/QiMaoJiTest.java → jjt-admin/src/test/java/com/jjt/rziot/QiMaoJiTest.java

@@ -1,4 +1,4 @@
-package com.jjt.data;
+package com.jjt.rziot;
 
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;

+ 1 - 1
jjt-admin/src/test/java/com/jjt/data/SgtgjTest.java → jjt-admin/src/test/java/com/jjt/rziot/SgtgjTest.java

@@ -1,4 +1,4 @@
-package com.jjt.data;
+package com.jjt.rziot;
 
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;

+ 1 - 1
jjt-admin/src/test/java/com/jjt/data/TangJianJiTest.java → jjt-admin/src/test/java/com/jjt/rziot/TangJianJiTest.java

@@ -1,4 +1,4 @@
-package com.jjt.data;
+package com.jjt.rziot;
 
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;

+ 27 - 0
jjt-admin/src/test/java/com/jjt/rziot/TimeUtils.java

@@ -0,0 +1,27 @@
+package com.jjt.rziot;
+
+import com.jjt.utils.Tools;
+import javafx.util.Pair;
+
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
+
+/**
+ * TimeUtils$
+ *
+ * @author wukai
+ * @date 2025/5/19 16:44
+ */
+public class TimeUtils {
+    public static Pair<Long, Long> time() {
+        LocalDateTime ldt = Tools.currWholeTime();
+        //上一个小时
+        ldt = ldt.minusHours(1);
+        //开始时间需要向前取一秒
+        LocalDateTime start = ldt.minusSeconds(1);
+        LocalDateTime end = ldt.plusHours(1);
+        Long startTime = start.toInstant(ZoneOffset.of("+8")).toEpochMilli();
+        Long endTime = end.toInstant(ZoneOffset.of("+8")).toEpochMilli();
+        return new Pair<>(startTime, endTime);
+    }
+}

+ 1 - 1
jjt-admin/src/test/java/com/jjt/wk/EmpCalcTest.java

@@ -22,7 +22,7 @@ public class EmpCalcTest {
 
     @Test
     public void test() {
-        String s = "2025-04-28";
+        String s = "2025-05-16";
         Date date = DateUtils.parseDate(s);
         empCalcService.calcNew(date);
     }

+ 113 - 0
jjt-biz/src/main/java/com/jjt/rz/controller/TwinCalcHourRzController.java

@@ -0,0 +1,113 @@
+package com.jjt.rz.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.jjt.common.annotation.Log;
+import com.jjt.common.core.controller.BaseController;
+import com.jjt.common.core.domain.AjaxResult;
+import com.jjt.common.enums.BusinessType;
+import com.jjt.rz.domain.TwinCalcHourRz;
+import com.jjt.rz.service.ITwinCalcHourRzService;
+import com.jjt.common.utils.poi.ExcelUtil;
+import com.jjt.common.core.page.TableDataInfo;
+
+/**
+ * 染整线1小时数据Controller
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+@Api(tags="染整线1小时数据")
+@RestController
+@RequestMapping("/rz/hour")
+public class TwinCalcHourRzController extends BaseController{
+    @Resource
+    private ITwinCalcHourRzService twinCalcHourRzService;
+
+    /**
+     * 查询染整线1小时数据列表
+     */
+    @ApiOperation("查询染整线1小时数据列表")
+    @PreAuthorize("@ss.hasPermi('rz:hour:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TwinCalcHourRz twinCalcHourRz)
+    {
+        startPage();
+        List<TwinCalcHourRz> list = twinCalcHourRzService.selectTwinCalcHourRzList(twinCalcHourRz);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出染整线1小时数据列表
+     */
+    @ApiOperation("导出染整线1小时数据列表")
+    @PreAuthorize("@ss.hasPermi('rz:hour:export')")
+    @Log(title = "染整线1小时数据", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TwinCalcHourRz twinCalcHourRz)
+    {
+        List<TwinCalcHourRz> list = twinCalcHourRzService.selectTwinCalcHourRzList(twinCalcHourRz);
+        ExcelUtil<TwinCalcHourRz> util = new ExcelUtil<TwinCalcHourRz>(TwinCalcHourRz.class);
+        util.exportExcel(response, list, "染整线1小时数据数据");
+    }
+
+    /**
+     * 获取染整线1小时数据详细信息
+     */
+    @ApiOperation("获取染整线1小时数据详细信息")
+    @PreAuthorize("@ss.hasPermi('rz:hour:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(twinCalcHourRzService.selectTwinCalcHourRzById(id));
+    }
+
+    /**
+     * 新增染整线1小时数据
+     */
+    @ApiOperation("新增染整线1小时数据")
+    @PreAuthorize("@ss.hasPermi('rz:hour:add')")
+    @Log(title = "染整线1小时数据", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TwinCalcHourRz twinCalcHourRz)
+    {
+        return toAjax(twinCalcHourRzService.insertTwinCalcHourRz(twinCalcHourRz));
+    }
+
+    /**
+     * 修改染整线1小时数据
+     */
+    @ApiOperation("修改染整线1小时数据")
+    @PreAuthorize("@ss.hasPermi('rz:hour:edit')")
+    @Log(title = "染整线1小时数据", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TwinCalcHourRz twinCalcHourRz)
+    {
+        return toAjax(twinCalcHourRzService.updateTwinCalcHourRz(twinCalcHourRz));
+    }
+
+    /**
+     * 删除染整线1小时数据
+     */
+    @ApiOperation("删除染整线1小时数据")
+    @PreAuthorize("@ss.hasPermi('rz:hour:remove')")
+    @Log(title = "染整线1小时数据", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(twinCalcHourRzService.deleteTwinCalcHourRzByIds(ids));
+    }
+}

+ 113 - 0
jjt-biz/src/main/java/com/jjt/rz/controller/TwinDeviceRzController.java

@@ -0,0 +1,113 @@
+package com.jjt.rz.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.jjt.common.annotation.Log;
+import com.jjt.common.core.controller.BaseController;
+import com.jjt.common.core.domain.AjaxResult;
+import com.jjt.common.enums.BusinessType;
+import com.jjt.rz.domain.TwinDeviceRz;
+import com.jjt.rz.service.ITwinDeviceRzService;
+import com.jjt.common.utils.poi.ExcelUtil;
+import com.jjt.common.core.page.TableDataInfo;
+
+/**
+ * 染整线设备管理Controller
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+@Api(tags="染整线设备管理")
+@RestController
+@RequestMapping("/rz/rz")
+public class TwinDeviceRzController extends BaseController{
+    @Resource
+    private ITwinDeviceRzService twinDeviceRzService;
+
+    /**
+     * 查询染整线设备管理列表
+     */
+    @ApiOperation("查询染整线设备管理列表")
+    @PreAuthorize("@ss.hasPermi('rz:rz:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TwinDeviceRz twinDeviceRz)
+    {
+        startPage();
+        List<TwinDeviceRz> list = twinDeviceRzService.selectTwinDeviceRzList(twinDeviceRz);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出染整线设备管理列表
+     */
+    @ApiOperation("导出染整线设备管理列表")
+    @PreAuthorize("@ss.hasPermi('rz:rz:export')")
+    @Log(title = "染整线设备管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TwinDeviceRz twinDeviceRz)
+    {
+        List<TwinDeviceRz> list = twinDeviceRzService.selectTwinDeviceRzList(twinDeviceRz);
+        ExcelUtil<TwinDeviceRz> util = new ExcelUtil<TwinDeviceRz>(TwinDeviceRz.class);
+        util.exportExcel(response, list, "染整线设备管理数据");
+    }
+
+    /**
+     * 获取染整线设备管理详细信息
+     */
+    @ApiOperation("获取染整线设备管理详细信息")
+    @PreAuthorize("@ss.hasPermi('rz:rz:query')")
+    @GetMapping(value = "/{deviceId}")
+    public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
+    {
+        return success(twinDeviceRzService.selectTwinDeviceRzByDeviceId(deviceId));
+    }
+
+    /**
+     * 新增染整线设备管理
+     */
+    @ApiOperation("新增染整线设备管理")
+    @PreAuthorize("@ss.hasPermi('rz:rz:add')")
+    @Log(title = "染整线设备管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TwinDeviceRz twinDeviceRz)
+    {
+        return toAjax(twinDeviceRzService.insertTwinDeviceRz(twinDeviceRz));
+    }
+
+    /**
+     * 修改染整线设备管理
+     */
+    @ApiOperation("修改染整线设备管理")
+    @PreAuthorize("@ss.hasPermi('rz:rz:edit')")
+    @Log(title = "染整线设备管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TwinDeviceRz twinDeviceRz)
+    {
+        return toAjax(twinDeviceRzService.updateTwinDeviceRz(twinDeviceRz));
+    }
+
+    /**
+     * 删除染整线设备管理
+     */
+    @ApiOperation("删除染整线设备管理")
+    @PreAuthorize("@ss.hasPermi('rz:rz:remove')")
+    @Log(title = "染整线设备管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{deviceIds}")
+    public AjaxResult remove(@PathVariable Long[] deviceIds)
+    {
+        return toAjax(twinDeviceRzService.deleteTwinDeviceRzByDeviceIds(deviceIds));
+    }
+}

+ 113 - 0
jjt-biz/src/main/java/com/jjt/rz/controller/TwinDeviceTypeController.java

@@ -0,0 +1,113 @@
+package com.jjt.rz.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.jjt.common.annotation.Log;
+import com.jjt.common.core.controller.BaseController;
+import com.jjt.common.core.domain.AjaxResult;
+import com.jjt.common.enums.BusinessType;
+import com.jjt.rz.domain.TwinDeviceType;
+import com.jjt.rz.service.ITwinDeviceTypeService;
+import com.jjt.common.utils.poi.ExcelUtil;
+import com.jjt.common.core.page.TableDataInfo;
+
+/**
+ * 设备类型管理Controller
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+@Api(tags="设备类型管理")
+@RestController
+@RequestMapping("/rz/dtype")
+public class TwinDeviceTypeController extends BaseController{
+    @Resource
+    private ITwinDeviceTypeService twinDeviceTypeService;
+
+    /**
+     * 查询设备类型管理列表
+     */
+    @ApiOperation("查询设备类型管理列表")
+    @PreAuthorize("@ss.hasPermi('rz:dtype:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TwinDeviceType twinDeviceType)
+    {
+        startPage();
+        List<TwinDeviceType> list = twinDeviceTypeService.selectTwinDeviceTypeList(twinDeviceType);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出设备类型管理列表
+     */
+    @ApiOperation("导出设备类型管理列表")
+    @PreAuthorize("@ss.hasPermi('rz:dtype:export')")
+    @Log(title = "设备类型管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TwinDeviceType twinDeviceType)
+    {
+        List<TwinDeviceType> list = twinDeviceTypeService.selectTwinDeviceTypeList(twinDeviceType);
+        ExcelUtil<TwinDeviceType> util = new ExcelUtil<TwinDeviceType>(TwinDeviceType.class);
+        util.exportExcel(response, list, "设备类型管理数据");
+    }
+
+    /**
+     * 获取设备类型管理详细信息
+     */
+    @ApiOperation("获取设备类型管理详细信息")
+    @PreAuthorize("@ss.hasPermi('rz:dtype:query')")
+    @GetMapping(value = "/{typeId}")
+    public AjaxResult getInfo(@PathVariable("typeId") Long typeId)
+    {
+        return success(twinDeviceTypeService.selectTwinDeviceTypeByTypeId(typeId));
+    }
+
+    /**
+     * 新增设备类型管理
+     */
+    @ApiOperation("新增设备类型管理")
+    @PreAuthorize("@ss.hasPermi('rz:dtype:add')")
+    @Log(title = "设备类型管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TwinDeviceType twinDeviceType)
+    {
+        return toAjax(twinDeviceTypeService.insertTwinDeviceType(twinDeviceType));
+    }
+
+    /**
+     * 修改设备类型管理
+     */
+    @ApiOperation("修改设备类型管理")
+    @PreAuthorize("@ss.hasPermi('rz:dtype:edit')")
+    @Log(title = "设备类型管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TwinDeviceType twinDeviceType)
+    {
+        return toAjax(twinDeviceTypeService.updateTwinDeviceType(twinDeviceType));
+    }
+
+    /**
+     * 删除设备类型管理
+     */
+    @ApiOperation("删除设备类型管理")
+    @PreAuthorize("@ss.hasPermi('rz:dtype:remove')")
+    @Log(title = "设备类型管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{typeIds}")
+    public AjaxResult remove(@PathVariable Long[] typeIds)
+    {
+        return toAjax(twinDeviceTypeService.deleteTwinDeviceTypeByTypeIds(typeIds));
+    }
+}

+ 79 - 0
jjt-biz/src/main/java/com/jjt/rz/domain/TwinCalcHourRz.java

@@ -0,0 +1,79 @@
+package com.jjt.rz.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+
+/**
+ * 染整线1小时数据对象 TWIN_CALC_HOUR_RZ
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+@ApiModel(value = "TwinCalcHourRz", description = "染整线1小时数据")
+@Data
+public class TwinCalcHourRz extends BaseEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    @ApiModelProperty("ID")
+    @TableId
+    private Long id;
+
+    /** 日期 */
+    @ApiModelProperty("日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date dataDate;
+
+    /** 小时;0-23 */
+    @ApiModelProperty("小时;0-23")
+    @Excel(name = "小时;0-23")
+    private Long hour;
+
+    /** 数据时间 */
+    @ApiModelProperty("数据时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "数据时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date dataTime;
+
+    /** 设备ID */
+    @ApiModelProperty("设备ID")
+    @Excel(name = "设备ID")
+    private Long deviceId;
+
+    /** 数据 */
+    @ApiModelProperty("数据")
+    @Excel(name = "数据")
+    private String data;
+
+    /** 创建人 */
+    @ApiModelProperty("创建人")
+    @Excel(name = "创建人")
+    private String createdBy;
+
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdTime;
+
+    /** 更新人 */
+    @ApiModelProperty("更新人")
+    @Excel(name = "更新人")
+    private String updatedBy;
+
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedTime;
+
+}

+ 87 - 0
jjt-biz/src/main/java/com/jjt/rz/domain/TwinDeviceRz.java

@@ -0,0 +1,87 @@
+package com.jjt.rz.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+
+/**
+ * 染整线设备管理对象 TWIN_DEVICE_RZ
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+@ApiModel(value = "TwinDeviceRz", description = "染整线设备管理")
+@Data
+public class TwinDeviceRz extends BaseEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    @ApiModelProperty("ID")
+    @TableId
+    private Long deviceId;
+
+    /** 车间 */
+    @ApiModelProperty("车间")
+    @Excel(name = "车间")
+    private String wsName;
+
+    /** 产线编号 */
+    @ApiModelProperty("产线编号")
+    @Excel(name = "产线编号")
+    private String line;
+
+    /** 设备类型 */
+    @ApiModelProperty("设备类型")
+    @Excel(name = "设备类型")
+    private Long typeId;
+
+    /** 设备类型名称 */
+    @ApiModelProperty("设备类型名称")
+    @Excel(name = "设备类型名称")
+    private String deviceType;
+
+    /** 设备编码 */
+    @ApiModelProperty("设备编码")
+    @Excel(name = "设备编码")
+    private String deviceCode;
+
+    /** 设备名称 */
+    @ApiModelProperty("设备名称")
+    @Excel(name = "设备名称")
+    private String deviceName;
+
+    /** 设备路径 */
+    @ApiModelProperty("设备路径")
+    @Excel(name = "设备路径")
+    private String devicePath;
+
+    /** 创建人 */
+    @ApiModelProperty("创建人")
+    @Excel(name = "创建人")
+    private String createdBy;
+
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdTime;
+
+    /** 更新人 */
+    @ApiModelProperty("更新人")
+    @Excel(name = "更新人")
+    private String updatedBy;
+
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedTime;
+
+}

+ 65 - 0
jjt-biz/src/main/java/com/jjt/rz/domain/TwinDeviceType.java

@@ -0,0 +1,65 @@
+package com.jjt.rz.domain;
+
+import java.util.List;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+
+/**
+ * 设备类型管理对象 TWIN_DEVICE_TYPE
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+@ApiModel(value = "TwinDeviceType", description = "设备类型管理")
+@Data
+public class TwinDeviceType extends BaseEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    @ApiModelProperty("ID")
+    @TableId
+    private Long typeId;
+
+    /** 组别;RZ.染整线 */
+    @ApiModelProperty("组别;RZ.染整线")
+    @Excel(name = "组别;RZ.染整线")
+    private String typeGroup;
+
+    /** 设备类型 */
+    @ApiModelProperty("设备类型")
+    @Excel(name = "设备类型")
+    private String typeName;
+
+    /** 设备IOT通配符 */
+    @ApiModelProperty("设备IOT通配符")
+    @Excel(name = "设备IOT通配符")
+    private String typeMatch;
+
+    /** 创建人 */
+    @ApiModelProperty("创建人")
+    private String createdBy;
+
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    private Date createdTime;
+
+    /** 更新人 */
+    @ApiModelProperty("更新人")
+    private String updatedBy;
+
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Date updatedTime;
+
+    /** 设备类型数据管理信息 */
+    private List<TwinDeviceTypeData> twinDeviceTypeDataList;
+
+}

+ 154 - 0
jjt-biz/src/main/java/com/jjt/rz/domain/TwinDeviceTypeData.java

@@ -0,0 +1,154 @@
+package com.jjt.rz.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+
+/**
+ * 设备类型数据管理对象 TWIN_DEVICE_TYPE_DATA
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+public class TwinDeviceTypeData extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long dataId;
+
+    /** 设备类型ID */
+    @Excel(name = "设备类型ID")
+    private Long typeId;
+
+    /** 数据名称 */
+    @Excel(name = "数据名称")
+    private String dataName;
+
+    /** 数据IOT字段 */
+    @Excel(name = "数据IOT字段")
+    private String dataCode;
+
+    /** 数据获取类型;1.累计类型  2.累计中间清零 3.状态记录 */
+    @Excel(name = "数据获取类型;1.累计类型  2.累计中间清零 3.状态记录")
+    private String dataType;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createdBy;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdTime;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updatedBy;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedTime;
+
+    public void setDataId(Long dataId)
+    {
+        this.dataId = dataId;
+    }
+
+    public Long getDataId()
+    {
+        return dataId;
+    }
+    public void setTypeId(Long typeId)
+    {
+        this.typeId = typeId;
+    }
+
+    public Long getTypeId()
+    {
+        return typeId;
+    }
+    public void setDataName(String dataName)
+    {
+        this.dataName = dataName;
+    }
+
+    public String getDataName()
+    {
+        return dataName;
+    }
+    public void setDataCode(String dataCode)
+    {
+        this.dataCode = dataCode;
+    }
+
+    public String getDataCode()
+    {
+        return dataCode;
+    }
+    public void setDataType(String dataType)
+    {
+        this.dataType = dataType;
+    }
+
+    public String getDataType()
+    {
+        return dataType;
+    }
+    public void setCreatedBy(String createdBy)
+    {
+        this.createdBy = createdBy;
+    }
+
+    public String getCreatedBy()
+    {
+        return createdBy;
+    }
+    public void setCreatedTime(Date createdTime)
+    {
+        this.createdTime = createdTime;
+    }
+
+    public Date getCreatedTime()
+    {
+        return createdTime;
+    }
+    public void setUpdatedBy(String updatedBy)
+    {
+        this.updatedBy = updatedBy;
+    }
+
+    public String getUpdatedBy()
+    {
+        return updatedBy;
+    }
+    public void setUpdatedTime(Date updatedTime)
+    {
+        this.updatedTime = updatedTime;
+    }
+
+    public Date getUpdatedTime()
+    {
+        return updatedTime;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("dataId", getDataId())
+            .append("typeId", getTypeId())
+            .append("dataName", getDataName())
+            .append("dataCode", getDataCode())
+            .append("dataType", getDataType())
+            .append("createdBy", getCreatedBy())
+            .append("createdTime", getCreatedTime())
+            .append("updatedBy", getUpdatedBy())
+            .append("updatedTime", getUpdatedTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 62 - 0
jjt-biz/src/main/java/com/jjt/rz/mapper/TwinCalcHourRzMapper.java

@@ -0,0 +1,62 @@
+package com.jjt.rz.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jjt.rz.domain.TwinCalcHourRz;
+
+/**
+ * 染整线1小时数据Mapper接口
+ * 
+ * @author wukai
+ * @date 2025-05-21
+ */
+public interface TwinCalcHourRzMapper extends BaseMapper<TwinCalcHourRz>
+{
+    /**
+     * 查询染整线1小时数据
+     * 
+     * @param id 染整线1小时数据主键
+     * @return 染整线1小时数据
+     */
+    public TwinCalcHourRz selectTwinCalcHourRzById(Long id);
+
+    /**
+     * 查询染整线1小时数据列表
+     * 
+     * @param twinCalcHourRz 染整线1小时数据
+     * @return 染整线1小时数据集合
+     */
+    public List<TwinCalcHourRz> selectTwinCalcHourRzList(TwinCalcHourRz twinCalcHourRz);
+
+    /**
+     * 新增染整线1小时数据
+     * 
+     * @param twinCalcHourRz 染整线1小时数据
+     * @return 结果
+     */
+    public int insertTwinCalcHourRz(TwinCalcHourRz twinCalcHourRz);
+
+    /**
+     * 修改染整线1小时数据
+     * 
+     * @param twinCalcHourRz 染整线1小时数据
+     * @return 结果
+     */
+    public int updateTwinCalcHourRz(TwinCalcHourRz twinCalcHourRz);
+
+    /**
+     * 删除染整线1小时数据
+     * 
+     * @param id 染整线1小时数据主键
+     * @return 结果
+     */
+    public int deleteTwinCalcHourRzById(Long id);
+
+    /**
+     * 批量删除染整线1小时数据
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTwinCalcHourRzByIds(Long[] ids);
+}

+ 62 - 0
jjt-biz/src/main/java/com/jjt/rz/mapper/TwinDeviceRzMapper.java

@@ -0,0 +1,62 @@
+package com.jjt.rz.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jjt.rz.domain.TwinDeviceRz;
+
+/**
+ * 染整线设备管理Mapper接口
+ * 
+ * @author wukai
+ * @date 2025-05-21
+ */
+public interface TwinDeviceRzMapper extends BaseMapper<TwinDeviceRz>
+{
+    /**
+     * 查询染整线设备管理
+     * 
+     * @param deviceId 染整线设备管理主键
+     * @return 染整线设备管理
+     */
+    public TwinDeviceRz selectTwinDeviceRzByDeviceId(Long deviceId);
+
+    /**
+     * 查询染整线设备管理列表
+     * 
+     * @param twinDeviceRz 染整线设备管理
+     * @return 染整线设备管理集合
+     */
+    public List<TwinDeviceRz> selectTwinDeviceRzList(TwinDeviceRz twinDeviceRz);
+
+    /**
+     * 新增染整线设备管理
+     * 
+     * @param twinDeviceRz 染整线设备管理
+     * @return 结果
+     */
+    public int insertTwinDeviceRz(TwinDeviceRz twinDeviceRz);
+
+    /**
+     * 修改染整线设备管理
+     * 
+     * @param twinDeviceRz 染整线设备管理
+     * @return 结果
+     */
+    public int updateTwinDeviceRz(TwinDeviceRz twinDeviceRz);
+
+    /**
+     * 删除染整线设备管理
+     * 
+     * @param deviceId 染整线设备管理主键
+     * @return 结果
+     */
+    public int deleteTwinDeviceRzByDeviceId(Long deviceId);
+
+    /**
+     * 批量删除染整线设备管理
+     * 
+     * @param deviceIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTwinDeviceRzByDeviceIds(Long[] deviceIds);
+}

+ 88 - 0
jjt-biz/src/main/java/com/jjt/rz/mapper/TwinDeviceTypeMapper.java

@@ -0,0 +1,88 @@
+package com.jjt.rz.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jjt.rz.domain.TwinDeviceType;
+import com.jjt.rz.domain.TwinDeviceTypeData;
+
+/**
+ * 设备类型管理Mapper接口
+ * 
+ * @author wukai
+ * @date 2025-05-21
+ */
+public interface TwinDeviceTypeMapper extends BaseMapper<TwinDeviceType>
+{
+    /**
+     * 查询设备类型管理
+     * 
+     * @param typeId 设备类型管理主键
+     * @return 设备类型管理
+     */
+    public TwinDeviceType selectTwinDeviceTypeByTypeId(Long typeId);
+
+    /**
+     * 查询设备类型管理列表
+     * 
+     * @param twinDeviceType 设备类型管理
+     * @return 设备类型管理集合
+     */
+    public List<TwinDeviceType> selectTwinDeviceTypeList(TwinDeviceType twinDeviceType);
+
+    /**
+     * 新增设备类型管理
+     * 
+     * @param twinDeviceType 设备类型管理
+     * @return 结果
+     */
+    public int insertTwinDeviceType(TwinDeviceType twinDeviceType);
+
+    /**
+     * 修改设备类型管理
+     * 
+     * @param twinDeviceType 设备类型管理
+     * @return 结果
+     */
+    public int updateTwinDeviceType(TwinDeviceType twinDeviceType);
+
+    /**
+     * 删除设备类型管理
+     * 
+     * @param typeId 设备类型管理主键
+     * @return 结果
+     */
+    public int deleteTwinDeviceTypeByTypeId(Long typeId);
+
+    /**
+     * 批量删除设备类型管理
+     * 
+     * @param typeIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTwinDeviceTypeByTypeIds(Long[] typeIds);
+
+    /**
+     * 批量删除设备类型数据管理
+     * 
+     * @param typeIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTwinDeviceTypeDataByTypeIds(Long[] typeIds);
+    
+    /**
+     * 批量新增设备类型数据管理
+     * 
+     * @param twinDeviceTypeDataList 设备类型数据管理列表
+     * @return 结果
+     */
+    public int batchTwinDeviceTypeData(List<TwinDeviceTypeData> twinDeviceTypeDataList);
+    
+
+    /**
+     * 通过设备类型管理主键删除设备类型数据管理信息
+     * 
+     * @param typeId 设备类型管理ID
+     * @return 结果
+     */
+    public int deleteTwinDeviceTypeDataByTypeId(Long typeId);
+}

+ 60 - 0
jjt-biz/src/main/java/com/jjt/rz/service/ITwinCalcHourRzService.java

@@ -0,0 +1,60 @@
+package com.jjt.rz.service;
+
+import java.util.List;
+import com.jjt.rz.domain.TwinCalcHourRz;
+
+/**
+ * 染整线1小时数据Service接口
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+public interface ITwinCalcHourRzService {
+    /**
+     * 查询染整线1小时数据
+     *
+     * @param id 染整线1小时数据主键
+     * @return 染整线1小时数据
+     */
+    public TwinCalcHourRz selectTwinCalcHourRzById(Long id);
+
+    /**
+     * 查询染整线1小时数据列表
+     *
+     * @param twinCalcHourRz 染整线1小时数据
+     * @return 染整线1小时数据集合
+     */
+    public List<TwinCalcHourRz> selectTwinCalcHourRzList(TwinCalcHourRz twinCalcHourRz);
+
+    /**
+     * 新增染整线1小时数据
+     *
+     * @param twinCalcHourRz 染整线1小时数据
+     * @return 结果
+     */
+    public int insertTwinCalcHourRz(TwinCalcHourRz twinCalcHourRz);
+
+    /**
+     * 修改染整线1小时数据
+     *
+     * @param twinCalcHourRz 染整线1小时数据
+     * @return 结果
+     */
+    public int updateTwinCalcHourRz(TwinCalcHourRz twinCalcHourRz);
+
+    /**
+     * 批量删除染整线1小时数据
+     *
+     * @param ids 需要删除的染整线1小时数据主键集合
+     * @return 结果
+     */
+    public int deleteTwinCalcHourRzByIds(Long[] ids);
+
+    /**
+     * 删除染整线1小时数据信息
+     *
+     * @param id 染整线1小时数据主键
+     * @return 结果
+     */
+    public int deleteTwinCalcHourRzById(Long id);
+}

+ 60 - 0
jjt-biz/src/main/java/com/jjt/rz/service/ITwinDeviceRzService.java

@@ -0,0 +1,60 @@
+package com.jjt.rz.service;
+
+import java.util.List;
+import com.jjt.rz.domain.TwinDeviceRz;
+
+/**
+ * 染整线设备管理Service接口
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+public interface ITwinDeviceRzService {
+    /**
+     * 查询染整线设备管理
+     *
+     * @param deviceId 染整线设备管理主键
+     * @return 染整线设备管理
+     */
+    public TwinDeviceRz selectTwinDeviceRzByDeviceId(Long deviceId);
+
+    /**
+     * 查询染整线设备管理列表
+     *
+     * @param twinDeviceRz 染整线设备管理
+     * @return 染整线设备管理集合
+     */
+    public List<TwinDeviceRz> selectTwinDeviceRzList(TwinDeviceRz twinDeviceRz);
+
+    /**
+     * 新增染整线设备管理
+     *
+     * @param twinDeviceRz 染整线设备管理
+     * @return 结果
+     */
+    public int insertTwinDeviceRz(TwinDeviceRz twinDeviceRz);
+
+    /**
+     * 修改染整线设备管理
+     *
+     * @param twinDeviceRz 染整线设备管理
+     * @return 结果
+     */
+    public int updateTwinDeviceRz(TwinDeviceRz twinDeviceRz);
+
+    /**
+     * 批量删除染整线设备管理
+     *
+     * @param deviceIds 需要删除的染整线设备管理主键集合
+     * @return 结果
+     */
+    public int deleteTwinDeviceRzByDeviceIds(Long[] deviceIds);
+
+    /**
+     * 删除染整线设备管理信息
+     *
+     * @param deviceId 染整线设备管理主键
+     * @return 结果
+     */
+    public int deleteTwinDeviceRzByDeviceId(Long deviceId);
+}

+ 60 - 0
jjt-biz/src/main/java/com/jjt/rz/service/ITwinDeviceTypeService.java

@@ -0,0 +1,60 @@
+package com.jjt.rz.service;
+
+import java.util.List;
+import com.jjt.rz.domain.TwinDeviceType;
+
+/**
+ * 设备类型管理Service接口
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+public interface ITwinDeviceTypeService {
+    /**
+     * 查询设备类型管理
+     *
+     * @param typeId 设备类型管理主键
+     * @return 设备类型管理
+     */
+    public TwinDeviceType selectTwinDeviceTypeByTypeId(Long typeId);
+
+    /**
+     * 查询设备类型管理列表
+     *
+     * @param twinDeviceType 设备类型管理
+     * @return 设备类型管理集合
+     */
+    public List<TwinDeviceType> selectTwinDeviceTypeList(TwinDeviceType twinDeviceType);
+
+    /**
+     * 新增设备类型管理
+     *
+     * @param twinDeviceType 设备类型管理
+     * @return 结果
+     */
+    public int insertTwinDeviceType(TwinDeviceType twinDeviceType);
+
+    /**
+     * 修改设备类型管理
+     *
+     * @param twinDeviceType 设备类型管理
+     * @return 结果
+     */
+    public int updateTwinDeviceType(TwinDeviceType twinDeviceType);
+
+    /**
+     * 批量删除设备类型管理
+     *
+     * @param typeIds 需要删除的设备类型管理主键集合
+     * @return 结果
+     */
+    public int deleteTwinDeviceTypeByTypeIds(Long[] typeIds);
+
+    /**
+     * 删除设备类型管理信息
+     *
+     * @param typeId 设备类型管理主键
+     * @return 结果
+     */
+    public int deleteTwinDeviceTypeByTypeId(Long typeId);
+}

+ 86 - 0
jjt-biz/src/main/java/com/jjt/rz/service/impl/TwinCalcHourRzServiceImpl.java

@@ -0,0 +1,86 @@
+package com.jjt.rz.service.impl;
+
+import java.util.List;
+import org.springframework.stereotype.Service;
+import com.jjt.rz.mapper.TwinCalcHourRzMapper;
+import com.jjt.rz.domain.TwinCalcHourRz;
+import com.jjt.rz.service.ITwinCalcHourRzService;
+import javax.annotation.Resource;
+
+/**
+ * 染整线1小时数据Service业务层处理
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+@Service
+public class TwinCalcHourRzServiceImpl implements ITwinCalcHourRzService {
+    @Resource
+    private TwinCalcHourRzMapper twinCalcHourRzMapper;
+
+    /**
+     * 查询染整线1小时数据
+     *
+     * @param id 染整线1小时数据主键
+     * @return 染整线1小时数据
+     */
+    @Override
+    public TwinCalcHourRz selectTwinCalcHourRzById(Long id) {
+        return twinCalcHourRzMapper.selectTwinCalcHourRzById(id);
+    }
+
+    /**
+     * 查询染整线1小时数据列表
+     *
+     * @param twinCalcHourRz 染整线1小时数据
+     * @return 染整线1小时数据
+     */
+    @Override
+    public List<TwinCalcHourRz> selectTwinCalcHourRzList(TwinCalcHourRz twinCalcHourRz) {
+        return twinCalcHourRzMapper.selectTwinCalcHourRzList(twinCalcHourRz);
+    }
+
+    /**
+     * 新增染整线1小时数据
+     *
+     * @param twinCalcHourRz 染整线1小时数据
+     * @return 结果
+     */
+    @Override
+    public int insertTwinCalcHourRz(TwinCalcHourRz twinCalcHourRz) {
+            return twinCalcHourRzMapper.insertTwinCalcHourRz(twinCalcHourRz);
+    }
+
+    /**
+     * 修改染整线1小时数据
+     *
+     * @param twinCalcHourRz 染整线1小时数据
+     * @return 结果
+     */
+    @Override
+    public int updateTwinCalcHourRz(TwinCalcHourRz twinCalcHourRz) {
+        return twinCalcHourRzMapper.updateTwinCalcHourRz(twinCalcHourRz);
+    }
+
+    /**
+     * 批量删除染整线1小时数据
+     *
+     * @param ids 需要删除的染整线1小时数据主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTwinCalcHourRzByIds(Long[] ids) {
+        return twinCalcHourRzMapper.deleteTwinCalcHourRzByIds(ids);
+    }
+
+    /**
+     * 删除染整线1小时数据信息
+     *
+     * @param id 染整线1小时数据主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTwinCalcHourRzById(Long id) {
+        return twinCalcHourRzMapper.deleteTwinCalcHourRzById(id);
+    }
+}

+ 86 - 0
jjt-biz/src/main/java/com/jjt/rz/service/impl/TwinDeviceRzServiceImpl.java

@@ -0,0 +1,86 @@
+package com.jjt.rz.service.impl;
+
+import java.util.List;
+import org.springframework.stereotype.Service;
+import com.jjt.rz.mapper.TwinDeviceRzMapper;
+import com.jjt.rz.domain.TwinDeviceRz;
+import com.jjt.rz.service.ITwinDeviceRzService;
+import javax.annotation.Resource;
+
+/**
+ * 染整线设备管理Service业务层处理
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+@Service
+public class TwinDeviceRzServiceImpl implements ITwinDeviceRzService {
+    @Resource
+    private TwinDeviceRzMapper twinDeviceRzMapper;
+
+    /**
+     * 查询染整线设备管理
+     *
+     * @param deviceId 染整线设备管理主键
+     * @return 染整线设备管理
+     */
+    @Override
+    public TwinDeviceRz selectTwinDeviceRzByDeviceId(Long deviceId) {
+        return twinDeviceRzMapper.selectTwinDeviceRzByDeviceId(deviceId);
+    }
+
+    /**
+     * 查询染整线设备管理列表
+     *
+     * @param twinDeviceRz 染整线设备管理
+     * @return 染整线设备管理
+     */
+    @Override
+    public List<TwinDeviceRz> selectTwinDeviceRzList(TwinDeviceRz twinDeviceRz) {
+        return twinDeviceRzMapper.selectTwinDeviceRzList(twinDeviceRz);
+    }
+
+    /**
+     * 新增染整线设备管理
+     *
+     * @param twinDeviceRz 染整线设备管理
+     * @return 结果
+     */
+    @Override
+    public int insertTwinDeviceRz(TwinDeviceRz twinDeviceRz) {
+            return twinDeviceRzMapper.insertTwinDeviceRz(twinDeviceRz);
+    }
+
+    /**
+     * 修改染整线设备管理
+     *
+     * @param twinDeviceRz 染整线设备管理
+     * @return 结果
+     */
+    @Override
+    public int updateTwinDeviceRz(TwinDeviceRz twinDeviceRz) {
+        return twinDeviceRzMapper.updateTwinDeviceRz(twinDeviceRz);
+    }
+
+    /**
+     * 批量删除染整线设备管理
+     *
+     * @param deviceIds 需要删除的染整线设备管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTwinDeviceRzByDeviceIds(Long[] deviceIds) {
+        return twinDeviceRzMapper.deleteTwinDeviceRzByDeviceIds(deviceIds);
+    }
+
+    /**
+     * 删除染整线设备管理信息
+     *
+     * @param deviceId 染整线设备管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTwinDeviceRzByDeviceId(Long deviceId) {
+        return twinDeviceRzMapper.deleteTwinDeviceRzByDeviceId(deviceId);
+    }
+}

+ 123 - 0
jjt-biz/src/main/java/com/jjt/rz/service/impl/TwinDeviceTypeServiceImpl.java

@@ -0,0 +1,123 @@
+package com.jjt.rz.service.impl;
+
+import java.util.List;
+import org.springframework.stereotype.Service;
+    import java.util.ArrayList;
+
+    import com.jjt.common.utils.StringUtils;
+    import org.springframework.transaction.annotation.Transactional;
+    import com.jjt.rz.domain.TwinDeviceTypeData;
+import com.jjt.rz.mapper.TwinDeviceTypeMapper;
+import com.jjt.rz.domain.TwinDeviceType;
+import com.jjt.rz.service.ITwinDeviceTypeService;
+import javax.annotation.Resource;
+
+/**
+ * 设备类型管理Service业务层处理
+ *
+ * @author wukai
+ * @date 2025-05-21
+ */
+@Service
+public class TwinDeviceTypeServiceImpl implements ITwinDeviceTypeService {
+    @Resource
+    private TwinDeviceTypeMapper twinDeviceTypeMapper;
+
+    /**
+     * 查询设备类型管理
+     *
+     * @param typeId 设备类型管理主键
+     * @return 设备类型管理
+     */
+    @Override
+    public TwinDeviceType selectTwinDeviceTypeByTypeId(Long typeId) {
+        return twinDeviceTypeMapper.selectTwinDeviceTypeByTypeId(typeId);
+    }
+
+    /**
+     * 查询设备类型管理列表
+     *
+     * @param twinDeviceType 设备类型管理
+     * @return 设备类型管理
+     */
+    @Override
+    public List<TwinDeviceType> selectTwinDeviceTypeList(TwinDeviceType twinDeviceType) {
+        return twinDeviceTypeMapper.selectTwinDeviceTypeList(twinDeviceType);
+    }
+
+    /**
+     * 新增设备类型管理
+     *
+     * @param twinDeviceType 设备类型管理
+     * @return 结果
+     */
+        @Transactional
+    @Override
+    public int insertTwinDeviceType(TwinDeviceType twinDeviceType) {
+            int rows = twinDeviceTypeMapper.insertTwinDeviceType(twinDeviceType);
+            insertTwinDeviceTypeData(twinDeviceType);
+            return rows;
+    }
+
+    /**
+     * 修改设备类型管理
+     *
+     * @param twinDeviceType 设备类型管理
+     * @return 结果
+     */
+        @Transactional
+    @Override
+    public int updateTwinDeviceType(TwinDeviceType twinDeviceType) {
+                twinDeviceTypeMapper.deleteTwinDeviceTypeDataByTypeId(twinDeviceType.getTypeId())
+            ;
+            insertTwinDeviceTypeData(twinDeviceType);
+        return twinDeviceTypeMapper.updateTwinDeviceType(twinDeviceType);
+    }
+
+    /**
+     * 批量删除设备类型管理
+     *
+     * @param typeIds 需要删除的设备类型管理主键
+     * @return 结果
+     */
+        @Transactional
+    @Override
+    public int deleteTwinDeviceTypeByTypeIds(Long[] typeIds) {
+                twinDeviceTypeMapper.deleteTwinDeviceTypeDataByTypeIds(typeIds);
+        return twinDeviceTypeMapper.deleteTwinDeviceTypeByTypeIds(typeIds);
+    }
+
+    /**
+     * 删除设备类型管理信息
+     *
+     * @param typeId 设备类型管理主键
+     * @return 结果
+     */
+        @Transactional
+    @Override
+    public int deleteTwinDeviceTypeByTypeId(Long typeId) {
+                twinDeviceTypeMapper.deleteTwinDeviceTypeDataByTypeId(typeId);
+        return twinDeviceTypeMapper.deleteTwinDeviceTypeByTypeId(typeId);
+    }
+
+        /**
+         * 新增设备类型数据管理信息
+         *
+         * @param twinDeviceType 设备类型管理对象
+         */
+        public void insertTwinDeviceTypeData(TwinDeviceType twinDeviceType) {
+            List<TwinDeviceTypeData> twinDeviceTypeDataList = twinDeviceType.getTwinDeviceTypeDataList();
+            Long typeId = twinDeviceType.getTypeId();
+            if (StringUtils.isNotNull(twinDeviceTypeDataList)) {
+                List<TwinDeviceTypeData> list = new ArrayList<TwinDeviceTypeData>();
+                for (TwinDeviceTypeData twinDeviceTypeData :twinDeviceTypeDataList)
+                {
+                    twinDeviceTypeData.setTypeId(typeId);
+                    list.add(twinDeviceTypeData);
+                }
+                if (list.size() > 0) {
+                        twinDeviceTypeMapper.batchTwinDeviceTypeData(list);
+                }
+            }
+        }
+}

+ 101 - 0
jjt-biz/src/main/resources/mapper/rz/TwinCalcHourRzMapper.xml

@@ -0,0 +1,101 @@
+<?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="com.jjt.rz.mapper.TwinCalcHourRzMapper">
+    
+    <resultMap type="TwinCalcHourRz" id="TwinCalcHourRzResult">
+        <result property="id"    column="ID"    />
+        <result property="dataDate"    column="DATA_DATE"    />
+        <result property="hour"    column="HOUR"    />
+        <result property="dataTime"    column="DATA_TIME"    />
+        <result property="deviceId"    column="DEVICE_ID"    />
+        <result property="data"    column="DATA"    />
+        <result property="createdBy"    column="CREATED_BY"    />
+        <result property="createdTime"    column="CREATED_TIME"    />
+        <result property="updatedBy"    column="UPDATED_BY"    />
+        <result property="updatedTime"    column="UPDATED_TIME"    />
+        <result property="remark"    column="REMARK"    />
+    </resultMap>
+
+    <sql id="selectTwinCalcHourRzVo">
+        select ID, DATA_DATE, HOUR, DATA_TIME, DEVICE_ID, DATA, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from TWIN_CALC_HOUR_RZ
+    </sql>
+
+    <select id="selectTwinCalcHourRzList" parameterType="TwinCalcHourRz" resultMap="TwinCalcHourRzResult">
+        <include refid="selectTwinCalcHourRzVo"/>
+        <where>  
+            <if test="dataDate != null "> and DATA_DATE = #{dataDate}</if>
+            <if test="hour != null "> and HOUR = #{hour}</if>
+            <if test="dataTime != null "> and DATA_TIME = #{dataTime}</if>
+            <if test="deviceId != null "> and DEVICE_ID = #{deviceId}</if>
+            <if test="data != null  and data != ''"> and DATA = #{data}</if>
+            <if test="createdBy != null  and createdBy != ''"> and CREATED_BY = #{createdBy}</if>
+            <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
+            <if test="updatedBy != null  and updatedBy != ''"> and UPDATED_BY = #{updatedBy}</if>
+            <if test="updatedTime != null "> and UPDATED_TIME = #{updatedTime}</if>
+            <if test="remark != null  and remark != ''"> and REMARK = #{remark}</if>
+        </where>
+    </select>
+    
+    <select id="selectTwinCalcHourRzById" parameterType="Long" resultMap="TwinCalcHourRzResult">
+        <include refid="selectTwinCalcHourRzVo"/>
+        where ID = #{id}
+    </select>
+
+    <insert id="insertTwinCalcHourRz" parameterType="TwinCalcHourRz" useGeneratedKeys="true" keyProperty="id">
+        insert into TWIN_CALC_HOUR_RZ
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="dataDate != null">DATA_DATE,</if>
+            <if test="hour != null">HOUR,</if>
+            <if test="dataTime != null">DATA_TIME,</if>
+            <if test="deviceId != null">DEVICE_ID,</if>
+            <if test="data != null">DATA,</if>
+            <if test="createdBy != null">CREATED_BY,</if>
+            <if test="createdTime != null">CREATED_TIME,</if>
+            <if test="updatedBy != null">UPDATED_BY,</if>
+            <if test="updatedTime != null">UPDATED_TIME,</if>
+            <if test="remark != null">REMARK,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="dataDate != null">#{dataDate},</if>
+            <if test="hour != null">#{hour},</if>
+            <if test="dataTime != null">#{dataTime},</if>
+            <if test="deviceId != null">#{deviceId},</if>
+            <if test="data != null">#{data},</if>
+            <if test="createdBy != null">#{createdBy},</if>
+            <if test="createdTime != null">#{createdTime},</if>
+            <if test="updatedBy != null">#{updatedBy},</if>
+            <if test="updatedTime != null">#{updatedTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTwinCalcHourRz" parameterType="TwinCalcHourRz">
+        update TWIN_CALC_HOUR_RZ
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="dataDate != null">DATA_DATE = #{dataDate},</if>
+            <if test="hour != null">HOUR = #{hour},</if>
+            <if test="dataTime != null">DATA_TIME = #{dataTime},</if>
+            <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
+            <if test="data != null">DATA = #{data},</if>
+            <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
+            <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
+            <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
+            <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
+            <if test="remark != null">REMARK = #{remark},</if>
+        </trim>
+        where ID = #{id}
+    </update>
+
+    <delete id="deleteTwinCalcHourRzById" parameterType="Long">
+        delete from TWIN_CALC_HOUR_RZ where ID = #{id}
+    </delete>
+
+    <delete id="deleteTwinCalcHourRzByIds" parameterType="String">
+        delete from TWIN_CALC_HOUR_RZ where ID in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 111 - 0
jjt-biz/src/main/resources/mapper/rz/TwinDeviceRzMapper.xml

@@ -0,0 +1,111 @@
+<?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="com.jjt.rz.mapper.TwinDeviceRzMapper">
+    
+    <resultMap type="TwinDeviceRz" id="TwinDeviceRzResult">
+        <result property="deviceId"    column="DEVICE_ID"    />
+        <result property="wsName"    column="WS_NAME"    />
+        <result property="line"    column="LINE"    />
+        <result property="typeId"    column="TYPE_ID"    />
+        <result property="deviceType"    column="DEVICE_TYPE"    />
+        <result property="deviceCode"    column="DEVICE_CODE"    />
+        <result property="deviceName"    column="DEVICE_NAME"    />
+        <result property="devicePath"    column="DEVICE_PATH"    />
+        <result property="createdBy"    column="CREATED_BY"    />
+        <result property="createdTime"    column="CREATED_TIME"    />
+        <result property="updatedBy"    column="UPDATED_BY"    />
+        <result property="updatedTime"    column="UPDATED_TIME"    />
+        <result property="remark"    column="REMARK"    />
+    </resultMap>
+
+    <sql id="selectTwinDeviceRzVo">
+        select DEVICE_ID, WS_NAME, LINE, TYPE_ID, DEVICE_TYPE, DEVICE_CODE, DEVICE_NAME, DEVICE_PATH, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from TWIN_DEVICE_RZ
+    </sql>
+
+    <select id="selectTwinDeviceRzList" parameterType="TwinDeviceRz" resultMap="TwinDeviceRzResult">
+        <include refid="selectTwinDeviceRzVo"/>
+        <where>  
+            <if test="wsName != null  and wsName != ''"> and WS_NAME like concat('%', #{wsName}, '%')</if>
+            <if test="line != null  and line != ''"> and LINE = #{line}</if>
+            <if test="typeId != null "> and TYPE_ID = #{typeId}</if>
+            <if test="deviceType != null  and deviceType != ''"> and DEVICE_TYPE = #{deviceType}</if>
+            <if test="deviceCode != null  and deviceCode != ''"> and DEVICE_CODE = #{deviceCode}</if>
+            <if test="deviceName != null  and deviceName != ''"> and DEVICE_NAME like concat('%', #{deviceName}, '%')</if>
+            <if test="devicePath != null  and devicePath != ''"> and DEVICE_PATH = #{devicePath}</if>
+            <if test="createdBy != null  and createdBy != ''"> and CREATED_BY = #{createdBy}</if>
+            <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
+            <if test="updatedBy != null  and updatedBy != ''"> and UPDATED_BY = #{updatedBy}</if>
+            <if test="updatedTime != null "> and UPDATED_TIME = #{updatedTime}</if>
+            <if test="remark != null  and remark != ''"> and REMARK = #{remark}</if>
+        </where>
+    </select>
+    
+    <select id="selectTwinDeviceRzByDeviceId" parameterType="Long" resultMap="TwinDeviceRzResult">
+        <include refid="selectTwinDeviceRzVo"/>
+        where DEVICE_ID = #{deviceId}
+    </select>
+
+    <insert id="insertTwinDeviceRz" parameterType="TwinDeviceRz" useGeneratedKeys="true" keyProperty="deviceId">
+        insert into TWIN_DEVICE_RZ
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="wsName != null">WS_NAME,</if>
+            <if test="line != null">LINE,</if>
+            <if test="typeId != null">TYPE_ID,</if>
+            <if test="deviceType != null">DEVICE_TYPE,</if>
+            <if test="deviceCode != null">DEVICE_CODE,</if>
+            <if test="deviceName != null">DEVICE_NAME,</if>
+            <if test="devicePath != null">DEVICE_PATH,</if>
+            <if test="createdBy != null">CREATED_BY,</if>
+            <if test="createdTime != null">CREATED_TIME,</if>
+            <if test="updatedBy != null">UPDATED_BY,</if>
+            <if test="updatedTime != null">UPDATED_TIME,</if>
+            <if test="remark != null">REMARK,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="wsName != null">#{wsName},</if>
+            <if test="line != null">#{line},</if>
+            <if test="typeId != null">#{typeId},</if>
+            <if test="deviceType != null">#{deviceType},</if>
+            <if test="deviceCode != null">#{deviceCode},</if>
+            <if test="deviceName != null">#{deviceName},</if>
+            <if test="devicePath != null">#{devicePath},</if>
+            <if test="createdBy != null">#{createdBy},</if>
+            <if test="createdTime != null">#{createdTime},</if>
+            <if test="updatedBy != null">#{updatedBy},</if>
+            <if test="updatedTime != null">#{updatedTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTwinDeviceRz" parameterType="TwinDeviceRz">
+        update TWIN_DEVICE_RZ
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="wsName != null">WS_NAME = #{wsName},</if>
+            <if test="line != null">LINE = #{line},</if>
+            <if test="typeId != null">TYPE_ID = #{typeId},</if>
+            <if test="deviceType != null">DEVICE_TYPE = #{deviceType},</if>
+            <if test="deviceCode != null">DEVICE_CODE = #{deviceCode},</if>
+            <if test="deviceName != null">DEVICE_NAME = #{deviceName},</if>
+            <if test="devicePath != null">DEVICE_PATH = #{devicePath},</if>
+            <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
+            <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
+            <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
+            <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
+            <if test="remark != null">REMARK = #{remark},</if>
+        </trim>
+        where DEVICE_ID = #{deviceId}
+    </update>
+
+    <delete id="deleteTwinDeviceRzByDeviceId" parameterType="Long">
+        delete from TWIN_DEVICE_RZ where DEVICE_ID = #{deviceId}
+    </delete>
+
+    <delete id="deleteTwinDeviceRzByDeviceIds" parameterType="String">
+        delete from TWIN_DEVICE_RZ where DEVICE_ID in 
+        <foreach item="deviceId" collection="array" open="(" separator="," close=")">
+            #{deviceId}
+        </foreach>
+    </delete>
+</mapper>

+ 128 - 0
jjt-biz/src/main/resources/mapper/rz/TwinDeviceTypeMapper.xml

@@ -0,0 +1,128 @@
+<?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="com.jjt.rz.mapper.TwinDeviceTypeMapper">
+
+    <resultMap type="TwinDeviceType" id="TwinDeviceTypeResult">
+        <result property="typeId"    column="TYPE_ID"    />
+        <result property="typeGroup"    column="TYPE_GROUP"    />
+        <result property="typeName"    column="TYPE_NAME"    />
+        <result property="typeMatch"    column="TYPE_MATCH"    />
+        <result property="createdBy"    column="CREATED_BY"    />
+        <result property="createdTime"    column="CREATED_TIME"    />
+        <result property="updatedBy"    column="UPDATED_BY"    />
+        <result property="updatedTime"    column="UPDATED_TIME"    />
+        <result property="remark"    column="REMARK"    />
+    </resultMap>
+
+    <resultMap id="TwinDeviceTypeTwinDeviceTypeDataResult" type="TwinDeviceType" extends="TwinDeviceTypeResult">
+        <collection property="twinDeviceTypeDataList" ofType="TwinDeviceTypeData" column="TYPE_ID" select="selectTwinDeviceTypeDataList" />
+    </resultMap>
+
+    <resultMap type="TwinDeviceTypeData" id="TwinDeviceTypeDataResult">
+        <result property="dataId"    column="DATA_ID"    />
+        <result property="typeId"    column="TYPE_ID"    />
+        <result property="dataName"    column="DATA_NAME"    />
+        <result property="dataCode"    column="DATA_CODE"    />
+        <result property="dataType"    column="DATA_TYPE"    />
+        <result property="createdBy"    column="CREATED_BY"    />
+        <result property="createdTime"    column="CREATED_TIME"    />
+        <result property="updatedBy"    column="UPDATED_BY"    />
+        <result property="updatedTime"    column="UPDATED_TIME"    />
+        <result property="remark"    column="REMARK"    />
+    </resultMap>
+
+    <sql id="selectTwinDeviceTypeVo">
+        select TYPE_ID, TYPE_GROUP, TYPE_NAME, TYPE_MATCH, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from TWIN_DEVICE_TYPE
+    </sql>
+
+    <select id="selectTwinDeviceTypeList" parameterType="TwinDeviceType" resultMap="TwinDeviceTypeResult">
+        <include refid="selectTwinDeviceTypeVo"/>
+        <where>
+            <if test="typeGroup != null  and typeGroup != ''"> and TYPE_GROUP = #{typeGroup}</if>
+            <if test="typeName != null  and typeName != ''"> and TYPE_NAME like concat('%', #{typeName}, '%')</if>
+            <if test="typeMatch != null  and typeMatch != ''"> and TYPE_MATCH = #{typeMatch}</if>
+        </where>
+    </select>
+
+    <select id="selectTwinDeviceTypeByTypeId" parameterType="Long" resultMap="TwinDeviceTypeTwinDeviceTypeDataResult">
+        select TYPE_ID, TYPE_GROUP, TYPE_NAME, TYPE_MATCH, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK
+        from TWIN_DEVICE_TYPE
+        where TYPE_ID = #{typeId}
+    </select>
+
+    <select id="selectTwinDeviceTypeDataList" resultMap="TwinDeviceTypeDataResult">
+        select DATA_ID, TYPE_ID, DATA_NAME, DATA_CODE, DATA_TYPE, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK
+        from TWIN_DEVICE_TYPE_DATA
+        where TYPE_ID = #{TYPE_ID}
+    </select>
+
+    <insert id="insertTwinDeviceType" parameterType="TwinDeviceType" useGeneratedKeys="true" keyProperty="typeId">
+        insert into TWIN_DEVICE_TYPE
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="typeGroup != null">TYPE_GROUP,</if>
+            <if test="typeName != null">TYPE_NAME,</if>
+            <if test="typeMatch != null">TYPE_MATCH,</if>
+            <if test="createdBy != null">CREATED_BY,</if>
+            <if test="createdTime != null">CREATED_TIME,</if>
+            <if test="updatedBy != null">UPDATED_BY,</if>
+            <if test="updatedTime != null">UPDATED_TIME,</if>
+            <if test="remark != null">REMARK,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="typeGroup != null">#{typeGroup},</if>
+            <if test="typeName != null">#{typeName},</if>
+            <if test="typeMatch != null">#{typeMatch},</if>
+            <if test="createdBy != null">#{createdBy},</if>
+            <if test="createdTime != null">#{createdTime},</if>
+            <if test="updatedBy != null">#{updatedBy},</if>
+            <if test="updatedTime != null">#{updatedTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTwinDeviceType" parameterType="TwinDeviceType">
+        update TWIN_DEVICE_TYPE
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="typeGroup != null">TYPE_GROUP = #{typeGroup},</if>
+            <if test="typeName != null">TYPE_NAME = #{typeName},</if>
+            <if test="typeMatch != null">TYPE_MATCH = #{typeMatch},</if>
+            <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
+            <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
+            <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
+            <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
+            <if test="remark != null">REMARK = #{remark},</if>
+        </trim>
+        where TYPE_ID = #{typeId}
+    </update>
+
+    <delete id="deleteTwinDeviceTypeByTypeId" parameterType="Long">
+        delete from TWIN_DEVICE_TYPE where TYPE_ID = #{typeId}
+    </delete>
+
+    <delete id="deleteTwinDeviceTypeByTypeIds" parameterType="String">
+        delete from TWIN_DEVICE_TYPE where TYPE_ID in
+        <foreach item="typeId" collection="array" open="(" separator="," close=")">
+            #{typeId}
+        </foreach>
+    </delete>
+
+    <delete id="deleteTwinDeviceTypeDataByTypeIds" parameterType="String">
+        delete from TWIN_DEVICE_TYPE_DATA where TYPE_ID in
+        <foreach item="typeId" collection="array" open="(" separator="," close=")">
+            #{typeId}
+        </foreach>
+    </delete>
+
+    <delete id="deleteTwinDeviceTypeDataByTypeId" parameterType="Long">
+        delete from TWIN_DEVICE_TYPE_DATA where TYPE_ID = #{typeId}
+    </delete>
+
+    <insert id="batchTwinDeviceTypeData">
+        insert into TWIN_DEVICE_TYPE_DATA( TYPE_ID, DATA_NAME, DATA_CODE, DATA_TYPE, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            ( #{item.typeId}, #{item.dataName}, #{item.dataCode}, #{item.dataType}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.remark})
+        </foreach>
+    </insert>
+</mapper>