feat:枚举表增加sort排序字段
This commit is contained in:
@@ -62,6 +62,7 @@ public class CommWebController {
|
|||||||
QueryWrapper<CoreConfigEnum> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CoreConfigEnum> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("is_deleted", 0);
|
queryWrapper.eq("is_deleted", 0);
|
||||||
queryWrapper.eq("type", dto.getType());
|
queryWrapper.eq("type", dto.getType());
|
||||||
|
queryWrapper.orderByAsc("type", "sort");
|
||||||
List<CoreConfigEnum> selectList = coreConfigService.getEnumMapper().selectList(queryWrapper);
|
List<CoreConfigEnum> selectList = coreConfigService.getEnumMapper().selectList(queryWrapper);
|
||||||
|
|
||||||
return ApiResp.respOK(selectList);
|
return ApiResp.respOK(selectList);
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public class ConfigEnumController {
|
|||||||
if (!StrUtil.isEmpty(dto.getType())) {
|
if (!StrUtil.isEmpty(dto.getType())) {
|
||||||
queryWrapper.eq("type", dto.getType());
|
queryWrapper.eq("type", dto.getType());
|
||||||
}
|
}
|
||||||
|
queryWrapper.orderByAsc("type", "sort");
|
||||||
List<CoreConfigEnum> selectList = coreConfigService.getEnumMapper().selectList(queryWrapper);
|
List<CoreConfigEnum> selectList = coreConfigService.getEnumMapper().selectList(queryWrapper);
|
||||||
|
|
||||||
return ApiResp.respOK(selectList);
|
return ApiResp.respOK(selectList);
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ public class CoreConfigEnum extends DaoBase {
|
|||||||
@TableField(value = "`name`")
|
@TableField(value = "`name`")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@TableField(value = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
@@ -69,6 +75,24 @@ public class CoreConfigEnum extends DaoBase {
|
|||||||
this.name = name;
|
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
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='配置-系统';
|
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;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|||||||
@@ -10,11 +10,12 @@
|
|||||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
<result column="ext" jdbcType="VARCHAR" property="ext" />
|
<result column="ext" jdbcType="VARCHAR" property="ext" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@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>
|
</sql>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user