mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 12:52:07 +08:00
装配订单分页性能优化
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
* @param parentIds
|
||||
* @return
|
||||
*/
|
||||
List<OrderDO> selectChildList(@Param("reqVO") OrderPageReqVO reqVO, @Param("parentIds") List<Long> parentIds);
|
||||
List<Long> selectChildIdList(@Param("reqVO") OrderPageReqVO reqVO, @Param("parentIds") List<Long> parentIds);
|
||||
|
||||
IPage<OrderRespVOCopy> selectOrderPage(@Param("page") IPage<OrderRespVOCopy> page, @Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper);
|
||||
|
||||
|
||||
+5
-2
@@ -108,9 +108,12 @@ public class AssemblyListServiceImpl implements AssemblyListService {
|
||||
orderDOS.sort(Comparator.comparing(o -> sortMap.get(o.getId())));
|
||||
|
||||
// 3. 查询子单
|
||||
List<OrderDO> childList =
|
||||
orderMapper.selectChildList(pageReqVO, orderIds);
|
||||
List<Long> childIdList = orderMapper.selectChildIdList(pageReqVO, orderIds);
|
||||
if (CollUtil.isEmpty(childIdList)) {
|
||||
return new PageResult<>(orderDOS, pageResultTotal);
|
||||
}
|
||||
|
||||
List<OrderDO> childList = orderMapper.selectByIds(childIdList);
|
||||
if (CollUtil.isEmpty(childList)) {
|
||||
return new PageResult<>(orderDOS, pageResultTotal);
|
||||
}
|
||||
|
||||
+5
-2
@@ -356,9 +356,12 @@ public class OrderServiceImpl implements OrderService {
|
||||
orderDOS.sort(Comparator.comparing(o -> sortMap.get(o.getId())));
|
||||
|
||||
// 3. 查询子单
|
||||
List<OrderDO> childList =
|
||||
orderMapper.selectChildList(pageReqVO, orderIds);
|
||||
List<Long> childIdList = orderMapper.selectChildIdList(pageReqVO, orderIds);
|
||||
if (CollUtil.isEmpty(childIdList)) {
|
||||
return new PageResult<>(orderDOS, pageResultTotal);
|
||||
}
|
||||
|
||||
List<OrderDO> childList = orderMapper.selectByIds(childIdList);
|
||||
if (CollUtil.isEmpty(childList)) {
|
||||
return new PageResult<>(orderDOS, pageResultTotal);
|
||||
}
|
||||
|
||||
+20
-25
@@ -34,13 +34,10 @@
|
||||
t.root_id
|
||||
|
||||
FROM orders t
|
||||
where 1=1
|
||||
|
||||
<if test="reqVO.assembly or reqVO.processStatus != null">
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM order_component oc
|
||||
WHERE oc.order_id = t.id
|
||||
JOIN order_component oc
|
||||
ON oc.organ_id = t.organ_id
|
||||
AND oc.order_id = t.id
|
||||
AND oc.deleted = 0
|
||||
AND oc.pid = 0
|
||||
<if test="reqVO.processStatus != null">
|
||||
@@ -60,8 +57,8 @@
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
)
|
||||
</if>
|
||||
where 1=1
|
||||
|
||||
<if test="reqVO.id != null and reqVO.id != ''">
|
||||
AND CAST(t.id AS CHAR) LIKE CONCAT('%', #{reqVO.id}, '%')
|
||||
@@ -171,26 +168,16 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectChildList"
|
||||
resultType="com.cf.imes.module.executor.dal.dataobject.order.OrderDO">
|
||||
<select id="selectChildIdList"
|
||||
resultType="java.lang.Long">
|
||||
|
||||
SELECT *
|
||||
SELECT DISTINCT
|
||||
t.id
|
||||
FROM orders t
|
||||
WHERE t.parent_id IN
|
||||
|
||||
<foreach collection="parentIds"
|
||||
item="parentId"
|
||||
open="("
|
||||
separator=","
|
||||
close=")">
|
||||
#{parentId}
|
||||
</foreach>
|
||||
|
||||
<if test="reqVO.assembly or reqVO.processStatus != null">
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM order_component oc
|
||||
WHERE oc.order_id = t.id
|
||||
JOIN order_component oc
|
||||
ON oc.organ_id = t.organ_id
|
||||
AND oc.order_id = t.id
|
||||
AND oc.deleted = 0
|
||||
AND oc.pid = 0
|
||||
<if test="reqVO.processStatus != null">
|
||||
@@ -210,8 +197,16 @@
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
)
|
||||
</if>
|
||||
WHERE t.parent_id IN
|
||||
|
||||
<foreach collection="parentIds"
|
||||
item="parentId"
|
||||
open="("
|
||||
separator=","
|
||||
close=")">
|
||||
#{parentId}
|
||||
</foreach>
|
||||
|
||||
<if test="reqVO.id != null and reqVO.id != ''">
|
||||
AND CAST(t.id AS CHAR) LIKE CONCAT('%', #{reqVO.id}, '%')
|
||||
|
||||
Reference in New Issue
Block a user