From 3a7da032ec18b2d5d36afb3fd9622c7d763257b7 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 17 十一月 2021 13:05:06 +0800
Subject: [PATCH] 1. 将用电量接口返回的参数动态化

---
 /dev/null                                                                                |   12 --
 src/main/resources/generator/generatorConfig.xml                                         |    4 
 src/main/kotlin/com/flightfeather/uav/lightshare/bean/ElectricVo.kt                      |    4 
 src/main/kotlin/com/flightfeather/uav/lightshare/eunm/ElectricityType.kt                 |   12 ++
 src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt          |    5 +
 src/main/kotlin/com/flightfeather/uav/domain/entity/CompanyDevice.java                   |  120 ++++++++++++++++++++++++
 src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt           |   46 ++++----
 src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt |    4 
 src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/ElectricityServiceImpl.kt  |   65 ++++++-------
 src/main/resources/application.yml                                                       |   12 +-
 src/main/resources/mapper/CompanyDeviceMapper.xml                                        |    8 +
 11 files changed, 212 insertions(+), 80 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/domain/entity/CompanyDevice.java b/src/main/kotlin/com/flightfeather/uav/domain/entity/CompanyDevice.java
index 6c26ca5..7be13e7 100644
--- a/src/main/kotlin/com/flightfeather/uav/domain/entity/CompanyDevice.java
+++ b/src/main/kotlin/com/flightfeather/uav/domain/entity/CompanyDevice.java
@@ -15,6 +15,36 @@
     private String cdDeviceCode;
 
     /**
+     * 璁惧绫诲瀷锛�0锛氫骇绾匡紱1锛氬噣鍖�
+     */
+    @Column(name = "CD_Type")
+    private Integer cdType;
+
+    /**
+     * 璁惧绫诲瀷鍚嶇О
+     */
+    @Column(name = "CD_Type_Name")
+    private String cdTypeName;
+
+    /**
+     * 璁惧鐢垫祦鐣岄檺鍊硷紝閲囩敤鈥�;鈥濆垎闅斾笉鍚岀晫闄�
+     */
+    @Column(name = "CD_Limits")
+    private String cdLimits;
+
+    /**
+     * 璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佺紪鍙�
+     */
+    @Column(name = "CD_Status")
+    private String cdStatus;
+
+    /**
+     * 璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佸悕绉�
+     */
+    @Column(name = "CD_Status_Name")
+    private String cdStatusName;
+
+    /**
      * @return CD_Id
      */
     public Integer getCdId() {
@@ -55,4 +85,94 @@
     public void setCdDeviceCode(String cdDeviceCode) {
         this.cdDeviceCode = cdDeviceCode == null ? null : cdDeviceCode.trim();
     }
+
+    /**
+     * 鑾峰彇璁惧绫诲瀷锛�0锛氫骇绾匡紱1锛氬噣鍖�
+     *
+     * @return CD_Type - 璁惧绫诲瀷锛�0锛氫骇绾匡紱1锛氬噣鍖�
+     */
+    public Integer getCdType() {
+        return cdType;
+    }
+
+    /**
+     * 璁剧疆璁惧绫诲瀷锛�0锛氫骇绾匡紱1锛氬噣鍖�
+     *
+     * @param cdType 璁惧绫诲瀷锛�0锛氫骇绾匡紱1锛氬噣鍖�
+     */
+    public void setCdType(Integer cdType) {
+        this.cdType = cdType;
+    }
+
+    /**
+     * 鑾峰彇璁惧绫诲瀷鍚嶇О
+     *
+     * @return CD_Type_Name - 璁惧绫诲瀷鍚嶇О
+     */
+    public String getCdTypeName() {
+        return cdTypeName;
+    }
+
+    /**
+     * 璁剧疆璁惧绫诲瀷鍚嶇О
+     *
+     * @param cdTypeName 璁惧绫诲瀷鍚嶇О
+     */
+    public void setCdTypeName(String cdTypeName) {
+        this.cdTypeName = cdTypeName == null ? null : cdTypeName.trim();
+    }
+
+    /**
+     * 鑾峰彇璁惧鐢垫祦鐣岄檺鍊硷紝閲囩敤鈥�;鈥濆垎闅斾笉鍚岀晫闄�
+     *
+     * @return CD_Limits - 璁惧鐢垫祦鐣岄檺鍊硷紝閲囩敤鈥�;鈥濆垎闅斾笉鍚岀晫闄�
+     */
+    public String getCdLimits() {
+        return cdLimits;
+    }
+
+    /**
+     * 璁剧疆璁惧鐢垫祦鐣岄檺鍊硷紝閲囩敤鈥�;鈥濆垎闅斾笉鍚岀晫闄�
+     *
+     * @param cdLimits 璁惧鐢垫祦鐣岄檺鍊硷紝閲囩敤鈥�;鈥濆垎闅斾笉鍚岀晫闄�
+     */
+    public void setCdLimits(String cdLimits) {
+        this.cdLimits = cdLimits == null ? null : cdLimits.trim();
+    }
+
+    /**
+     * 鑾峰彇璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佺紪鍙�
+     *
+     * @return CD_Status - 璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佺紪鍙�
+     */
+    public String getCdStatus() {
+        return cdStatus;
+    }
+
+    /**
+     * 璁剧疆璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佺紪鍙�
+     *
+     * @param cdStatus 璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佺紪鍙�
+     */
+    public void setCdStatus(String cdStatus) {
+        this.cdStatus = cdStatus == null ? null : cdStatus.trim();
+    }
+
+    /**
+     * 鑾峰彇璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佸悕绉�
+     *
+     * @return CD_Status_Name - 璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佸悕绉�
+     */
+    public String getCdStatusName() {
+        return cdStatusName;
+    }
+
+    /**
+     * 璁剧疆璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佸悕绉�
+     *
+     * @param cdStatusName 璁惧鐢垫祦涓嶅悓鐣岄檺涓嬪搴旂殑鐘舵�佸悕绉�
+     */
+    public void setCdStatusName(String cdStatusName) {
+        this.cdStatusName = cdStatusName == null ? null : cdStatusName.trim();
+    }
 }
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/bean/ElectricVo.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/bean/ElectricVo.kt
index 79f63c0..856bf3c 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/bean/ElectricVo.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/bean/ElectricVo.kt
@@ -7,9 +7,11 @@
     var d1eB: Double = .0,
     var d1eC: Double = .0,
     var d1Status: String? = "0",
+    var d1StatusName: String? = null,
     //搴熸皵鍑�鍖栬缃�
     var d2eA: Double = .0,
     var d2eB: Double = .0,
     var d2eC: Double = .0,
-    var d2Status: String? = "0"
+    var d2Status: String? = "0",
+    var d2StatusName: String? = null
 )
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/eunm/CarStatus.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/eunm/CarStatus.kt
deleted file mode 100644
index 53f6201..0000000
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/eunm/CarStatus.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.flightfeather.uav.lightshare.eunm
-
-/**
- * @author riku
- * Date: 2019/9/26
- * 杞﹁締鐘舵��
- * 0锛氱绾�
- * 1锛氬湪绾�
- * 2锛氳鎶�
- * 3锛氳秴鏍�
- */
-enum class CarStatus(val value: Int) {
-    OffLine(0),
-    OnLine(1),
-    Warn(2),
-    Exceed(3)
-}
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/eunm/CarType.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/eunm/CarType.kt
deleted file mode 100644
index 51854d1..0000000
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/eunm/CarType.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.flightfeather.uav.lightshare.eunm
-
-/**
- * @author riku
- * Date: 2019/9/26
- */
-enum class CarType(val value: Int){
-    //闆嗚绠卞崱杞�
-    ContainerTruck(0),
-    //娓e湡杞�
-    SlagCar(1)
-}
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/eunm/ElectricityType.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/eunm/ElectricityType.kt
new file mode 100644
index 0000000..64eb3a1
--- /dev/null
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/eunm/ElectricityType.kt
@@ -0,0 +1,12 @@
+package com.flightfeather.uav.lightshare.eunm
+
+/**
+ * @author riku
+ * Date: 2019/9/26
+ */
+enum class ElectricityType(val value: Int){
+    //浜х嚎璁惧
+    ProductionLine(0),
+    //鍑�鍖栬澶�
+    Purify(1)
+}
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt
index c7fb767..3da6d86 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt
@@ -30,4 +30,9 @@
      * 鍧囧�艰绠楋紝灏嗙绾у�兼崲绠椾负鍒嗛挓鍧囧��
      */
     fun averageData(): BaseResponse<String>
