Przeglądaj źródła

修改助力成功数

dingxin 5 lat temu
rodzic
commit
b83b96be26

+ 5
- 0
src/main/java/com/huiju/estateagents/entity/HelpActivity.java Wyświetl plik

@@ -120,4 +120,9 @@ public class HelpActivity implements Serializable {
120 120
     @TableField(exist = false)
121 121
     private String helpStatus;
122 122
 
123
+    /**
124
+     * 发起成功的总数
125
+     */
126
+    @TableField(exist = false)
127
+    private String succeedCount;
123 128
 }

+ 16
- 9
src/main/resources/mapper/HelpActivityMapper.xml Wyświetl plik

@@ -2,29 +2,36 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.huiju.estateagents.mapper.HelpActivityMapper">
4 4
     <select id="helpActivityListPage" resultType="com.huiju.estateagents.entity.HelpActivity">
5
-        select * from ta_help_activity
5
+        SELECT
6
+        COUNT(hir.verification) as succeedCount,
7
+        ha.*
8
+        FROM
9
+        ta_help_activity ha
10
+        LEFT JOIN ta_help_initiate_record hir ON ha.help_activity_id = hir.help_activity_id
11
+        AND (hir.verification is NULL or hir.verification != '')
6 12
         <where>
7 13
         <if test="cityId != null and cityId != ''">
8
-            and city_id = #{cityId}
14
+            and ha.city_id = #{cityId}
9 15
         </if>
10 16
         <if test="buildingId != null and buildingId != ''">
11
-            and building_id = #{buildingId}
17
+            and ha.building_id = #{buildingId}
12 18
         </if>
13 19
         <if test="title != null and title != ''">
14
-            and title like CONCAT('%',#{title}, '%')
20
+            and ha.title like CONCAT('%',#{title}, '%')
15 21
         </if>
16 22
         <if test="startDate != null and startDate != ''and startDate!='Invalid date'">
17
-         and date_format(start_date,'%Y-%m-%d') = date_format( #{startDate}, '%Y-%m-%d' )
23
+         and date_format(ha.start_date,'%Y-%m-%d') = date_format( #{startDate}, '%Y-%m-%d' )
18 24
         </if>
19 25
         <if test="endDate != null and endDate != ''and endDate!='Invalid date'">
20
-            and date_format(end_date,'%Y-%m-%d') = date_format( #{endDate}, '%Y-%m-%d' )
26
+            and date_format(ha.end_date,'%Y-%m-%d') = date_format( #{endDate}, '%Y-%m-%d' )
21 27
         </if>
22 28
         <if test="activityStatus != null and activityStatus != null">
23
-            and activity_status = #{activityStatus}
29
+            and ha.activity_status = #{activityStatus}
24 30
         </if>
25
-            and org_id=#{orgId}
31
+            and ha.org_id=#{orgId}
26 32
         </where>
27
-        order by activity_status = 0 desc,activity_status = 1 desc,activity_status = 2 desc,start_date desc
33
+        GROUP BY ha.help_activity_id
34
+        order by ha.activity_status = 0 desc,ha.activity_status = 1 desc,ha.activity_status = 2 desc,ha.start_date desc
28 35
     </select>
29 36
 
30 37
     <update id="updateUnStartHelpActivity">