Browse Source

update 乐器置换的商品的搜索条件

周箭河 4 years ago
parent
commit
ecd3287383

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ReplacementInstrumentQueryInfo.java

@@ -7,6 +7,10 @@ public class ReplacementInstrumentQueryInfo extends QueryInfo {
 
     private Integer subjectId;
 
+    private String brand;
+
+    private String specification;
+
     public Integer getSubjectId() {
         return subjectId;
     }
@@ -14,4 +18,20 @@ public class ReplacementInstrumentQueryInfo extends QueryInfo {
     public void setSubjectId(Integer subjectId) {
         this.subjectId = subjectId;
     }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public String getSpecification() {
+        return specification;
+    }
+
+    public void setSpecification(String specification) {
+        this.specification = specification;
+    }
 }

+ 7 - 1
mec-biz/src/main/resources/config/mybatis/ReplacementInstrumentMapper.xml

@@ -84,7 +84,13 @@
 	<sql id="queryPageSql">
 		<where>
 			<if test="subjectId != null">
-				subject_id_ = #{subjectId}
+				AND subject_id_ = #{subjectId}
+			</if>
+			<if test="brand != null">
+				AND brand_ = #{brand}
+			</if>
+			<if test="specification != null">
+				AND specification_ = #{specification}
 			</if>
 		</where>
 	</sql>

+ 16 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentController.java

@@ -1,8 +1,12 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.page.ReplacementInstrumentQueryInfo;
 import com.ym.mec.biz.service.ReplacementInstrumentService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -13,5 +17,17 @@ public class ReplacementInstrumentController extends BaseController {
 
     @Autowired
     private ReplacementInstrumentService replacementInstrumentService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "分页查询列表")
+    @GetMapping("/queryPage")
+    public Object queryPage(ReplacementInstrumentQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        return succeed(replacementInstrumentService.queryPage(queryInfo));
+    }
 
 }