傅行帆 il y a 3 ans
Parent
révision
c243f42b93

+ 9
- 8
src/main/java/com/yunzhi/marketing/xlk/controller/CustomerSignatoryController.java Voir le fichier

@@ -7,6 +7,7 @@ import com.yunzhi.marketing.base.BaseController;
7 7
 import com.yunzhi.marketing.base.ResponseBean;
8 8
 import com.yunzhi.marketing.xlk.entity.CustomerSignatory;
9 9
 import com.yunzhi.marketing.xlk.service.ICustomerSignatoryService;
10
+import com.yunzhi.marketing.xlk.vo.CustomerSignatoryVO;
10 11
 import io.swagger.annotations.Api;
11 12
 import io.swagger.annotations.ApiOperation;
12 13
 import org.slf4j.Logger;
@@ -48,20 +49,20 @@ public class CustomerSignatoryController extends BaseController {
48 49
      * @param pageSize
49 50
      * @return
50 51
      */
51
-    @ApiOperation(value = "", notes = "")
52
-    @RequestMapping(value="/customerSignatory",method= RequestMethod.GET)
52
+    @ApiOperation(value = "获取成交或者签约数据", notes = "获取成交或者签约数据")
53
+    @RequestMapping(value="/admin/customerSignatory",method= RequestMethod.GET)
53 54
     public ResponseBean customerSignatoryList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
54 55
                                               @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
56
+                                              @RequestParam(value ="buildingId",required = false) String buildingId,
57
+                                              @RequestParam(value ="name",required = false) String name,
58
+                                              @RequestParam(value ="phone",required = false) String phone,
59
+                                              @RequestParam(value ="type",required = false) String type,
55 60
                                               @RequestHeader("authorization") String token, HttpServletRequest request){
56 61
         ResponseBean responseBean = new ResponseBean();
57 62
         try {
58 63
             //使用分页插件
59
-		    IPage<CustomerSignatory> pg = new Page<>(pageNum, pageSize);
60
-            LambdaQueryWrapper<CustomerSignatory> queryWrapper = new LambdaQueryWrapper<>();
61
-            queryWrapper.eq(CustomerSignatory::getOrgId,getOrgId(request));
62
-            queryWrapper.orderByDesc(CustomerSignatory::getCreateDate);
63
-
64
-            IPage<CustomerSignatory> result = iCustomerSignatoryService.page(pg, queryWrapper);
64
+		    IPage<CustomerSignatoryVO> pg = new Page<>(pageNum, pageSize);
65
+            IPage<CustomerSignatoryVO> result = iCustomerSignatoryService.getCustomerSignatoryList(pg, buildingId,name,phone,type,getOrgId(request));
65 66
             responseBean.addSuccess(result);
66 67
         }catch (Exception e){
67 68
             e.printStackTrace();

+ 5
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/CustomerSignatoryMapper.java Voir le fichier

@@ -1,8 +1,11 @@
1 1
 package com.yunzhi.marketing.xlk.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.yunzhi.marketing.xlk.entity.CustomerSignatory;
6
+import com.yunzhi.marketing.xlk.vo.CustomerSignatoryVO;
5 7
 import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
6 9
 
7 10
 /**
8 11
  * <p>
@@ -15,4 +18,6 @@ import org.apache.ibatis.annotations.Mapper;
15 18
 @Mapper
16 19
 public interface CustomerSignatoryMapper extends BaseMapper<CustomerSignatory> {
17 20
 
21
+    IPage<CustomerSignatoryVO> getCustomerSignatoryList(IPage<CustomerSignatoryVO> pg, @Param("buildingId") String buildingId,@Param("name") String name,
22
+                                                        @Param("phone") String phone,@Param("type") String type, @Param("orgId") Integer orgId);
18 23
 }

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/service/ICustomerSignatoryService.java Voir le fichier

@@ -1,7 +1,9 @@
1 1
 package com.yunzhi.marketing.xlk.service;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.baomidou.mybatisplus.extension.service.IService;
4 5
 import com.yunzhi.marketing.xlk.entity.CustomerSignatory;
6
+import com.yunzhi.marketing.xlk.vo.CustomerSignatoryVO;
5 7
 
6 8
 /**
7 9
  * <p>
@@ -13,4 +15,5 @@ import com.yunzhi.marketing.xlk.entity.CustomerSignatory;
13 15
  */
14 16
 public interface ICustomerSignatoryService extends IService<CustomerSignatory> {
15 17
 
18
+    IPage<CustomerSignatoryVO> getCustomerSignatoryList(IPage<CustomerSignatoryVO> pg, String buildingId, String name, String phone, String type, Integer orgId);
16 19
 }

+ 6
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/CustomerSignatoryServiceImpl.java Voir le fichier

@@ -1,9 +1,11 @@
1 1
 package com.yunzhi.marketing.xlk.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 5
 import com.yunzhi.marketing.xlk.entity.CustomerSignatory;
5 6
 import com.yunzhi.marketing.xlk.mapper.CustomerSignatoryMapper;
6 7
 import com.yunzhi.marketing.xlk.service.ICustomerSignatoryService;
8
+import com.yunzhi.marketing.xlk.vo.CustomerSignatoryVO;
7 9
 import org.springframework.stereotype.Service;
8 10
 
9 11
 /**
@@ -17,4 +19,8 @@ import org.springframework.stereotype.Service;
17 19
 @Service
18 20
 public class CustomerSignatoryServiceImpl extends ServiceImpl<CustomerSignatoryMapper, CustomerSignatory> implements ICustomerSignatoryService {
19 21
 
22
+    @Override
23
+    public IPage<CustomerSignatoryVO> getCustomerSignatoryList(IPage<CustomerSignatoryVO> pg, String buildingId, String name, String phone, String type, Integer orgId) {
24
+        return this.baseMapper.getCustomerSignatoryList(pg,buildingId,name,phone,type,orgId);
25
+    }
20 26
 }

+ 97
- 0
src/main/java/com/yunzhi/marketing/xlk/vo/CustomerSignatoryVO.java Voir le fichier

@@ -0,0 +1,97 @@
1
+package com.yunzhi.marketing.xlk.vo;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import com.yunzhi.marketing.entity.TaBuildingApartment;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+
12
+import java.io.Serializable;
13
+import java.time.LocalDateTime;
14
+
15
+/**
16
+ * <p>
17
+ * 客户签约单 
18
+ * </p>
19
+ *
20
+ * @author jobob
21
+ * @since 2021-07-30
22
+ */
23
+@Data
24
+public class CustomerSignatoryVO implements Serializable {
25
+
26
+    private static final long serialVersionUID = 1L;
27
+
28
+    /**
29
+     * 主键
30
+     */
31
+    @TableId(type = IdType.UUID)
32
+    private String customerSignatoryId;
33
+
34
+    /**
35
+     * 客户id
36
+     */
37
+    private String customerId;
38
+
39
+    /**
40
+     * 楼盘id
41
+     */
42
+    private String buildingId;
43
+
44
+    /**
45
+     * 客户姓名
46
+     */
47
+    private String name;
48
+
49
+
50
+    /**
51
+     * 创建时间
52
+     */
53
+    private LocalDateTime createDate;
54
+
55
+    /**
56
+     * 备注
57
+     */
58
+    private String remark;
59
+
60
+    /**
61
+     * 业绩分成人
62
+     */
63
+    private String dividendsName;
64
+
65
+    /**
66
+     * 比例
67
+     */
68
+    private String proportion;
69
+
70
+    /**
71
+     * 户型
72
+     */
73
+    private String houseType;
74
+
75
+    /** 房屋信息 */
76
+    private String houseInfo;
77
+
78
+    /**
79
+     * 金额
80
+     */
81
+    private String price;
82
+
83
+
84
+    /** 类型 */
85
+    private String type ;
86
+
87
+    private String picture;
88
+
89
+    private String  sex;
90
+    private String  phone;
91
+    private String  buildingName;
92
+
93
+    private String recommendName;
94
+    private String recommendTel;
95
+    private String realtyConsultantName;
96
+    private String realtyConsultantTel;
97
+}

+ 44
- 0
src/main/resources/mapper/xlk/CustomerSignatoryMapper.xml Voir le fichier

@@ -2,4 +2,48 @@
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.yunzhi.marketing.xlk.mapper.CustomerSignatoryMapper">
4 4
 
5
+    <select id="getCustomerSignatoryList" resultType="com.yunzhi.marketing.xlk.vo.CustomerSignatoryVO">
6
+        SELECT
7
+            c.picture,
8
+            c.`name`,
9
+            c.sex,
10
+            c.phone,
11
+            b.building_name,
12
+            t.customer_signatory_id,
13
+            t.customer_id,
14
+            t.building_id,
15
+            t.price,
16
+            t.remark,
17
+            t.create_date,
18
+            t.type,
19
+            t.dividends_name,
20
+            t.proportion,
21
+            t.house_type,
22
+            t.house_info,
23
+            p.`name` as recommend_name,
24
+            p.tel as recommend_tel,
25
+            p.`name` as realty_consultant_name,
26
+            p.tel as realty_consultant_tel
27
+        FROM
28
+            xlk_customer_signatory t
29
+        LEFT JOIN ta_recommend_customer c ON t.customer_id = c.customer_id
30
+        LEFT JOIN ta_building b on t.building_id = b.building_id
31
+        LEFT JOIN ta_person p on t.recommend_person = p.person_id
32
+        LEFT JOIN ta_person pp on t.realty_consultant = pp.person_id
33
+        WHERE
34
+        t.org_id = #{orgId}
35
+        <if test="buildingId != null and buildingId != ''">
36
+            and t.building_id = #{buildingId}
37
+            and p.nickname like concat('%', #{params.nickname}, '%')
38
+        </if>
39
+        <if test="name != null and name != ''">
40
+            and c.name like concat('%', #{name}, '%')
41
+        </if>
42
+        <if test="phone != null and phone != ''">
43
+            and c.phone like concat('%', #{phone}, '%')
44
+        </if>
45
+        <if test="type != null and type != ''">
46
+            and t.type = #{type}
47
+        </if>
48
+    </select>
5 49
 </mapper>