zss
2 天以前 a5198f6c2306d1dae7709e9643e09e678cc36eca
refactor(database): 优化多处查询排序字段

- 调整生产任务查询排序字段为工单号降序
- 更新生产订单查询排序,优先按状态排序,再按计划完成时间降序
- 修改生产计划查询排序字段为需求日期降序
- 调整生产产品主表查询排序为产品编号降序
- 采购台账查询增加按录入日期降序排序
- 销售台账添加录入日期时区格式并按录入日期降序排序
- 配送信息发货日期添加时区格式并调整排序字段为发货编号降序
- 库存出库记录查询排序优化为出库批次降序

# Conflicts:
# src/main/resources/mapper/production/ProductionPlanMapper.xml
已修改9个文件
16 ■■■■■ 文件已修改
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionOperationTaskMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionOrderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionPlanMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductMainMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesLedgerMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/ShippingInfoMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/stock/StockInRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/stock/StockOutRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -130,6 +130,7 @@
        if (purchaseLedger.getApprovalStatus() != null) {
            queryWrapper.eq(PurchaseLedger::getApprovalStatus, purchaseLedger.getApprovalStatus());
        }
        queryWrapper.orderByDesc(PurchaseLedger::getEntryDate);
        return purchaseLedgerMapper.selectList(queryWrapper);
    }
src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
@@ -71,7 +71,7 @@
                and pot.work_order_no like concat('%', #{c.workOrderNo}, '%')
            </if>
        </where>
        order by pot.production_order_id desc, poro.drag_sort
        order by pot.work_order_no desc, poro.drag_sort
    </select>
    <select id="selectTaskStatisticsByDate" resultType="com.ruoyi.home.dto.ProductionTaskStatisticsDto">
src/main/resources/mapper/production/ProductionOrderMapper.xml
@@ -134,7 +134,7 @@
        <include refid="ProductionOrderVoColumns" />
        <include refid="ProductionOrderVoFrom" />
        <include refid="ProductionOrderWhere" />
        order by po.id desc
        order by po.status  , po.plan_complete_time desc
    </select>
    <select id="listProductionOrder" resultMap="ProductionOrderVoResultMap">
src/main/resources/mapper/production/ProductionPlanMapper.xml
@@ -58,7 +58,7 @@
                </if>
            </if>
        </where>
        ORDER BY COALESCE(pp.id) DESC
        ORDER BY pp.required_date DESC
    </select>
    <select id="selectWithMaterialByIds" resultType="com.ruoyi.production.bean.dto.ProductionPlanDto">
src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -82,7 +82,7 @@
                and ppm.id = #{c.productMainId}
            </if>
        </where>
        order by ppm.create_time desc
        order by ppm.product_no desc
    </select>
    <select id="getOrderByMainId" resultType="com.ruoyi.production.pojo.ProductionOrder">
src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -40,6 +40,7 @@
                T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
            </if>
        </where>
        order by T1.entry_date desc
    </select>
    <select id="selectSalesLedgerListPage" resultType="com.ruoyi.sales.vo.SalesLedgerVo">
src/main/resources/mapper/sales/ShippingInfoMapper.xml
@@ -48,7 +48,7 @@
        <if test="req.expressNumber != null and req.expressNumber != ''">
            AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%')
        </if>
        order by create_time DESC
        order by shipping_no DESC
    </select>
    <select id="listAll" resultType="com.ruoyi.sales.pojo.ShippingInfo">
        SELECT
src/main/resources/mapper/stock/StockInRecordMapper.xml
@@ -132,7 +132,7 @@
                and p.id in (select id from product_tree)
            </if>
        </where>
        order by sir.id desc
        order by sir.inbound_batches desc
    </select>
    <select id="listStockInRecordExportData" resultType="com.ruoyi.stock.execl.StockInRecordExportData">
        SELECT
src/main/resources/mapper/stock/StockOutRecordMapper.xml
@@ -89,7 +89,7 @@
                and sor.record_type = #{params.recordType}
            </if>
        </where>
        order by sor.id desc
        order by sor.outbound_batches desc
    </select>
    <select id="listPageAccountSales" resultType="com.ruoyi.account.bean.vo.sales.SalesOutboundVo">