1
This commit is contained in:
@@ -21,12 +21,26 @@ public class XbGroup
|
||||
/** 启用状态:0-禁用,1-启用 */
|
||||
private Integer isActive;
|
||||
|
||||
/** 类型,1管理群,2评论群,3线报来源群,4线报推送群 */
|
||||
private Integer groupType;
|
||||
|
||||
public String getGroupTypeName() {
|
||||
return groupTypeName;
|
||||
}
|
||||
|
||||
public void setGroupTypeName(String groupTypeName) {
|
||||
this.groupTypeName = groupTypeName;
|
||||
}
|
||||
|
||||
private String groupTypeName;
|
||||
|
||||
/** 创建时间 */
|
||||
private Date createDate;
|
||||
|
||||
/** 更新时间 */
|
||||
private Date updateDate;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -59,6 +73,14 @@ public class XbGroup
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
public Integer getGroupType() {
|
||||
return groupType;
|
||||
}
|
||||
|
||||
public void setGroupType(Integer groupType) {
|
||||
this.groupType = groupType;
|
||||
}
|
||||
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
@@ -82,6 +104,7 @@ public class XbGroup
|
||||
", name='" + name + '\'' +
|
||||
", wxid='" + wxid + '\'' +
|
||||
", isActive=" + isActive +
|
||||
", groupType=" + groupType +
|
||||
", createDate=" + createDate +
|
||||
", updateDate=" + updateDate +
|
||||
'}';
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.ruoyi.jarvis.enums;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 上午 10:27
|
||||
* @description:
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public enum GroupType implements IEnum {
|
||||
|
||||
/**
|
||||
* 类型,1管理群,2评论群,3线报来源群,4线报推送群
|
||||
* */
|
||||
MANAGEMENT(1, "管理群"),
|
||||
COMMENT(2, "评论群"),
|
||||
LINE_REPORT_SOURCE(3, "线报来源群"),
|
||||
LINE_REPORT_PUSH(4, "线报推送群");
|
||||
private final int key;
|
||||
|
||||
private final String name;
|
||||
|
||||
GroupType(int key, String name) {
|
||||
this.key = key;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static GroupType get(int key) {
|
||||
for (GroupType e : GroupType.values()) {
|
||||
if (e.getKey() == key) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getName(Integer key) {
|
||||
//if (Object.isNotEmpty(key)) {
|
||||
GroupType[] items = GroupType.values();
|
||||
for (GroupType item : items) {
|
||||
if (item.getKey() == key) {
|
||||
return item.getName();
|
||||
}
|
||||
}
|
||||
//}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static Map<String, String> getKeyVlue() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
GroupType[] items = GroupType.values();
|
||||
for (GroupType item : items) {
|
||||
map.put(item.getKey() + "", item.getName());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> getSelectItems() {
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
|
||||
GroupType[] items = GroupType.values();
|
||||
for (GroupType item : items) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("label", item.getName());
|
||||
map.put("value", item.getKey());
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Integer getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
14
ruoyi-system/src/main/java/com/ruoyi/jarvis/enums/IEnum.java
Normal file
14
ruoyi-system/src/main/java/com/ruoyi/jarvis/enums/IEnum.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.jarvis.enums;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 上午 10:33
|
||||
* @description:
|
||||
*/
|
||||
public interface IEnum {
|
||||
|
||||
Integer getKey();
|
||||
|
||||
String getName();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.jarvis.enums;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @version 1.0
|
||||
* @create 2023/12/19 0019 上午 10:33
|
||||
* @description:
|
||||
*/
|
||||
public interface IEnumForString {
|
||||
|
||||
String getKey();
|
||||
|
||||
String getName();
|
||||
}
|
||||
@@ -9,12 +9,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="name" column="name"/>
|
||||
<result property="wxid" column="wxid"/>
|
||||
<result property="isActive" column="is_active"/>
|
||||
<result property="groupType" column="group_type"/>
|
||||
<result property="createDate" column="create_date"/>
|
||||
<result property="updateDate" column="update_date"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectXbGroupVo">
|
||||
select id, name, wxid, is_active, create_date, update_date from xb_group
|
||||
select id, name, wxid, is_active, group_type, create_date, update_date from xb_group
|
||||
</sql>
|
||||
|
||||
<select id="selectXbGroupList" parameterType="XbGroup" resultMap="XbGroupResult">
|
||||
@@ -23,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
||||
<if test="wxid != null and wxid != ''">and wxid = #{wxid}</if>
|
||||
<if test="isActive != null">and is_active = #{isActive}</if>
|
||||
<if test="groupType != null">and group_type = #{groupType}</if>
|
||||
<if test="createDate != null">and create_date = #{createDate}</if>
|
||||
<if test="updateDate != null">and update_date = #{updateDate}</if>
|
||||
</where>
|
||||
@@ -40,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="wxid != null and wxid != ''">wxid,</if>
|
||||
<if test="isActive != null">is_active,</if>
|
||||
<if test="groupType != null">group_type,</if>
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="updateDate != null">update_date,</if>
|
||||
</trim>
|
||||
@@ -47,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="wxid != null and wxid != ''">#{wxid},</if>
|
||||
<if test="isActive != null">#{isActive},</if>
|
||||
<if test="groupType != null">#{groupType},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="updateDate != null">#{updateDate},</if>
|
||||
</trim>
|
||||
@@ -58,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="wxid != null and wxid != ''">wxid = #{wxid},</if>
|
||||
<if test="isActive != null">is_active = #{isActive},</if>
|
||||
<if test="groupType != null">group_type = #{groupType},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="updateDate != null">update_date = #{updateDate},</if>
|
||||
</set>
|
||||
|
||||
Reference in New Issue
Block a user