dingxin 6 years ago
parent
commit
6218ad7e56

+ 44
- 5
whole-estate/src/main/java/com/example/wholeestate/controller/BuildingController.java View File

12
 import io.swagger.annotations.ApiImplicitParams;
12
 import io.swagger.annotations.ApiImplicitParams;
13
 import io.swagger.annotations.ApiOperation;
13
 import io.swagger.annotations.ApiOperation;
14
 import org.springframework.beans.factory.annotation.Autowired;
14
 import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.beans.factory.annotation.Value;
15
 import org.springframework.beans.propertyeditors.CustomDateEditor;
16
 import org.springframework.beans.propertyeditors.CustomDateEditor;
16
 import org.springframework.web.bind.ServletRequestDataBinder;
17
 import org.springframework.web.bind.ServletRequestDataBinder;
17
 import org.springframework.web.bind.annotation.*;
18
 import org.springframework.web.bind.annotation.*;
97
             @ApiImplicitParam(paramType = "Query",dataType = "Integer",name = "pageNum",value = "分页第几页" ),
98
             @ApiImplicitParam(paramType = "Query",dataType = "Integer",name = "pageNum",value = "分页第几页" ),
98
             @ApiImplicitParam(paramType = "Query",dataType = "Integer",name = "pageSize",value = "pageSize:每页长度" ),
99
             @ApiImplicitParam(paramType = "Query",dataType = "Integer",name = "pageSize",value = "pageSize:每页长度" ),
99
             @ApiImplicitParam(paramType = "Query",dataType = "Integer",name = "buildingId",value = "buildingId:楼盘ID" ),
100
             @ApiImplicitParam(paramType = "Query",dataType = "Integer",name = "buildingId",value = "buildingId:楼盘ID" ),
100
-            @ApiImplicitParam(paramType = "Query",dataType = "String",name = "username",value = "username:用户名称" )
101
-
101
+            @ApiImplicitParam(paramType = "Query",dataType = "String",name = "username",value = "username:用户名称" ),
102
+            @ApiImplicitParam(paramType = "Query",dataType = "String",name = "phone",value = "phone:用户名称" ),
103
+            @ApiImplicitParam(paramType = "Query",dataType = "String",name = "status",value = "status:用户名称" )
102
     })
104
     })
103
 //    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
105
 //    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
104
     @RequestMapping(value = "/appointmentlist", method = RequestMethod.GET)
106
     @RequestMapping(value = "/appointmentlist", method = RequestMethod.GET)
105
     public ResponseBean appointmentList(@RequestParam("pageNum")Integer pageNum,
107
     public ResponseBean appointmentList(@RequestParam("pageNum")Integer pageNum,
106
                                         @RequestParam("pageSize")Integer pageSize, HttpSession session,
108
                                         @RequestParam("pageSize")Integer pageSize, HttpSession session,
107
-                                        @RequestParam("buildingId")Integer buildingId,
108
-                                        @RequestParam("username")String username){
109
+                                        @RequestParam(value="buildingId",required = false)String buildingId,
110
+                                        @RequestParam(value="username",required = false)String username,
111
+                                        @RequestParam(value="phone",required = false)String phone,
112
+                                        @RequestParam(value="status",required = false)String status
113
+                                        ){
109
 //        SysUser sessionUser= getSessionUser(session);
114
 //        SysUser sessionUser= getSessionUser(session);
110
-        ResponseBean  responseBean = iBuildingService.appointmentList(pageNum,pageSize,buildingId,username);
115
+        ResponseBean  responseBean = iBuildingService.appointmentList(pageNum,pageSize,buildingId,username,phone,status);
111
         return responseBean;
116
         return responseBean;
112
     }
117
     }
113
 
118
 
206
         return responseBean;
211
         return responseBean;
207
     }
212
     }
208
 
213
 
