傅行帆 5 年之前
父節點
當前提交
e842d1bb46

+ 47
- 1
src/main/java/com/huiju/estateagents/controller/TaPointsExchangeController.java 查看文件

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.huiju.estateagents.base.BaseController;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8
+import com.huiju.estateagents.common.CommConstant;
8 9
 import com.huiju.estateagents.entity.TaPointsExchange;
9 10
 import com.huiju.estateagents.service.ITaPointsExchangeService;
10 11
 import org.slf4j.Logger;
@@ -44,11 +45,31 @@ public class TaPointsExchangeController extends BaseController {
44 45
      */
45 46
     @RequestMapping(value="/admin/taPointsExchange",method= RequestMethod.GET)
46 47
     public ResponseBean taPointsExchangeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
-                                             @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
48
+                                             @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
49
+                                             @RequestParam(value ="personName",required = false) String personName,
50
+                                             @RequestParam(value ="phone",required = false) String phone,
51
+                                             @RequestParam(value ="personType",required = false) String personType,
52
+                                             @RequestParam(value ="targetName",required = false) String targetName,
53
+                                             @RequestParam(value ="startCreateDate",required = false) String startCreateDate,
54
+                                             @RequestParam(value ="endCreateDate",required = false) String endCreateDate,
55
+                                             @RequestParam(value ="startVerifyDate",required = false) String startVerifyDate,
56
+                                             @RequestParam(value ="endVerifyDate",required = false) String endVerifyDate,
57
+                                             @RequestParam(value ="status",required = false) Integer status,
58
+                                             @RequestParam(value ="tel",required = false) String tel){
48 59
         ResponseBean responseBean = new ResponseBean();
49 60
         try {
50 61
             //使用分页插件
51 62
             TaPointsExchange taPointsExchange = new TaPointsExchange();
63
+            taPointsExchange.setPersonName(personName);
64
+            taPointsExchange.setPhone(phone);
65
+            taPointsExchange.setPersonType(personType);
66
+            taPointsExchange.setTargetName(targetName);
67
+            taPointsExchange.setStartCreateDate(startCreateDate);
68
+            taPointsExchange.setEndCreateDate(endCreateDate);
69
+            taPointsExchange.setStartVerifyDate(startVerifyDate);
70
+            taPointsExchange.setEndVerifyDate(endVerifyDate);
71
+            taPointsExchange.setStatus(status);
72
+            taPointsExchange.setTel(tel);
52 73
             
53 74
             responseBean = iTaPointsExchangeService.selectList(pageNum,pageSize,taPointsExchange);
54 75
 
@@ -59,6 +80,31 @@ public class TaPointsExchangeController extends BaseController {
59 80
         }
60 81
         return responseBean;
61 82
     }
83
+    
84
+    /**
85
+     * 修改对象
86
+     * @param taPointsExchange 实体对象
87
+     * @return
88
+     */
89
+    @RequestMapping(value="/admin/taPointsExchange/change",method= RequestMethod.PUT)
90
+    public ResponseBean taPointsExchangeStatusChange(@RequestBody TaPointsExchange taPointsExchange){
91
+        ResponseBean responseBean = new ResponseBean();
92
+        try {
93
+            if (null != taPointsExchange.getStatus() && !taPointsExchange.getStatus().equals(CommConstant.STATUS_NORMAL)){
94
+                taPointsExchange.setStatus(CommConstant.STATUS_NORMAL);
95
+            }
96
+            if (iTaPointsExchangeService.updateById(taPointsExchange)){
97
+                responseBean.addSuccess(taPointsExchange);
98
+            }else {
99
+                responseBean.addError("fail");
100
+            }
101
+        }catch (Exception e){
102
+            e.printStackTrace();
103
+            logger.error("taPointsExchangeUpdate -=- {}",e.toString());
104
+            responseBean.addError(e.getMessage());
105
+        }
106
+        return responseBean;
107
+    }
62 108
 
63 109
     /**
64 110
      * 保存对象

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

@@ -120,4 +120,7 @@ public class TaPointsExchange implements Serializable {
120 120
     
121 121
     @TableField(exist = false)
122 122
     private String endVerifyDate;
123
+    
124
+    @TableField(exist = false)
125
+    private String tel;
123 126
 }

+ 2
- 1
src/main/java/com/huiju/estateagents/mapper/TaPointsExchangeMapper.java 查看文件

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 5
 import com.huiju.estateagents.entity.TaPointsExchange;
6 6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
7 8
 
8 9
 import java.util.List;
9 10
 
@@ -18,5 +19,5 @@ import java.util.List;
18 19
 @Mapper
19 20
 public interface TaPointsExchangeMapper extends BaseMapper<TaPointsExchange> {
20 21
 	
21
-	List<TaPointsExchange> selectListByParams(Page page, TaPointsExchange taPointsExchange);
22
+	List<TaPointsExchange> selectListByParams(Page page,@Param("taPointsExchange") TaPointsExchange taPointsExchange);
22 23
 }

+ 31
- 0
src/main/resources/mapper/TaPointsExchangeMapper.xml 查看文件

@@ -24,5 +24,36 @@
24 24
         FROM
25 25
             ta_points_exchange t
26 26
             LEFT JOIN ta_person p ON t.person_id = p.person_id
27
+        where 1=1
28
+        <if test="taPointsExchange.status != null and taPointsExchange.status != '' or taPointsExchange.status ==0">
29
+            and  t.`status` = #{taPointsExchange.status}
30
+        </if>
31
+        <if test="taPointsExchange.personName != null and taPointsExchange.personName != ''">
32
+            and  t.person_name like concat('%',#{taPointsExchange.personName},'%')
33
+        </if>
34
+        <if test="taPointsExchange.phone != null and taPointsExchange.phone != ''">
35
+            and  t.phone like concat('%',#{taPointsExchange.phone},'%')
36
+        </if>
37
+        <if test="taPointsExchange.tel != null and taPointsExchange.tel != ''">
38
+            and  t.phone = #{taPointsExchange.tel}
39
+        </if>
40
+        <if test="taPointsExchange.personType != null and taPointsExchange.personType != ''">
41
+            and  p.person_type = #{taPointsExchange.personType}
42
+        </if>
43
+        <if test="taPointsExchange.targetName != null and taPointsExchange.targetName != ''">
44
+            and  t.target_name like concat('%',#{taPointsExchange.targetName},'%')
45
+        </if>
46
+        <if test="taPointsExchange.startCreateDate != null and taPointsExchange.startCreateDate != ''">
47
+            and  date_format(t.create_date,'%Y-%m-%d') >= date_format(#{taPointsExchange.startCreateDate},'%Y-%m-%d')
48
+        </if>
49
+        <if test="taPointsExchange.endCreateDate != null and taPointsExchange.endCreateDate != ''">
50
+            and  date_format(t.create_date,'%Y-%m-%d') &lt;= date_format(#{taPointsExchange.endCreateDate},'%Y-%m-%d')
51
+        </if>
52
+        <if test="taPointsExchange.startVerifyDate != null and taPointsExchange.startVerifyDate != ''">
53
+            and  date_format(t.verify_date,'%Y-%m-%d') >= date_format(#{taPointsExchange.startVerifyDate},'%Y-%m-%d')
54
+        </if>
55
+        <if test="taPointsExchange.endVerifyDate != null and taPointsExchange.endVerifyDate != ''">
56
+            and  date_format(t.verify_date,'%Y-%m-%d') &lt;= date_format(#{taPointsExchange.startVerifyDate},'%Y-%m-%d')
57
+        </if>
27 58
     </select>
28 59
 </mapper>