Преглед на файлове

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/com/huiju/estateagents/mapper/TaLiveActivityMapper.java
#	src/main/resources/mapper/TaLiveActivityMapper.xml
顾绍勇 преди 5 години
родител
ревизия
1e788fdbb6

+ 5
- 5
src/main/java/com/huiju/estateagents/controller/TaLiveActivityController.java Целия файл

@@ -45,14 +45,14 @@ public class TaLiveActivityController extends BaseController {
45 45
     @RequestMapping(value = "/admin/taLiveActivity", method = RequestMethod.GET)
46 46
     public ResponseBean taLiveActivityList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
47 47
                                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
48
-                                           String liveActivityTitle, String cityId, String buildingId,
49
-                                           String liveDetailType, Integer status,
48
+                                           String liveActivityTitle, String cityId, String buildingId, Integer status,
50 49
                                            HttpServletRequest request) {
51 50
         ResponseBean responseBean = new ResponseBean();
52 51
         try {
53
-            Integer orgId = getOrgId(request);
54
-            responseBean = iTaLiveActivityService.listLiveActivityByCondition(pageNum, pageSize, orgId,
55
-                    liveActivityTitle, cityId, buildingId, liveDetailType, status);
52
+            IPage<TaLiveActivity> result = iTaLiveActivityService.listLiveActivityByCondition(pageNum, pageSize, getOrgId(request),
53
+                    liveActivityTitle, cityId, buildingId, status);
54
+            responseBean.addSuccess(result);
55
+
56 56
         } catch (Exception e) {
57 57
             e.printStackTrace();
58 58
             logger.error("taLiveActivityList -=- {}", e.toString());

+ 7
- 3
src/main/java/com/huiju/estateagents/entity/TaLiveActivity.java Целия файл

@@ -100,12 +100,12 @@ public class TaLiveActivity implements Serializable {
100 100
     /**
101 101
      * 直播开始时间
102 102
      */
103
-    private LocalDateTime liveStartDate;
103
+    private String liveStartDate;
104 104
 
105 105
     /**
106 106
      * 直播结束时间
107 107
      */
108
-    private LocalDateTime liveEndDate;
108
+    private String liveEndDate;
109 109
 
110 110
     /**
111 111
      * 创建时间
@@ -130,7 +130,7 @@ public class TaLiveActivity implements Serializable {
130 130
     /**
131 131
      * 权重
132 132
      */
133
-//    private Integer weight;
133
+    private Integer weight;
134 134
 
135 135
     @TableField(exist = false)
136 136
     private List<TaPoster> posters;
@@ -138,5 +138,9 @@ public class TaLiveActivity implements Serializable {
138 138
     @TableField(exist = false)
139 139
     private List<TaShareContent> shareContents;
140 140
 
141
+    @TableField(exist = false)
142
+    private String buildingName;
141 143
 
144
+    @TableField(exist = false)
145
+    private String cityName;
142 146
 }

+ 2
- 3
src/main/java/com/huiju/estateagents/mapper/TaLiveActivityMapper.java Целия файл

@@ -1,14 +1,12 @@
1 1
 package com.huiju.estateagents.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.huiju.estateagents.entity.TaLiveActivity;
5
-import com.huiju.estateagents.entity.TaSalesBatch;
6 6
 import org.apache.ibatis.annotations.Mapper;
7 7
 import org.apache.ibatis.annotations.Param;
8 8
 import org.springframework.stereotype.Component;
9 9
 
10
-import java.util.List;
11
-
12 10
 /**
13 11
  * <p>
14 12
  * Mapper 接口
@@ -29,6 +27,7 @@ public interface TaLiveActivityMapper extends BaseMapper<TaLiveActivity> {
29 27
      */
30 28
     Boolean addVisitNum(@Param("id") String id);
31 29
 
30
+    IPage<TaLiveActivity> selectLiveListByCondition(IPage<TaLiveActivity> pg, @Param("liveActivityTitle") String liveActivityTitle, @Param("cityId") String cityId, @Param("buildingId") String buildingId, @Param("status") Integer status, @Param("orgId")Integer orgId);
32 31
     /**
33 32
      * 批量更新直播活动状态
34 33
      *

+ 3
- 2
src/main/java/com/huiju/estateagents/service/ITaLiveActivityService.java Целия файл

@@ -1,5 +1,6 @@
1 1
 package com.huiju.estateagents.service;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.baomidou.mybatisplus.extension.service.IService;
4 5
 import com.huiju.estateagents.base.ResponseBean;
5 6
 import com.huiju.estateagents.entity.TaLiveActivity;
@@ -37,8 +38,8 @@ public interface ITaLiveActivityService extends IService<TaLiveActivity> {
37 38
      * @param status
38 39
      * @return
39 40
      */
40
-    ResponseBean listLiveActivityByCondition(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle,
41
-                                             String cityId, String buildingId, String liveDetailType, Integer status);
41
+    IPage<TaLiveActivity> listLiveActivityByCondition(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle,
42
+                                                      String cityId, String buildingId, Integer status);
42 43
 
43 44
     /**
44 45
      * 访问量自增

+ 4
- 28
src/main/java/com/huiju/estateagents/service/impl/TaLiveActivityServiceImpl.java Целия файл

@@ -101,38 +101,14 @@ public class TaLiveActivityServiceImpl extends ServiceImpl<TaLiveActivityMapper,
101 101
     }
102 102
 
103 103
     @Override
104
-    public ResponseBean listLiveActivityByCondition(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle,
105
-                                                    String cityId, String buildingId, String liveDetailType, Integer status) {
104
+    public IPage<TaLiveActivity> listLiveActivityByCondition(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle,
105
+                                                    String cityId, String buildingId, Integer status) {
106 106
         logger.info("TaLiveActivityServiceImpl.listLiveActivityByCondition 接收参数:pageNum:{},pageSize:{},orgId:{}," +
107 107
                     "liveActivityTitle:{},cityId:{},buildingId:{},liveDetailType:{},status:{}", pageNum, pageSize,
108
-                liveActivityTitle, cityId, buildingId, liveDetailType, status);
108
+                liveActivityTitle, cityId, buildingId, status);
109 109
 
110
-        ResponseBean responseBean = new ResponseBean();
111 110
         IPage<TaLiveActivity> pg = new Page<>(pageNum, pageSize);
112
-        QueryWrapper<TaLiveActivity> queryWrapper = new QueryWrapper<>();
113
-
114
-        if (orgId != null) {
115
-            queryWrapper.eq("org_id", orgId);
116
-        }
117
-        if (StringUtils.isNotBlank(liveActivityTitle)) {
118
-            queryWrapper.like("live_activity_title", liveActivityTitle);
119
-        }
120
-        if (StringUtils.isNotBlank(cityId)) {
121
-            queryWrapper.eq("city_id", cityId);
122
-        }
123
-        if (StringUtils.isNotBlank(buildingId)) {
124
-            queryWrapper.eq("building_id", buildingId);
125
-        }
126
-        if (StringUtils.isNotBlank(liveDetailType)) {
127
-            queryWrapper.eq("live_detail_type", liveDetailType);
128
-        }
129
-        if (status != null) {
130
-            queryWrapper.eq("status", status);
131
-        }
132
-        queryWrapper.orderByDesc("create_date");
133
-        IPage<TaLiveActivity> result = page(pg, queryWrapper);
134
-        responseBean.addSuccess(result);
135
-        return responseBean;
111
+        return taLiveActivityMapper.selectLiveListByCondition(pg, liveActivityTitle, cityId, buildingId, status, orgId);
136 112
     }
137 113
 
138 114
     @Override

+ 18
- 0
src/main/resources/mapper/TaLiveActivityMapper.xml Целия файл

@@ -21,4 +21,22 @@
21 21
         </foreach>
22 22
     </update>
23 23
 
24
+    <select id="selectLiveListByCondition" resultType="com.huiju.estateagents.entity.TaLiveActivity">
25
+     select a.building_name,b.name as city_name, t.* From ta_live_activity t
26
+     left join ta_building a on t.building_id = a.building_id
27
+     LEFT JOIN td_city b on t.city_id = b.id
28
+     where t.org_id = #{orgId}
29
+     <if test="status != null and status != ''">
30
+         and t.status = #{status}
31
+     </if>
32
+     <if test="liveActivityTitle != null and liveActivityTitle != ''">
33
+         and t.liveActivityTitle like CONCAT('%', #{liveActivityTitle}, '%')
34
+     </if>
35
+     <if test="cityId != null and cityId != ''">
36
+         and t.city_id = #{cityId}
37
+     </if><if test="buildingId != null and buildingId != ''">
38
+         and t.building_id = #{buildingId}
39
+    </if>
40
+    </select>
41
+
24 42
 </mapper>

+ 1
- 1
src/main/resources/mapper/TaShareMapper.xml Целия файл

@@ -8,7 +8,7 @@
8 8
       left join ta_sales_batch b on t.be_share = b.sales_batch_id
9 9
       where a.org_id = #{orgId}
10 10
       and t.tagert_type in ('housePost','houseApp')
11
-      and b.sales_batch_id = #{liveActivityId}
11
+      and b.sales_batch_id = #{saleBatchId}
12 12
       <if test="personType != null and personType != ''">
13 13
           and a.person_Type = #{personType}
14 14
       </if>