214
+    @RequestMapping(value = "/buildingApartment/{id}", method = RequestMethod.GET)
215
+    @ApiOperation(value = "楼盘户型详情", notes = "楼盘户型详情")
216
+    @ApiImplicitParams({
217
+            @ApiImplicitParam(paramType = "path", dataTypeClass=String.class, name = "id", value = "楼盘id"),
218
+    })
219
+    public ResponseBean buildingApartmentSelectId(@PathVariable(value = "id") String id, HttpSession session){
220
+        ResponseBean  responseBean = iBuildingService.buildingApartmentSelectId(id);
221
+        return responseBean;
222
+    }
223
+
224
+    @ApiOperation(value = "核销备注", notes = "核销备注")
225
+    @ApiImplicitParams({
226
+            @ApiImplicitParam(paramType = "path", dataTypeClass = String.class, name = "id", value = "核销id"),
227
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "writeoffRemark", value = "核销备注")
228
+
229
+    })
230
+    @RequestMapping(value = "/appointment/writeoff/{id}", method = RequestMethod.PUT)
231
+    public ResponseBean appointmentUpdate(@PathVariable(value = "id") String id,
232
+                                        @RequestParam(value="writeoffRemark",required = false)String writeoffRemark){
233
+        ResponseBean  responseBean = iBuildingService.appointmentUpdate(id,writeoffRemark);
234
+        return responseBean;
235
+    }
236
+
237
+//    @ApiOperation(value = "户型列表", notes = "户型列表")
238
+////    @ApiImplicitParams({
239
+////            @ApiImplicitParam(paramType = "path", dataTypeClass = String.class, name = "id", value = "核销id"),
240
+////    })
241
+////    @RequestMapping(value = "/buildingApartment/{id}", method = RequestMethod.GET)
242
+////    public ResponseBean buildingApartmentSelectId(@PathVariable(value = "id") String id,
243
+////                                     @RequestParam("pageSize")Integer pageSize){
244
+////        ResponseBean  responseBean = iBuildingService.buildingApartmentSelectId(id);
245
+////        return responseBean;
246
+////    }
247
+
209
 }
248
 }

+ 4
- 2
whole-estate/src/main/java/com/example/wholeestate/controller/CustomerController.java View File

32
     @ApiOperation(value = "会员列表", notes = "会员列表")
32
     @ApiOperation(value = "会员列表", notes = "会员列表")
33
     @ApiImplicitParams({
33
     @ApiImplicitParams({
34
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "pageNum:分页第几页" +
34
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "pageNum:分页第几页" +
35
-                    "pageSize:每页长度")
35
+                    "pageSize:每页长度,phone:手机号,name:姓名"
36
+
37
+            )
36
 
38
 
37
     })
39
     })
38
 //    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
40
 //    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
39
-    @RequestMapping(value = "/customerList", method = RequestMethod.POST)
41
+    @RequestMapping(value = "/customerList", method = RequestMethod.GET)
40
     public ResponseBean buildingList(@RequestBody String parameter, HttpSession session){
42
     public ResponseBean buildingList(@RequestBody String parameter, HttpSession session){
41
         ResponseBean  responseBean = iCustomerService.customerList(parameter);
43
         ResponseBean  responseBean = iCustomerService.customerList(parameter);
42
         return responseBean;
44
         return responseBean;

+ 2
- 2
whole-estate/src/main/java/com/example/wholeestate/dao/AppointmentMapper.java View File

21
      * @param page
21
      * @param page
22
      * @return
22
      * @return
23
      */
23
      */
24
-    IPage<Appendable> appendableList(Page<Appendable> page);
24
+//    IPage<Appendable> appendableList(Page<Appendable> page);
25
 
25
 
26
     @Select("SELECT " +
26
     @Select("SELECT " +
27
             "taa.*, " +
27
             "taa.*, " +
33
             "WHERE tac.openid = #{openid}")
33
             "WHERE tac.openid = #{openid}")
34
     IPage<Appointment> getOpenidAppendableList(Page<Appointment> page, @Param("openid") String openid);
34
     IPage<Appointment> getOpenidAppendableList(Page<Appointment> page, @Param("openid") String openid);
35
 
35
 
36
-    IPage<Appointment> appendableList(Page page, @Param("buildingId") Integer buildingId, @Param("username")String username);
36
+    IPage<Appointment> appendableList(Page page, @Param("buildingId") String buildingId, @Param("username")String username,@Param("phone") String phone,@Param("status") String status);
37
 
37
 
38
 }
38
 }

+ 2
- 1
whole-estate/src/main/java/com/example/wholeestate/dao/CustomerMapper.java View File

4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.example.wholeestate.model.Customer;
6
 import com.example.wholeestate.model.Customer;
7
+import org.apache.ibatis.annotations.Param;
7
 
8
 
8
 /**
9
 /**
9
  * <p>
10
  * <p>
20
      * @param page
21
      * @param page
21
      * @return
22
      * @return
22
      */
23
      */
