多店铺需求

This commit is contained in:
Tankaikai
2025-04-07 18:11:48 +08:00
parent 1eafd54536
commit 18b2c536f3
5 changed files with 15 additions and 8 deletions

View File

@@ -2,9 +2,9 @@ package com.czg.service.account.mapper;
import com.czg.account.dto.ShopBranchDTO;
import com.czg.account.entity.ShopConfig;
import com.czg.account.param.ShopBranchParam;
import com.mybatisflex.core.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -17,6 +17,6 @@ import java.util.List;
@Mapper
public interface ShopConfigMapper extends BaseMapper<ShopConfig> {
List<ShopBranchDTO> findBranchList(@Param("shopId") Long shopId);
List<ShopBranchDTO> findBranchList(ShopBranchParam param);
}

View File

@@ -6,6 +6,7 @@ import com.czg.account.entity.ShopConfig;
import com.czg.account.entity.ShopInfo;
import com.czg.account.enums.BranchDataSyncMethodEnum;
import com.czg.account.enums.ShopTypeEnum;
import com.czg.account.param.ShopBranchParam;
import com.czg.account.service.ShopBranchService;
import com.czg.enums.YesNoEnum;
import com.czg.exception.CzgException;
@@ -38,9 +39,9 @@ public class ShopBranchServiceImpl implements ShopBranchService {
private ShopInfoMapper shopInfoMapper;
@Override
public Page<ShopBranchDTO> findPage(Long shopId) {
public Page<ShopBranchDTO> findPage(ShopBranchParam param) {
PageHelper.startPage(PageUtil.buildPageHelp());
List<ShopBranchDTO> branchList = shopConfigMapper.findBranchList(shopId);
List<ShopBranchDTO> branchList = shopConfigMapper.findBranchList(param);
return PageUtil.convert(new PageInfo<>(branchList));
}

View File

@@ -12,5 +12,8 @@
left join tb_shop_info t2 on t1.id = t2.id
left join sys_user t3 on t1.id = t3.id
where t1.main_id = #{shopId}
<if test="branchName != null and branchName != ''">
and t2.shop_name like concat('%', #{branchName}, '%')
</if>
</select>
</mapper>