新火炬后端单体项目初始化代码
Houjie
5 天以前 d4e360f184369881bc14c8949de941e5b9f70bf6
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?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.andon.mapper.AndonButtonConfigMapper">
    <select id="getAndonButtonById" resultType="org.jeecg.modules.andon.entity.AndonButtonConfig">
        SELECT *
        FROM andon_button_config
        WHERE id = #{id}
          and del_flag = 0
          and button_status = '启用'
    </select>
    <select id="queryUserAndonButtonList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">
        select arc.id,
               abc.id as button_id,
               abc.button_name,
               abc.button_code,
               (select count(1)
                from andon_order ao
                where ao.button_id = arc.button_id
                  and ao.factory_id = arc.factory_id
                  and ao.order_status != '3') as blinking_flag, STUFF((SELECT ',' + CAST (ao.id AS VARCHAR)
            FROM andon_order ao
            WHERE ao.button_id = arc.button_id
            and ao.factory_id = arc.factory_id
            FOR XML PATH ('')), 1, 1, '') as order_ids
        from andon_response_config arc
            left join andon_button_config abc
        on arc.button_id = abc.id
        where arc.factory_id=#{factoryId};
    </select>
    <select id="queryUserAndonCallList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">
        select arc.id,
               abc.id          as buttonId,
               abc.button_name as buttonName,
               abc.button_code as buttonCode,
               (select count(1)
                from andon_order ao
                where ao.button_id = arc.button_id
                  and ao.factory_id = arc.factory_id
                  and ao.order_status = '1') as blinkingFlag,
               STUFF((SELECT ',' + CAST (ao.id AS VARCHAR)
                      FROM andon_order ao
                      WHERE ao.button_id = arc.button_id
                        and ao.factory_id = arc.factory_id
                        and ao.order_status = '1'
                   FOR XML PATH ('')), 1, 1, '') as orderIds,
               bf.factory_name as factoryName,
               parent_bf.factory_name as parentFactoryName,
               abc.upgrade_response_duration as upgradeResponseDuration,
               abc.second_upgrade_response_duration as secondUpgradeResponseDuration,
               arc.firster_responder as responder,
               arc.second_responder,
               arc.third_responder,
               STUFF((SELECT ',' + ao.order_status
                      FROM andon_order ao
                      WHERE ao.button_id = arc.button_id
                        and ao.factory_id = arc.factory_id
                        and ao.order_status = '1'
                   FOR XML PATH ('')), 1, 1, '') as orderStatus
        from andon_response_config arc
                 left join andon_button_config abc
                           on arc.button_id = abc.id
                 left join base_factory bf on arc.factory_id = bf.id
                 left join base_factory parent_bf on bf.parent_id = parent_bf.id
        where arc.factory_id=#{factoryId}
          and (select count (1)
               from andon_order ao
               where ao.button_id = arc.button_id
                 and ao.factory_id = arc.factory_id
                 and ao.order_status = '1') = 1
    </select>
<!--    <select id="queryUserAndonCallList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">-->
<!--        select arc.id,-->
<!--               abc.id          as buttonId,-->
<!--               abc.button_name as buttonName,-->
<!--               abc.button_code as buttonCode,-->
<!--               (select count(1)-->
<!--                from andon_order ao-->
<!--                where ao.button_id = arc.button_id-->
<!--                  and ao.factory_id = arc.factory_id-->
<!--                  and ao.order_status != '3') as blinkingFlag, STUFF((SELECT ',' + CAST (ao.id AS VARCHAR)-->
<!--            FROM andon_order ao-->
<!--            WHERE ao.button_id = arc.button_id-->
<!--            and ao.factory_id = arc.factory_id-->
<!--            FOR XML PATH ('')), 1, 1, '') as orderIds, bf.factory_name as factoryName, parent_bf.factory_name as parentFactoryName, abc.upgrade_response_duration as upgradeResponseDuration, abc.second_upgrade_response_duration as secondUpgradeResponseDuration, arc.firster_responder as responder, arc.second_responder, arc.third_responder, STUFF((SELECT ',' + ao.order_status-->
<!--            FROM andon_order ao-->
<!--            WHERE ao.button_id = arc.button_id-->
<!--            and ao.factory_id = arc.factory_id-->
<!--            and ao.order_status != '3'-->
<!--            FOR XML PATH ('')), 1, 1, '') as orderStatus-->
<!--        from andon_response_config arc-->
<!--            left join andon_button_config abc-->
<!--        on arc.button_id = abc.id-->
<!--            left join base_factory bf on arc.factory_id = bf.id-->
<!--            left join base_factory parent_bf on bf.parent_id = parent_bf.id-->
<!--        where arc.factory_id=#{factoryId}-->
<!--          and (select count (1)-->
<!--            from andon_order ao-->
<!--            where ao.button_id = arc.button_id-->
<!--          and ao.factory_id = arc.factory_id-->
<!--          and ao.order_status != '3') = 1-->
<!--    </select>-->
 
    <select id="queryUserAndonRespondList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">
        select arc.id,
               abc.id                               as buttonId,
               abc.button_name                      as buttonName,
               abc.button_code                      as buttonCode,
               (select count(1)
                from andon_order ao
                where ao.button_id = arc.button_id
                  and ao.factory_id = arc.factory_id
                  and ao.order_status = '2')        as blinkingFlag,
               STUFF((SELECT ',' + CAST(ao.id AS VARCHAR)
                      FROM andon_order ao
                      WHERE ao.button_id = arc.button_id
                        and ao.factory_id = arc.factory_id
                        and ao.order_status = '2'
                   FOR XML PATH ('')), 1, 1, '')    as orderIds,
               bf.factory_name                      as factoryName,
               parent_bf.factory_name               as parentFactoryName,
               abc.upgrade_response_duration        as upgradeResponseDuration,
               abc.second_upgrade_response_duration as secondUpgradeResponseDuration,
               arc.firster_responder                as responder,
               arc.second_responder,
               arc.third_responder,
               STUFF((SELECT ',' + ao.order_status
                      FROM andon_order ao
                      WHERE ao.button_id = arc.button_id
                        and ao.factory_id = arc.factory_id
                        and ao.order_status = '2'
                   FOR XML PATH ('')), 1, 1, '')    as orderStatus
        from andon_response_config arc
                 left join andon_button_config abc
                           on arc.button_id = abc.id
                 left join base_factory bf on arc.factory_id = bf.id
                 left join base_factory parent_bf on bf.parent_id = parent_bf.id
        where arc.factory_id = #{factoryId}
          and (select count(1)
               from andon_order ao
               where ao.button_id = arc.button_id
                 and ao.factory_id = arc.factory_id
                 and ao.order_status = '2') = 1
    </select>
</mapper>