瀏覽代碼

新需求

weichaochao 5 年之前
父節點
當前提交
f37af44578

+ 5
- 5
src/main/java/com/huiju/estateagents/controller/TaLiveActivityController.java 查看文件

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

+ 4
- 0
src/main/java/com/huiju/estateagents/entity/TaLiveActivity.java 查看文件

@@ -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
- 0
src/main/java/com/huiju/estateagents/mapper/TaLiveActivityMapper.java 查看文件

@@ -1,6 +1,7 @@
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 6
 import org.apache.ibatis.annotations.Mapper;
6 7
 import org.apache.ibatis.annotations.Param;
@@ -26,4 +27,5 @@ public interface TaLiveActivityMapper extends BaseMapper<TaLiveActivity> {
26 27
      */
27 28
     Boolean addVisitNum(@Param("id") String id);
28 29
 
30
+    IPage<TaLiveActivity> selectLiveListByCondition(IPage<TaLiveActivity> pg, @Param("liveActivityTitle") String liveActivityTitle, @Param("cityId") String cityId, @Param("buildingId") String buildingId, @Param("status") Integer status);
29 31
 }

+ 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;
@@ -35,8 +36,8 @@ public interface ITaLiveActivityService extends IService<TaLiveActivity> {
35 36
      * @param status
36 37
      * @return
37 38
      */
38
-    ResponseBean listLiveActivityByCondition(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle,
39
-                                             String cityId, String buildingId, String liveDetailType, Integer status);
39
+    IPage<TaLiveActivity> listLiveActivityByCondition(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle,
40
+                                                      String cityId, String buildingId, Integer status);
40 41
 
41 42
     /**
42 43
      * 访问量自增

+ 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);
136 112
     }
137 113
 
138 114
     @Override

+ 5
- 0
src/main/resources/mapper/TaLiveActivityMapper.xml 查看文件

@@ -9,4 +9,9 @@
9 9
             t.live_activity_id = #{id}
10 10
     </update>
11 11
 
12
+    <select id="selectLiveListByCondition" resultType="com.huiju.estateagents.entity.TaLiveActivity">
13
+      select a.building_name, t.* From ta_live_activity t
14
+      left join ta_building a on t.building_id = a.building_id
15
+    </select>
16
+
12 17
 </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>