Przeglądaj źródła

查询条件添加

jz.kai 5 lat temu
rodzic
commit
e69fd0c9f0

+ 10 - 0
src/main/java/com/jpsoft/smart/modules/base/controller/PersonInfoController.java

@@ -180,6 +180,8 @@ public class PersonInfoController {
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "name",value = "姓名", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "idCard",value = "身份证", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "phone",value = "手机号", required = false, paramType = "form",dataType = "String"),
             @ApiImplicitParam(name = "position1",value = "一级位置", required = false, paramType = "form",dataType = "String"),
             @ApiImplicitParam(name = "position2",value = "二级位置", required = false, paramType = "form",dataType = "String"),
             @ApiImplicitParam(name = "position3",value = "三级位置", required = false, paramType = "form",dataType = "String"),
@@ -188,6 +190,8 @@ public class PersonInfoController {
     })
     public MessageResult<Map> pageList(
             @RequestParam(value="name",defaultValue="") String name,
+            @RequestParam(value="idCard",defaultValue="") String idCard,
+            @RequestParam(value="phone",defaultValue="") String phone,
             @RequestParam(value="position1",defaultValue="") String position1,
             @RequestParam(value="position2",defaultValue="") String position2,
             @RequestParam(value="position3",defaultValue="") String position3,
@@ -210,6 +214,12 @@ public class PersonInfoController {
         if (StringUtils.isNotEmpty(name)) {
             searchParams.put("name","%" + name + "%");
         }
+        if (StringUtils.isNotEmpty(idCard)) {
+            searchParams.put("name","%" + idCard + "%");
+        }
+        if (StringUtils.isNotEmpty(phone)) {
+            searchParams.put("name","%" + phone + "%");
+        }
         if (StringUtils.isNotEmpty(position1)) {
             searchParams.put("position1",position1);
         }

+ 6 - 0
src/main/resources/mapper/base/PersonInfo.xml

@@ -154,6 +154,12 @@
             <if test="searchParams.name != null">
                 and name_ like #{searchParams.name}
             </if>
+            <if test="searchParams.idCard != null">
+                and id_card like #{searchParams.idCard}
+            </if>
+            <if test="searchParams.phone != null">
+                and phone_ like #{searchParams.phone}
+            </if>
             <if test="searchParams.position1 != null">
                 and position1_ like #{searchParams.position1}
             </if>