Commit ef946740 by 林永健

feat(follow): 支持根据门店名称模糊查询关注记录

- MerchantBiFollowMapper接口中增加merchantName参数用于模糊搜索
- MerchantBiFollowMapper.xml中添加根据merchantName模糊过滤的SQL条件
- MerchantBiFollowService中调用查询接口时传入merchantName参数
- SceneBaseReq新增merchantName字段支持传递门店名称模糊搜索条件
- 查询我的关注列表方法支持按门店名称进行筛选,提升查询灵活性和准确性
1 parent 59e10824
......@@ -73,6 +73,9 @@ public class SceneBaseReq implements Serializable {
@ApiModelProperty(notes = "模糊搜索")
private String search;
@ApiModelProperty(notes = "门店名称 (模糊搜索)")
private String merchantName;
@ApiModelProperty(notes = "指标查询参数")
private DataBizQueryParamsDTO queryParams;
......
......@@ -20,9 +20,9 @@ public interface MerchantBiFollowMapper extends OreMapper<MerchantBiFollow> {
MerchantBiFollow findFollowByMerchantAndBiz(@Param("merchantId") Integer merchantId, @Param("businessType") Byte businessType);
/**
* 根据员工UUID查询其关注的门店+业务组合
* 根据员工 UUID 查询其关注的门店 + 业务组合
*/
List<MyFollowResponse> findMyFollowsByStaffUuid(@Param("staffUuid") String staffUuid);
List<MyFollowResponse> findMyFollowsByStaffUuid(@Param("staffUuid") String staffUuid, @Param("merchantName") String merchantName);
/**
* 通用查询关注门店+业务组合(支持按员工查询/排除员工、权限门店过滤)
......
......@@ -163,7 +163,7 @@ public class MerchantBiFollowService {
RpcAssert.assertNotNull(req.getLoginUserUuid(), DefaultErrorEnum.SERVER_ERROR, "当前用户未登录,返回空列表");
long startMs = System.currentTimeMillis();
List<MyFollowResponse> resList = followMapper.findMyFollowsByStaffUuid(req.getLoginUserUuid());
List<MyFollowResponse> resList = followMapper.findMyFollowsByStaffUuid(req.getLoginUserUuid(), req.getMerchantName());
if (CollectionUtils.isEmpty(resList)) {
log.info("查询我的关注列表:为空,loginUserUuid={}", req.getLoginUserUuid());
return Collections.emptyList();
......
......@@ -46,6 +46,9 @@
WHERE d.staff_uuid = #{staffUuid}
AND f.deleted_flag = 'N'
AND d.deleted_flag = 'N'
<if test="merchantName != null and merchantName != ''">
AND f.merchant_name LIKE CONCAT('%', #{merchantName}, '%')
</if>
ORDER BY d.created_date DESC
</select>
......@@ -78,6 +81,9 @@
#{id}
</foreach>
</if>
<if test="req != null and req.merchantName != null and req.merchantName != ''">
AND f.merchant_name LIKE CONCAT('%', #{req.merchantName}, '%')
</if>
GROUP BY f.merchant_id, f.merchant_name, f.business_type
ORDER BY followDate DESC
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!