yuan
3 天以前 7aad06fedc12f0183734088fa44c929ac6ff42b3
feat: 增加多个查询的排序功能以优化数据检索
已修改54个文件
274 ■■■■■ 文件已修改
src/main/java/com/ruoyi/collaborativeApproval/service/impl/NoticeServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/quality/service/impl/QualityInspectServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/account/AccountExpenseMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/account/AccountIncomeMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/account/SalesRefundAmountOrderMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/approve/ApproveProcessMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/approve/KnowledgeBaseMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/approve/NotificationManagementMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/basic/SupplierManageMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/NoticeMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/RulesRegulationsManagementMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/SealApplicationManagementMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/StaffContactsPersonalMapper.xml 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/device/DeviceDefectRecordMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/device/DeviceMaintenanceMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/device/DeviceRepairMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/equipmentenergyconsumption/EquipmentEnergyConsumptionMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/lavorissue/LavorIssueMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/measuringinstrumentledger/SparePartsMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/oA/OaProjectMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/officesupplies/OfficeSuppliesMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/CustomStorageMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/InboundManagementMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/ReturnManagementMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductOrderMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductWorkOrderMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductInputMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductMainMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductOutputMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/SalesLedgerWorkMapper.xml 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/ProductRecordMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/PurchaseReturnOrdersMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/quality/QualityUnqualifiedMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/InvoiceLedgerMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/InvoiceRegistrationMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/ReceiptPaymentMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesLedgerMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesQuotationMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/ShipmentApprovalMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/ShippingInfoMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/staff/PersonalAttendanceRecordsMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/staff/StaffContractMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/staff/StaffLeaveMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/staff/StaffOnJobMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/DocumentationBorrowManagementMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/DocumentationMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/DocumentationReturnManagementMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/warehouse/WarehouseGoodsShelvesMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/waterrecord/WaterRecordMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/collaborativeApproval/service/impl/NoticeServiceImpl.java
@@ -42,7 +42,8 @@
    @Override
    public List<NoticeDTO> selectCount() {
        List<Notice> notices = noticeMapper.selectList(Wrappers.lambdaQuery(Notice.class).groupBy(Notice::getType));
        // 只查 type 一列并按其分组(原写法 selectList+groupBy 会带出全部列,在 ONLY_FULL_GROUP_BY 下报 1055)
        List<Notice> notices = noticeMapper.selectList(Wrappers.lambdaQuery(Notice.class).select(Notice::getType).groupBy(Notice::getType));
        List<NoticeDTO> result = new ArrayList<>();
        for (Notice notice : notices) {
            NoticeDTO notice1 = new NoticeDTO();
src/main/java/com/ruoyi/quality/service/impl/QualityInspectServiceImpl.java
@@ -10,6 +10,7 @@
import com.deepoove.poi.config.Configure;
import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum;
import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.HackLoopTableRenderPolicy;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.procurementrecord.service.ProcurementRecordService;
@@ -33,6 +34,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
@@ -129,6 +131,9 @@
        InputStream inputStream = this.getClass().getResourceAsStream("/static/report-template.docx");
        Configure configure = Configure.builder()
                .bind("paramList", new HackLoopTableRenderPolicy())
                //日期默认按Date.toString()渲染(如Sun Sep 27 00:00:00 CST 2026),这里统一格式化为yyyy-MM-dd
                .addPreRenderDataCastor((policy, data) -> data instanceof Date
                        ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, (Date) data) : data)
                .build();
        String finalInspectType = inspectType;
        XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(
src/main/resources/mapper/account/AccountExpenseMapper.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ruoyi.account.mapper.AccountExpenseMapper">
    <select id="accountExpenseListPage" resultType="com.ruoyi.account.pojo.AccountExpense">
@@ -19,6 +19,7 @@
        <if test="accountExpense.expenseMethod != null and accountExpense.expenseMethod != '' ">
            AND expense_method = #{accountExpense.expenseMethod}
        </if>
        ORDER BY expense_date DESC, id DESC
    </select>
    <select id="accountExpenseExport" resultType="com.ruoyi.account.pojo.AccountExpense">
        SELECT
@@ -53,7 +54,7 @@
        <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
            AND expense_date &lt;= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
        </if>
        group by expense_type
        group by expense_type, sdd.dict_label
    </select>
    <select id="report1" resultType="java.math.BigDecimal">
src/main/resources/mapper/account/AccountIncomeMapper.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ruoyi.account.mapper.AccountIncomeMapper">
@@ -20,6 +20,7 @@
        <if test="accountIncome.incomeMethod != null and accountIncome.incomeMethod != '' ">
            AND income_method = #{accountIncome.incomeMethod}
        </if>
        ORDER BY income_date DESC, id DESC
    </select>
    <select id="accountIncomeExport" resultType="com.ruoyi.account.pojo.AccountIncome">
        SELECT
@@ -54,7 +55,7 @@
        <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
            AND income_date &lt;= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
        </if>
        group by income_type
        group by income_type, sdd.dict_label
    </select>
    <select id="report1" resultType="java.math.BigDecimal">
        SELECT
src/main/resources/mapper/account/SalesRefundAmountOrderMapper.xml
@@ -37,6 +37,7 @@
                and rm.return_no like concat('%',#{ew.returnManagementNo},'%')
            </if>
        </where>
        ORDER BY srao.id DESC
    </select>
</mapper>
src/main/resources/mapper/approve/ApproveProcessMapper.xml
@@ -38,5 +38,6 @@
        <if test="req.approveType != null ">
            and approve_type = #{req.approveType}
        </if>
        ORDER BY approve_time DESC, approve_id DESC
    </select>
</mapper>
src/main/resources/mapper/approve/KnowledgeBaseMapper.xml
@@ -16,6 +16,6 @@
                and type = #{knowledgeBase.type}
            </if>
        </where>
        ORDER BY create_time DESC, id DESC
    </select>
</mapper>
src/main/resources/mapper/approve/NotificationManagementMapper.xml
@@ -15,5 +15,6 @@
                and type = #{notificationManagement.type}
            </if>
        </where>
        ORDER BY create_time DESC, id DESC
    </select>
</mapper>
src/main/resources/mapper/basic/SupplierManageMapper.xml
@@ -34,6 +34,7 @@
                AND T1.is_white = #{supplierManageDto.isWhite}
            </if>
        </where>
        ORDER BY T1.maintain_time DESC, T1.id DESC
    </select>
    <select id="supplierExportList" resultType="com.ruoyi.basic.excel.SupplierManageExcelDto">
src/main/resources/mapper/collaborativeApproval/NoticeMapper.xml
@@ -17,5 +17,6 @@
                and n.status = #{ew.status}
            </if>
        </where>
        ORDER BY n.create_time DESC, n.id DESC
    </select>
</mapper>
src/main/resources/mapper/collaborativeApproval/RulesRegulationsManagementMapper.xml
@@ -27,5 +27,6 @@
                and rrm.category = #{ew.category}
            </if>
        </where>
        ORDER BY rrm.effective_time DESC, rrm.id DESC
    </select>
</mapper>
src/main/resources/mapper/collaborativeApproval/SealApplicationManagementMapper.xml
@@ -4,13 +4,13 @@
    <select id="listPage" resultType="com.ruoyi.collaborativeApproval.dto.SealApplicationManagementDTO">
        select sam.*, su.user_name as create_user_name, d.dept_name as department,
        select sam.*, su.user_name as create_user_name,
        (select d.dept_name from sys_user_dept sud join sys_dept d on d.dept_id = sud.dept_id
          where sud.user_id = su.user_id order by sud.dept_id desc limit 1) as department,
        su1.nick_name as approveUserName
        from seal_application_management sam
        left join sys_user su on sam.create_user = su.user_id
        left join sys_user su1 on sam.approve_user_id = su1.user_id
        left join sys_user_dept sud on su.user_id = sud.user_id
        left join sys_dept d on sud.dept_id = d.dept_id
        <where>
            <if test="ew.applicationNum != null and ew.applicationNum != ''">
                and sam.application_num like concat('%',#{ew.applicationNum},'%')
src/main/resources/mapper/collaborativeApproval/StaffContactsPersonalMapper.xml
@@ -10,7 +10,7 @@
            sjlr.staff_no,
            sjlr.staff_name,
            sjlr.sex,
            sjlr.post_job,
            (SELECT p.post_name FROM sys_post p WHERE p.post_id = sjlr.sys_post_id LIMIT 1) AS post_job,
            sjlr.adress,
            sjlr.profession,
            sjlr.identity_card,
@@ -22,6 +22,6 @@
        <if test="staffContactsPersonalDTO.staffName != null and staffContactsPersonalDTO.staffName != ''">
            and sjlr.staff_name like concat('%',#{staffContactsPersonalDTO.staffName},'%')
        </if>
        ORDER BY scp.create_time DESC
    </select>
</mapper>
src/main/resources/mapper/device/DeviceDefectRecordMapper.xml
@@ -21,6 +21,6 @@
                and ddr.status = #{deviceDefectRecordDto.status}
            </if>
        </where>
        ORDER BY ddr.id DESC
    </select>
</mapper>
src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
@@ -49,6 +49,7 @@
                and dm.maintenance_actually_time &lt; date_add(str_to_date(#{deviceMaintenanceDto.maintenanceActuallyTime}, '%Y-%m-%d'), interval 1 day)
            </if>
        </where>
        ORDER BY dm.id DESC
    </select>
    <select id="detailById" resultType="com.ruoyi.device.dto.DeviceMaintenanceDto">
        select dm.id,
src/main/resources/mapper/device/DeviceRepairMapper.xml
@@ -49,6 +49,7 @@
                and dr.maintenance_time like concat('%',#{deviceRepairDto.maintenanceTimeStr},'%')
            </if>
        </where>
        ORDER BY dr.id DESC
    </select>
    <select id="detailById" resultType="com.ruoyi.device.dto.DeviceRepairDto">
        select dr.id,
src/main/resources/mapper/equipmentenergyconsumption/EquipmentEnergyConsumptionMapper.xml
@@ -8,6 +8,7 @@
        <if test="req.name != null and req.name != ''">
            and `name` like concat('%',#{req.name},'%')
        </if>
        ORDER BY run_date DESC, id DESC
    </select>
    <select id="listPageByTrend" resultType="com.ruoyi.equipmentenergyconsumption.pojo.EquipmentEnergyConsumption">
        SELECT
@@ -20,9 +21,7 @@
        <if test="req.name != null and req.name != ''">
            and `name` like concat('%',#{req.name},'%')
        </if>
        GROUP BY
            `code`
        ORDER BY
            update_time DESC;
            update_time DESC
    </select>
</mapper>
src/main/resources/mapper/lavorissue/LavorIssueMapper.xml
@@ -36,6 +36,7 @@
                and t1.adopted_date is null and t1.issue_date &lt; current_date()
            </if>
        </where>
        ORDER BY t1.Issue_date DESC, t1.id DESC
    </select>
    <select id="list" resultType="com.ruoyi.lavorissue.pojo.LaborIssue">
        select
src/main/resources/mapper/measuringinstrumentledger/SparePartsMapper.xml
@@ -10,5 +10,6 @@
                and sp.name like concat('%',#{spareParts.name},'%')
            </if>
        </where>
        ORDER BY id DESC
    </select>
</mapper>
src/main/resources/mapper/oA/OaProjectMapper.xml
@@ -20,6 +20,7 @@
                and op.status = #{req.status}
            </if>
        </where>
        ORDER BY op.start_date DESC, op.project_id DESC
    </select>
    <select id="selectByIds" resultType="com.ruoyi.oA.dto.OaProjectDto">
        select op.*,su.nick_name as managerName from oa_project op
src/main/resources/mapper/officesupplies/OfficeSuppliesMapper.xml
@@ -15,5 +15,6 @@
                and status = #{req.status}
            </if>
        </where>
        ORDER BY apply_time DESC, id DESC
    </select>
</mapper>
src/main/resources/mapper/procurementrecord/CustomStorageMapper.xml
@@ -3,7 +3,25 @@
<mapper namespace="com.ruoyi.procurementrecord.mapper.CustomStorageMapper">
    <select id="listPageCopyByCustom" resultType="com.ruoyi.procurementrecord.pojo.CustomStorage">
        select t1.*,
        select ANY_VALUE(t1.id) as id,
               t1.product_category,
               t1.specification_model,
               t1.tax_inclusive_unit_price,
               ANY_VALUE(t1.item_type) as item_type,
               ANY_VALUE(t1.inbound_date) as inbound_date,
               ANY_VALUE(t1.inbound_batches) as inbound_batches,
               ANY_VALUE(t1.supplier_name) as supplier_name,
               ANY_VALUE(t1.unit) as unit,
               ANY_VALUE(t1.tax_inclusive_total_price) as tax_inclusive_total_price,
               ANY_VALUE(t1.tax_rate) as tax_rate,
               ANY_VALUE(t1.tax_exclusive_total_price) as tax_exclusive_total_price,
               ANY_VALUE(t1.create_by) as create_by,
               ANY_VALUE(t1.create_time) as create_time,
               ANY_VALUE(t1.update_time) as update_time,
               ANY_VALUE(t1.create_user) as create_user,
               ANY_VALUE(t1.update_user) as update_user,
               ANY_VALUE(t1.tenant_id) as tenant_id,
               ANY_VALUE(t1.code) as code,
               sum(t1.inbound_num) as inboundNum,
               sum(t1.inbound_num) as inboundNum0,
               sum(t1.tax_inclusive_total_price) as taxInclusiveTotalPrice,
@@ -23,6 +41,6 @@
        </where>
        group by t1.product_category, t1.specification_model, t1.tax_inclusive_unit_price
        HAVING availableStock > 0
        order by t1.inbound_date desc
        order by ANY_VALUE(t1.inbound_date) desc
    </select>
</mapper>
src/main/resources/mapper/procurementrecord/InboundManagementMapper.xml
@@ -12,5 +12,6 @@
                and supplier_name like concat('%',#{req.supplierName},'%')
            </if>
        </where>
        ORDER BY id DESC
    </select>
</mapper>
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -4,10 +4,10 @@
    <select id="listProcurementBySalesLedgerId" resultType="com.ruoyi.procurementrecord.dto.ProcurementDto">
        select
            t1.supplier_name,
            ANY_VALUE(t1.supplier_name) as supplier_name,
            t2.product_category,
            t2.id,
            t3.id as recordId,
            ANY_VALUE(t3.id) as recordId,
            t2.specification_model,
            t2.unit,
            t2.quantity,
@@ -18,9 +18,9 @@
            t2.tax_inclusive_unit_price,
            t2.tax_inclusive_total_price,
            t2.tax_exclusive_total_price,
            t3.inbound_num as quantityStock
            ANY_VALUE(t3.inbound_num) as quantityStock
        from  purchase_ledger t1
        left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id and slp.type = 2
        left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id and t2.type = 2
        left join procurement_record_storage t3 on t2.id = t3.sales_ledger_product_id
        where t1.purchase_contract_number = #{req.purchaseContractNumber}
        <if test="req.id != null and req.id != ''">
@@ -120,28 +120,28 @@
    <select id="listPageCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy">
        select
        t3.supplier_name,
        t3.purchase_contract_number,
        ANY_VALUE(t3.purchase_contract_number) as purchase_contract_number,
        t2.product_category,
        t1.id,
        t1.sales_ledger_product_id,
        t1.create_user,
        ANY_VALUE(t1.id) as id,
        ANY_VALUE(t1.sales_ledger_product_id) as sales_ledger_product_id,
        ANY_VALUE(t1.create_user) as create_user,
        t2.specification_model,
        t2.unit,
        t2.min_stock,
        t2.tax_rate,
        t2.tax_inclusive_unit_price,
        t2.tax_inclusive_total_price,
        t2.tax_exclusive_total_price,
        t1.inbound_batches,
        ANY_VALUE(t2.unit) as unit,
        ANY_VALUE(t2.min_stock) as min_stock,
        ANY_VALUE(t2.tax_rate) as tax_rate,
        ANY_VALUE(t2.tax_inclusive_unit_price) as tax_inclusive_unit_price,
        ANY_VALUE(t2.tax_inclusive_total_price) as tax_inclusive_total_price,
        ANY_VALUE(t2.tax_exclusive_total_price) as tax_exclusive_total_price,
        ANY_VALUE(t1.inbound_batches) as inbound_batches,
        t1.unit_price as unitPrice,
        sum(t1.total_price) as totalPrice,
        sum(t1.inbound_num) as inboundNum,
        sum(t1.inbound_num) as inboundNum0,
        t1.inbound_num as totalInboundNum,
        t1.create_time,
        t1.update_time,
        t1.create_by,
        t2.warn_num
        ANY_VALUE(t1.inbound_num) as totalInboundNum,
        ANY_VALUE(t1.create_time) as create_time,
        ANY_VALUE(t1.update_time) as update_time,
        ANY_VALUE(t1.create_by) as create_by,
        ANY_VALUE(t2.warn_num) as warn_num
        from  procurement_record_storage t1
        left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2
        left join purchase_ledger t3 on t3.id = t2.sales_ledger_id
@@ -178,25 +178,25 @@
    <select id="listCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy">
        select
            t3.supplier_name,
            t3.purchase_contract_number,
            ANY_VALUE(t3.purchase_contract_number) as purchase_contract_number,
            t2.product_category,
            t1.id,
            t1.sales_ledger_product_id,
            t1.create_user,
            t2.specification_model,
            t2.unit,
            t2.tax_rate,
            t2.tax_inclusive_unit_price,
            t2.tax_inclusive_total_price,
            t2.tax_exclusive_total_price,
            t1.inbound_batches,
            t1.inbound_num,
            t1.inbound_num as inboundNum0,
            t1.create_time,
            t1.update_time,
            t1.create_time as cTime,
            t1.update_time as uTime,
            t1.create_by
            ANY_VALUE(t1.id) as id,
            ANY_VALUE(t1.sales_ledger_product_id) as sales_ledger_product_id,
            ANY_VALUE(t1.create_user) as create_user,
            ANY_VALUE(t2.specification_model) as specification_model,
            ANY_VALUE(t2.unit) as unit,
            ANY_VALUE(t2.tax_rate) as tax_rate,
            ANY_VALUE(t2.tax_inclusive_unit_price) as tax_inclusive_unit_price,
            ANY_VALUE(t2.tax_inclusive_total_price) as tax_inclusive_total_price,
            ANY_VALUE(t2.tax_exclusive_total_price) as tax_exclusive_total_price,
            ANY_VALUE(t1.inbound_batches) as inbound_batches,
            ANY_VALUE(t1.inbound_num) as inbound_num,
            ANY_VALUE(t1.inbound_num) as inboundNum0,
            ANY_VALUE(t1.create_time) as create_time,
            ANY_VALUE(t1.update_time) as update_time,
            ANY_VALUE(t1.create_time) as cTime,
            ANY_VALUE(t1.update_time) as uTime,
            ANY_VALUE(t1.create_by) as create_by
        from  procurement_record_storage t1
                  left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2
                  left join purchase_ledger t3 on t3.id = t2.sales_ledger_id
@@ -205,27 +205,27 @@
    </select>
    <select id="listCopyOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy">
        select
            t3.customer_contract_no,
            t3.sales_contract_no,
            ANY_VALUE(t3.customer_contract_no) as customer_contract_no,
            ANY_VALUE(t3.sales_contract_no) as sales_contract_no,
            t3.customer_name,
            t2.product_category,
            t1.id,
            t1.sales_ledger_product_id,
            t1.create_user,
            t2.specification_model,
            t2.unit,
            t2.tax_rate,
            t2.tax_inclusive_unit_price,
            t2.tax_inclusive_total_price,
            t2.tax_exclusive_total_price,
            t1.inbound_batches,
            t1.inbound_num,
            t1.inbound_num as inboundNum0,
            t1.create_time,
            t1.update_time,
            t1.create_time as cTime,
            t1.update_time as uTime,
            t1.create_by
            ANY_VALUE(t1.id) as id,
            ANY_VALUE(t1.sales_ledger_product_id) as sales_ledger_product_id,
            ANY_VALUE(t1.create_user) as create_user,
            ANY_VALUE(t2.specification_model) as specification_model,
            ANY_VALUE(t2.unit) as unit,
            ANY_VALUE(t2.tax_rate) as tax_rate,
            ANY_VALUE(t2.tax_inclusive_unit_price) as tax_inclusive_unit_price,
            ANY_VALUE(t2.tax_inclusive_total_price) as tax_inclusive_total_price,
            ANY_VALUE(t2.tax_exclusive_total_price) as tax_exclusive_total_price,
            ANY_VALUE(t1.inbound_batches) as inbound_batches,
            ANY_VALUE(t1.inbound_num) as inbound_num,
            ANY_VALUE(t1.inbound_num) as inboundNum0,
            ANY_VALUE(t1.create_time) as create_time,
            ANY_VALUE(t1.update_time) as update_time,
            ANY_VALUE(t1.create_time) as cTime,
            ANY_VALUE(t1.update_time) as uTime,
            ANY_VALUE(t1.create_by) as create_by
        from  procurement_record_storage t1
                  left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1
                  left join sales_ledger t3 on t3.id = t2.sales_ledger_id
src/main/resources/mapper/procurementrecord/ReturnManagementMapper.xml
@@ -39,6 +39,7 @@
                and sl.sales_contract_no like concat('%',#{req.salesContractNo},'%')
            </if>
        </where>
        ORDER BY rm.make_time DESC, rm.id DESC
    </select>
    <select id="getReturnManagementDtoById" resultType="com.ruoyi.procurementrecord.dto.ReturnManagementDto">
     select rm.*,
src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -64,6 +64,7 @@
                and po.create_time between #{c.startTime} and #{c.endTime}
            </if>
        </where>
        ORDER BY po.create_time DESC, po.id DESC
    </select>
    <select id="listProcessRoute" resultType="com.ruoyi.production.pojo.ProcessRoute">
        select pr.*
src/main/resources/mapper/production/ProductWorkOrderMapper.xml
@@ -48,6 +48,7 @@
            <if test="c.productOrderId != null and c.productOrderId != ''">
               and pwo.product_order_id = #{c.productOrderId}
            </if>
        ORDER BY pwo.create_time DESC, pwo.id DESC
    </select>
    <select id="getProductWorkOrderFlowCard" resultType="com.ruoyi.production.dto.ProductWorkOrderDto">
        SELECT
src/main/resources/mapper/production/ProductionProductInputMapper.xml
@@ -26,7 +26,7 @@
                and ppm.id = #{c.productMainId}
            </if>
        </where>
        order by ppi.id
        order by ppi.id DESC
    </select>
    <delete id="deleteByProductMainIds" parameterType="java.util.List">
src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -49,7 +49,7 @@
                and ppm.status = #{c.status}
            </if>
        </where>
        order by ppm.id
        order by ppm.id DESC
    </select>
    <select id="getOrderByMainId" resultType="com.ruoyi.production.pojo.ProductOrder">
src/main/resources/mapper/production/ProductionProductOutputMapper.xml
@@ -24,7 +24,7 @@
                and ppm.id = #{c.productMainId}
            </if>
        </where>
        order by ppo.id
        order by ppo.id DESC
    </select>
    <delete id="deleteByProductMainIds" parameterType="java.util.List">
src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper">
@@ -22,7 +22,7 @@
        FROM
        sales_ledger_production_accounting t4
        LEFT JOIN sales_ledger T1 ON T1.id = t4.sales_ledger_id
        left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and slp.type = 1
        left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and t3.type = 1
        <where>
            t3.type = 1
            <if test="salesLedgerDto.schedulingUserName != null and salesLedgerDto.schedulingUserName != '' ">
@@ -84,7 +84,7 @@
            </if>
        </where>
        GROUP BY slpa.scheduling_user_name
        GROUP BY slpa.scheduling_user_id, slpa.scheduling_user_name
    </select>
@@ -115,7 +115,7 @@
                 left join product_process pp on pp.name = slpa.process
        where  slpa.scheduling_user_id = #{ew.userId}
          and slpa.scheduling_date like concat(#{ew.date}, '%')
        group by slpa.scheduling_user_id
        group by slpa.scheduling_user_id, pp.type
    </select>
src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.production.mapper.SalesLedgerSchedulingMapper">
@@ -67,6 +67,7 @@
                LEFT join sales_ledger_scheduling t3 on T1.id = t3.sales_ledger_id
        where T1.id is not null and T2.type = 1
        GROUP BY T2.id
        ORDER BY T2.id DESC
    </select>
    <select id="listPageProcess" resultType="com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto">
        SELECT
@@ -91,7 +92,7 @@
        FROM
        sales_ledger_scheduling T2
        LEFT JOIN sales_ledger T1 ON T1.id = T2.sales_ledger_id
        left join sales_ledger_product t3 on T2.sales_ledger_product_id = t3.id and slp.type = 1
        left join sales_ledger_product t3 on T2.sales_ledger_product_id = t3.id and t3.type = 1
        <where>
            t3.type = 1
            <if test="salesLedgerDto.status != null and salesLedgerDto.status != '' ">
src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.production.mapper.SalesLedgerWorkMapper">
@@ -28,7 +28,7 @@
        FROM
        sales_ledger_work t4
        LEFT JOIN sales_ledger T1 ON T1.id = t4.sales_ledger_id
        left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and slp.type = 1
        left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and t3.type = 1
        left join sales_ledger_scheduling t2 on t4.sales_ledger_scheduling_id = t2.id
        <where>
            t3.type = 1
src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
@@ -81,6 +81,7 @@
                or pl.purchase_contract_number LIKE CONCAT('%', #{supplierNameOrContractNo}, '%')
            </if>
        </where>
        ORDER BY pr.payment_date DESC, pr.id DESC
    </select>
    <select id="selectPaymentRegistrationById" parameterType="Long" resultMap="PaymentRegistrationDtoResult">
@@ -145,7 +146,7 @@
             FROM payment_registration
             WHERE supplier_id = #{supplierId}
        ) T1
        ORDER BY T1.happenTime ASC
        ORDER BY T1.happenTime DESC
    </select>
@@ -197,13 +198,14 @@
                T1.supplier_name LIKE CONCAT ('%',#{req.supplierName},'%')
            </if>
        </where>
        GROUP BY T1.supplier_name
        GROUP BY T1.supplier_id, T1.supplier_name
        ORDER BY invoiceAmount DESC
    </select>
    <select id="supplierNameListPageDetails" resultType="com.ruoyi.purchase.dto.PaymentRegistrationDto">
        SELECT
        T1.supplier_id,
        T1.supplier_name,
        ANY_VALUE(T1.supplier_id) AS supplier_id,
        ANY_VALUE(T1.supplier_name) AS supplier_name,
        SUM(contract_amount) AS invoiceAmount,
        IFNULL( SUM(T2.current_payment_amount) , 0 ) AS paymentAmount,
        IFNULL((IFNULL(SUM(contract_amount),0)  - IFNULL(SUM(T2.current_payment_amount),0)),0) AS payableAmount,
src/main/resources/mapper/purchase/ProductRecordMapper.xml
@@ -42,6 +42,7 @@
        <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''">
            and tr.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%')
        </if>
        ORDER BY tr.issue_date DESC, pr.id DESC
    </select>
    <select id="getProductRecordById" resultType="com.ruoyi.purchase.dto.ProductRecordDto">
        SELECT
src/main/resources/mapper/purchase/PurchaseReturnOrdersMapper.xml
@@ -35,5 +35,6 @@
        <if test="params.no != null and params.no != '' ">
            AND pro.no LIKE CONCAT('%',#{params.no},'%')
        </if>
        ORDER BY pro.prepared_at DESC, pro.id DESC
    </select>
</mapper>
src/main/resources/mapper/quality/QualityUnqualifiedMapper.xml
@@ -43,6 +43,7 @@
        <if test="qualityUnqualified.entryDateEnd != null and qualityUnqualified.entryDateEnd != '' ">
            AND  check_time &lt;= DATE_FORMAT(#{qualityUnqualified.entryDateEnd},'%Y-%m-%d')
        </if>
        ORDER BY qu.check_time DESC, qu.id DESC
    </select>
    <select id="qualityUnqualifiedExport" resultType="com.ruoyi.quality.pojo.QualityUnqualified">
        SELECT
src/main/resources/mapper/sales/InvoiceLedgerMapper.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -43,6 +43,7 @@
                AND DATE_FORMAT(T1.invoice_date,'%Y-%m-%d') = DATE_FORMAT(#{invoiceLedgerDto.invoiceDate},'%Y-%m-%d')
            </if>
        </where>
        ORDER BY T1.invoice_date DESC, T1.id DESC
    </select>
    <select id="invoiceLedgerList" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto">
@@ -85,6 +86,7 @@
                AND DATE_FORMAT(T1.invoice_date,'%Y-%m-%d') = DATE_FORMAT(#{invoiceLedgerDto.invoiceDate},'%Y-%m-%d')
            </if>
        </where>
        ORDER BY T1.invoice_date DESC, T1.id DESC
    </select>
    <select id="invoiceLedgerInfo" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto">
@@ -123,7 +125,7 @@
                T1.customer_name LIKE CONCAT ('%',#{invoiceLedgerDto.searchText},'%')
            </if>
        </where>
        GROUP BY T1.customer_name
        GROUP BY T1.customer_id, T1.customer_name
    </select>
    <select id="invoiceLedgerProductInfo" resultType="com.ruoyi.sales.dto.InvoiceRegistrationProductDto">
src/main/resources/mapper/sales/InvoiceRegistrationMapper.xml
@@ -32,6 +32,7 @@
            GROUP BY
                invoice_registration_id
        ) T4 ON T1.id = T4.invoice_registration_id
        ORDER BY T1.id DESC
    </select>
    <select id="invoiceRegisAndProductExcelDtoList" resultType="com.ruoyi.sales.excel.InvoiceRegisAndProductExcelDto">
@@ -67,6 +68,6 @@
                 JOIN sales_ledger T2 ON T1.sales_ledger_id = T2.id
                 JOIN customer T3 ON T1.customer_id = T3.id
                JOIN invoice_registration_product T4 ON T1.id = T4.invoice_registration_id
        ORDER BY T1.id ASC
        ORDER BY T1.id DESC
    </select>
</mapper>
src/main/resources/mapper/sales/ReceiptPaymentMapper.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -29,7 +29,7 @@
                AND T4.customer_id = #{receiptPaymentDto.customerId}
            </if>
        </where>
        ORDER BY T1.create_time ASC
        ORDER BY T1.create_time DESC
    </select>
    <select id="receiptPaymentInfo" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto">
@@ -90,7 +90,7 @@
        FROM invoice_ledger_file
        GROUP BY invoice_ledger_id
        ) T4 ON T4.invoice_ledger_id = T1.id
        LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and slp.type = 1
        LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and T5.type = 1
        LEFT JOIN (
        SELECT
        SUM(receipt_payment_amount) AS receipt_payment_amount_total,
@@ -347,6 +347,7 @@
                LEFT JOIN invoice_ledger T2 ON T1.invoice_ledger_id = T2.id
        WHERE
            T2.invoice_registration_product_id = #{invoiceRegistrationProductId}
        ORDER BY T1.receipt_payment_date DESC
    </select>
    <select id="bindInvoiceNoRegListAll" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto">
        SELECT
@@ -378,7 +379,7 @@
                GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName
            FROM invoice_ledger_file GROUP BY invoice_ledger_id
        ) T4 ON T4.invoice_ledger_id = T1.id
                 LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and slp.type = 1
                 LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and T5.type = 1
                 LEFT JOIN (
            SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP
                BY invoice_ledger_id
@@ -414,7 +415,7 @@
        GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName
        FROM invoice_ledger_file GROUP BY invoice_ledger_id
        ) T4 ON T4.invoice_ledger_id = T1.id
        LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and slp.type = 1
        LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and T5.type = 1
        LEFT JOIN (
        SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP
        BY invoice_ledger_id
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, T1.id DESC
    </select>
    <select id="selectSalesLedgerListPage" resultType="com.ruoyi.sales.pojo.SalesLedger">
@@ -119,6 +120,7 @@
            and sl.customer_name like concat('%',#{ew.customerName},'%')
            </if>
        </where>
        ORDER BY sl.entry_date DESC, sl.id DESC
    </select>
</mapper>
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -106,8 +106,8 @@
            resultType="com.ruoyi.purchase.dto.ProcurementBusinessSummaryDto">
        SELECT
        slp.product_category AS productCategory,
        slp.specification_model AS specificationModel,
        sl.supplier_name AS supplierName,
        ANY_VALUE(slp.specification_model) AS specificationModel,
        ANY_VALUE(sl.supplier_name) AS supplierName,
        SUM(slp.quantity) AS purchaseNum,
        SUM(slp.tax_inclusive_total_price) AS purchaseAmount,
        COUNT(DISTINCT slp.sales_ledger_id) AS purchaseTimes,
src/main/resources/mapper/sales/SalesQuotationMapper.xml
@@ -18,5 +18,6 @@
        <if test="salesQuotationDto.status != null and salesQuotationDto.status != '' ">
            AND t1.status = #{salesQuotationDto.status}
        </if>
        ORDER BY t1.quotation_date DESC, t1.id DESC
    </select>
</mapper>
src/main/resources/mapper/sales/ShipmentApprovalMapper.xml
@@ -3,8 +3,12 @@
<mapper namespace="com.ruoyi.sales.mapper.ShipmentApprovalMapper">
    <select id="listPage" resultType="com.ruoyi.sales.pojo.ShipmentApproval">
        SELECT *,
        SELECT sa.*,
        slp.product_category, slp.specification_model, slp.unit, slp.quantity, slp.min_stock,
        slp.tax_rate, slp.tax_inclusive_unit_price, slp.tax_inclusive_total_price, slp.tax_exclusive_total_price,
        slp.invoice_type, slp.type,
        si.shipping_car_number,
        si.shipping_date,
        T2.nick_name AS entry_person_name
        FROM shipment_approval sa
                 LEFT JOIN shipping_info si ON sa.shipping_info_id = si.id
@@ -20,5 +24,6 @@
                AND  sl.sales_contract_no LIKE CONCAT('%',#{req.salesContractNo},'%')
            </if>
        </where>
        ORDER BY sa.id DESC
    </select>
</mapper>
src/main/resources/mapper/sales/ShippingInfoMapper.xml
@@ -57,6 +57,7 @@
            sl.customer_name
        FROM shipping_info s
                 LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id
        ORDER BY s.shipping_date DESC, s.id DESC
    </select>
    <select id="getReturnManagementDtoById" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto">
        SELECT
src/main/resources/mapper/staff/PersonalAttendanceRecordsMapper.xml
@@ -39,6 +39,7 @@
            and personal_attendance_records.date &gt;= #{params.date}
            and personal_attendance_records.date &lt; DATE_ADD(DATE(#{params.date}), INTERVAL 1 DAY)
        </if>
        ORDER BY personal_attendance_records.id DESC
    </select>
    <!-- 查询指定日期没有考勤记录的在职员工(在指定时间之前入职的) -->
src/main/resources/mapper/staff/StaffContractMapper.xml
@@ -11,5 +11,6 @@
        <if test="staffContract.staffOnJobId != null">
            AND soj.id = #{staffContract.staffOnJobId}
        </if>
        ORDER BY sc.contract_start_time DESC, sc.id DESC
    </select>
</mapper>
src/main/resources/mapper/staff/StaffLeaveMapper.xml
@@ -30,6 +30,7 @@
        <if test="c.staffName != null and c.staffName != '' ">
            AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%')
        </if>
        ORDER BY staff_leave.id DESC
    </select>
    <select id="staffLeaveList" resultType="com.ruoyi.staff.dto.StaffLeaveDto">
        SELECT
src/main/resources/mapper/staff/StaffOnJobMapper.xml
@@ -24,6 +24,7 @@
        <if test="staffOnJob.entryDateEnd != null and staffOnJob.entryDateEnd != '' ">
            AND contract_expire_time &lt;= DATE_FORMAT(#{staffOnJob.entryDateEnd},'%Y-%m-%d')
        </if>
        ORDER BY staff_on_job.sign_date DESC, staff_on_job.id DESC
    </select>
    <select id="staffOnJobList" resultType="com.ruoyi.staff.dto.StaffOnJobDto">
        SELECT
src/main/resources/mapper/warehouse/DocumentationBorrowManagementMapper.xml
@@ -51,6 +51,7 @@
        <if test="documentationBorrowManagement.entryDateEnd != null and documentationBorrowManagement.entryDateEnd != ''">
            and borrow_date &lt;= DATE_FORMAT(#{documentationBorrowManagement.entryDateEnd},'%Y-%m-%d')
        </if>
        ORDER BY borrow_date DESC, id DESC
    </select>
    <select id="export" resultType="com.ruoyi.warehouse.dto.DocumentationBorrowManagementDto">
        select dbm.*,doc.doc_name
src/main/resources/mapper/warehouse/DocumentationMapper.xml
@@ -32,6 +32,7 @@
        <if test="documentation.id != null">
            and doc.id = #{documentation.id}
        </if>
        ORDER BY id DESC
    </select>
    <select id="listByDocumentClassificationId" resultType="com.ruoyi.warehouse.dto.DocumentationDto">
        SELECT
src/main/resources/mapper/warehouse/DocumentationReturnManagementMapper.xml
@@ -28,6 +28,7 @@
        <if test="documentationReturnManagement.entryDateEnd != null and documentationReturnManagement.entryDateEnd != ''">
            and return_date &lt;= DATE_FORMAT(#{documentationReturnManagement.entryDateEnd},'%Y-%m-%d')
        </if>
        ORDER BY return_date DESC, id DESC
    </select>
    <select id="exportrevent" resultType="com.ruoyi.warehouse.dto.ReturnExportDto">
src/main/resources/mapper/warehouse/WarehouseGoodsShelvesMapper.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesMapper">
@@ -19,7 +19,7 @@
        <where>
            1=1
            <if test="warehouseGoodsShelves.goodsShelvesName != null and warehouseGoodsShelves.goodsShelvesName != ''">
                and wgs.goods_shelves_name like concat('%',#{warehouseGoodsShelves.goodsShelvesName},'%')
                and wgs.name like concat('%',#{warehouseGoodsShelves.goodsShelvesName},'%')
            </if>
            <if test="warehouseGoodsShelves.warehouseId != null">
                and wgs.warehouse_id = #{warehouseGoodsShelves.warehouseId}
@@ -35,7 +35,7 @@
        <where>
            1=1
            <if test="warehouseGoodsShelves.goodsShelvesName != null and warehouseGoodsShelves.goodsShelvesName != ''">
                and goods_shelves_name like concat('%',#{warehouseGoodsShelves.goodsShelvesName},'%')
                and wgs.name like concat('%',#{warehouseGoodsShelves.goodsShelvesName},'%')
            </if>
            <if test="warehouseGoodsShelves.warehouseId != null">
                and warehouse_id = #{warehouseGoodsShelves.warehouseId}
src/main/resources/mapper/waterrecord/WaterRecordMapper.xml
@@ -13,5 +13,6 @@
                and t2.device_name like concat('%',#{req.deviceName},'%')
            </if>
        </where>
        ORDER BY t1.id DESC
    </select>
</mapper>