From ebc2468ee241bc71b2178a72902cc315825b8623 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Mon, 12 Jan 2026 15:34:52 +0800 Subject: [PATCH] =?UTF-8?q?2026-01-12=201=E3=80=81=E7=89=A9=E6=96=99?= =?UTF-8?q?=E6=9C=AA=E7=BB=B4=E6=8A=A4=E6=A8=A1=E7=89=88=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=88=86=E9=A1=B5=E4=BC=98=E5=8C=96?= =?UTF-8?q?=202=E3=80=81=E7=B3=BB=E7=BB=9F=E6=97=A5=E5=BF=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=90=8C=E6=97=B6=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2site=20=3D=20'*'=E7=9A=84=E6=95=B0=E6=8D=AE=203?= =?UTF-8?q?=E3=80=81=E6=A0=87=E7=AD=BE=E5=8F=98=E5=8A=A8=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=89=80=E6=9C=89=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E2=80=9C=E5=90=88=E7=BA=A6?= =?UTF-8?q?=E5=8F=B7=E7=A0=81=E2=80=9D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/dao/PartTemplateStatusMapper.java | 12 ++++++ .../impl/PartTemplateStatusServiceImpl.java | 16 +++++++- .../report/PartTemplateStatusMapper.xml | 40 +++++++++++++++++++ .../resources/mapper/sys/SystemLogDao.xml | 4 +- .../warehouse/LabelTransactionLogMapper.xml | 1 + 5 files changed, 69 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gaotao/modules/report/dao/PartTemplateStatusMapper.java b/src/main/java/com/gaotao/modules/report/dao/PartTemplateStatusMapper.java index 882abcf..c733e57 100644 --- a/src/main/java/com/gaotao/modules/report/dao/PartTemplateStatusMapper.java +++ b/src/main/java/com/gaotao/modules/report/dao/PartTemplateStatusMapper.java @@ -21,5 +21,17 @@ public interface PartTemplateStatusMapper { * @return site列表 */ List getAccessSiteList(@Param("userName") String userName); + + /** + * 快速查询物料总数(不需要复杂JOIN,只查询Part表) + */ + int queryPartCount(@Param("site") String site, + @Param("partNo") String partNo, + @Param("partDesc") String partDesc, + @Param("spec") String spec, + @Param("iqcExempt") String iqcExempt, + @Param("ipqcExempt") String ipqcExempt, + @Param("fqcExempt") String fqcExempt, + @Param("oqcExempt") String oqcExempt); } diff --git a/src/main/java/com/gaotao/modules/report/service/impl/PartTemplateStatusServiceImpl.java b/src/main/java/com/gaotao/modules/report/service/impl/PartTemplateStatusServiceImpl.java index 5879a67..2dc01bb 100644 --- a/src/main/java/com/gaotao/modules/report/service/impl/PartTemplateStatusServiceImpl.java +++ b/src/main/java/com/gaotao/modules/report/service/impl/PartTemplateStatusServiceImpl.java @@ -97,8 +97,20 @@ public class PartTemplateStatusServiceImpl implements PartTemplateStatusService // totalCount = dataList.size(); // } - log.info("查询物料模版状态完成,共{}条数据", dataList.size()); - return new PageUtils(dataList, dataList.size(), limit, page); + // 使用快速SQL查询总数(只查询Part表,不需要复杂的JOIN操作) + int totalCount = partTemplateStatusMapper.queryPartCount( + query.getSite(), + query.getPartNo(), + query.getPartDesc(), + query.getSpec(), + query.getIqcExempt(), + query.getIpqcExempt(), + query.getFqcExempt(), + query.getOqcExempt() + ); + + log.info("查询物料模版状态完成,当前页{}条,总共{}条", dataList.size(), totalCount); + return new PageUtils(dataList, totalCount, limit, page); } catch (Exception e) { log.error("查询物料模版状态异常", e); diff --git a/src/main/resources/mapper/report/PartTemplateStatusMapper.xml b/src/main/resources/mapper/report/PartTemplateStatusMapper.xml index 03778fb..df76c1b 100644 --- a/src/main/resources/mapper/report/PartTemplateStatusMapper.xml +++ b/src/main/resources/mapper/report/PartTemplateStatusMapper.xml @@ -7,5 +7,45 @@ SELECT site FROM AccessSite WHERE userID = #{userName} + + + diff --git a/src/main/resources/mapper/sys/SystemLogDao.xml b/src/main/resources/mapper/sys/SystemLogDao.xml index cb3c689..b2d25b3 100644 --- a/src/main/resources/mapper/sys/SystemLogDao.xml +++ b/src/main/resources/mapper/sys/SystemLogDao.xml @@ -34,7 +34,7 @@ FROM api_log as a left join api_Interface as b on a.interface_name = b.interface_name AND a.site = b.site and a.bu_no = b.bu_no - a.site in (select site from AccessSite where userID = #{userName}) + (a.site in (select site from AccessSite where userID = #{userName}) OR a.site = '*') and a.bu_no in (select bu_no from AccessBu where username = #{userName}) and type <> 'Interface' @@ -87,7 +87,7 @@ FROM api_log as a left join api_Interface as b on a.interface_name = b.interface_name AND a.site = b.site - a.site in (select site from AccessSite where userID = #{userName}) + (a.site in (select site from AccessSite where userID = #{userName}) OR a.site = '*') and a.bu_no in (select bu_no from AccessBu where username = #{userName}) and type <> 'Interface' diff --git a/src/main/resources/mapper/warehouse/LabelTransactionLogMapper.xml b/src/main/resources/mapper/warehouse/LabelTransactionLogMapper.xml index 5184a01..f339814 100644 --- a/src/main/resources/mapper/warehouse/LabelTransactionLogMapper.xml +++ b/src/main/resources/mapper/warehouse/LabelTransactionLogMapper.xml @@ -15,6 +15,7 @@ a.order_line_no as orderLineNo, a.roll_no AS rollNo, a.roll_qty AS rollQty, + a.batch_no AS batchNo, a.part_no AS partNo, a.warehouse_id as warehouseId, b.WareHouseName as warehouseName,