添加数据权限处理方法

yun-zuoyi
贾文涛 5 years ago
parent 46a91a13bc
commit eadf0d67f8

@ -4,6 +4,7 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import java.util.HashMap;
import java.util.Map;
/**
* @Description : hql
@ -141,6 +142,24 @@ public class DdlPackBean {
}
/**
* -
* @param hql
* @param hqlMap
*/
public void addColumnQuery(String hql,HashMap<String,Object> hqlMap){
if(hqlPreparedMap == null){
hqlPreparedMap = new HashMap<>();
}
if(hqlMap != null && !hqlMap.isEmpty()) {
hqlPreparedMap.putAll(hqlMap);
}
whereAppend.append(hql);
}
/**
*
* @return
*/

@ -14,26 +14,26 @@ public class MesEnumUtil {
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum HQL_EXPRESSION {
GT(10,">","大于"),
LT(20,"<","小于"),
EQ(30,"=","等于"),
NEQ(40,"!=","不等于"),
GTE(50,">=","大于等于"),
LTE(60,"<=","小于等于"),
LIKE(70,"like","LIKE"),
IN(80,"in","包含");
GT(">",">","大于"),
LT("<","<","小于"),
EQ("=","=","等于"),
NEQ("!=","!=","不等于"),
GTE(">=",">=","大于等于"),
LTE("<=","<=","小于等于"),
LIKE("like","like","LIKE"),
IN("in","in","包含");
private int value;
private String value;
private String code;
private String description;
HQL_EXPRESSION(int value, String code, String description) {
HQL_EXPRESSION(String value, String code, String description) {
this.value = value;
this.code = code;
this.description = description;
}
public int getValue() {
public String getValue() {
return value;
}
@ -45,38 +45,22 @@ public class MesEnumUtil {
return code;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static String codeOf(int val) {
String tmp = null;
public static String valueOfDesc(String val) {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].code;
if (values()[i].value.equals(val)) {
return values()[i].description;
}
}
return tmp;
return null;
}
public static int descOf(String desc) {
int tmp = 1;
public static HQL_EXPRESSION codeOf(String value) {
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) {
tmp = values()[i].value;
if (values()[i].value.equals(value)) {
return values()[i];
}
}
return tmp;
}
public static String valueOfDescription(int val) {
return valueOf(val);
return null;
}
}

@ -7,5 +7,5 @@ import java.util.List;
@Data
public class FilterGroup {
private String andOr;
private List<FilterRuleAndOr> groups;
private List<FilterRules> groups;
}

@ -4,7 +4,7 @@ import lombok.Data;
@Data
public class FilterRule {
private String filed;
private String field;
private String op;
private String value;
}

@ -5,7 +5,7 @@ import lombok.Data;
import java.util.List;
@Data
public class FilterRuleAndOr {
public class FilterRules {
private String andOr;
private List<FilterRule> rules;
}
Loading…
Cancel
Save