mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
排单查询小板SQL参数修改
This commit is contained in:
+5
-1
@@ -43,7 +43,10 @@ public interface PlanItemMapper extends BaseMapperX<PlanItemDO> {
|
||||
|
||||
List<PlateInfoVO> selectOrderPlanPlateList(@Param("planIds") List<Long> planIds, @Param("organId") Long organId);
|
||||
|
||||
IPage<PlateResList> selectPlateListByPlateIds(@Param("page") IPage<PlateResList> page, @Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper,@Param("organId") Long organId);
|
||||
List<PlateResList> selectPlateListByPlateIds(@Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper,@Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize);
|
||||
|
||||
Long selectPlateCountByPlateIds(@Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper);
|
||||
|
||||
|
||||
IPage<OrderGoodsResp> selectNoPlanGoodsByRoomAndBodyIds(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper,@Param("organId") Long organId);
|
||||
|
||||
@@ -86,4 +89,5 @@ public interface PlanItemMapper extends BaseMapperX<PlanItemDO> {
|
||||
.inIfPresent(PlanItemDO::getOrderId,orderIds)
|
||||
.select(PlanItemDO::getGoodsId));
|
||||
}
|
||||
|
||||
}
|
||||
+18
-7
@@ -753,9 +753,19 @@ public class PlanServiceImpl implements PlanService {
|
||||
if(vo.getPlanIds().isEmpty()){
|
||||
return null;
|
||||
}
|
||||
for (Long planId : vo.getPlanIds()) {
|
||||
validatePlan(planId);
|
||||
|
||||
List<Long> planIds = vo.getPlanIds();
|
||||
|
||||
List<PlanDO> planDOS = planMapper.selectBatchIds(planIds);
|
||||
|
||||
if(planDOS.size() != planIds.size()){
|
||||
planDOS.forEach(f->{
|
||||
if(!planIds.contains(f.getId())){
|
||||
throw exception(PLAN_NOT_DATA_EXISTS,f.getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
QueryWrapperX<PlanItemDO> queryWrapperX = new QueryWrapperX<>();
|
||||
|
||||
String filterTypes = "";
|
||||
@@ -779,17 +789,18 @@ public class PlanServiceImpl implements PlanService {
|
||||
.betweenIfPresent("op.height", new BigDecimal[]{vo.getLongMinRang(), vo.getLongMaxRang()})
|
||||
.likeIfPresent("op.filter_type", insertSeparator(filterTypes));
|
||||
|
||||
PageDTO<PlateResList> page = new PageDTO<>(vo.getPageNo(), vo.getPageSize());
|
||||
Integer pageNo = (vo.getPageNo() - 1) * vo.getPageSize();
|
||||
|
||||
IPage<PlateResList> pageResult = planItemMapper.selectPlateListByPlateIds(page,queryWrapperX,getUserOrganId());
|
||||
List<PlateResList> pageResult = planItemMapper.selectPlateListByPlateIds(queryWrapperX,pageNo,vo.getPageSize());
|
||||
|
||||
|
||||
if (CollUtil.isEmpty(pageResult.getRecords())) {
|
||||
if (CollUtil.isEmpty(pageResult)) {
|
||||
return new PageResult<>();
|
||||
}
|
||||
|
||||
Long sum = planItemMapper.selectPlateCountByPlateIds(queryWrapperX);
|
||||
|
||||
return new PageResult<>(pageResult, sum);
|
||||
|
||||
return new PageResult<>(pageResult.getRecords(), pageResult.getTotal());
|
||||
}
|
||||
|
||||
|
||||
|
||||
+24
-4
@@ -124,10 +124,30 @@
|
||||
ob.room_name as roomName
|
||||
|
||||
from order_plan_item opi
|
||||
join order_goods og on opi.order_id = og.order_id and opi.goods_id = og.id and og.organ_id = #{organId}
|
||||
join order_plate op on opi.order_id = op.order_id and opi.goods_id = op.goods_id and opi.plate_id = op.id and op.organ_id = #{organId}
|
||||
join order_item oi on op.order_id = oi.order_id and op.id = oi.plate_id and oi.organ_id = #{organId}
|
||||
join order_body ob on oi.order_id = ob.order_id and oi.body_id = ob.id and ob.organ_id = #{organId}
|
||||
join order_goods og on opi.order_id = og.order_id and opi.goods_id = og.id
|
||||
join order_plate op on opi.order_id = op.order_id and opi.goods_id = op.goods_id and opi.plate_id = op.id
|
||||
join order_item oi on op.order_id = oi.order_id and op.id = oi.plate_id
|
||||
join order_body ob on oi.order_id = ob.order_id and oi.body_id = ob.id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
limit #{pageNo},#{pageSize};
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectPlateCountByPlateIds" resultType="java.lang.Long">
|
||||
|
||||
|
||||
select count(distinct op.id)
|
||||
|
||||
from order_plan_item opi
|
||||
join order_goods og on opi.order_id = og.order_id and opi.goods_id = og.id
|
||||
join order_plate op on opi.order_id = op.order_id and opi.goods_id = op.goods_id and opi.plate_id = op.id
|
||||
join order_item oi on op.order_id = oi.order_id and op.id = oi.plate_id
|
||||
join order_body ob on oi.order_id = ob.order_id and oi.body_id = ob.id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user