From 2c7f3e6a3b7ca78e6d18815c36006fbd14e1dcf1 Mon Sep 17 00:00:00 2001 From: fanzongzhe <285169773@qq.com> Date: Fri, 16 Aug 2024 16:32:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=A7=E5=93=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/baseproduct/BaseProductMapper.java | 3 ++- .../biz/baseproduct/BaseProductMapper.xml | 6 ++++-- .../biz/baseproduct/BaseProductService.java | 19 ++++++++++++++----- .../goods/biz/baseproduct/BaseProductVo.java | 1 + 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/yxt/goods/biz/baseproduct/BaseProductMapper.java b/src/main/java/com/yxt/goods/biz/baseproduct/BaseProductMapper.java index 39f579d..7bf920e 100644 --- a/src/main/java/com/yxt/goods/biz/baseproduct/BaseProductMapper.java +++ b/src/main/java/com/yxt/goods/biz/baseproduct/BaseProductMapper.java @@ -18,7 +18,8 @@ public interface BaseProductMapper extends BaseMapper { IPage selectPageVo(IPage page,@Param(Constants.WRAPPER) QueryWrapper qw); - List selChildrenList(@Param("sid") String sid, @Param("cSid") String cSid); +// List selChildrenList(@Param("sid") String sid, @Param("cSid") String cSid); + List selChildrenList(@Param("sid") String sid); int checkByGoodsSidAndUseOrgSid(@Param("goodsSid") String goodsSid, @Param("useOrgSid") String useOrgSid); diff --git a/src/main/java/com/yxt/goods/biz/baseproduct/BaseProductMapper.xml b/src/main/java/com/yxt/goods/biz/baseproduct/BaseProductMapper.xml index dc925fd..cb7ed35 100644 --- a/src/main/java/com/yxt/goods/biz/baseproduct/BaseProductMapper.xml +++ b/src/main/java/com/yxt/goods/biz/baseproduct/BaseProductMapper.xml @@ -13,7 +13,8 @@ g.goodsCode AS productCode, p.rateType, m.rate, - m.sid AS cSid + m.sid AS cSid, + (SELECT COUNT(*) FROM base_product_material as pm WHERE pm.productSid = p.sid) as num FROM base_product AS p LEFT JOIN base_product_material AS m ON p.sid = m.productSid @@ -43,7 +44,8 @@ LEFT JOIN base_product_material AS m ON p.sid = m.productSid LEFT JOIN goods_spu AS g ON p.goodsSid = g.sid LEFT JOIN goods_spu AS mg ON m.materialSid = mg.sid - WHERE p.sid = #{sid} and m.sid != #{cSid} + WHERE p.sid = #{sid} +-- and m.sid != #{cSid}