|
@@ -1,12 +1,11 @@
|
|
|
package com.lc.ibps.base.db.ddd.dao;
|
|
package com.lc.ibps.base.db.ddd.dao;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
import java.io.Serializable;
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
-import java.util.Arrays;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
import java.util.Map.Entry;
|
|
import java.util.Map.Entry;
|
|
|
|
|
|
|
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.ibatis.session.RowBounds;
|
|
import org.apache.ibatis.session.RowBounds;
|
|
|
import org.mybatis.spring.SqlSessionTemplate;
|
|
import org.mybatis.spring.SqlSessionTemplate;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -574,9 +573,36 @@ public abstract class MyBatisQueryDaoImpl<PK extends java.io.Serializable, P ext
|
|
|
dynamicWhereSql = StringUtil.isNotEmpty(dynamicWhereSql) ? dynamicWhereSql + " and " + defaultWhere
|
|
dynamicWhereSql = StringUtil.isNotEmpty(dynamicWhereSql) ? dynamicWhereSql + " and " + defaultWhere
|
|
|
: defaultWhere;
|
|
: defaultWhere;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /** 1.是否华创启德医院环境 */
|
|
|
|
|
+ String setting = currentContext().getSetting();
|
|
|
|
|
+ boolean flag1 = false;
|
|
|
|
|
+ if (StringUtils.isNotEmpty(setting)) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
|
+ HashMap<String, Object> map = (HashMap) objectMapper.readValue(setting, Map.class);
|
|
|
|
|
+ String dgyy = Optional.ofNullable(map)
|
|
|
|
|
+ .map(m -> m.get("HCQD"))
|
|
|
|
|
+ .map(Object::toString)
|
|
|
|
|
+ .orElse("");
|
|
|
|
|
+ flag1 = Boolean.parseBoolean(dgyy);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ logger.warn("解析setting JSON失败, setting={}", setting, e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (StringUtil.isNotEmpty(dynamicWhereSql)) {
|
|
if (StringUtil.isNotEmpty(dynamicWhereSql)) {
|
|
|
- params.put("whereSql", dynamicWhereSql);
|
|
|
|
|
|
|
+ if (StringUtil.isNotEmpty(dynamicWhereSql)) {
|
|
|
|
|
+ // 将 subject_ like 替换为对两个 # 之间内容的匹配
|
|
|
|
|
+ String modifiedWhereSql = dynamicWhereSql.replaceAll(
|
|
|
|
|
+ "subject_\\s+like\\s+",
|
|
|
|
|
+ "SUBSTRING_INDEX(SUBSTRING_INDEX(subject_, '#', 2), '#', -1) like "
|
|
|
|
|
+ );
|
|
|
|
|
+ if(flag1){//如果修改流程数据客户不好根据标题区分,所以在这里进行代码转换,保证页面查询无误
|
|
|
|
|
+ params.put("whereSql", modifiedWhereSql);//华创
|
|
|
|
|
+ }else{
|
|
|
|
|
+ params.put("whereSql", dynamicWhereSql);//原逻辑
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
// 构建排序SQL
|
|
// 构建排序SQL
|
|
|
if (BeanUtils.isNotEmpty(queryFilter.getFieldSortList())) {
|
|
if (BeanUtils.isNotEmpty(queryFilter.getFieldSortList())) {
|