23
-    IPage<Customer> customerList(Page<Customer> page);
24
+    IPage<Customer> customerList(Page<Customer> page, @Param("Name") String name,@Param("phone")String phone);
24
 }
25
 }

+ 16
- 0
whole-estate/src/main/java/com/example/wholeestate/dao/PageImgMapper.java View File

1
+package com.example.wholeestate.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.wholeestate.model.PageImg;
5
+
6
+/**
7
+ * <p>
8
+ *  Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-03-22
13
+ */
14
+public interface PageImgMapper extends BaseMapper<PageImg> {
15
+
16
+}

+ 9
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Appointment.java View File

4
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import com.baomidou.mybatisplus.annotation.TableName;
5
 import java.time.LocalDateTime;
5
 import java.time.LocalDateTime;
6
 import java.io.Serializable;
6
 import java.io.Serializable;
7
+import java.util.Date;
7
 import java.util.List;
8
 import java.util.List;
8
 
9
 
9
 import lombok.Data;
10
 import lombok.Data;
88
     @TableField(exist = false)
89
     @TableField(exist = false)
89
     private List<Building> arrayListbuilding;
90
     private List<Building> arrayListbuilding;
90
 
91
 
92
+    /**
93
+     * 核销备注
94
+     */
95
+    private String writeoffRemark;
91
 
96
 
97
+    /**
98
+     * 核销时间
99
+     */
100
+    private LocalDateTime writeoffDate;
92
 }
101
 }

+ 8
- 0
whole-estate/src/main/java/com/example/wholeestate/model/BuildingApartment.java View File

1
 package com.example.wholeestate.model;
1
 package com.example.wholeestate.model;
2
 
2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import java.time.LocalDateTime;
5
 import java.time.LocalDateTime;
5
 import java.io.Serializable;
6
 import java.io.Serializable;
7
+import java.util.List;
8
+
6
 import lombok.Data;
9
 import lombok.Data;
7
 import lombok.EqualsAndHashCode;
10
 import lombok.EqualsAndHashCode;
8
 import lombok.experimental.Accessors;
11
 import lombok.experimental.Accessors;
35
 
38
 
36
     private LocalDateTime createDate;
39
     private LocalDateTime createDate;
37
 
40
 
41
+    /**
42
+     * 户型图片列表
43
+     */
44
+    @TableField(exist = false)
45
+    private List<BuildingImg> buildingImgList;
38
 
46
 
39
 }
47
 }

+ 43
- 0
whole-estate/src/main/java/com/example/wholeestate/model/PageImg.java View File

1
+package com.example.wholeestate.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import java.time.LocalDateTime;
5
+import java.io.Serializable;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+/**
11
+ * <p>
12
+ * 
13
+ * </p>
14
+ *
15
+ * @author jobob
16
+ * @since 2019-03-22
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+@TableName("ta_page_img")
22
+public class PageImg implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    private String pageId;
27
+
28
+    private String imgLocation;
29
+
30
+    private String imgType;
31
+
32
+    private String url;
33
+
34
+    private String link;
35
+
36
+    private Integer status;
37
+
38
+    private LocalDateTime createDate;
39
+
40
+    private Integer orderNo;
41
+
42
+
43
+}

+ 14
- 1
whole-estate/src/main/java/com/example/wholeestate/service/IBuildingService.java View File

41
      * @param
41
      * @param
42
      * @return
42
      * @return
43
      */
43
      */
44
-    ResponseBean appointmentList(Integer pageNum, Integer pageSize,Integer buildingId,String username);
44
+    ResponseBean appointmentList(Integer pageNum, Integer pageSize,String buildingId,String username,String phone,String status);
45
 
45
 
46
     /**
46
     /**
47
      * 添加楼盘
47
      * 添加楼盘
76
      * @return
76
      * @return
77
      */
77
      */
78
     ResponseBean buildingApartmentUpdate(String parameter);
78
     ResponseBean buildingApartmentUpdate(String parameter);
79
+
80
+    /**
81
+     * 户型详情
82
+     * @param id
83
+     * @return
84
+     */
85
+    ResponseBean buildingApartmentSelectId(String id);
86
+
87
+    /**
88
+     * 修改核销备注
89
+     * @return
90
+     */
91
+    ResponseBean appointmentUpdate(String id,String writeoffRemark);
79
 }
92
 }

+ 69
- 24
whole-estate/src/main/java/com/example/wholeestate/service/impl/BuildingServiceImpl.java View File

