yangys
2024-04-09 5e7afb7c22b702b3ab725d0a762e6f5b8119a9df
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?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.qianwen.smartman.modules.mdc.mapper.SuperAggregateStateFeedbackMapper">
 
 
    <sql id="superAggregateStateColumnSql">
        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,
        feedback_id as feedbackId
    </sql>
 
 
    <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,
        feedback_id as feedbackId
        from iot_data.super_aggregate_state_with_feedback
        where factory_date <![CDATA[>=]]> #{startDate} and factory_date <![CDATA[<=]]> #{endDate}
        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>
 
 
 
    <select id="getStatusData" resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
        select
        <include refid="superAggregateStateColumnSql"/>
        from iot_data.super_aggregate_state_with_feedback
        where is_deleted = 0
        and wcs > 0 and is_deleted = false
        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>
 
 
 
 
</mapper>