Ver Fonte

设备管理-电力监测设备页面增加查询条件:手机号,联系人

jichaobo há 3 anos atrás
pai
commit
c9054c5936

+ 4 - 2
fiveep-controller/src/main/java/com/bizmatics/controller/web/DeviceAttributeController.java

@@ -102,8 +102,10 @@ public class DeviceAttributeController {
     @GetMapping("monitorDeviceList")
     public ApiResult<CommonPage<MonitorDeviceListVO>> monitorDeviceList(@RequestParam(required = false) String siteName,
                                                                         @RequestParam(value = "size", required = false, defaultValue = "15") Integer size,
-                                                                        @RequestParam(value = "current", required = false, defaultValue = "1") Integer current) {
-        return ApiResult.success(deviceAttributeService.monitorDeviceList(siteName, size, current));
+                                                                        @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
+                                                                        @RequestParam(value = "userName", required = false) String userName,
+                                                                        @RequestParam(value = "phone", required = false) String phone) {
+        return ApiResult.success(deviceAttributeService.monitorDeviceList(siteName,userName,phone, size, current));
     }
 
     /**

+ 2 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/DeviceAttributeMapper.java

@@ -17,6 +17,8 @@ import java.util.List;
  */
 public interface DeviceAttributeMapper extends CrudMapper<DeviceAttribute> {
     List<MonitorDeviceListVO> monitorDeviceList(@Param("siteName") String siteName,
+                                                @Param("userName") String userName,
+                                                @Param("phone") String phone,
                                                 @Param("startCurrent") Integer startCurrent,
                                                 @Param("size") Integer size);
 }

+ 6 - 0
fiveep-persistence/src/main/resources/mapper/mysql/DeviceAttributeMapper.xml

@@ -49,6 +49,12 @@
             <if test="siteName != null and siteName !=''">
                 and a.site_name LIKE CONCAT(CONCAT('%', #{siteName}), '%')
             </if>
+            <if test="userName != null and userName !=''">
+                and a.userName LIKE CONCAT(CONCAT('%', #{userName}), '%')
+            </if>
+            <if test="phone != null and phone !=''">
+                and a.phone LIKE CONCAT(CONCAT('%', #{phone}), '%')
+            </if>
         </where>
         <if test="startCurrent != null and size !=0">
             LIMIT #{startCurrent},

+ 1 - 1
fiveep-service/src/main/java/com/bizmatics/service/DeviceAttributeService.java

@@ -25,7 +25,7 @@ public interface DeviceAttributeService extends CrudService<DeviceAttribute> {
 
     void deviceNewsDel(int id);
 
-    CommonPage<MonitorDeviceListVO> monitorDeviceList(String siteName,Integer size,Integer current);
+    CommonPage<MonitorDeviceListVO> monitorDeviceList(String siteName,String userName,String phone,Integer size,Integer current);
 
     String deviceAttributeExport(Integer id, Integer siteId);
 

+ 3 - 3
fiveep-service/src/main/java/com/bizmatics/service/impl/DeviceAttributeServiceImpl.java

@@ -101,14 +101,14 @@ public class DeviceAttributeServiceImpl extends AbstractCrudService<DeviceAttrib
     }
 
     @Override
-    public CommonPage<MonitorDeviceListVO> monitorDeviceList(String siteName ,Integer size,Integer current) {
-        List<MonitorDeviceListVO> monitorDeviceListOne = baseMapper.monitorDeviceList(siteName,null,0);
+    public CommonPage<MonitorDeviceListVO> monitorDeviceList(String siteName ,String userName,String phone,Integer size,Integer current) {
+        List<MonitorDeviceListVO> monitorDeviceListOne = baseMapper.monitorDeviceList(siteName,userName,phone,null,0);
         Integer total = 0;
         if (monitorDeviceListOne.size()>0){
             total = monitorDeviceListOne.size();
         }
         Integer startCurrent = (current - 1) * size;
-        List<MonitorDeviceListVO> monitorDeviceList = baseMapper.monitorDeviceList(siteName,startCurrent,size);
+        List<MonitorDeviceListVO> monitorDeviceList = baseMapper.monitorDeviceList(siteName,userName,phone,startCurrent,size);
         return new CommonPage<>(monitorDeviceList, total, size,current);
     }