13
 import com.example.wholeestate.service.IBuildingService;
13
 import com.example.wholeestate.service.IBuildingService;
14
 import com.fasterxml.jackson.databind.util.ArrayBuilders;
14
 import com.fasterxml.jackson.databind.util.ArrayBuilders;
15
 import com.sun.org.apache.bcel.internal.generic.NEW;
15
 import com.sun.org.apache.bcel.internal.generic.NEW;
16
+import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
16
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.stereotype.Service;
18
 import org.springframework.stereotype.Service;
18
 
19
 
43
 
44
 
44
     @Autowired
45
     @Autowired
45
     private BuildingImgMapper buildingImgMapper;
46
     private BuildingImgMapper buildingImgMapper;
47
+
46
     @Autowired
48
     @Autowired
47
     private ApartmentImgMapper apartmentImgMapper;
49
     private ApartmentImgMapper apartmentImgMapper;
48
 
50
 
49
     @Autowired
51
     @Autowired
50
     private  BuildingApartmentMapper buildingApartmentMapper;
52
     private  BuildingApartmentMapper buildingApartmentMapper;
51
 
53
 
54
+//    @Autowired
55
+//    private  ApartmentImgMapper apartmentImgMapper;
56
+
52
     private IdGen idGen = IdGen.get();
57
     private IdGen idGen = IdGen.get();
53
 
58
 
54
     @Override
59
     @Override
122
     }
127
     }
123
 
128
 
124
     @Override
129
     @Override
125
-    public ResponseBean appointmentList(Integer pageNum,Integer pageSize,Integer buildingId,String username) {
130
+    public ResponseBean appointmentList(Integer pageNum,Integer pageSize,String buildingId,String username,String phone,String status) {
126
         ResponseBean response= new ResponseBean();
131
         ResponseBean response= new ResponseBean();
127
         Page<Appointment> page = new Page<>();
132
         Page<Appointment> page = new Page<>();
128
         page.setSize(pageSize == null ? 10 : pageSize);
133
         page.setSize(pageSize == null ? 10 : pageSize);
129
-        page.setCurrent(pageNum == null ? 1 : pageNum);
130
-        IPage<Appointment> building= AppointmentMapper.appendableList(page,buildingId,username);
134
+        page.setCurrent(pageNum == null ? 0 : pageNum);
135
+        IPage<Appointment> building= AppointmentMapper.appendableList(page,buildingId,username,phone,status);
131
         List<Appointment> buildingList=building.getRecords();
136
         List<Appointment> buildingList=building.getRecords();
132
         //预约的用户,
137
         //预约的用户,
133
-        ArrayList  arrayListUser= new ArrayList<>();
138
+//        ArrayList  arrayListUser= new ArrayList<>();
134
 
139
 
135
         //预约的楼盘,
140
         //预约的楼盘,
136
-        ArrayList  arrayListbuilding= new ArrayList<>();
137
-       for (Appointment bui:buildingList){
138
-          Building buil= new Building();
139
-           QueryWrapper<Building> buildingtWrapper = new QueryWrapper<>();
140
-           buildingtWrapper.lambda().eq(Building::getStatus,0);
141
-           buildingtWrapper.lambda().eq(Building::getBuildingId,bui.getBuildingId());
142
-           Building bu= buildingMapper.selectOne(buildingtWrapper);
143
-           arrayListUser.add(bu);
144
-
145
-           QueryWrapper<Customer> customerWrapper = new QueryWrapper<>();
146
-           customerWrapper.lambda().eq(Customer::getStatus,0);
147
-           customerWrapper.lambda().eq(Customer::getCustomerId,bui.getCustomerId());
148
-           Customer cust= customerMapper.selectOne(customerWrapper);
149
-           arrayListbuilding.add(cust);
150
-
151
-           bui.setArrayListUser(arrayListUser);
152
-           bui.setArrayListbuilding(arrayListbuilding);
153
-       }
154
-
141
+//        ArrayList  arrayListbuilding= new ArrayList<>();
142
+//       for (Appointment bui:buildingList){
143
+//          Building buil= new Building();
144
+//           QueryWrapper<Building> buildingtWrapper = new QueryWrapper<>();
145
+//           buildingtWrapper.lambda().eq(Building::getStatus,0);
146
+//           buildingtWrapper.lambda().eq(Building::getBuildingId,bui.getBuildingId());
147
+//           Building bu= buildingMapper.selectOne(buildingtWrapper);
148
+//           arrayListUser.add(bu);
149
+//
150
+//           QueryWrapper<Customer> customerWrapper = new QueryWrapper<>();
151
+//           customerWrapper.lambda().eq(Customer::getStatus,0);
152
+//           customerWrapper.lambda().eq(Customer::getCustomerId,bui.getCustomerId());
153
+//           Customer cust= customerMapper.selectOne(customerWrapper);
154
+//           arrayListbuilding.add(cust);
155
+//           bui.setArrayListUser(arrayListUser);
156
+//           bui.setArrayListbuilding(arrayListbuilding);
157
+//       }
155
         HashMap hashMap= new HashMap<>();
158
         HashMap hashMap= new HashMap<>();
156
         hashMap.put("list",buildingList);
159
         hashMap.put("list",buildingList);
157
         hashMap.put("total",building.getTotal());
160
         hashMap.put("total",building.getTotal());
320
         return responseBean;
323
         return responseBean;
321
     }
324
     }
