feat:枚举表增加sort排序字段
This commit is contained in:
@@ -62,6 +62,7 @@ public class CommWebController {
|
||||
QueryWrapper<CoreConfigEnum> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
queryWrapper.eq("type", dto.getType());
|
||||
queryWrapper.orderByAsc("type", "sort");
|
||||
List<CoreConfigEnum> selectList = coreConfigService.getEnumMapper().selectList(queryWrapper);
|
||||
|
||||
return ApiResp.respOK(selectList);
|
||||
|
||||
@@ -41,6 +41,7 @@ public class ConfigEnumController {
|
||||
if (!StrUtil.isEmpty(dto.getType())) {
|
||||
queryWrapper.eq("type", dto.getType());
|
||||
}
|
||||
queryWrapper.orderByAsc("type", "sort");
|
||||
List<CoreConfigEnum> selectList = coreConfigService.getEnumMapper().selectList(queryWrapper);
|
||||
|
||||
return ApiResp.respOK(selectList);
|
||||
|
||||
@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 配置-枚举
|
||||
*/
|
||||
* 配置-枚举
|
||||
*/
|
||||
@TableName(value = "core_config_enum")
|
||||
public class CoreConfigEnum extends DaoBase {
|
||||
/**
|
||||
@@ -21,6 +21,12 @@ public class CoreConfigEnum extends DaoBase {
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@@ -69,6 +75,24 @@ public class CoreConfigEnum extends DaoBase {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序
|
||||
*
|
||||
* @return sort - 排序
|
||||
*/
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置排序
|
||||
*
|
||||
* @param sort 排序
|
||||
*/
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取备注
|
||||
*
|
||||
|
||||
@@ -33,4 +33,7 @@ CREATE TABLE `core_config_system`
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='配置-系统';
|
||||
|
||||
alter table core_config_enum
|
||||
add sort int(10) not null default 0 comment '排序' after name;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
@@ -10,11 +10,12 @@
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="ext" jdbcType="VARCHAR" property="ext" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, `type`, `name`, remark, ext
|
||||
id, create_time, update_time, is_deleted, `type`, `name`, sort, remark, ext
|
||||
</sql>
|
||||
</mapper>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user