zhoushihao
2025-04-15 c6cb57f307b0c62a05cac78cfd828c313f10e611
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
<?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.mes.hollow.mapper.HollowGlassOutRelationInfoMapper">
 
 
    <select id="queryOrderByFlowCardId" resultType="com.mes.hollow.entity.dto.OrderDTO">
        select t1.*
        from pp.flow_card t
                 inner join sd.order t1 on t.order_id = t1.order_id
        where t.process_id = #{flowCardId}
        limit 1
    </select>
    <select id="queryPieChart" resultType="com.mes.largenscreen.entity.PieChartVO">
        SELECT
            round( sum( CASE WHEN hgori.cell = 930 AND hgqi.state = 0 THEN 1 ELSE 0 END ), 2 ) AS oneCompletedQuantity,
            round(
                    sum( CASE WHEN hgori.cell = 930 AND hgqi.state = 0 THEN hgqi.width * hgqi.height / 1000000 ELSE 0 END ),
                    2
                ) AS oneCompletedArea,
            round( sum( CASE WHEN hgori.cell = 931 AND hgqi.state = 0 THEN 1 ELSE 0 END ), 2 ) AS twoCompletedQuantity,
            round(
                    sum( CASE WHEN hgori.cell = 931 AND hgqi.state = 0 THEN hgqi.width * hgqi.height / 1000000 ELSE 0 END ),
                    2
                ) AS twoCompletedArea,
            round( sum( CASE WHEN hgori.cell = 930 AND hgqi.state =- 1 THEN 1 ELSE 0 END ), 2 ) AS oneUncompletedQuantity,
            round(
                    sum( CASE WHEN hgori.cell = 930 AND hgqi.state =- 1 THEN hgqi.width * hgqi.height / 1000000 ELSE 0 END ),
                    2
                ) AS oneUncompletedArea,
            round( sum( CASE WHEN hgori.cell = 931 AND hgqi.state =- 1 THEN 1 ELSE 0 END ), 2 ) AS twoUncompletedQuantity,
            round(
                    sum( CASE WHEN hgori.cell = 931 AND hgqi.state =- 1 THEN hgqi.width * hgqi.height / 1000000 ELSE 0 END ),
                    2
                ) AS twoUncompletedArea
        FROM
            hollow_glass_out_relation_info hgori
                INNER JOIN hollow_glass_queue_info hgqi ON hgori.formula_id = hgqi.relation_id
        WHERE
            date( hgori.create_time ) = date(
            now())
    </select>
</mapper>