From b5f11bdb85bef278b4d0a695ed959749dc6c068c Mon Sep 17 00:00:00 2001 From: liao Date: Wed, 15 Nov 2023 14:00:32 +0800 Subject: [PATCH] =?UTF-8?q?fix=20SQL=E6=B3=A8=E5=85=A5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/service/impl/LawsCommonServiceImpl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java index 7f97a332..cfe84ec2 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java @@ -175,7 +175,12 @@ public class LawsCommonServiceImpl implements ILawsCommonService { // 封装查询条件 String selectCondition = getSelectCondition(parameterMap, fieldListCondition); // 获取分页查询结果 - IPage> infoPage = lawsCommonMapper.getCommonPage(page, tableName, selectField, selectCondition); + IPage> infoPage; + try { + infoPage = lawsCommonMapper.getCommonPage(page, tableName, selectField, selectCondition); + } catch (Exception e) { + throw new JeroBootException("非法参数异常"); + } // 对返回的数据做处理 // 做字段翻译和拼接 infoPage.setRecords(processResultMapPageList(infoPage.getRecords(), fieldListSelect)); @@ -1082,7 +1087,12 @@ public class LawsCommonServiceImpl implements ILawsCommonService { // 封装查询显示的字段 String selectField = getSelectField(fieldList); // 封装查询条件 - Map initMap = lawsCommonMapper.getByIdAndModule(tableName, selectField, id, standardNumber); + Map initMap; + try { + initMap = lawsCommonMapper.getByIdAndModule(tableName, selectField, id, standardNumber); + } catch (Exception e) { + throw new JeroBootException("非法参数异常"); + } if (initMap == null) { throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND); }