feat: 更新查询顺序以首先显示多个服务和映射器中的最新记录
| | |
| | | borrowInfoLambdaQueryWrapper.like(BorrowInfo::getBorrowerName, borrowInfo.getBorrowerName()); |
| | | } |
| | | } |
| | | // 最新借款在前 |
| | | borrowInfoLambdaQueryWrapper.orderByDesc(BorrowInfo::getCreateTime); |
| | | return AjaxResult.success(borrowInfoMapper.selectPage(page, borrowInfoLambdaQueryWrapper)); |
| | | } |
| | | |
| | |
| | | QueryWrapper<InvoiceRegistrationProduct> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("sales_ledger_id", invoiceRegistrationProduct.getSalesLedgerId()); |
| | | queryWrapper.eq("sales_ledger_product_id", invoiceRegistrationProduct.getSalesLedgerProductId()); |
| | | queryWrapper.orderByAsc("create_time"); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | List<InvoiceRegistrationProduct> allList = invoiceRegistrationProductMapper.selectList(queryWrapper); |
| | | |
| | | int index = -1; |
| | |
| | | QueryWrapper<InvoiceRegistrationProduct> newQueryWrapper = new QueryWrapper<>(); |
| | | newQueryWrapper.eq("sales_ledger_id", invoiceRegistrationProduct.getSalesLedgerId()); |
| | | newQueryWrapper.eq("sales_ledger_product_id", invoiceRegistrationProduct.getSalesLedgerProductId()); |
| | | newQueryWrapper.orderByAsc("create_time"); |
| | | newQueryWrapper.orderByDesc("create_time"); |
| | | List<InvoiceRegistrationProduct> remainList = invoiceRegistrationProductMapper.selectList(newQueryWrapper); |
| | | |
| | | // 查询销售台账产品 |
| | |
| | | QueryWrapper<InvoiceRegistrationProduct> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("sales_ledger_id", invoiceRegistrationProduct.getSalesLedgerId()); |
| | | queryWrapper.eq("sales_ledger_product_id", invoiceRegistrationProduct.getSalesLedgerProductId()); |
| | | queryWrapper.orderByAsc("create_time"); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | List<InvoiceRegistrationProduct> list = invoiceRegistrationProductMapper.selectList(queryWrapper); |
| | | |
| | | if (CollectionUtils.isEmpty(list)) { |
| | |
| | | } else { |
| | | item.setShippingStatus("已发货"); |
| | | } |
| | | } else { |
| | | // 没有任何磅单 → 未发货 |
| | | item.setShippingStatus("未发货"); |
| | | } |
| | | item.setShippingStatus("未发货"); |
| | | }); |
| | | // 开票 |
| | | InvoiceRegistrationProductDto invoiceRegistrationProductDto = new InvoiceRegistrationProductDto(); |
| | |
| | | // 发货单位(精确查询,可选) |
| | | queryWrapper.eq(StringUtils.isNotBlank(weighingRecord.getShipUnit()), |
| | | WeighingRecord::getShipUnit, weighingRecord.getShipUnit()); |
| | | // 最新过磅在前 |
| | | queryWrapper.orderByDesc(WeighingRecord::getCreateTime); |
| | | return weighingRecordMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | |
| | | and supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | | </where> |
| | | order by create_time desc, id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | 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.* |
| | |
| | | <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 |
| | |
| | | and ppm.id = #{c.productMainId} |
| | | </if> |
| | | </where> |
| | | order by ppi.id |
| | | order by ppi.create_time desc, ppi.id desc |
| | | </select> |
| | | |
| | | <delete id="deleteByProductMainIds" parameterType="java.util.List"> |
| | |
| | | and ppm.status = #{c.status} |
| | | </if> |
| | | </where> |
| | | order by ppm.id |
| | | order by ppm.create_time desc, ppm.id desc |
| | | |
| | | </select> |
| | | <select id="getOrderByMainId" resultType="com.ruoyi.production.pojo.ProductOrder"> |
| | |
| | | and ppm.id = #{c.productMainId} |
| | | </if> |
| | | </where> |
| | | order by ppo.id |
| | | order by ppo.create_time desc, ppo.id desc |
| | | </select> |
| | | |
| | | <delete id="deleteByProductMainIds" parameterType="java.util.List"> |
| | |
| | | </if> |
| | | </where> |
| | | GROUP BY slpa.scheduling_user_id, slpa.scheduling_user_name |
| | | order by slpa.scheduling_date desc, slpa.id desc |
| | | </select> |
| | | |
| | | <select id="selectDailyWagesStats" resultType="java.util.Map"> |
| | |
| | | <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''"> |
| | | and tr.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%') |
| | | </if> |
| | | ORDER BY pr.created_at DESC, pr.id DESC |
| | | </select> |
| | | <select id="getProductRecordById" resultType="com.ruoyi.purchase.dto.ProductRecordDto"> |
| | | SELECT |
| | |
| | | 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"> |
| | |
| | | GROUP BY |
| | | invoice_registration_id |
| | | ) T4 ON T1.id = T4.invoice_registration_id |
| | | ORDER BY T1.create_time DESC, T1.id DESC |
| | | </select> |
| | | |
| | | <select id="invoiceRegisAndProductExcelDtoList" resultType="com.ruoyi.sales.excel.InvoiceRegisAndProductExcelDto"> |
| | |
| | | AND T4.customer_id = #{receiptPaymentDto.customerId} |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.create_time ASC |
| | | ORDER BY T1.create_time DESC, T1.id DESC |
| | | </select> |
| | | |
| | | <select id="receiptPaymentInfo" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto"> |
| | |
| | | <if test="salesQuotationDto.status != null and salesQuotationDto.status != '' "> |
| | | AND t1.status = #{salesQuotationDto.status} |
| | | </if> |
| | | order by t1.create_time desc, t1.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | sl.customer_name |
| | | FROM shipping_info s |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | order by s.create_time desc, s.id desc |
| | | </select> |
| | | <select id="getReturnManagementDtoById" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto"> |
| | | SELECT |
| | |
| | | and sir.record_type = #{params.recordType} |
| | | </if> |
| | | </where> |
| | | order by sir.id desc |
| | | order by sir.create_time desc, sir.id desc |
| | | </select> |
| | | <select id="listStockInRecordExportData" resultType="com.ruoyi.stock.execl.StockInRecordExportData"> |
| | | SELECT |
| | |
| | | <if test="ew.productName != null and ew.productName !=''"> |
| | | and p.product_name like concat('%',#{ew.productName},'%') |
| | | </if> |
| | | order by si.update_time desc, si.id desc |
| | | </select> |
| | | <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData"> |
| | | select si.qualitity, |
| | |
| | | and sir.create_time <= #{ew.endMonth} |
| | | </if> |
| | | </where> |
| | | order by sir.update_time desc, sir.id desc |
| | | </select> |
| | | |
| | | <select id="stockInAndOutRecord" resultType="com.ruoyi.stock.dto.StockInventoryDto"> |
| | |
| | | and sor.record_type = #{params.recordType} |
| | | </if> |
| | | </where> |
| | | order by sor.id desc |
| | | order by sor.create_time desc, sor.id desc |
| | | </select> |
| | | <select id="listStockOutRecordExportData" resultType="com.ruoyi.stock.execl.StockOutRecordExportData"> |
| | | SELECT |