|
@@ -181,9 +181,14 @@ public class APIIndexenterController {
|
|
|
@ApiOperationSupport(order = 20)
|
|
|
@ApiOperation(value = "搜索商品", notes = "按商品名称模糊搜索商品")
|
|
|
@GetMapping(value = "/queryCommpdity")
|
|
|
- public Result<List<AaCommodity>> getCommpdityD(@ApiParam(name="name",value="商品名称")String name) {
|
|
|
+ public Result<List<AaCommodity>> getCommpdityD(@ApiParam(name="name",value="商品名称")String name,@ApiParam(name="nameEnglish",value="商品名称英文") String nameEnglish) {
|
|
|
LambdaQueryWrapper<AaCommodity> queryMapper = new LambdaQueryWrapper<>();
|
|
|
- queryMapper.like(AaCommodity::getName,name);
|
|
|
+ if(!Strings.isNullOrEmpty(name)) {
|
|
|
+ queryMapper.like(AaCommodity::getName,name);
|
|
|
+ }
|
|
|
+ if(!Strings.isNullOrEmpty(nameEnglish)) {
|
|
|
+ queryMapper.like(AaCommodity::getNameEnglish,nameEnglish);
|
|
|
+ }
|
|
|
List<AaCommodity> list = aaCommodityService.list(queryMapper);
|
|
|
return Result.OK(list);
|
|
|
}
|