yangbin
2025-02-20 710df8489c740910bda9a557d9a7fdc6cf39df41
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
<?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.mdc.mapper.EquipmentStatisticalInfoMapper">
    <select id="findDataRankingForBigScreen" resultType="org.jeecg.modules.mdc.subcontrol.vo.LastWeekDataVo">
        SELECT
        equipment_id equipment,
        SUM( open_long ) openlong,
        SUM( close_long ) closelong,
        SUM( wait_long ) waitlong,
        SUM( process_long ) processingLong,
        SUM( error_long ) errorlong
        FROM
        mdc_equipment_statistical_info
        <where>
            <if test="equipmentIdList != null and equipmentIdList.size() > 0">
                AND equipment_id IN
                <foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
            AND the_date &gt;= #{ monday }
            AND the_date &lt;= #{ saturday }
        </where>
        GROUP BY
        equipment_id;
    </select>
 
    <select id="findDataForBigScreen" resultType="org.jeecg.modules.mdc.subcontrol.vo.LastWeekDataVo">
        SELECT
        equipment_id equipment,
        SUM( open_long ) openlong,
        SUM( close_long ) closelong,
        SUM( wait_long ) waitlong,
        SUM( process_long ) processingLong,
        SUM( error_long ) errorlong
        FROM
        mdc_equipment_statistical_info
        <where>
            <if test="equipmentIdList != null and equipmentIdList.size() > 0">
                AND equipment_id IN
                <foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
            AND the_date &gt;= #{ monday }
            AND the_date &lt;= #{ saturday }
        </where>
        GROUP BY
        the_date
        ORDER BY
        the_date ASC;
    </select>
 
    <select id="findEquipmentId" resultType="java.lang.String">
        SELECT DISTINCT
        equipment_id equipment
        FROM
 
        mdc_equipment_statistical_info
        <where>
            <if test="equipmentIdList != null and equipmentIdList.size() > 0">
                AND equipment_id IN
                <foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
            <if test="date != null and date != ''">
                AND the_date = #{ date }
            </if>
        </where>
    </select>
 
</mapper>