322
 
325
 
323
-    
326
+    @Override
327
+    public ResponseBean buildingApartmentSelectId(String id) {
328
+        ResponseBean responseBean = new ResponseBean();
329
+        //查询户型详情
330
+        QueryWrapper<BuildingApartment> buildingApartmentQueryWrapper = new QueryWrapper<>();
331
+        buildingApartmentQueryWrapper.eq("apartment_id", id);
332
+        //拿到当前户型信息
333
+         BuildingApartment buildingApartment = buildingApartmentMapper.selectOne(buildingApartmentQueryWrapper);
334
+         if ( null == buildingApartment ){
335
+             responseBean.addSuccess("此楼盘没有户型图请上传");
336
+             return responseBean;
337
+         }
338
+         //根据户型ID查楼盘户型对应图片表
339
+        ArrayList arrayList= new ArrayList<>();
340
+        QueryWrapper< ApartmentImg> ApartmentImgQueryWrapper = new QueryWrapper<>();
341
+        ApartmentImgQueryWrapper.eq("apartment_id", buildingApartment.getApartmentId());
342
+        List<ApartmentImg> buildingImg= apartmentImgMapper.selectList(ApartmentImgQueryWrapper);
343
+        for (ApartmentImg apartmentImg:buildingImg){
344
+            QueryWrapper<BuildingImg> buildingImgQueryWrapper = new QueryWrapper<>();
345
+            buildingImgQueryWrapper.eq("img_id",apartmentImg.getImgId());
346
+             List<BuildingImg> buildingImgList= buildingImgMapper.selectList(buildingImgQueryWrapper);
347
+             arrayList.add(buildingImgList);
348
+        }
349
+        buildingApartment.setBuildingImgList(arrayList);
350
+        responseBean .addSuccess(buildingApartment);
351
+        return responseBean;
352
+    }
353
+
354
+    @Override
355
+    public ResponseBean appointmentUpdate(String id,String writeoffRemark) {
356
+        ResponseBean responseBean= new ResponseBean();
357
+       Appointment appointment= new Appointment();
358
+        appointment.setAppointmentId(id);
359
+        appointment.setWriteoffRemark(writeoffRemark);
360
+        appointment.setStatus(2);
361
+//        new DateTimeLiteralExpression.DateTime()
362
+//        appointment.setWriteoffDate(LocalDateTime.now());
363
+        QueryWrapper<Appointment> AppointmentQueryWrapper = new QueryWrapper<>();
364
+        AppointmentQueryWrapper.eq("appointment_id", id);
365
+        AppointmentMapper.update(appointment,AppointmentQueryWrapper);
366
+        responseBean.addSuccess("成功");
367
+        return responseBean;
368
+    }
324
 
369
 
325
 
370
 
326
 }
371
 }

+ 3
- 2
whole-estate/src/main/java/com/example/wholeestate/service/impl/CustomerServiceImpl.java View File

