feat(mall): 商品搜索接口增加筛选条件
- 在商品搜索接口中添加环保等级、防火等级、试用场景等筛选条件 - 更新相关服务和 mapper 方法,支持新增的筛选条件 - 修改 SQL 查询语句,增加相应的 WHERE条件
This commit is contained in:
@@ -60,7 +60,7 @@ public interface TzProdMapper extends BaseMapperPlus<TzProd, TzProdVo>, MPJBaseM
|
||||
* @param orderBy
|
||||
* @return
|
||||
*/
|
||||
IPage<TzProdVo> getSearchProdPageByProdName(@Param("page") IPage<TzProdBo> page, @Param("categoryId") Long categoryId, @Param("prodName") String prodName, @Param("floor") Integer floor, @Param("sort") Integer sort, @Param("orderBy") Integer orderBy);
|
||||
IPage<TzProdVo> getSearchProdPageByProdName(@Param("page") IPage<TzProdBo> page, @Param("categoryId") Long categoryId, @Param("prodName") String prodName, @Param("envLevel") String envLevel, @Param("fireLevel") String fireLevel, @Param("trialScenario") String trialScenario, @Param("floor") Integer floor, @Param("sort") Integer sort, @Param("orderBy") Integer orderBy);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -108,7 +108,7 @@ public interface ITzProdService extends MPJBaseService<TzProd> {
|
||||
* @param orderBy
|
||||
* @return
|
||||
*/
|
||||
IPage<TzProdVo> getSearchProdPageByProdName(PageQuery pageQuery, Long categoryId, String prodName, Integer floor, Integer sort, Integer orderBy);
|
||||
IPage<TzProdVo> getSearchProdPageByProdName(PageQuery pageQuery, Long categoryId, String prodName, String envLevel, String fireLevel, String trialScenario, Integer floor, Integer sort, Integer orderBy);
|
||||
|
||||
/**
|
||||
* 商品收藏
|
||||
|
||||
@@ -453,9 +453,9 @@ public class TzProdServiceImpl extends MPJBaseServiceImpl<TzProdMapper,TzProd> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<TzProdVo> getSearchProdPageByProdName(PageQuery pageQuery, Long categoryId, String prodName, Integer floor, Integer sort, Integer orderBy) {
|
||||
public IPage<TzProdVo> getSearchProdPageByProdName(PageQuery pageQuery, Long categoryId, String prodName, String envLevel, String fireLevel, String trialScenario, Integer floor, Integer sort, Integer orderBy) {
|
||||
IPage<TzProdBo> page = new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize());
|
||||
return baseMapper.getSearchProdPageByProdName(page, categoryId, prodName, floor, sort, orderBy);
|
||||
return baseMapper.getSearchProdPageByProdName(page, categoryId, prodName, envLevel, fireLevel, trialScenario, floor, sort, orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,6 +75,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
or
|
||||
p.prod_code like concat('%',#{prodName} ,'%')
|
||||
</if>
|
||||
<if test="envLevel != null and envLevel != ''">
|
||||
and FIND_IN_SET(p.env_level, #{envLevel}) > 0
|
||||
</if>
|
||||
<if test="fireLevel != null and fireLevel != ''">
|
||||
and FIND_IN_SET(p.fire_level, #{fireLevel}) > 0
|
||||
</if>
|
||||
<if test="trialScenario != null and trialScenario != ''">
|
||||
and FIND_IN_SET(p.trial_scenario, #{trialScenario}) > 0
|
||||
</if>
|
||||
|
||||
<if test="sort == 0">
|
||||
ORDER BY RAND()
|
||||
|
||||
Reference in New Issue
Block a user