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