From d728f14a2f23cb477ebfecd33df5f7e5cb54a178 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 29 十月 2024 17:33:22 +0800
Subject: [PATCH] 去掉rocketmq

---
 smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateMapper.xml |  309 +++++++++++++++++++++++---------------------------
 1 files changed, 143 insertions(+), 166 deletions(-)

diff --git a/smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateMapper.xml b/smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateMapper.xml
index 1fac162..ab0a931 100644
--- a/smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateMapper.xml
+++ b/smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateMapper.xml
@@ -112,129 +112,13 @@
 
     </select>
 
-    <select id="dateState"
-            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
-        select ts as startTime,
-        end_time as endTime,
-        duration_collect,
-        value_collect,
-        calendar_code as calendarCode,
-        factory_year as factoryYear,
-        factory_month as factoryMonth,
-        factory_week as factoryWeek,
-        factory_date as factoryDate,
-        shift_index as shiftIndex,
-        shift_time_type as shiftTimeType,
-        wcs,
-        rps,
-        is_deleted as isDeleted,
-        workstation_id as workstationId,
-        is_plan as isPlan
-        from iot_data.super_aggregate_state
-        where is_deleted = 0
-        and wcs > 0
-        and factory_date = #{factoryDate}
-        <if test="ids != null and ids.size() > 0">
-            AND workstation_id IN
-            <foreach collection="ids" item="id" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-        </if>
-    </select>
+    
 
-    <select id="weekState"
-            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
-        select ts as startTime,
-        end_time as endTime,
-        duration_collect,
-        value_collect,
-        calendar_code as calendarCode,
-        factory_year as factoryYear,
-        factory_month as factoryMonth,
-        factory_week as factoryWeek,
-        factory_date as factoryDate,
-        shift_index as shiftIndex,
-        shift_time_type as shiftTimeType,
-        wcs,
-        rps,
-        is_deleted as isDeleted,
-        workstation_id as workstationId,
-        is_plan as isPlan
-        from iot_data.super_aggregate_state
-        where factory_year = #{year}
-        and factory_week = #{week}
-        and is_deleted = 0
-        and wcs > 0
-        <if test="ids != null and ids.size() > 0">
-            AND workstation_id IN
-            <foreach collection="ids" item="id" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-        </if>
-    </select>
+    
 
-    <select id="yearState"
-            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
-        select ts as startTime,
-        end_time as endTime,
-        duration_collect,
-        value_collect,
-        calendar_code as calendarCode,
-        factory_year as factoryYear,
-        factory_month as factoryMonth,
-        factory_week as factoryWeek,
-        factory_date as factoryDate,
-        shift_index as shiftIndex,
-        shift_time_type as shiftTimeType,
-        wcs,
-        rps,
-        is_deleted as isDeleted,
-        workstation_id as workstationId,
-        is_plan as isPlan
-        from iot_data.super_aggregate_state
-        where factory_year = #{year}
-        and factory_month = #{month}
-        and is_deleted = 0
-        and wcs > 0
-        <if test="ids != null and ids.size() > 0">
-            AND workstation_id IN
-            <foreach collection="ids" item="id" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-        </if>
-    </select>
+    
 
-    <select id="shiftState"
-            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
-        select ts as startTime,
-        end_time as endTime,
-        duration_collect,
-        value_collect,
-        calendar_code as calendarCode,
-        factory_year as factoryYear,
-        factory_month as factoryMonth,
-        factory_week as factoryWeek,
-        factory_date as factoryDate,
-        shift_index as shiftIndex,
-        shift_time_type as shiftTimeType,
-        wcs,
-        rps,
-        is_deleted as isDeleted,
-        workstation_id as workstationId,
-        is_plan as isPlan
-        from iot_data.super_aggregate_state
-        where factory_date = #{factoryDate}
-        and wcs > 0
-        and shift_index = #{shiftIndex}
-        and calendar_code = #{calendarCode}
-        and is_deleted = 0
-        <if test="ids != null and ids.size() > 0">
-            AND workstation_id IN
-            <foreach collection="ids" item="id" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-        </if>
-    </select>
+    
 
     <select id="deviceStatusStatisticsList"
             resultType="com.qianwen.smartman.modules.mdc.vo.DeviceStatusStatisticsVO">
@@ -394,20 +278,7 @@
         </if>
     </select>
 
-    <select id="getStatusData" resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
-        select
-        <include refid="superAggregateStateColumnSql"/>
-        from iot_data.super_aggregate_state
-        where is_deleted = 0
-        and wcs > 0
-        and ts <![CDATA[>=]]> #{startDate} and ts <![CDATA[<]]> #{endDate}
-        <if test="workstationIds != null and workstationIds.size() > 0">
-            AND workstation_id IN
-            <foreach collection="workstationIds" item="id" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-        </if>
-    </select>
+    
 
     <sql id="superAggregateStateColumnSql">
         ts as startTime,
@@ -430,35 +301,7 @@
 
     
 
-    <select id="getStatusDataByFactoryDate"
-            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
-        select ts as startTime,
-        end_time as endTime,
-        duration_collect,
-        value_collect,
-        calendar_code as calendarCode,
-        factory_year as factoryYear,
-        factory_month as factoryMonth,
-        factory_week as factoryWeek,
-        factory_date as factoryDate,
-        shift_index as shiftIndex,
-        shift_time_type as shiftTimeType,
-        wcs,
-        rps,
-        workstation_id as workstationId,
-        is_plan as isPlan
-        from iot_data.super_aggregate_state
-        where factory_date <![CDATA[>=]]> #{startDate} and factory_date <![CDATA[<=]]> #{endDate}
-        and rps > 0
-        and wcs > 0
-        and is_deleted = false
-        <if test="workstationIds != null and workstationIds.size() > 0">
-            AND workstation_id IN
-            <foreach collection="workstationIds" item="id" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-        </if>
-    </select>
+    
 
     
 
