mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
<?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.panzhihua.service_community.dao.ComActEasyPhotoDAO">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActEasyPhotoDO">
        <id column="id" property="id" />
        <result column="sponsor_id" property="sponsorId" />
        <result column="happen_addr" property="happenAddr" />
        <result column="addr_remark" property="addrRemark" />
        <result column="status" property="status" />
        <result column="handler_id" property="handlerId" />
        <result column="create_at" property="createAt" />
        <result column="examine_at" property="examineAt" />
        <result column="detail" property="detail" />
        <result column="photo_path_list" property="photoPathList" />
        <result column="handle_result" property="handleResult" />
        <result column="handle_photo_list" property="handlePhotoList" />
        <result column="community_id" property="communityId" />
        <result column="is_hide" property="isHide" />
        <result column="is_need_feed_back" property="isNeedFeedBack" />
        <result column="feedback_at" property="feedbackAt" />
        <result column="reject_reason" property="rejectReason" />
        <result column="del_tag" property="delTag" />
        <result column="is_report" property="isReport" />
        <result column="is_publicity" property="isPublicity" />
        <result column="handle_status" property="handleStatus" />
        <result column="lng_lat" property="lngLat" />
        <result column="activity_type" property="activityType" />
        <result column="activity_amount" property="activityAmount" />
        <result column="activity_id" property="activityId" />
        <result column="img_width" property="imgWidth" />
        <result column="img_height" property="imgHeight" />
        <result column="add_type" property="addType" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, sponsor_id, happen_addr, addr_remark, status, handler_id, create_at, examine_at, detail, photo_path_list
        , handle_result, handle_photo_list, community_id, is_hide, is_need_feed_back, feedback_at, reject_reason
        , del_tag, is_report, is_publicity, handle_status, lng_lat, activity_type, activity_amount, activity_id
        , img_width, img_height,add_type
    </sql>
 
    <select id="pageEasyPhotoAdmin" parameterType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO"
            resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO">
        SELECT
            p.id,
            u.`name` sponsor_name,
            u.phone phone,
            count( pu.id ) giveThumbsUpNum,
            u.image_url,
            p.happen_addr,
            su.`name` handler_name,
            p.`status`,
            p.`detail`,
            p.`is_need_feed_back`,
            p.`photo_path_list`,
            p.create_at,
            p.feedback_at,
            p.is_report,
            p.is_publicity,
            p.activity_type,
            p.activity_amount,
            p.activity_id,
            p.is_report_urban,
            p.is_report_dpc,
            p.classify_id,
            ca.`name` as classifyName,
            p.examine_at,
            c.name  communityName,
            p.urban_status,
            p.transfer_reason,
            p.add_type,
        p.handle_status
        FROM
            com_act_easy_photo p
            LEFT JOIN sys_user u ON p.sponsor_id = u.user_id
            LEFT JOIN com_act_easy_photo_user pu ON p.id = pu.easy_photo_id
            LEFT JOIN sys_user su ON p.handler_id = su.user_id
            left join com_act c on p.community_id =c.community_id
            left join com_act_easy_photo_classify ca on ca.id = p.classify_id
        WHERE
            p.del_tag = 0 and p.`status` != 3
        <if test='comActEasyPhotoVO.communityId != null and comActEasyPhotoVO.communityId != 0'>
          and p.community_id = ${comActEasyPhotoVO.communityId}
        </if>
        <if test='comActEasyPhotoVO.addType != null'>
            and p.add_type = #{comActEasyPhotoVO.addType}
        </if>
        <if test='comActEasyPhotoVO.status != null and comActEasyPhotoVO.status!=0' >
          AND p.`status` = #{comActEasyPhotoVO.status}
        </if>
        <if test='comActEasyPhotoVO.isPublicity != null' >
            AND p.`is_publicity` = #{comActEasyPhotoVO.isPublicity}
        </if>
        <if test='comActEasyPhotoVO.isReportUrban != null' >
            AND p.`is_report_urban` = #{comActEasyPhotoVO.isReportUrban}
        </if>
        <if test='comActEasyPhotoVO.isReportDpc != null' >
            AND p.`is_report_dpc` = #{comActEasyPhotoVO.isReportDpc}
        </if>
        <if test='comActEasyPhotoVO.classifyId != null' >
            AND p.`classify_id` = #{comActEasyPhotoVO.classifyId}
        </if>
        <if test='comActEasyPhotoVO.urbanStatus != null' >
            AND p.`urban_status` = #{comActEasyPhotoVO.urbanStatus}
        </if>
        <if test='comActEasyPhotoVO.createBegin != null  '>
        AND p.create_at BETWEEN #{comActEasyPhotoVO.createBegin}
        AND #{comActEasyPhotoVO.createEnd}
        </if>
        <if test='comActEasyPhotoVO.activityType != null'>
            AND p.activity_type =#{comActEasyPhotoVO.activityType}
        </if>
 
        <if test='comActEasyPhotoVO.keyWord != null and comActEasyPhotoVO.keyWord != &quot;&quot;'>
            AND (u.`name` like concat(#{comActEasyPhotoVO.keyWord},'%') or
            p.happen_addr like concat(#{comActEasyPhotoVO.keyWord},'%') or
            su.`name` like concat(#{comActEasyPhotoVO.keyWord},'%') or
            p.detail like concat(#{comActEasyPhotoVO.keyWord},'%') or u.phone like concat(#{comActEasyPhotoVO.keyWord},'%')
            )
        </if>
        GROUP BY
            p.id
        ORDER BY
            p.create_at DESC
 
    </select>
 
    <select id="getEasyPhotoStatistics" resultType="com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoStatisticsVO">
        SELECT
            count( id ) AS examineNum,
            ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 2 AND community_id = ${communityId} AND del_tag = 0 ) AS verificationNum,
            ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` in (1,2,4,5) AND `is_publicity` = 1 AND community_id = ${communityId} AND del_tag = 0 ) AS rejectNum,
            ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 5 AND community_id = ${communityId} AND del_tag = 0 ) AS completeNum,
            ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 4 AND community_id = ${communityId} AND del_tag = 0 ) AS commitAmount,
            (select count(id) from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0 and activity_type = 1) as yzAllTotal,
            (select count(id) from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0 and activity_type = 1 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as yzDayTotal,
            (select count(id) from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0 and activity_type = 2) as jlAllTotal,
            (select count(id) from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0 and activity_type = 2 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as jlDayTotal,
            (select count(id) from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0 and activity_type = 3) as ptAllTotal,
            (select count(id) from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0 and activity_type = 3 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as ptDayTotal,
            (select count(id) from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0 and activity_type = 4) as ybAllTotal,
            (select count(id) from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0 and activity_type = 4 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as ybDayTotal,
            (select IFNULL(sum(activity_amount),0) from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0) as allRewardAmount,
            (select IFNULL(sum(activity_amount),0)  from com_act_easy_photo where `status` in (2,4,5) AND community_id = ${communityId} and del_tag = 0 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as dayRewardAmount
        FROM
            com_act_easy_photo
        WHERE
            `status` = 1
            AND community_id = ${communityId}
            AND del_tag = 0
    </select>
 
    <select id="easyPhotoCount" resultType="com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoCountVO">
        select count(*) total,(select count(*) today from com_act_easy_photo where transfer_time BETWEEN DATE_FORMAT(CURDATE(),'%Y-%m-%d %H:%i:%s')  and DATE_ADD(CURRENT_DATE, INTERVAL 1 DAY)
       <if test="urbanStatus !=null">
        and urban_status=#{urbanStatus}
        </if>)
            today from com_act_easy_photo
        <where>
            1=1
            <if test="urbanStatus !=null">
                    and urban_status=#{urbanStatus}
            </if>
        </where>
    </select>
 
    <select id="export" resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO">
        SELECT
            p.id,
            u.`name` sponsor_name,
            u.phone phone,
            count( pu.id ) giveThumbsUpNum,
            u.image_url,
            p.happen_addr,
            su.`name` handler_name,
            p.`status`,
            p.`detail`,
            p.`is_need_feed_back`,
            p.`photo_path_list`,
            p.create_at,
            p.feedback_at,
            p.is_report,
            p.is_publicity,
            p.activity_type,
            p.activity_amount,
            p.activity_id,
            p.examine_at,
            c.name  communityName,
            p.is_report_urban,
            p.urban_status,
            p.add_type,
            ca.`name` as photoType
        FROM
            com_act_easy_photo p
                LEFT JOIN sys_user u ON p.sponsor_id = u.user_id
                LEFT JOIN com_act_easy_photo_user pu ON p.id = pu.easy_photo_id
                LEFT JOIN sys_user su ON p.handler_id = su.user_id
                left join com_act c on p.community_id =c.community_id
                left join com_act_easy_photo_classify ca on ca.id = p.classify_id
        WHERE
            p.del_tag = 0 and p.`is_report_urban` =1
        <if test='communityId != null and communityId != 0'>
            and p.community_id = ${communityId}
        </if>
        <if test='urbanStatus != null ' >
            AND p.`urban_status` = #{urbanStatus}
        </if>
        <if test='createBegin != null  '>
            AND p.create_at BETWEEN #{createBegin}
            AND #{createEnd}
        </if>
 
        <if test='keyWord != null and keyWord != &quot;&quot;'>
            AND (u.`name` like concat(#{keyWord},'%') or
            p.happen_addr like concat(#{keyWord},'%') or
            su.`name` like concat(#{keyWord},'%') or
            p.detail like concat(#{keyWord},'%') or u.phone like concat(#{comActEasyPhotoVO.keyWord},'%')
            )
        </if>
        GROUP BY
        p.id
        ORDER BY
        p.create_at DESC
    </select>
 
    <select id="exportByIds" resultType="com.panzhihua.common.model.vos.community.easyPhoto.ExportEasyPhotoVO">
        SELECT
        p.id,
        u.`name` sponsor_name,
        u.phone phone,
        count( pu.id ) giveThumbsUpNum,
        u.image_url,
        p.happen_addr,
        su.`name` handler_name,
        p.`status`,
        p.`detail`,
        p.`is_need_feed_back`,
        p.`photo_path_list`,
        p.create_at,
        p.feedback_at,
        p.is_report,
        p.is_publicity,
        p.activity_type,
        p.activity_amount,
        p.activity_id,
        p.examine_at,
        c.name  communityName,
        p.is_report_urban,
        p.is_report_dpc,
        p.urban_status,
        p.add_type,
        ca.`name` as photoType
        FROM
        com_act_easy_photo p
        LEFT JOIN sys_user u ON p.sponsor_id = u.user_id
        LEFT JOIN com_act_easy_photo_user pu ON p.id = pu.easy_photo_id
        LEFT JOIN sys_user su ON p.handler_id = su.user_id
        left join com_act c on p.community_id =c.community_id
        left join com_act_easy_photo_classify ca on ca.id = p.classify_id
        WHERE
        p.id in
        <foreach collection="list" item="ids" index="index"
                 open="(" close=")" separator=",">
        #{ids}
        </foreach>
        GROUP BY
        p.id
        ORDER BY
        p.create_at DESC
    </select>
 
    <select id="easyPhotoNoHandleIds" resultType="Long">
        select id from com_act_easy_photo where `status` = 1 and community_id = ${communityId} and del_tag = 0
    </select>
 
    <select id="banner" resultType="com.panzhihua.common.model.vos.community.easyPhoto.BannerVO">
        select id,cover,publish_at as show_time,1 as type,jump_url,jump_type  from com_act_dyn where status =1 and category !=10 and cover is not null and community_id = ${communityId}
        UNION ALL
        select id,cover,publish_at as show_time,2 as type,"" as   jump_url,"" as jump_type from com_act_activity  where status =3 and cover is not null and community_id = ${communityId}
        UNION ALL
        select id,cover,release_time as show_time,3 as type,"" as   jump_url,"" as jump_type from com_pb_activity  where status =3 and cover is not null and community_id = ${communityId}
        UNION ALL
        select id,"" as cover,publish_time as show_time,4 as type,"" as   jump_url,"" as jump_type from com_act_questnaire  where state =2   and community_id = ${communityId}
        UNION ALL
        select id,cover,publish_at as show_time,5 as type,jump_url,jump_type from com_pb_dyn  where status =2 and cover is not null and community_id = ${communityId}
        UNION ALL
        select id,img_url as cover,publish_time as show_time,6 as type,"" as   jump_url,"" as jump_type from com_act_reserve  where status =2 and community_id = ${communityId}
        UNION ALL
        select id,logo as cover,release_at as show_time,7 as type,"" as   jump_url,"" as jump_type from com_act_easy_photo_activity  where status =2  and community_id = ${communityId}
        order by show_time desc limit 30
    </select>
    <select id="selectStatisticsList" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO">
        SELECT t1.`name` AS filed, COUNT(t2.id) AS num
        FROM com_act_easy_photo_classify t1
        LEFT JOIN (SELECT * FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0) t2 ON t1.id = t2.classify_id
        WHERE t1.`status` = 1 GROUP BY filed
    </select>
    <select id="selectResidentAutonomyStatistics"
            resultType="com.panzhihua.common.model.vos.community.bigscreen.ResidentAutonomyStatisticsVO">
        SELECT * FROM
        (SELECT COUNT(id) AS easyPhotoCurrentMonCount FROM com_act_easy_photo WHERE community_id = ${communityId} AND del_tag = 0 AND DATE_FORMAT( create_at, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) t1,
        (SELECT COUNT(id) AS microWishCurrentMonCount FROM com_act_micro_wish WHERE community_id = ${communityId} AND DATE_FORMAT( create_at, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) t2,
        (SELECT IF(SUM(aim_num) IS NULL,0,SUM(aim_num)) AS aimNum FROM com_act_micro_wish WHERE community_id = ${communityId} AND `status` != 4) t3,
        (SELECT COUNT(id) AS microWishTotal FROM com_act_micro_wish WHERE community_id = ${communityId} AND `status` != 4) t4,
        (SELECT COUNT(id) AS committeeCurrentMonCount FROM com_act_committee WHERE community_id = ${communityId} AND DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) t5,
        (SELECT COUNT(id) AS committeeTotal FROM com_act_committee WHERE community_id = ${communityId}) t6,
        (SELECT ROUND( a.num / b.total * 100, 2 ) AS areaCoverPercent FROM
            (SELECT COUNT(DISTINCT(area_id)) AS num FROM com_act_committee WHERE community_id = ${communityId}) a,
            (SELECT COUNT(village_id) AS total FROM com_mng_village WHERE community_id = ${communityId}) b
        ) t7,
        (SELECT COUNT(id) AS discussCurrentMonCount FROM com_act_discuss WHERE community_id = ${communityId} AND is_del = 2 AND DATE_FORMAT( create_at, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) t8,
        (SELECT COUNT(id) AS discussTotal FROM com_act_discuss WHERE community_id = ${communityId} AND is_del = 2) t9,
        (SELECT COUNT(id) AS neighborCurrentMonCount FROM com_act_neighbor_circle WHERE community_id = ${communityId} AND is_del = 2 AND DATE_FORMAT( create_at, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) t10,
        (SELECT COUNT(id) AS neighborTotal, SUM(fabulous_num) AS neighborFabulousNum, SUM(forward_num) AS neighborForwardNum,
            SUM(comment_num) AS neighborCommentNum FROM com_act_neighbor_circle WHERE community_id = ${communityId} AND is_del = 2) t11,
        (SELECT COUNT(c1.id) AS repairCurrentMonCount FROM com_property_repair c1
            LEFT JOIN com_property c2 ON c1.property_id = c2.id
            WHERE c2.community_id = ${communityId} AND DATE_FORMAT( c1.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) t12,
        (SELECT COUNT(c1.id) AS repairTotal FROM com_property_repair c1
            LEFT JOIN com_property c2 ON c1.property_id = c2.id
            WHERE c2.community_id = ${communityId}) t13,
        (SELECT IF(SUM(quantity) IS NULL,0,SUM(quantity)) AS warehouseCurrentMonCount FROM com_act_warehouse_donates WHERE community_id = ${communityId} AND `status` = 2 AND DATE_FORMAT( signing_at, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) t14,
        (SELECT warehouseTotal, warehouseSurplusTotal, warehouseTotal - warehouseSurplusTotal AS warehouseApplyTotal FROM
            (SELECT IF(SUM(quantity) IS NULL,0,SUM(quantity)) AS warehouseTotal, IF(SUM(surplus_quantity) IS NULL,0,SUM(surplus_quantity)) AS warehouseSurplusTotal FROM com_act_warehouse_donates WHERE community_id = ${communityId} AND `status` = 2) temp) t15,
        (SELECT COUNT(DISTINCT d2.user_id) AS discussCount FROM com_act_discuss d1
            INNER JOIN com_act_discuss_comment d2 ON d1.id = d2.discuss_id
            WHERE d1.community_id = ${communityId} AND d1.is_del = 2 AND `type` = 1) t16,
        (SELECT COUNT(DISTINCT d2.user_id) AS voteCount FROM com_act_discuss d1
            INNER JOIN com_act_discuss_option_user d2 ON d1.id = d2.discuss_id
            WHERE d1.community_id = ${communityId} AND d1.is_del = 2 AND `type` = 2) t17,
        (SELECT COUNT(id) AS residentActCurrentMonCount
            FROM com_act_activity
            WHERE community_id = ${communityId} AND volunteer_max = 0 AND DATE_FORMAT( publish_at, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) t18
    </select>
    <select id="selectGridsGovernance"
            resultType="com.panzhihua.common.model.vos.community.bigscreen.GridsGovernanceStatisticsVO">
        SELECT
        IFNULL((SELECT  count( e.id ) FROM   `event` AS e
        LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
        WHERE   e.event_category = 1   AND e.event_type = 5   AND e.event_status = 2    AND egd.grid_community_id = ${communityId}), 0) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 7), 0) AS eventTFTotal,
 
        IFNULL((   SELECT  count( e1.id )   FROM   `event` AS e1
        LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id     WHERE    event_category = 1     AND event_type = 1     AND event_status = 2      AND egd1.grid_community_id = ${communityId}     ),   0   ) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 4), 0) AS eventZATotal,
 
        IFNULL((   SELECT    count( e2.id )    FROM    `event` AS e2     LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id    WHERE    event_category = 1      AND event_type = 3     AND event_status = 2     AND egd2.grid_community_id = ${communityId}      ),   0   ) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 5), 0) AS eventMDTotal,
 
        IFNULL((   SELECT    count( e3.id )    FROM     `event` AS e3    LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id    WHERE     event_category = 1     AND event_type = 6     AND event_status = 2      AND egd3.grid_community_id = ${communityId}     ),   0   ) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 3), 0) AS eventTSTotal,
 
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 8), 0) AS eventFJTotal,
 
        IFNULL((   SELECT    count( e5.id )    FROM     `event` AS e5    LEFT JOIN event_grid_data AS egd5 ON egd5.id = e5.grid_id    WHERE     event_category = 1     AND event_type = 2     AND event_status = 2      AND egd5.grid_community_id = ${communityId}     ),   0   ) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 6), 0) AS eventMSTotal,
 
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 1), 0) AS otherTotal,
 
        IFNULL((SELECT  count( e.id ) FROM   `event` AS e
        LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
        WHERE   e.event_category = 1   AND e.event_type = 5   AND e.event_deal_status = 4    AND egd.grid_community_id = ${communityId}), 0) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 7), 0) AS eventTFDeal,
 
        IFNULL((   SELECT  count( e1.id )   FROM   `event` AS e1
        LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id     WHERE    event_category = 1     AND event_type = 1     AND event_deal_status = 4      AND egd1.grid_community_id = ${communityId}     ),   0   ) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 4), 0) AS eventZADeal,
 
        IFNULL((   SELECT    count( e2.id )    FROM    `event` AS e2     LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id    WHERE    event_category = 1      AND event_type = 3     AND event_deal_status = 4     AND egd2.grid_community_id = ${communityId}      ),   0   ) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 5), 0) AS eventMDDeal,
 
        IFNULL((   SELECT    count( e3.id )    FROM     `event` AS e3    LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id    WHERE     event_category = 1     AND event_type = 6     AND event_deal_status = 4      AND egd3.grid_community_id = ${communityId}     ),   0   ) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 3), 0) AS eventTSDeal,
 
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 8), 0) AS eventFJDeal,
 
        IFNULL((   SELECT    count( e5.id )    FROM     `event` AS e5    LEFT JOIN event_grid_data AS egd5 ON egd5.id = e5.grid_id    WHERE     event_category = 1     AND event_type = 2     AND event_deal_status = 4      AND egd5.grid_community_id = ${communityId}     ),   0   ) +
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 6), 0) AS eventMSDeal,
 
        IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 1), 0) AS otherDeal,
        IFNULL((SELECT  count(id) FROM  event_grid_data WHERE  grid_community_id = ${communityId}), 0) AS gridTotal,
        IFNULL((select count(egmr.id) from event_grid_member_relation as egmr left join event_grid_data as egd1 on egd1.id = egmr.grid_id where egd1.grid_community_id = ${communityId}), 0) AS gridMemberTotal
    </select>
    <select id="selectIndexEasyPhotoBaseData"
            resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenEasyPhotoStatisticsInfo">
        SELECT
        (SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id IN (1552663338578743296,1552663345243492353,1552663345524510720,1552663345570648064,1552663345683894273,1552663345751003136,1552663345885220866)) AS eventDealTotal,
        (SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 1552663345751003136) AS eventTFDeal,
        (SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 1552663345524510720) AS eventZADeal,
        (SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 1552663345570648064) AS eventMDDeal,
        (SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 1552663345243492353) AS eventTSDeal,
        (SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 1552663345683894273) AS eventMSDeal,
        (SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 1552663345885220866) AS eventFJDeal,
        (SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN(4,5) AND del_tag = 0 AND classify_id = 1552663338578743296) AS otherDeal
    </select>
    <select id="getEasyPhotoAddPolylineData"
            resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO">
        SELECT filed, SUM(num) AS num FROM (
        SELECT DATE_FORMAT( create_at, '%Y-%m' ) AS filed, COUNT(id) AS num
        FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND del_tag = 0
        AND DATE_FORMAT( create_at, '%Y-%m' ) &gt; DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed
        UNION ALL SELECT * FROM
            (
                SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num
            ) temT
        ) temp GROUP BY filed ORDER BY filed ASC
    </select>
    <select id="getEasyPhotoTotalPolylineDate"
            resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO">
        SELECT COUNT(id) AS num FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND del_tag = 0
        AND DATE_FORMAT( create_at, '%Y-%m' ) &lt;= #{date}
    </select>
    <select id="indexEasyPhotoList" resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO">
        SELECT t1.id, t1.detail, t1.photo_path_list, t1.`status`, t2.`name` AS classifyName
        FROM com_act_easy_photo t1
        LEFT JOIN com_act_easy_photo_classify t2 ON t1.classify_id = t2.id
        WHERE t1.community_id = ${pageBaseDTO.communityId} AND t1.`status` IN(4,5) AND t1.del_tag = 0
        <if test="pageBaseDTO.paramId != null">
            AND t1.classify_id = #{pageBaseDTO.paramId}
        </if>
        ORDER BY t1.id DESC
    </select>
 
    <select id="selectBigscreenGridsGovern" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigscreenGridsGovernanceStatisticsVO">
        SELECT
                IFNULL((SELECT  count( e.id ) FROM   `event` AS e
                                                         LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
                        WHERE   e.event_category = 1   AND e.event_type = 5   AND e.event_status = 2    AND egd.grid_community_id = ${communityId}), 0) +
                IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
                        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 7), 0) AS eventTFTotal,
 
                IFNULL((   SELECT  count( e1.id )   FROM   `event` AS e1
                                                               LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id     WHERE    event_category = 1     AND event_type = 1     AND event_status = 2      AND egd1.grid_community_id = ${communityId}     ),   0   ) +
                IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
                        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 4), 0) AS eventZATotal,
 
                IFNULL((   SELECT    count( e2.id )    FROM    `event` AS e2     LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id    WHERE    event_category = 1      AND event_type = 3     AND event_status = 2     AND egd2.grid_community_id = ${communityId}      ),   0   ) +
                IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
                        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 5), 0) AS eventMDTotal,
 
                IFNULL((   SELECT    count( e3.id )    FROM     `event` AS e3    LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id    WHERE     event_category = 1     AND event_type = 6     AND event_status = 2      AND egd3.grid_community_id = ${communityId}     ),   0   ) +
                IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
                        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 3), 0) AS eventTSTotal,
 
                IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
                        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 8), 0) AS eventFJTotal,
 
                IFNULL((   SELECT    count( e5.id )    FROM     `event` AS e5    LEFT JOIN event_grid_data AS egd5 ON egd5.id = e5.grid_id    WHERE     event_category = 1     AND event_type = 2     AND event_status = 2      AND egd5.grid_community_id = ${communityId}     ),   0   ) +
                IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
                        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 6), 0) AS eventMSTotal,
 
                IFNULL((   SELECT    count( e5.id )    FROM     `event` AS e5    LEFT JOIN event_grid_data AS egd5 ON egd5.id = e5.grid_id    WHERE     event_category = 1     AND event_type = 8     AND event_status = 2      AND egd5.grid_community_id = ${communityId}     ),   0   ) +
                IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
                        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 2), 0) AS eventFGTotal,
 
                IFNULL((SELECT COUNT(1) FROM com_act_easy_photo
                        WHERE community_id = ${communityId} AND `status` IN (1,2,4,5) AND del_tag = 0 AND classify_id = 1), 0) AS otherTotal,
                IFNULL((SELECT  count( e.id ) FROM   `event` AS e
                                                         LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
                        WHERE   e.event_category = 1     AND e.event_status = 2    AND egd.grid_community_id = ${communityId}), 0) AS eventTotal,
 
                IFNULL((SELECT  count(id) FROM  com_sw_patrol_record WHERE  community_id = ${communityId}), 0) AS safety
    </select>
    <select id="getPartyBuildIngRecord"
            resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO">
        SELECT t1.id, t1.create_at, t2.`name` AS classifyName, t3.nick_name AS userNickName, t4.score
        FROM com_act_easy_photo t1
        LEFT JOIN com_act_easy_photo_classify t2 ON t1.classify_id = t2.id
        LEFT JOIN sys_user t3 ON t1.sponsor_id = t3.user_id
        LEFT JOIN (SELECT * FROM com_act_easy_photo_evaluate WHERE service_type = 1) t4 ON t1.id = t4.service_id
        WHERE t1.community_id = #{communityId} AND t1.`status` = 5 AND t1.del_tag = 0 LIMIT #{pageSize}
    </select>
    <select id="pageEasyPhotoApplets" resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO">
        SELECT
        p.id,
        u.`name` sponsor_name,
        u.`nick_name` userNickName,
        u.phone sponsor_phone,
        (SELECT  count(pu.id) FROM com_act_easy_photo_user pu WHERE pu.easy_photo_id = p.id) giveThumbsUpNum,
        (SELECT  count(c.id) FROM com_act_easy_photo_comment c WHERE c.easy_photo_id =p.id) commentNum,
        u.image_url,
        p.happen_addr,
        p.addr_remark,
        su.`name` handler_name,
        p.`status`,
        p.`is_hide`,
        p.`detail`,
        p.`is_need_feed_back`,
        p.`photo_path_list`,
        p.create_at,
        p.feedback_at,
        p.activity_type,
        p.activity_amount,
        p.classify_id,
        p.community_id,
        ca.name as communityName,
        class.`name` AS classifyName,
        p.img_width,
        p.img_height,
        p.examine_at,
        p.add_type,
        f.id AS fid,
        p.handle_status
        FROM
        com_act_easy_photo p
        JOIN sys_user u ON p.sponsor_id = u.user_id
        LEFT JOIN sys_user su ON p.handler_id = su.user_id
        LEFT JOIN com_act ca ON ca.community_id=p.community_id
        LEFT JOIN com_act_easy_photo_classify class ON p.classify_id = class.id
        LEFT JOIN (SELECT * FROM com_act_easy_photo_feedback WHERE `type` = 2) f ON p.id = f.easy_id
        <where> p.del_tag = 0
            <if test = 'comActEasyPhotoVO.communityId != null and comActEasyPhotoVO.communityId != 0' >
                AND p.community_id = ${comActEasyPhotoVO.communityId}
            </if>
            <if test="comActEasyPhotoVO.addType != null and comActEasyPhotoVO.addType != ''">
                AND p.add_type=${comActEasyPhotoVO.addType}
            </if>
            <if test = 'comActEasyPhotoVO.status != null and comActEasyPhotoVO.status!=0' >
                AND p.`status` = #{comActEasyPhotoVO.status}
            </if>
            <if test='comActEasyPhotoVO.sponsorId != null and comActEasyPhotoVO.sponsorId != 0'>
                AND p.sponsor_id = #{comActEasyPhotoVO.sponsorId}
            </if>
            <if test='comActEasyPhotoVO.sponsorId == null or comActEasyPhotoVO.sponsorId==0'>
                AND p.`status` in (2,4,5)
                <if test="comActEasyPhotoVO.isFeedBackForDpc == null or comActEasyPhotoVO.isDpcMember == 0">
                    AND p.is_publicity = 1
                </if>
            </if>
            <if test='comActEasyPhotoVO.isReportDpc != null' >
                AND p.`is_report_dpc` = #{comActEasyPhotoVO.isReportDpc}
            </if>
            <if test='comActEasyPhotoVO.keyWord != null and comActEasyPhotoVO.keyWord != &quot;&quot;'>
                AND (class.`name` like concat(#{comActEasyPhotoVO.keyWord},'%') or p.detail like concat(#{comActEasyPhotoVO.keyWord},'%'))
            </if>
            <if test='comActEasyPhotoVO.classifyId != null and comActEasyPhotoVO.classifyId != &quot;&quot;'>
                AND p.classify_id =#{comActEasyPhotoVO.classifyId}
            </if>
        </where>
        group by p.id
        <if test="comActEasyPhotoVO.isFeedBackForDpc != null">
            HAVING
            <if test="comActEasyPhotoVO.isFeedBackForDpc == 1">
                fid IS NULL
            </if>
            <if test="comActEasyPhotoVO.isFeedBackForDpc == 2">
                fid IS NOT NULL
            </if>
        </if>
        order by p.create_at desc
    </select>
    <select id="getEasyPhotoAddPolylineDataForDpc"
            resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO">
        SELECT filed, SUM(num) AS num FROM (
        SELECT DATE_FORMAT( create_at, '%Y-%m' ) AS filed, COUNT(id) AS num
        FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND del_tag = 0 AND is_report_dpc = 1
        AND DATE_FORMAT( create_at, '%Y-%m' ) &gt; DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed
        UNION ALL SELECT * FROM
            (
                SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union
                SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num
            ) temT
        ) temp GROUP BY filed ORDER BY filed ASC
    </select>
    <select id="getEasyPhotoTotalPolylineDateForDpc"
            resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO">
        SELECT COUNT(id) AS num FROM com_act_easy_photo
        WHERE community_id = ${communityId} AND del_tag = 0 AND is_report_dpc = 1
        AND DATE_FORMAT( create_at, '%Y-%m' ) &lt;= #{date}
    </select>
    <select id="dpcEasyPhotoList" resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO">
        SELECT t1.id, t1.detail, t1.photo_path_list, t1.`status`, t2.`name` AS classifyName
        FROM com_act_easy_photo t1
        LEFT JOIN com_act_easy_photo_classify t2 ON t1.classify_id = t2.id
        WHERE t1.community_id = ${pageBaseDTO.communityId} AND t1.`status` IN(4,5) AND t1.del_tag = 0 AND t1.is_report_dpc = 1
        <if test="pageBaseDTO.paramId != null">
            AND t1.classify_id = #{pageBaseDTO.paramId}
        </if>
        ORDER BY t1.id DESC
    </select>
    <select id="selectDpcBaseData"
            resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenDpcStatisticsInfo">
        SELECT
        (select count(id) from com_act_dpc where community_id = ${communityId} AND is_del = 0) AS dpcNum
    </select>
    <select id="getBanner" resultType="com.panzhihua.common.model.vos.community.easyPhoto.BannerVO">
        select id,type,cover,jump_url,jump_type,image_url from com_act_dyn where type=1 AND on_top=1
    </select>
 
    <select id="selectPhotoAll" resultType="com.panzhihua.common.model.vos.community.StatisticsPhotoVO">
        SELECT count(1) count_num,(case `status` when 1 THEN '待处理' WHEN 2 THEN '进行中' WHEN 3 THEN '已驳回' WHEN 4 THEN '待评价' WHEN 5 THEN '已完成' ELSE '其他' END) count_name
         FROM `com_act_easy_photo` where del_tag = 0  GROUP BY `status`
    </select>
    <select id="selectPhotoByMonth" resultType="com.panzhihua.common.model.vos.community.StatisticsPhotoVO">
        SELECT count(1) count_num,(case `status` when 1 THEN '待处理' WHEN 2 THEN '进行中' WHEN 3 THEN '已驳回' WHEN 4 THEN '待评价' WHEN 5 THEN '已完成' ELSE '其他' END) count_name,date_format(create_at,'%Y-%m') as statistics_date
        FROM `com_act_easy_photo` WHERE date_format(create_at,'%Y-%m') >= date_format(date_sub(now(), INTERVAL 9 MONTH),'%Y-%m') and del_tag = 0 GROUP BY  statistics_date, `status`
    </select>
 
 
 
    <!--  浪潮专用接口  -->
    <select id="pageEasyPhotoAdminLC" resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO">
        SELECT
        p.id,
        u.`name` sponsor_name,
        u.phone phone,
        count( pu.id ) giveThumbsUpNum,
        u.image_url,
        p.happen_addr,
        su.`name` handler_name,
        p.`status`,
        p.`detail`,
        p.`is_need_feed_back`,
        p.`photo_path_list`,
        p.create_at,
        p.feedback_at,
        p.is_report,
        p.is_publicity,
        p.activity_type,
        p.activity_amount,
        p.activity_id,
        p.is_report_urban,
        p.is_report_dpc,
        p.classify_id,
        ca.`name` as classifyName,
        p.examine_at,
        c.name  communityName,
        p.urban_status,
        p.transfer_reason,
        p.add_type,
        p.handle_status
        FROM
        com_act_easy_photo p
        LEFT JOIN sys_user u ON p.sponsor_id = u.user_id
        LEFT JOIN com_act_easy_photo_user pu ON p.id = pu.easy_photo_id
        LEFT JOIN sys_user su ON p.handler_id = su.user_id
        left join com_act c on p.community_id =c.community_id
        left join com_act_easy_photo_classify ca on ca.id = p.classify_id
        WHERE
        p.del_tag = 0
        and p.add_type = 1
        AND p.`status` = 5
        GROUP BY
        p.id
        ORDER BY
        p.create_at DESC
 
    </select>
 
 
 
 
 
 
 
 
</mapper>