+
+    /**
+     * 鏁版嵁浼樺寲锛屽湪鏁版嵁棰勫鐞嗗熀纭�涓婂仛杩涗竴姝ユ暟鎹紭鍖�
+     */
+    fun dataCalibration(): BaseResponse<String>
 }
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/ElectricityServiceImpl.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/ElectricityServiceImpl.kt
index 1a696eb..c6f3e68 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/ElectricityServiceImpl.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/ElectricityServiceImpl.kt
@@ -10,6 +10,7 @@
 import com.flightfeather.uav.lightshare.bean.DataHead
 import com.flightfeather.uav.lightshare.bean.DataVo
 import com.flightfeather.uav.lightshare.bean.ElectricVo
+import com.flightfeather.uav.lightshare.eunm.ElectricityType
 import com.flightfeather.uav.lightshare.service.ElectricityService
 import com.flightfeather.uav.socket.bean.AirData
 import com.github.pagehelper.PageHelper
@@ -102,22 +103,21 @@
             createCriteria().andEqualTo("cdCompanyId", cId)
         })
         //浜х嚎椋庢満
-        var d1: String? = null
+        var d1: CompanyDevice? = null
         //搴熸皵鍑�鍖栬缃�
-        var d2: String? = null
+        var d2: CompanyDevice? = null
 
         deviceCodeList.forEach {
-            // FIXME: 2021/11/5 姝ゅ鏆傛椂鍐欐锛屽悗缁慨鏀�
-            if (it?.cdDeviceCode == "31011020210602" || it?.cdDeviceCode == "31011020210603") {
-                d1 = it.cdDeviceCode
-            }else if (it?.cdDeviceCode == "31011020210601" || it?.cdDeviceCode == "31011020210604") {
-                d2 = it.cdDeviceCode
+            if (it?.cdType == ElectricityType.ProductionLine.value) {
+                d1 = it
+            }else if (it?.cdType == ElectricityType.Purify.value) {
+                d2 = it
             }
         }
 
         var pageInfo = PageHelper.startPage<ElectricMinuteValue>(p, perP)
         val dataList1 = electricMinuteValueMapper.selectByExample(Example(ElectricMinuteValue::class.java).apply {
-            createCriteria().andEqualTo("mvStatCode", d1)
+            createCriteria().andEqualTo("mvStatCode", d1?.cdDeviceCode)
                 .apply {
                     sTime?.let { andGreaterThanOrEqualTo("mvDataTime", it) }
                     eTime?.let { andLessThanOrEqualTo("mvDataTime", it) }
@@ -134,7 +134,7 @@
         }
         pageInfo = PageHelper.startPage<ElectricMinuteValue>(p, perP)
         val dataList2 = electricMinuteValueMapper.selectByExample(Example(ElectricMinuteValue::class.java).apply {
-            createCriteria().andEqualTo("mvStatCode", d2)
+            createCriteria().andEqualTo("mvStatCode", d2?.cdDeviceCode)
                 .apply {
                     sTime?.let { andGreaterThanOrEqualTo("mvDataTime", it) }
                     eTime?.let { andLessThanOrEqualTo("mvDataTime", it) }
@@ -192,7 +192,9 @@
                             d1eA = d?.mvElectricityA ?: .0
                             d1eB = d?.mvElectricityB ?: .0
                             d1eC = d?.mvElectricityC ?: .0
-                            d1Status = getStatus(d)
+                            val s = getStatus(d, d1)
+                            d1Status = s.first
+                            d1StatusName = s.second
                         }
                         dataList1.removeAt(0)
                     }
@@ -205,7 +207,9 @@
                             d2eA = d?.mvElectricityA ?: .0
                             d2eB = d?.mvElectricityB ?: .0
                             d2eC = d?.mvElectricityC ?: .0
-                            d2Status = getStatus(d)
+                            val s = getStatus(d, d2)
+                            d2Status = s.first
+                            d2StatusName = s.second
                         }
                         dataList2.removeAt(0)
                     }
@@ -220,30 +224,21 @@
     }
 
     // FIXME: 2021/11/5 姝ゅ鏆傛椂鍐欐锛屽悗缁慨鏀�
-    private fun getStatus(e: ElectricMinuteValue?): String {
-        var values = listOf(1, 100)
-        var status = listOf("0", "2", "3")
+    private fun getStatus(e: ElectricMinuteValue?, d: CompanyDevice?): Pair<String, String> {
+        var values = mutableListOf<Int>().apply {
+            d?.cdLimits?.split(";")?.forEach {
+                it.toIntOrNull()?.let { i -> add(i) }
+            }
+        }
+        var status = d?.cdStatus?.split(";") ?: emptyList()
+        var statusNames = d?.cdStatusName?.split(";") ?: emptyList()
+        if (values.isEmpty()) values = mutableListOf(1, 100)
+        if (status.isEmpty()) status = listOf("0", "2", "3")
+        if (statusNames.isEmpty()) statusNames = listOf("寰呮満", "杩愯", "瓒呰礋鑽�")
         if (e == null) {
-            return status.first()
+            return Pair(status.first(), statusNames.first())
         }
-        when (e.mvStatCode) {
-            "31011020210601" -> {
-                values = listOf(1, 100)
-                status = listOf("0", "2", "3")
-            }
-            "31011020210602" -> {
-                values = listOf(13, 30)
-                status = listOf("0", "2", "3")
-            }
-            "31011020210603" -> {
-                values = listOf(1, 50, 80)
-                status = listOf("0", "1", "2", "3")
-            }
-            "31011020210604" -> {
-                values = listOf(15, 90, 125)
-                status = listOf("0", "1", "2", "3")
-            }
-        }
+
         val electricityList = mutableListOf<Double>()
         electricityList.add(e.mvElectricityA)
         electricityList.add(e.mvElectricityB)
@@ -252,9 +247,9 @@
         val avg = electricityList.average()
         for (i in values.indices) {
             if (avg < values[i]) {
-                return status[i]
+                return Pair(status[i], statusNames[i])
             }
         }
-        return status.last()
+        return Pair(status.last(), statusNames.last())
     }
 }
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
index 48aff07..301ccbe 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
@@ -317,4 +317,8 @@
 
         return BaseResponse(count > 0, data = "鎻掑叆鏁版嵁: ${count}鏉�")
     }
