From c9bd4bf5c2677771ea14f85df758de6e6c3dbe97 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 26 Jul 2022 17:27:59 +0800 Subject: [PATCH] temp --- .../dto/result/ZhzlCategorySelectDTO.java | 23 ++++ .../tools/enums/ZhzlResiCategoryEnum.java | 108 ++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/ZhzlCategorySelectDTO.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ZhzlResiCategoryEnum.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/ZhzlCategorySelectDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/ZhzlCategorySelectDTO.java new file mode 100644 index 0000000000..94b58de257 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/ZhzlCategorySelectDTO.java @@ -0,0 +1,23 @@ +package com.epmet.commons.tools.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/7/26 16:37 + */ +@Data +public class ZhzlCategorySelectDTO implements Serializable { + private String label; + private String value; + + private String queryType; + private String tableName; + private String columnName; + private String columnValue; + private Integer sort; +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ZhzlResiCategoryEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ZhzlResiCategoryEnum.java new file mode 100644 index 0000000000..b57baedf5e --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ZhzlResiCategoryEnum.java @@ -0,0 +1,108 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.dto.result.ZhzlCategorySelectDTO; + +import java.util.ArrayList; +import java.util.List; + +public enum ZhzlResiCategoryEnum { + // resi_xfry 信访人员 + // anzhibangjiao 安置帮教 + // xiejiaorenyuan 邪教人员 + // buliangqingshaonian 不良青少年 + // shequjiaozheng 社区矫正 + // zhaoshizhaohuojingshenbing 肇事肇祸精神病 + // xidurenyuan 吸毒人员 + + resi_xfry("resi_xfry", "信访人员", "equal", "ic_resi_user", "IS_XFRY", "1", 1), + anzhibangjiao("anzhibangjiao", "安置帮教", "list_equal", "ic_special", "SPECIAL_RQLB", "anzhibangjiao", 2), + xiejiaorenyuan("xiejiaorenyuan", "邪教人员", "list_equal", "ic_special", "SPECIAL_RQLB", "xiejiaorenyuan", 3), + buliangqingshaonian("buliangqingshaonian", "不良青少年", "list_equal", "ic_special", "SPECIAL_RQLB", "buliangqingshaonian", 4), + shequjiaozheng("shequjiaozheng", "社区矫正", "list_equal", "ic_special", "SPECIAL_RQLB", "shequjiaozheng", 5), + zhaoshizhaohuojingshenbing("zhaoshizhaohuojingshenbing", "肇事肇祸精神病", "list_equal", "ic_special", "SPECIAL_RQLB", "zhaoshizhaohuojingshenbing", 6), + xidurenyuan("xidurenyuan", "吸毒人员", "list_equal", "ic_special", "SPECIAL_RQLB", "xidurenyuan", 7); + + private String code; + private String name; + private String queryType; + private String tableName; + private String columnName; + private String columnValue; + private Integer sort; + + + ZhzlResiCategoryEnum(String code, String name, String queryType, String tableName, String columnName, String columnValue, Integer sort) { + this.code = code; + this.name = name; + this.queryType = queryType; + this.tableName = tableName; + this.columnName = columnName; + this.columnValue = columnValue; + this.sort = sort; + } + + public static ZhzlResiCategoryEnum getEnum(String code) { + ZhzlResiCategoryEnum[] values = ZhzlResiCategoryEnum.values(); + for (ZhzlResiCategoryEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + + } + + + /** + * 转为数据 + * + * @return 枚举对象数组 + */ + public static List toSelectList() { + List list = new ArrayList<>(); + for (ZhzlResiCategoryEnum item : ZhzlResiCategoryEnum.values()) { + ZhzlCategorySelectDTO selectDTO = new ZhzlCategorySelectDTO(); + selectDTO.setLabel(item.getName()); + selectDTO.setValue(item.getCode()); + selectDTO.setQueryType(item.getQueryType()); + selectDTO.setTableName(item.getTableName()); + selectDTO.setColumnName(item.getColumnName()); + selectDTO.setColumnValue(item.getColumnValue()); + selectDTO.setSort(item.getSort()); + list.add(selectDTO); + } + return list; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + + public String getQueryType() { + return queryType; + } + + public String getTableName() { + return tableName; + } + + public String getColumnName() { + return columnName; + } + + public String getColumnValue() { + return columnValue; + } + + public Integer getSort() { + return sort; + } + + +}