40
     public ResponseBean customerList(String parameter) {
40
     public ResponseBean customerList(String parameter) {
41
         ResponseBean response= new ResponseBean();
41
         ResponseBean response= new ResponseBean();
42
         JSONObject object= JSONObject.parseObject(parameter);
42
         JSONObject object= JSONObject.parseObject(parameter);
43
-
43
+        String phone = object.getString("phone");
44
+        String name = object.getString("name");
44
         Integer pageNum = object.getInteger("pageNum");
45
         Integer pageNum = object.getInteger("pageNum");
45
         Integer pageSize = object.getInteger("pageSize");
46
         Integer pageSize = object.getInteger("pageSize");
46
 
47
 
47
         Page<Customer> page = new Page<>();
48
         Page<Customer> page = new Page<>();
48
         page.setSize(pageSize == null ? 10 : pageSize);
49
         page.setSize(pageSize == null ? 10 : pageSize);
49
         page.setCurrent(pageNum == null ? 1 : pageNum);
50
         page.setCurrent(pageNum == null ? 1 : pageNum);
50
-        IPage<Customer> customer= customerMapper.customerList(page);
51
+        IPage<Customer> customer= customerMapper.customerList(page,name,phone);
51
         List<Customer> customerList=customer.getRecords();
52
         List<Customer> customerList=customer.getRecords();
52
 
53
 
53
         HashMap hashMap= new HashMap<>();
54
         HashMap hashMap= new HashMap<>();

+ 21
- 2
whole-estate/src/main/resources/mapper/AppointmentMapper.xml View File

3
 <mapper namespace="com.example.wholeestate.dao.AppointmentMapper">
3
 <mapper namespace="com.example.wholeestate.dao.AppointmentMapper">
4
 
4
 
5
     <select id="appendableList" resultType="com.example.wholeestate.model.Appointment">
5
     <select id="appendableList" resultType="com.example.wholeestate.model.Appointment">
6
-        SELECT * FROM ta_appointment
6
+        SELECT appointment_id,
7
+        building_id,
8
+        customer_id,
9
+        appointment_date,
10
+        customer_name,
11
+        phone,
12
+        remark,
13
+        status,
14
+        create_date,
15
+        writeoff_date,
16
+        writeoff_remark
17
+        FROM ta_appointment
7
       <where>
18
       <where>
8
         <if test="buildingId != null and buildingId != ''">
19
         <if test="buildingId != null and buildingId != ''">
9
-            and  ta_appointment.building_id like concat('%',#{buildingId,jdbcType=INTEGER},'%')
20
+            and  ta_appointment.building_id like concat('%',#{buildingId,jdbcType=VARCHAR},'%')
10
         </if>
21
         </if>
11
 
22
 
12
           <if test="username != null and username != ''">
23
           <if test="username != null and username != ''">
13
               and  ta_appointment.customer_name like concat('%',#{username,jdbcType=VARCHAR},'%')
24
               and  ta_appointment.customer_name like concat('%',#{username,jdbcType=VARCHAR},'%')
14
           </if>
25
           </if>
15
 
26
 
27
+          <if test="phone != null and phone != ''">
28
+              and  ta_appointment.phone like concat('%',#{phone,jdbcType=VARCHAR},'%')
29
+          </if>
30
+
31
+          <if test="status != null and status != ''">
32
+              and  ta_appointment.status like concat('%',#{status,jdbcType=VARCHAR},'%')
33
+          </if>
34
+
16
       </where>
35
       </where>
17
     </select>
36
     </select>
18
 </mapper>
37
 </mapper>

+ 11
- 0
whole-estate/src/main/resources/mapper/CustomerMapper.xml View File

3
 <mapper namespace="com.example.wholeestate.dao.CustomerMapper">
3
 <mapper namespace="com.example.wholeestate.dao.CustomerMapper">
4
     <select id="customerList" resultType="com.example.wholeestate.model.Customer">
4
     <select id="customerList" resultType="com.example.wholeestate.model.Customer">
5
         select * from ta_customer;
5
         select * from ta_customer;
6
+        <where>
7
+            <where>
8
+                status > -1
9
+                <if test="Name != null and Name != ''">
10
+                    and  (ta_customer.name like concat('%',#{Name,jdbcType=VARCHAR},'%') or ta_customer.customer_name like concat('%',#{Name,jdbcType=VARCHAR},'%'))
11
+                </if>
12
+                <if test="phone != null and phone != ''">
13
+                    and  ta_customer.phone like concat('%',#{phone,jdbcType=VARCHAR},'%')
14
+                </if>
15
+            </where>
16
+        </where>
6
     </select>
17
     </select>
7
 
18
 
8
 </mapper>
19
 </mapper>

+ 5
- 0
whole-estate/src/main/resources/mapper/PageImgMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.example.wholeestate.dao.PageImgMapper">
4
+
5
+</mapper>