|
@@ -343,11 +343,11 @@ public class CommonServiceImpl implements ICommonService {
|
|
|
// return commonEntityList;
|
|
|
// }
|
|
|
|
|
|
-
|
|
|
Map<String, Object> conditions = JSONObject.parseObject(JSON.toJSONString(commonEntity.getQueryMap()));
|
|
|
//正常的查询
|
|
|
String queryCriteriaValue = conditions.containsKey("queryCriteriaValue") ? conditions.get("queryCriteriaValue").toString() : "";
|
|
|
String endSQL = replaceSql.get().replace("#{val}", queryCriteriaValue);
|
|
|
+
|
|
|
queryMap.remove("sqlkey");
|
|
|
queryMap.remove("queryCriteriaValue");
|
|
|
AtomicReference<String> equivalent = new AtomicReference<>("");
|
|
@@ -355,6 +355,20 @@ public class CommonServiceImpl implements ICommonService {
|
|
|
String querySqlWhere = equivalent.get() + " and " + k + " = " + v;
|
|
|
equivalent.set(querySqlWhere);
|
|
|
});
|
|
|
+ //联动表格查询
|
|
|
+ AtomicReference<String> stringAtomicReference=new AtomicReference<>(endSQL);
|
|
|
+ if(endSQL.contains("#{")){
|
|
|
+ queryMap.forEach((k, v)->{
|
|
|
+ //是否包含这个条件
|
|
|
+ boolean contains = stringAtomicReference.get().contains(k.toString());
|
|
|
+ if(contains){
|
|
|
+ //#{ck.id 替换成具体的值
|
|
|
+ stringAtomicReference.set(stringAtomicReference.get().replace(k.toString(),v.toString()));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ endSQL=stringAtomicReference.get();
|
|
|
+ equivalent.set("");
|
|
|
+ }
|
|
|
String sqlString = tableSql.getTableSql() + " where " + endSQL + equivalent.get();
|
|
|
List<CommonEntity> commonEntities = commonMapper.queryTableList(sqlString);
|
|
|
//根据sqlKey查询表格数据
|