java110
2023-05-29 8c35f89b35488a27739024febbaf1bd55cc275a8
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?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="reportInoutStatisticsServiceDaoImpl">
 
    <!-- 进场车辆数 -->
    <select id="getCarInCount" parameterType="Map" resultType="Map">
        select count(1) count
        from car_inout_detail t
        where 1=1
        and t.car_inout = '3306'
        and t.community_id = #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 出场车辆数 -->
    <select id="getCarOutCount" parameterType="Map" resultType="Map">
        select count(1) count
        from car_inout_detail t
        where 1=1
        and t.car_inout = '3307'
        and t.community_id = #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 人员进场数 -->
    <select id="getPersonInCount" parameterType="Map" resultType="Map">
        select count(1) count
        from machine_record t
        where 1=1
        and t.community_id = #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 同步人脸数 -->
    <select id="getPersonFaceToMachineCount" parameterType="Map" resultType="Map">
        select count(1) count
        from machine_translate t
        where 1=1
        and t.type_cd = '8899'
        and t.community_id = #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 入库数 -->
    <select id="purchaseInCount" parameterType="Map" resultType="Map">
        select IFNULL(sum(t.quantity),0) count from purchase_apply_detail t
        inner join purchase_apply pa on t.apply_order_id = pa.apply_order_id and pa.res_order_type = '10000' and pa.status_cd = '0' and pa.state  in ('1003','1002')
        where 1=1
        and pa.store_id = #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 出库数 -->
    <select id="purchaseOutCount" parameterType="Map" resultType="Map">
        select IFNULL(sum(t.quantity),0) count from purchase_apply_detail t
        inner join purchase_apply pa on t.apply_order_id = pa.apply_order_id and pa.res_order_type = '20000' and pa.status_cd = '0' and pa.state  in ('1003','1002')
        where 1=1
        and pa.store_id = #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 入库金额 -->
    <select id="purchaseInAmount" parameterType="Map" resultType="Map">
        select IFNULL(sum(t.quantity*t.price),0) amount from purchase_apply_detail t
        inner join purchase_apply pa on t.apply_order_id = pa.apply_order_id and pa.res_order_type = '10000' and pa.status_cd = '0' and pa.state  in ('1003','1002')
        where 1=1
        and pa.store_id = #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 出库金额 -->
    <select id="purchaseOutAmount" parameterType="Map" resultType="Map">
        select IFNULL(sum(t.quantity*t.price),0) amount from purchase_apply_detail t
        inner join purchase_apply pa on t.apply_order_id = pa.apply_order_id and pa.res_order_type = '20000' and pa.status_cd = '0' and pa.state  in ('1003','1002')
        where 1=1
        and pa.store_id = #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 调拨数 -->
    <select id="allocationCount" parameterType="Map" resultType="Map">
        select IFNULL(sum(t.apply_count),0) count
        from allocation_storehouse_apply t
        where 1=1
        and t.community_id = #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
 
    <!-- 装修申请 -->
    <select id="roomRenovationCount" parameterType="Map" resultType="Map">
        select count(1) count
        from room_renovation t
        where 1=1
        and t.community_id = #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 物品放行 -->
    <select id="itemReleaseCount" parameterType="Map" resultType="Map">
        select count(1) count
        from item_release t
        where 1=1
        and t.community_id = #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
        and t.state in ('W','D','C')
    </select>
 
    <!-- 交房数 -->
    <select id="roomInCount" parameterType="Map" resultType="Map">
        select count(1) count
        from building_owner_room_rel t
        inner join building_room br on t.room_id = br.room_id and br.status_cd = '0'
        inner join building_owner bo on t.owner_id = bo.owner_id and bo.status_cd = '0'
        where 1=1
        and br.community_id =  #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 退房数 -->
    <select id="roomOutCount" parameterType="Map" resultType="Map">
        select count(1) count
        from building_owner_room_rel t
        inner join building_room br on t.room_id = br.room_id and br.status_cd = '0'
        inner join building_owner bo on t.owner_id = bo.owner_id
        where 1=1
        and br.community_id =  #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '1'
    </select>
 
    <!-- 业主绑定数 -->
    <select id="ownerRegisterCount" parameterType="Map" resultType="Map">
        select count(1) count
        from owner_app_user t
        where 1=1
        and t.community_id = #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 未考勤人员 -->
    <select id="noAttendanceCount" parameterType="Map" resultType="Map">
        select count(1) count
        from attendance_classes_task t
        inner join attendance_classes ac on t.class_id = ac.classes_id and ac.status_cd = '0'
        where 1=1
        and t.state =  '10000'
        and t.store_id = #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
</mapper>