Lius
2024-10-31 e17986e0800584f650b42c6fb632d0244d695a35
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.screen.mapper.MdcLargeScreenMapper">
 
    <select id="findEquipmentCount" resultType="java.math.BigDecimal">
        SELECT DISTINCT
            COUNT(equipment_id)
        FROM
            mdc_equipment_statistical_info
        WHERE
            the_date = #{date}
    </select>
 
    <select id="findYesterdayProcessCount" resultType="java.math.BigDecimal">
        SELECT
            SUM( process_long )
        FROM
            mdc_equipment_statistical_info
        WHERE
            the_date = #{date}
    </select>
 
    <select id="todayProductionSchedule" resultType="org.jeecg.modules.screen.dto.TodayProductionDto">
        SELECT
            productName,
            SUM ( planCount ) planCount,
            SUM ( completionCount ) completionCount
        FROM
            mdcJc_ProductDayschedule
        WHERE
            planDate = #{date}
        GROUP BY
            productName
    </select>
 
    <select id="todayProductionPassRate" resultType="org.jeecg.modules.mdcJc.entity.MdcProductDayschedule">
        SELECT
            productName,
            SUM ( planCount ) planCount,
            SUM ( completionCount ) completionCount,
            SUM ( qualifiedCount ) qualifiedCount
        FROM
            mdcJc_ProductDayschedule
        WHERE
            planDate = #{date}
        GROUP BY
            productName
    </select>
 
    <select id="todayClazzCompletionCount" resultType="org.jeecg.modules.screen.dto.ClazzCompletionCountDto">
        SELECT
            clazz,
            SUM ( completionCount ) completionCount
        FROM
            mdcJc_ProductDayschedule
        WHERE
            planDate = #{date}
        GROUP BY
            clazz
    </select>
 
    <select id="efficiencyList" resultType="org.jeecg.modules.mdc.dto.MdcEfficiencyDto">
        SELECT
            t2.equipment_id equipmentId,
            t2.equipment_name equipmentName,
            t2.equipment_type equipmentType,
            t1.the_date theDate,
            t1.process_long processLong,
            t1.process_long / 86400 utilizationRate,
            CASE
                WHEN t1.open_long > 0 THEN
                    t1.process_long / t1.open_long ELSE 0
                END startRate,
            t1.open_long / 86400 openRate,
            t1.open_long openLong,
            t1.wait_long waitLong,
            t1.close_long closeLong
        FROM
            mdc_equipment t2
                LEFT JOIN mdc_equipment_statistical_info t1 ON t1.equipment_id = t2.equipment_id
        WHERE
            t1.the_date = #{date}
    </select>
 
    <select id="efficiency" resultType="org.jeecg.modules.mdc.dto.MdcEfficiencyDto">
        SELECT
            the_date,
            SUM ( process_long ) process_long
        FROM
            mdc_equipment_statistical_info
        WHERE
            the_date BETWEEN #{startDate} AND #{endDate}
        GROUP BY
            the_date
        ORDER BY
            the_date ASC
    </select>
</mapper>