|
@@ -8,4 +8,24 @@
|
|
|
from iden_warning_sta group by type
|
|
|
</select>
|
|
|
|
|
|
+ <insert id="insertWarningPersonRateSta">
|
|
|
+ insert into iden_warning_sta(data_date,community_id,type,community_code,community_name,district,subdistrict,total)
|
|
|
+ select t.data_date dataDate,
|
|
|
+ t.community_id communityId,
|
|
|
+ t.type,
|
|
|
+ max(t.community_code) communityCode,
|
|
|
+ max(t.community_name) communityName,
|
|
|
+ max(t.district) district,
|
|
|
+ max(t.subdistrict) subdistrict,
|
|
|
+ count(1) total
|
|
|
+ from iden_warning_person t
|
|
|
+ where t.data_date = DATE_SUB(curdate(),INTERVAL -1 DAY)
|
|
|
+ group by t.data_date,t.community_id,t.type
|
|
|
+ on duplicate key update
|
|
|
+ community_code=values(community_code),
|
|
|
+ community_name=values(community_name),
|
|
|
+ district=values(district),
|
|
|
+ subdistrict=values(subdistrict),
|
|
|
+ total=values(total)
|
|
|
+ </insert>
|
|
|
</mapper>
|