feat(store): 添加仓库名称搜索功能

This commit is contained in:
zxy 2026-04-13 09:01:41 +08:00
parent 970533321e
commit c449e6b6b2
3 changed files with 15 additions and 5 deletions

View File

@ -34,6 +34,7 @@ public class StoreAreaServiceImpl extends ServiceImpl<StoreAreaMapper, StoreArea
@Resource @Resource
private StoreHouseService storeHouseService; private StoreHouseService storeHouseService;
// ... existing code ...
@Override @Override
public List<StoreAreaEntity> getList(StoreAreaPagination storeAreaPagination) { public List<StoreAreaEntity> getList(StoreAreaPagination storeAreaPagination) {
LambdaQueryWrapper<StoreAreaEntity> storeAreaWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StoreAreaEntity> storeAreaWrapper = new LambdaQueryWrapper<>();
@ -53,6 +54,12 @@ public class StoreAreaServiceImpl extends ServiceImpl<StoreAreaMapper, StoreArea
if (ObjectUtil.isNotEmpty(storeAreaPagination.getStoreHouseId())) { if (ObjectUtil.isNotEmpty(storeAreaPagination.getStoreHouseId())) {
storeAreaWrapper.eq(StoreAreaEntity::getStoreHouseId, storeAreaPagination.getStoreHouseId()); storeAreaWrapper.eq(StoreAreaEntity::getStoreHouseId, storeAreaPagination.getStoreHouseId());
} }
if (ObjectUtil.isNotEmpty(storeAreaPagination.getStoreHouseName())) {
storeAreaWrapper.apply(
"EXISTS (SELECT 1 FROM tba_store_house h WHERE h.id = store_house_id AND h.f_delete_mark = 0 AND h.store_house_name LIKE {0})",
"%" + storeAreaPagination.getStoreHouseName() + "%"
);
}
storeAreaWrapper.eq(StoreAreaEntity::getDeleteMark, 0); storeAreaWrapper.eq(StoreAreaEntity::getDeleteMark, 0);
storeAreaWrapper.orderByDesc(StoreAreaEntity::getCreatorTime); storeAreaWrapper.orderByDesc(StoreAreaEntity::getCreatorTime);
List<StoreAreaEntity> storeAreaList; List<StoreAreaEntity> storeAreaList;

View File

@ -40,6 +40,9 @@ public class StoreAreaPagination extends Pagination {
@Schema(description = "仓库id") @Schema(description = "仓库id")
private Integer storeHouseId; private Integer storeHouseId;
@Schema(description = "仓库名称")
private String storeHouseName;
@Schema(description = "仓库类型") @Schema(description = "仓库类型")
private String storeType; private String storeType;
} }

View File

@ -10,11 +10,11 @@
</JnpfSelect> </JnpfSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="6">--> <el-col :span="6">
<!-- <el-form-item label="仓库名称">--> <el-form-item label="仓库名称">
<!-- <el-input v-model="query.storeHouseName" placeholder="请输入" clearable></el-input>--> <el-input v-model="query.storeHouseName" placeholder="请输入" clearable></el-input>
<!-- </el-form-item>--> </el-form-item>
<!-- </el-col>--> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="状态"> <el-form-item label="状态">
<JnpfSelect v-model="query.enabledStatus" placeholder="请选择" clearable :options="enabledStatusOptions" <JnpfSelect v-model="query.enabledStatus" placeholder="请选择" clearable :options="enabledStatusOptions"