提交 175902e9 authored 作者: zgy's avatar zgy

新增查询所有商品接口

上级 7c728232
......@@ -184,4 +184,17 @@ public class TbCfStationItemController {
return tbCfStationItemService.queryHotRecommended();
}
/**
* 查询所有商品
*
* @return
*/
@ApiOperation("查询所有商品")
@GetMapping("/queryAll")
public Result queryAll(@ApiParam("页数") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@ApiParam("每页数量") @RequestParam(value = "pageSize", defaultValue = "6") Integer pageSize) {
return tbCfStationItemService.queryAll(pageNum, pageSize);
}
}
......@@ -167,5 +167,12 @@ public interface TbCfStationItemService {
*/
Result queryHotRecommended();
/**
* 查询所有商品
*
* @return
*/
Result queryAll(Integer pageNum,Integer pageSize);
}
......@@ -430,5 +430,24 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
return result;
}
/**
* 查询所有商品
*
* @return
*/
@Override
public Result queryAll(Integer pageNum, Integer pageSize) {
Result result = new Result();
try {
startPage(pageNum, pageSize);
List<TbCfStationItemEntity> itemList = tbCfStationItemDao.queryList(null);
PageInfo<TbCfStationItemEntity> pageInfo = new PageInfo<>(itemList);
result.setData(pageInfo).setMessage(ResultCodeEnum.SUCCESS.getDesc());
} catch (Exception e) {
result.setCode(ResultCodeEnum.SERVICE_ERROR.getCode()).setMessage(e.getMessage());
}
return result;
}
}
......@@ -66,7 +66,7 @@
`item_categorytwo`,
`item_descrition_id`
from tb_cf_station_item
WHERE 1=1
WHERE enable_flag=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论