fix SQL注入报错

This commit is contained in:
liao
2023-11-15 14:00:32 +08:00
parent 84da9869c3
commit b5f11bdb85
@@ -175,7 +175,12 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
// 封装查询条件
String selectCondition = getSelectCondition(parameterMap, fieldListCondition);
// 获取分页查询结果
IPage<Map<String, Object>> infoPage = lawsCommonMapper.getCommonPage(page, tableName, selectField, selectCondition);
IPage<Map<String, Object>> 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<String, Object> initMap = lawsCommonMapper.getByIdAndModule(tableName, selectField, id, standardNumber);
Map<String, Object> 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);
}