Bladeren bron

添加查询条件

xiao547607 4 jaren geleden
bovenliggende
commit
6d8a8fecbb

+ 3 - 0
common/src/main/resources/mapper/base/PersonDeviceRelation.xml

@@ -175,6 +175,9 @@
 			<if test="'0'.toString() == searchParams.isUploadPhoto and null != searchParams.isUploadPhoto">
 				and c.face_image_url is null
 			</if>
+			<if test="searchParams.deviceName != null">
+				and b.alias_name like #{searchParams.deviceName}
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        a.${sort.name} ${sort.order}

+ 7 - 2
web/src/main/java/com/jpsoft/shinestar/modules/base/controller/PersonDeviceRelationController.java

@@ -604,10 +604,11 @@ public class PersonDeviceRelationController {
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "deviceId",value = "设备ID",  paramType = "query"),
-            @ApiImplicitParam(name = "personId",value = "人员ID",  paramType = "query")
+            @ApiImplicitParam(name = "personId",value = "人员ID",  paramType = "query"),
+            @ApiImplicitParam(name = "deviceName",value = "设备名称",  paramType = "query")
     })
     public MessageResult<Map> pageList(
-            String deviceId,String personId,
+            String deviceId,String personId,String deviceName,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -629,6 +630,10 @@ public class PersonDeviceRelationController {
             searchParams.put("personId",personId);
         }
 
+        if (StringUtils.isNotEmpty(deviceName)) {
+            searchParams.put("deviceName","%" + deviceName + "%");
+        }
+
         Page<PersonDeviceRelation> page = personDeviceRelationService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
 //        for(PersonDeviceRelation pdr : page.getResult()){