feat: 机型排序增加类型系列号条件
This commit is contained in:
parent
247f3dfeef
commit
3d0545b8c5
|
|
@ -149,10 +149,11 @@ public class ProductModelController extends ControllerBase{
|
|||
|
||||
/**
|
||||
* 获取机型列表用于排序
|
||||
* @param typeNumber 类型系列号
|
||||
*/
|
||||
@GetMapping("/getListForSort")
|
||||
public ApiResult<List<ProductModelSearchVO>> getListForSort(){
|
||||
return ApiResult.success(productModelService.getListForSort());
|
||||
public ApiResult<List<ProductModelSearchVO>> getListForSort(@Valid @RequestParam @NotNull String typeNumber){
|
||||
return ApiResult.success(productModelService.getListForSort(typeNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@ public interface ProductModelMapper extends BaseMapper<ProductModel> {
|
|||
|
||||
List<ProductModelSimpleVO> getSimpleList(String typeNumber);
|
||||
|
||||
List<ProductModelSearchVO> getListForSort();
|
||||
List<ProductModelSearchVO> getListForSort(String typeNumber);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public interface IProductModelService extends IService<ProductModel> {
|
|||
|
||||
void deleteByParent(String typeNumber);
|
||||
|
||||
List<ProductModelSearchVO> getListForSort();
|
||||
List<ProductModelSearchVO> getListForSort(String typeNumber);
|
||||
|
||||
void saveSort(SortSaveRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ProductModelSearchVO> getListForSort() {
|
||||
public List<ProductModelSearchVO> getListForSort(String typeNumber) {
|
||||
// return Convert.toList(ProductModelSearchVO.class,
|
||||
// lambdaQuery()
|
||||
// .eq(ProductModel::getEnable, true)
|
||||
|
|
@ -361,7 +361,7 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
// .orderByAsc(ProductModel::getSort)
|
||||
// .list()
|
||||
// );
|
||||
return baseMapper.getListForSort();
|
||||
return baseMapper.getListForSort(typeNumber);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
select *
|
||||
,(SELECT `name` FROM product_type WHERE batch_number=type_number AND state!=2 ORDER BY state DESC LIMIT 1) as 'typeName'
|
||||
from product_model
|
||||
where enable=1 and state=1
|
||||
where enable=1 and state=1 and type_number=#{typeNumber}
|
||||
order by typeName, sort
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue