java110
2023-05-29 787ebd75ede131c7aec9d808819efab70f3d9d4e
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
<?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="reportOthersStatisticsServiceDaoImpl">
 
    <!-- 场地预约数 -->
    <select id="venueReservationCount" parameterType="Map" resultType="Map">
        select count(1) count
        from community_space_person 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="contractCount" parameterType="Map" resultType="Map">
        select count(1) count
        from contract t
        where 1=1
        and t.state in ('11','22','44')
        and t.store_id =  #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 合同资产变更 -->
    <select id="contractChangeCount" parameterType="Map" resultType="Map">
        select count(1) count
        from contract_change_plan t
        where 1=1
        and t.plan_type = '3003'
        and t.state in ('11','22','55')
        and t.store_id =  #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 合同租期变更 -->
    <select id="leaseChangeCount" parameterType="Map" resultType="Map">
        select count(1) count
        from contract_change_plan t
        where 1=1
        and t.plan_type = '2002'
        and t.state in ('11','22','55')
        and t.store_id =  #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 主体变更 -->
    <select id="mainChange" parameterType="Map" resultType="Map">
        select count(1) count
        from contract_change_plan t
        where 1=1
        and t.plan_type = '1001'
        and t.state in ('11','22','55')
        and t.store_id =  #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.status_cd = '0'
    </select>
 
    <!-- 到期合同 -->
    <select id="expirationContract" parameterType="Map" resultType="Map">
        select count(1) count
        from contract t
        where 1=1
        and t.state in ('11','22','44')
        and t.store_id =  #{storeId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        and t.end_time &lt; now()
        and t.status_cd = '0'
    </select>
 
    <!-- 车辆数 -->
    <select id="carCount" parameterType="Map" resultType="Map">
        select count(1) count
        from owner_car t
        where 1=1
        and t.car_type in ('1001','1002')
        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="carApplyCount" parameterType="Map" resultType="Map">
        select count(1) count
        from parking_space_apply t
        where 1=1
        and t.state in ('1001','2002','3003')
        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="buyParkingCouponCount" parameterType="Map" resultType="Map">
        select IFNULL(sum(t.received_amount),0) amount
        from parking_coupon_order 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="writeOffParkingCouponCount" parameterType="Map" resultType="Map">
        select count(1) count
        from parking_coupon_car_order 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="sendCouponCount" parameterType="Map" resultType="Map">
        select ifnull(sum(t.send_count),0) count
        from coupon_property_pool_detail 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="writeOffCouponCount" parameterType="Map" resultType="Map">
        select count(1) count
        from coupon_property_user_detail 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="sendIntegralCount" parameterType="Map" resultType="Map">
        select ifnull(sum(t.quantity),0) count
        from integral_gift_detail 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="writeOffIntegralCount" parameterType="Map" resultType="Map">
        select ifnull(sum(t.use_quantity),0) count
        from integral_user_detail 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>
 
</mapper>