Przeglądaj źródła

心愿互换 增加查询条件

jz.kai 1 rok temu
rodzic
commit
6108c18321

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

@@ -113,6 +113,9 @@
 			<if test="searchParams.title != null">
 				and title_ like #{searchParams.title}
 			</if>
+			<if test="searchParams.category != null">
+				and category_ = #{searchParams.category}
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        ${sort.name} ${sort.order}

+ 5 - 1
web/src/main/java/com/jpsoft/employment/modules/base/api/WishApi.java

@@ -46,9 +46,10 @@ public class WishApi {
     @RequestMapping(value = "list",method = RequestMethod.POST)
     @ApiImplicitParams({
             @ApiImplicitParam(name="title", value="名称", required=false, paramType="query"),
+            @ApiImplicitParam(name="category", value="类别", required=false, paramType="query"),
     })
     public MessageResult list(
-            String title,
+            String title, String category,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize){
         MessageResult msgResult = new MessageResult<>();
@@ -57,6 +58,9 @@ public class WishApi {
         if (StringUtils.isNotEmpty(title)) {
             searchParams.put("title","%" + title + "%");
         }
+        if (StringUtils.isNotEmpty(category)) {
+            searchParams.put("category",category);
+        }
 
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("create_time","desc"));