@@ -579,7 +422,7 @@
             #{week}
         </foreach>
     </select>
-
+	<!-- 
     <select id="getDataByMonth" resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
         select ts as startTime,
         end_time as endTime,
@@ -609,7 +452,38 @@
             #{month}
         </foreach>
     </select>
-
+     -->
+	
+	<select id="getDataByMonth" resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
+        select 
+        end_time as endTime,
+        duration_collect,
+        value_collect,
+        calendar_code as calendarCode,
+        factory_year as factoryYear,
+        factory_month as factoryMonth,
+        factory_week as factoryWeek,
+        factory_date as factoryDate,
+        shift_index as shiftIndex,
+        shift_time_type as shiftTimeType,
+        wcs,
+        rps,
+        is_deleted as isDeleted,
+        workstation_id as workstationId
+        from root.f2.aggregate_state_*
+        where is_deleted=false
+        and wcs > 0
+        and factory_year = #{year}
+        and workstation_id IN
+        <foreach collection="workstationIds" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+        and factory_month IN
+        <foreach collection="monthList" item="month" open="(" separator="," close=")">
+            #{month}
+        </foreach>
+         align by device
+    </select>
     <select id="listCrossDay" resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
         select ts              as startTime,
                end_time        as endTime,
@@ -1064,7 +938,6 @@
 
 	<!-- 璋冩暣鐨剆ql寮�濮� -->
 	<sql id="aggregateStateColumnSql">
-        
         end_time as endTime,
         duration_collect as durationCollect,
         value_collect as valueCollect,
@@ -1081,6 +954,8 @@
         workstation_id as workstationId,
         is_plan as isPlan
     </sql>
+    
+        
 	<!-- 鍘熸潵鏄痷nion2涓猻ql锛岀幇鍦ㄥ悎骞舵湭涓�涓� -->
 	<!-- 
 	OK: where ((time <![CDATA[<]]> #{startDate} and end_time <![CDATA[>=]]> #{startDate.time}) or (time <![CDATA[>=]]> #{startDate} and time <![CDATA[<=]]> #{endDate.time}))
@@ -1122,5 +997,107 @@
         </if>
           align by device
     </select>
+    
+    <select id="getStatusData" resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
+        select
+        <include refid="aggregateStateColumnSql"/>
+        from root.f2.aggregate_state_*
+        where is_deleted = false
+        and wcs > 0
+        and time <![CDATA[>=]]> #{startDate} and time <![CDATA[<]]> #{endDate}
+        <if test="workstationIds != null and workstationIds.size() > 0">
+            AND workstation_id IN
+            <foreach collection="workstationIds" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+         align by device
+    </select>
+    
+    <select id="getStatusDataByFactoryDate"
+            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
+        select <include refid="aggregateStateColumnSql"/>
+        from root.f2.aggregate_state_*
+        where factory_date <![CDATA[>=]]> #{startFactoryDate} and factory_date <![CDATA[<=]]> #{endFactoryDate}
+        and rps > 0
+        and wcs > 0
+        and is_deleted = false
+        <if test="workstationIds != null and workstationIds.size() > 0">
+            AND workstation_id IN
+            <foreach collection="workstationIds" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+        align by device
+    </select>
+    
+    <!-- 鏌ヨ鎸夌彮娆$殑鐘舵�佹暟鎹紝鍦ㄧ敤鏃跺垎鏋愪腑浣跨敤 and calendar_code = #{calendarCode,jdbcType=VARCHAR} -->
+    <select id="shiftState"
+            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
+        select <include refid="aggregateStateColumnSql"/>
+        from root.f2.aggregate_state_*
+        where factory_date = #{factoryDate}
+        and wcs > 0
+        and shift_index = #{shiftIndex}
+        and calendar_code = "#{calendarCode}"
+        and is_deleted = false
+        <if test="ids != null and ids.size() > 0">
+            AND workstation_id IN
+            <foreach collection="ids" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+         align by device
+    </select>
+    
+    <select id="weekState"
+            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
+        select <include refid="aggregateStateColumnSql"/>
+        from root.f2.aggregate_state_*
+        where factory_year = #{year}
+        and factory_week = #{week}
+        and is_deleted = false
+        and wcs > 0
+        <if test="ids != null and ids.size() > 0">
+            AND workstation_id IN
+            <foreach collection="ids" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+         align by device
+    </select>
+    
+    <select id="yearState"
+            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
+        select <include refid="aggregateStateColumnSql"/>
+        from root.f2.aggregate_state_*
+        where factory_year = #{year}
+        and factory_month = #{month}
+        and is_deleted = false
+        and wcs > 0
+        <if test="ids != null and ids.size() > 0">
+            AND workstation_id IN
+            <foreach collection="ids" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+         align by device
+    </select>
+    
+    <select id="dateState"
+            resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
+        select <include refid="aggregateStateColumnSql"/>
+        from root.f2.aggregate_state_*
+        where is_deleted = false
+        and wcs > 0
+        and factory_date = #{factoryDate}
+        <if test="ids != null and ids.size() > 0">
+            AND workstation_id IN
+            <foreach collection="ids" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+         align by device
+    </select>
 </mapper>
 

--
Gitblit v1.9.3