From 1916916935c797a93749aaf0e5031940ac42fceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Tue, 6 Jul 2021 15:13:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=89=AF=E4=BB=A3=E7=A0=81=E5=BE=85?= =?UTF-8?q?=E5=8A=9E=E4=BA=8B=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/meapi/controller/NcCodeController.java | 4 ++-- .../foreverwin/mesnac/meapi/mapper/NcCodeMapper.java | 5 ++++- .../foreverwin/mesnac/meapi/service/NcCodeService.java | 2 +- .../mesnac/meapi/service/impl/NcCodeServiceImpl.java | 4 ++-- meapi/src/main/resources/mapper/NcCodeMapper.xml | 10 +++++++++- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/NcCodeController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/NcCodeController.java index c93c7c9c..fd0987f4 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/NcCodeController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/NcCodeController.java @@ -128,8 +128,8 @@ public class NcCodeController { * 根据不良代码组找出它下面的所有的不良代码,并且是主要代码 */ @GetMapping("/findNcByNG") - public R findNcByNG(String messageType){ - return R.ok(ncCodeService.findNcByNG(messageType)); + public R findNcByNG(String messageType,String ncCode){ + return R.ok(ncCodeService.findNcByNG(messageType,ncCode)); } @GetMapping("findSecondaryNcByNc") diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/NcCodeMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/NcCodeMapper.java index 793b3f7d..f019aad6 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/NcCodeMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/NcCodeMapper.java @@ -17,7 +17,10 @@ import java.util.List; */ @Repository public interface NcCodeMapper extends BaseMapper { - List findNcByNG(@Param("site")String site, @Param("locale")String locale, @Param("messageType")String messageType); + List findNcByNG(@Param("site")String site, + @Param("locale")String locale, + @Param("messageType")String messageType, + @Param("ncCode")String ncCode); List findSecondaryNcByNc(@Param("site")String site,@Param("locale")String locale,@Param("ncCode")String ncCode); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/NcCodeService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/NcCodeService.java index 3fd4400a..5ec11bfa 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/NcCodeService.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/NcCodeService.java @@ -26,7 +26,7 @@ public interface NcCodeService extends IService { List selectList(NcCode ncCode); - List findNcByNG(String messageType); + List findNcByNG(String messageType,String ncCode); List findSecondaryNcByNc(String ncCode); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/NcCodeServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/NcCodeServiceImpl.java index 5197334a..8a2f91ea 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/NcCodeServiceImpl.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/NcCodeServiceImpl.java @@ -46,10 +46,10 @@ public class NcCodeServiceImpl extends ServiceImpl impleme } @Override - public List findNcByNG(String messageType) { + public List findNcByNG(String messageType,String ncCode) { String site = CommonMethods.getSite(); String locale = LocaleContextHolder.getLocale().getLanguage(); - return ncCodeMapper.findNcByNG(site,locale,messageType); + return ncCodeMapper.findNcByNG(site,locale,messageType,ncCode); } @Override diff --git a/meapi/src/main/resources/mapper/NcCodeMapper.xml b/meapi/src/main/resources/mapper/NcCodeMapper.xml index c68db60d..eca7f2f2 100644 --- a/meapi/src/main/resources/mapper/NcCodeMapper.xml +++ b/meapi/src/main/resources/mapper/NcCodeMapper.xml @@ -353,7 +353,15 @@ INNER JOIN NC_CODE NC ON NC.HANDLE = NGM.NC_CODE_OR_GROUP_GBO INNER JOIN NC_CODE_DEF NCD ON NC.HANDLE = NCD.NC_CODE_OR_GROUP_GBO AND NCD.CAN_BE_PRIMARY_CODE = 'true' INNER JOIN NC_CODE_T NCT ON NCT.NC_CODE_BO = NC.HANDLE AND NCT.LOCALE = #{locale} - WHERE NG.NC_GROUP = #{messageType} AND NG.SITE = #{site} + + NG.SITE = #{site} + + AND NG.NC_GROUP =#{messageType} + + + AND NC.NC_CODE = #{ncCode} + +