update 首页店铺列表模糊查询修改

This commit is contained in:
yyb
2026-01-07 17:34:24 +08:00
parent 3049b653b5
commit 48fb364d95
4 changed files with 22 additions and 16 deletions

View File

@@ -34,7 +34,7 @@ public interface LeaseMachineMapper extends BaseMapper<LeaseMachine> {
* 根据id集合查询店铺信息
* @return
*/
List<ShopInfoDto> getExistsMachineShop(@Param("ids") Set<Long> ids, @Param("coin") String coin , @Param("algorithm") String algorithm);
List<ShopInfoDto> getExistsMachineShop(@Param("ids") Set<Long> ids, @Param("keyword") String keyword );
/**

View File

@@ -74,7 +74,7 @@ public class LeaseMachineServiceImpl extends ServiceImpl<LeaseMachineMapper, Lea
return PageResult.success(new ArrayList<>());
}
PageHelper.startPage(productPageVo.getPageNum(), productPageVo.getPageSize());
List<ShopInfoDto> existsMachineShop = leaseMachineMapper.getExistsMachineShop(shopIds, productPageVo.getCoin(), productPageVo.getAlgorithm());
List<ShopInfoDto> existsMachineShop = leaseMachineMapper.getExistsMachineShop(shopIds, productPageVo.getKeyword());
PageInfo<ShopInfoDto> pageInfo = new PageInfo<>(existsMachineShop);
//店铺支付方式
List<PayTypeDto> payType = leaseShopConfigMapper.getPayType(new ArrayList<>(shopIds));

View File

@@ -33,6 +33,9 @@ public class ProductPageVo extends PageVo{
@ApiModelProperty(value = "算法")
private String algorithm;
@ApiModelProperty(value = "关键字")
private String keyword;
@ApiModelProperty(value = "用户邮箱(个人中心商品列表)")
private String userEmail;
}

View File

@@ -55,20 +55,23 @@
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
<choose>
<when test="coin != null and coin != ''">
AND (sub.coin LIKE CONCAT('%', #{coin}, '%')
<if test="algorithm != null and algorithm != ''">
AND sub.algorithm LIKE CONCAT('%', #{algorithm}, '%')
</if>
)
</when>
<otherwise>
<if test="algorithm != null and algorithm != ''">
AND sub.algorithm LIKE CONCAT('%', #{algorithm}, '%')
</if>
</otherwise>
</choose>
<if test="keyword != null and keyword != ''">
AND (sub.coin LIKE CONCAT('%', #{keyword}, '%') OR sub.algorithm LIKE CONCAT('%', #{keyword}, '%'))
</if>
<!-- <choose>-->
<!-- <when test="coin != null and coin != ''">-->
<!-- AND (sub.coin LIKE CONCAT('%', #{coin}, '%')-->
<!-- <if test="algorithm != null and algorithm != ''">-->
<!-- AND sub.algorithm LIKE CONCAT('%', #{algorithm}, '%')-->
<!-- </if>-->
<!-- )-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- <if test="algorithm != null and algorithm != ''">-->
<!-- AND sub.algorithm LIKE CONCAT('%', #{algorithm}, '%')-->
<!-- </if>-->
<!-- </otherwise>-->
<!-- </choose>-->
GROUP BY ls.id, ls.name, ls.image, ls.description, ls.sale_number
ORDER BY ls.fee_rate DESC, ls.sale_number DESC
</select>