+
+    override fun dataCalibration(): BaseResponse<String> {
+        return BaseResponse(true)
+    }
 }
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt b/src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt
index 7751fbc..b2193b0 100644
--- a/src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt
+++ b/src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt
@@ -172,29 +172,29 @@
                     dataTransform(vo, d)
                     /**************************************************************************/
                     // FIXME: 2021/11/8 閽堝鍘嗗彶缃戞牸鍖栧師濮嬫暟鎹紝杩涜涓存椂鏍″噯澶勭悊
-                    val dTime = LocalDateTime.ofInstant(d.dataTime?.toInstant(), ZoneId.systemDefault())
-                    // CO: 2021.8.28 17:27璧� *0.25
-                    val coTime = LocalDateTime.of(2021, 8, 28, 17, 27, 0)
-                    if (dTime.isAfter(coTime)) {
-                        d.co = d.co?.times(0.25f)
-                    }
-
-                    // NO2
-                    d.no2 = d.no2?.times(0.6f)
-
-                    // O3
-                    d.o3 = abs(d.o3?.minus(d.no2?.div(2) ?: 0f) ?: 0f) * 1.5f
-
-                    // SO2: *0.2, 2021.8.29 6:00璧� *0.08
-                    val so2Time = LocalDateTime.of(2021, 8, 29, 6, 0, 0)
-                    d.so2 = if (dTime.isAfter(so2Time)) {
-                        d.so2?.times(0.08f)
-                    } else {
-                        d.so2?.times(0.2f)
-                    }
-
-                    // H2S
-                    d.h2s = d.h2s?.let { sqrt(it) * 2 }
+//                    val dTime = LocalDateTime.ofInstant(d.dataTime?.toInstant(), ZoneId.systemDefault())
+//                    // CO: 2021.8.28 17:27璧� *0.25
+//                    val coTime = LocalDateTime.of(2021, 8, 28, 17, 27, 0)
+//                    if (dTime.isAfter(coTime)) {
+//                        d.co = d.co?.times(0.25f)
+//                    }
+//
+//                    // NO2
+//                    d.no2 = d.no2?.times(0.6f)
+//
+//                    // O3
+//                    d.o3 = abs(d.o3?.minus(d.no2?.div(2) ?: 0f) ?: 0f) * 1.5f
+//
+//                    // SO2: *0.2, 2021.8.29 6:00璧� *0.08
+//                    val so2Time = LocalDateTime.of(2021, 8, 29, 6, 0, 0)
+//                    d.so2 = if (dTime.isAfter(so2Time)) {
+//                        d.so2?.times(0.08f)
+//                    } else {
+//                        d.so2?.times(0.2f)
+//                    }
+//
+//                    // H2S
+//                    d.h2s = d.h2s?.let { sqrt(it) * 2 }
                     /**************************************************************************/
                     realTimeDataGridMapper.insert(d)
                     count++
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index e03ad45..1087cd6 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -7,9 +7,9 @@
 #    password: cn.FLIGHTFEATHER
 
 #    绾夸笂鏈嶅姟鍣�
