浏览代码

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents into dev

张延森 5 年前
父节点
当前提交
9f274ca5c2

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java 查看文件

852
             taBuildingQueryWrapper.ne("building_id", taBuilding.getBuildingId());
852
             taBuildingQueryWrapper.ne("building_id", taBuilding.getBuildingId());
853
         }
853
         }
854
         List<TaBuilding> taBuildings = taBuildingMapper.selectList(taBuildingQueryWrapper);
854
         List<TaBuilding> taBuildings = taBuildingMapper.selectList(taBuildingQueryWrapper);
855
-        if (taBuildings != null && taBuildings.size() > 10){
855
+        if (taBuildings != null && taBuildings.size() >= 10){
856
             return false;
856
             return false;
857
         }
857
         }
858
         return true;
858
         return true;

+ 1
- 1
src/main/resources/mapper/HelpActivityMapper.xml 查看文件

142
                     and t.building_id = #{buildingId}
142
                     and t.building_id = #{buildingId}
143
                 </if>
143
                 </if>
144
             )
144
             )
145
-            order by heavy
145
+            order by heavy desc
146
     </select>
146
     </select>
147
 
147
 
148
     <select id="helpActivityListEffectivePage" resultType="com.huiju.estateagents.entity.HelpActivity">
148
     <select id="helpActivityListEffectivePage" resultType="com.huiju.estateagents.entity.HelpActivity">

+ 50
- 36
src/main/resources/mapper/TaPersonVisitRecordMapper.xml 查看文件

180
 
180
 
181
     <select id="getConsultantShareInfoList" resultType="com.huiju.estateagents.entity.TaConsultantInfo">
181
     <select id="getConsultantShareInfoList" resultType="com.huiju.estateagents.entity.TaConsultantInfo">
182
         select * From (
182
         select * From (
183
-        select
184
-        t.target_id,
185
-        a.url as activity_img,
186
-        a.building_name as activity_name,
187
-        a.building_name,
188
-        a.address,
189
-        a.price,
190
-        t.event_type,
191
-		t.visit_time
192
-        from ta_person_visit_record t
193
-        left join (select b.url, a.building_name,a.address,a.price,a.building_id from ta_building a left join ta_building_img b on a.building_id = b.building_id where b.img_type = 'list') a on t.target_id = a.building_id
194
-        where t.event_type = 'building'
195
-        and t.consultant_id = #{userId}
196
-        and t.org_id = #{orgId}
197
-        and t.`event` = 'share'
198
-        group by t.target_id
183
+            select * from (
184
+                select
185
+                t.target_id,
186
+                a.url as activity_img,
187
+                a.building_name as activity_name,
188
+                a.building_name,
189
+                a.address,
190
+                a.price,
191
+                t.event_type,
192
+                t.visit_time
193
+                from ta_person_visit_record t
194
+                left join (select b.url, a.building_name,a.address,a.price,a.building_id from ta_building a left join ta_building_img b on a.building_id = b.building_id where b.img_type = 'list') a on t.target_id = a.building_id
195
+                where t.event_type = 'building'
196
+                and t.consultant_id = #{userId}
197
+                and t.org_id = #{orgId}
198
+                and t.`event` = 'share' order by t.visit_time desc
199
+            ) t
200
+            group by t.target_id
199
 
201
 
200
         union all
202
         union all
201
 
203
 
204
+        select * from (
202
         select
205
         select
203
         t.target_id,
206
         t.target_id,
204
         b.list_img_url as activity_img,
207
         b.list_img_url as activity_img,
213
         where t.event_type = 'activity'
216
         where t.event_type = 'activity'
214
         and t.consultant_id = #{userId}
217
         and t.consultant_id = #{userId}
215
         and t.org_id = #{orgId}
218
         and t.org_id = #{orgId}
216
-        and t.`event` = 'share'
219
+        and t.`event` = 'share' order by t.visit_time desc
220
+        ) t
217
         group by t.target_id
221
         group by t.target_id
218
 
222
 
219
         union all
223
         union all
220
 
224
 
225
+        select * from (
221
         select
226
         select
222
         t.target_id,
227
         t.target_id,
223
         c.list_img as activity_img,
228
         c.list_img as activity_img,
232
         where t.event_type = 'help'
237
         where t.event_type = 'help'
233
         and t.consultant_id = #{userId}
238
         and t.consultant_id = #{userId}
234
         and t.org_id = #{orgId}
239
         and t.org_id = #{orgId}
235
-        and t.`event` = 'share'
240
+        and t.`event` = 'share' order by t.visit_time desc
241
+        ) t
236
         group by t.target_id
242
         group by t.target_id
237
 
243
 
238
         union all
244
         union all
239
 
245
 
246
+        select * from (
240
         select
247
         select
241
         t.target_id,
248
         t.target_id,
242
         d.list_img as activity_img,
249
         d.list_img as activity_img,
252
         and t.consultant_id = #{userId}
259
         and t.consultant_id = #{userId}
253
         and t.org_id = #{orgId}
260
         and t.org_id = #{orgId}
254
         and t.`event` = 'share'
261
         and t.`event` = 'share'
255
-        group by t.target_id
262
+        group by t.target_id order by t.visit_time desc
263
+        ) t
256
 
264
 
257
         union all
265
         union all
258
 
266
 
267
+        select * from (
259
         select
268
         select
260
         t.target_id,
269
         t.target_id,
261
         e.news_img as activity_img,
270
         e.news_img as activity_img,
270
         where t.event_type = 'news'
279
         where t.event_type = 'news'
271
         and t.consultant_id = #{userId}
280
         and t.consultant_id = #{userId}
272
         and t.org_id = #{orgId}
281
         and t.org_id = #{orgId}
273
-        and t.`event` = 'share'
282
+        and t.`event` = 'share' order by t.visit_time desc
283
+        ) t
274
         group by t.target_id
284
         group by t.target_id
275
 
285
 
276
         union all
286
         union all
277
 
287
 
278
-        select
279
-        t.target_id,
280
-        f.share_img as activity_img,
281
-        f.`name` as activity_name,
282
-        '1' as price,
283
-        '2' as building_name,
284
-        '3' as address,
285
-        t.event_type,
286
-		t.visit_time
287
-        from ta_person_visit_record t
288
-        left join ta_drainage f on t.target_id = f.drainage_id
289
-        where t.event_type = 'h5'
290
-        and t.consultant_id = #{userId}
291
-        and t.org_id = #{orgId}
292
-        and t.`event` = 'share'
293
-        group by t.target_id ) t order by t.visit_time desc
288
+        select * from (
289
+            select
290
+            t.target_id,
291
+            f.share_img as activity_img,
292
+            f.`name` as activity_name,
293
+            '1' as price,
294
+            '2' as building_name,
295
+            '3' as address,
296
+            t.event_type,
297
+            t.visit_time
298
+            from ta_person_visit_record t
299
+            left join ta_drainage f on t.target_id = f.drainage_id
300
+            where t.event_type = 'h5'
301
+            and t.consultant_id = #{userId}
302
+            and t.org_id = #{orgId}
303
+            and t.`event` = 'share' order by t.visit_time desc
304
+            ) t
305
+            group by t.target_id
306
+        ) t
307
+        order by t.visit_time desc
294
     </select>
308
     </select>
295
 
309
 
296
     <select id="countShareNumByEventType" resultType="java.lang.Integer">
310
     <select id="countShareNumByEventType" resultType="java.lang.Integer">