-    url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
-    username: dronemonitor
-    password: dronemonitor_hackxrnomxm
+#    url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
+#    username: dronemonitor
+#    password: dronemonitor_hackxrnomxm
 
 #    寮�鍙戞湰鍦版湇鍔″櫒
 #    url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
@@ -17,9 +17,9 @@
 #    password: 123456
 
 #   寮�鍙戣繙绋嬫湇鍔″櫒
-#    url: jdbc:mysql://47.100.191.150:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
-#    username: remoteU1
-#    password: eSoF8DnzfGTlhAjE
+    url: jdbc:mysql://47.100.191.150:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
+    username: remoteU1
+    password: eSoF8DnzfGTlhAjE
     hikari:
       maximum-pool-size: 500
       minimum-idle: 20
diff --git a/src/main/resources/generator/generatorConfig.xml b/src/main/resources/generator/generatorConfig.xml
index 13864e0..0f54203 100644
--- a/src/main/resources/generator/generatorConfig.xml
+++ b/src/main/resources/generator/generatorConfig.xml
@@ -48,7 +48,7 @@
 <!--        <table tableName="air_real_time_data" domainObjectName="RealTimeData" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
 <!--        <table tableName="mission" domainObjectName="Mission" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
 <!--        <table tableName="el_minutevalue" domainObjectName="ElectricMinuteValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
-<!--        <table tableName="el_company_device" domainObjectName="CompanyDevice" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
+        <table tableName="el_company_device" domainObjectName="CompanyDevice" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>
 <!--        <table tableName="co_complaint" domainObjectName="Complaint" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
 <!--        <table tableName="co_assessment" domainObjectName="Assessment" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
 <!--        <table tableName="real_time_data_grid" domainObjectName="RealTimeDataGrid" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
@@ -56,6 +56,6 @@
 <!--        <table tableName="real_time_data_vehicle" domainObjectName="RealTimeDataVehicle" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
 <!--        <table tableName="device_info" domainObjectName="DeviceInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
 <!--        <table tableName="factor_calibration" domainObjectName="FactorCalibration" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
-        <table tableName="real_time_data_grid_min" domainObjectName="RealTimeDataGridMin" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>
+<!--        <table tableName="real_time_data_grid_min" domainObjectName="RealTimeDataGridMin" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
     </context>
 </generatorConfiguration>
\ No newline at end of file
diff --git a/src/main/resources/mapper/CompanyDeviceMapper.xml b/src/main/resources/mapper/CompanyDeviceMapper.xml
index e21368f..d97caec 100644
--- a/src/main/resources/mapper/CompanyDeviceMapper.xml
+++ b/src/main/resources/mapper/CompanyDeviceMapper.xml
@@ -8,11 +8,17 @@
     <id column="CD_Id" jdbcType="INTEGER" property="cdId" />
     <result column="CD_Company_Id" jdbcType="VARCHAR" property="cdCompanyId" />
     <result column="CD_Device_Code" jdbcType="VARCHAR" property="cdDeviceCode" />
+    <result column="CD_Type" jdbcType="INTEGER" property="cdType" />
+    <result column="CD_Type_Name" jdbcType="VARCHAR" property="cdTypeName" />
+    <result column="CD_Limits" jdbcType="VARCHAR" property="cdLimits" />
+    <result column="CD_Status" jdbcType="VARCHAR" property="cdStatus" />
+    <result column="CD_Status_Name" jdbcType="VARCHAR" property="cdStatusName" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--
       WARNING - @mbg.generated
     -->
-    CD_Id, CD_Company_Id, CD_Device_Code
+    CD_Id, CD_Company_Id, CD_Device_Code, CD_Type, CD_Type_Name, CD_Limits, CD_Status, 
+    CD_Status_Name
   </sql>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3