screen
This commit is contained in:
parent
48a4ab38ab
commit
6c4b379203
|
|
@ -1,169 +1,113 @@
|
|||
package com.bonus.material.screen.controller;
|
||||
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.screen.domain.BmConfig;
|
||||
import com.bonus.material.screen.service.IBmConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
* 功能参数配置Controller
|
||||
*
|
||||
* @author bonus
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
@Api(tags = "功能参数配置接口")
|
||||
@RestController
|
||||
@RequestMapping("/config")
|
||||
@Slf4j
|
||||
public class BmConfigController extends BaseController {
|
||||
|
||||
public class BmConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmConfigService bmConfigService;
|
||||
|
||||
/**
|
||||
* 获取参数配置列表
|
||||
* 查询功能参数配置列表
|
||||
*/
|
||||
|
||||
|
||||
// @ApiOperation("获取参数配置列表")
|
||||
@RequiresPermissions("material:config:list")
|
||||
@ApiOperation(value = "查询功能参数配置列表")
|
||||
@RequiresPermissions("screen:config:list")
|
||||
@GetMapping("/list")
|
||||
@SysLog(title = "参数配置", businessType = OperaType.QUERY,logType = 0,module = "系统管理->参数配置")
|
||||
// @ApiResponses(value = {
|
||||
// @ApiResponse(code = 200, message = "成功", response = TableDataInfo.class),
|
||||
// @ApiResponse(code = 400, message = "无效的ID"),
|
||||
// @ApiResponse(code = 404, message = "未找到用户")
|
||||
// })
|
||||
public TableDataInfo list(BmConfig config) {
|
||||
try{
|
||||
startPage();
|
||||
List<BmConfig> list = bmConfigService.selectConfigList(config);
|
||||
return getDataTable(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<BmConfig>());
|
||||
public TableDataInfo list(BmConfig bmConfig)
|
||||
{
|
||||
startPage();
|
||||
List<BmConfig> list = bmConfigService.selectBmConfigList(bmConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@RequiresPermissions("material:config:export")
|
||||
/**
|
||||
* 导出功能参数配置列表
|
||||
*/
|
||||
@ApiOperation(value = "导出功能参数配置列表")
|
||||
@RequiresPermissions("screen:config:export")
|
||||
@SysLog(title = "功能参数配置", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出功能参数配置")
|
||||
@PostMapping("/export")
|
||||
@SysLog(title = "参数配置", businessType = OperaType.EXPORT,logType = 0,module = "系统管理->参数配置")
|
||||
public void export(HttpServletResponse response, BmConfig config) {
|
||||
try{
|
||||
List<BmConfig> list = bmConfigService.selectConfigList(config);
|
||||
ExcelUtil<BmConfig> util = new ExcelUtil<BmConfig>(BmConfig.class);
|
||||
util.exportExcel(response, list, "参数数据");
|
||||
}catch (Exception e){
|
||||
ExcelUtil<BmConfig> util = new ExcelUtil<BmConfig>(BmConfig.class);
|
||||
util.exportExcel(response, new ArrayList<BmConfig>(), "参数数据");
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
public void export(HttpServletResponse response, BmConfig bmConfig)
|
||||
{
|
||||
List<BmConfig> list = bmConfigService.selectBmConfigList(bmConfig);
|
||||
ExcelUtil<BmConfig> util = new ExcelUtil<BmConfig>(BmConfig.class);
|
||||
util.exportExcel(response, list, "功能参数配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数编号获取详细信息
|
||||
* 获取功能参数配置详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{configId}")
|
||||
public AjaxResult getInfo(@PathVariable Long configId) {
|
||||
try{
|
||||
return success(bmConfigService.selectConfigById(configId));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常");
|
||||
}
|
||||
@ApiOperation(value = "获取功能参数配置详细信息")
|
||||
@RequiresPermissions("screen:config:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bmConfigService.selectBmConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数键名查询参数值
|
||||
* 新增功能参数配置
|
||||
*/
|
||||
@GetMapping(value = "/configKey/{configKey}")
|
||||
public AjaxResult getConfigKey(@PathVariable String configKey) {
|
||||
try{
|
||||
return success(bmConfigService.selectConfigByKey(configKey));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*/
|
||||
@RequiresPermissions("material:config:add")
|
||||
@SysLog(title = "参数配置", businessType = OperaType.INSERT,logType = 0,module = "系统管理->参数配置")
|
||||
@ApiOperation(value = "新增功能参数配置")
|
||||
@RequiresPermissions("screen:config:add")
|
||||
@SysLog(title = "功能参数配置", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增功能参数配置")
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody BmConfig config) {
|
||||
try{
|
||||
if (!bmConfigService.checkConfigKeyUnique(config)) {
|
||||
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setCreateBy(SecurityUtils.getUsername());
|
||||
return toAjax(bmConfigService.insertConfig(config));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常");
|
||||
}
|
||||
public AjaxResult add(@RequestBody BmConfig bmConfig)
|
||||
{
|
||||
return toAjax(bmConfigService.insertBmConfig(bmConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
* 修改功能参数配置
|
||||
*/
|
||||
@RequiresPermissions("material:config:edit")
|
||||
@ApiOperation(value = "修改功能参数配置")
|
||||
@RequiresPermissions("screen:config:edit")
|
||||
@SysLog(title = "功能参数配置", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改功能参数配置")
|
||||
@PutMapping
|
||||
@SysLog(title = "参数配置", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->参数配置")
|
||||
public AjaxResult edit(@Validated @RequestBody BmConfig config) {
|
||||
try{
|
||||
if (!bmConfigService.checkConfigKeyUnique(config)) {
|
||||
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(bmConfigService.updateConfig(config));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常");
|
||||
}
|
||||
public AjaxResult edit(@RequestBody BmConfig bmConfig)
|
||||
{
|
||||
return toAjax(bmConfigService.updateBmConfig(bmConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除参数配置
|
||||
* 删除功能参数配置
|
||||
*/
|
||||
@RequiresPermissions("material:config:remove")
|
||||
@SysLog(title = "参数配置", businessType = OperaType.DELETE,logType = 0,module = "系统管理->参数配置")
|
||||
@DeleteMapping("/{configIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] configIds) {
|
||||
try{
|
||||
bmConfigService.deleteConfigByIds(configIds);
|
||||
return success();
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新参数缓存
|
||||
*/
|
||||
@RequiresPermissions("material:config:remove")
|
||||
@DeleteMapping("/refreshCache")
|
||||
@SysLog(title = "参数配置", businessType = OperaType.FLASH,logType = 0,module = "系统管理->参数配置",details = "刷新参数缓存")
|
||||
public AjaxResult refreshCache() {
|
||||
try{
|
||||
bmConfigService.resetConfigCache();
|
||||
return success();
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return error("系统异常");
|
||||
}
|
||||
@ApiOperation(value = "删除功能参数配置")
|
||||
@RequiresPermissions("screen:config:remove")
|
||||
@SysLog(title = "功能参数配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除功能参数配置")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bmConfigService.deleteBmConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,115 +1,37 @@
|
|||
package com.bonus.material.screen.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.annotation.Excel.ColumnType;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 参数配置表 bm_config
|
||||
* 功能参数配置对象 bm_config
|
||||
*
|
||||
* @author bonus
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class BmConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//用于excel导出的序号一列,不需要业务逻辑处理
|
||||
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT)
|
||||
int sequence;
|
||||
|
||||
/** 参数主键 */
|
||||
@Excel(name = "参数主键", cellType = ColumnType.NUMERIC)
|
||||
private Long configId;
|
||||
|
||||
/** 参数名称 */
|
||||
@Excel(name = "参数名称")
|
||||
private String configName;
|
||||
private Long id;
|
||||
|
||||
/** 参数键名 */
|
||||
@Excel(name = "参数键名")
|
||||
private String configKey;
|
||||
@ApiModelProperty(value = "参数键名")
|
||||
private String itemName;
|
||||
|
||||
/** 参数键值 */
|
||||
@Excel(name = "参数键值")
|
||||
private String configValue;
|
||||
@ApiModelProperty(value = "参数键值")
|
||||
private String itemValue;
|
||||
|
||||
/** 系统内置(Y是 N否) */
|
||||
@Excel(name = "系统内置", readConverterExp = "Y=是,N=否")
|
||||
private String configType;
|
||||
|
||||
public Long getConfigId()
|
||||
{
|
||||
return configId;
|
||||
}
|
||||
|
||||
public void setConfigId(Long configId)
|
||||
{
|
||||
this.configId = configId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "参数名称不能为空")
|
||||
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
|
||||
public String getConfigName()
|
||||
{
|
||||
return configName;
|
||||
}
|
||||
|
||||
public void setConfigName(String configName)
|
||||
{
|
||||
this.configName = configName;
|
||||
}
|
||||
|
||||
@NotBlank(message = "参数键名长度不能为空")
|
||||
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
|
||||
public String getConfigKey()
|
||||
{
|
||||
return configKey;
|
||||
}
|
||||
|
||||
public void setConfigKey(String configKey)
|
||||
{
|
||||
this.configKey = configKey;
|
||||
}
|
||||
|
||||
@NotBlank(message = "参数键值不能为空")
|
||||
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
|
||||
public String getConfigValue()
|
||||
{
|
||||
return configValue;
|
||||
}
|
||||
|
||||
public void setConfigValue(String configValue)
|
||||
{
|
||||
this.configValue = configValue;
|
||||
}
|
||||
|
||||
public String getConfigType()
|
||||
{
|
||||
return configType;
|
||||
}
|
||||
|
||||
public void setConfigType(String configType)
|
||||
{
|
||||
this.configType = configType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("configId", getConfigId())
|
||||
.append("configName", getConfigName())
|
||||
.append("configKey", getConfigKey())
|
||||
.append("configValue", getConfigValue())
|
||||
.append("configType", getConfigType())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,106 +0,0 @@
|
|||
package com.bonus.material.screen.domain.vo;
|
||||
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 路由显示信息
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
public class MetaVo
|
||||
{
|
||||
/**
|
||||
* 设置该路由在侧边栏和面包屑中展示的名字
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 设置该路由的图标,对应路径src/assets/icons/svg
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 设置为true,则不会被 <keep-alive>缓存
|
||||
*/
|
||||
private boolean noCache;
|
||||
|
||||
/**
|
||||
* 内链地址(http(s)://开头)
|
||||
*/
|
||||
private String link;
|
||||
|
||||
public MetaVo()
|
||||
{
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon)
|
||||
{
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, boolean noCache)
|
||||
{
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.noCache = noCache;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, String link)
|
||||
{
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, boolean noCache, String link)
|
||||
{
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.noCache = noCache;
|
||||
if (StringUtils.ishttp(link))
|
||||
{
|
||||
this.link = link;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isNoCache()
|
||||
{
|
||||
return noCache;
|
||||
}
|
||||
|
||||
public void setNoCache(boolean noCache)
|
||||
{
|
||||
this.noCache = noCache;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getIcon()
|
||||
{
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon)
|
||||
{
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getLink()
|
||||
{
|
||||
return link;
|
||||
}
|
||||
|
||||
public void setLink(String link)
|
||||
{
|
||||
this.link = link;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
package com.bonus.material.screen.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路由配置信息
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
public class RouterVo
|
||||
{
|
||||
/**
|
||||
* 路由名字
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现
|
||||
*/
|
||||
private boolean hidden;
|
||||
|
||||
/**
|
||||
* 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
|
||||
*/
|
||||
private String redirect;
|
||||
|
||||
/**
|
||||
* 组件地址
|
||||
*/
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 路由参数:如 {"id": 1, "name": "ry"}
|
||||
*/
|
||||
private String query;
|
||||
|
||||
/**
|
||||
* 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
|
||||
*/
|
||||
private Boolean alwaysShow;
|
||||
|
||||
/**
|
||||
* 其他元素
|
||||
*/
|
||||
private MetaVo meta;
|
||||
|
||||
/**
|
||||
* 子路由
|
||||
*/
|
||||
private List<RouterVo> children;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPath()
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path)
|
||||
{
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public boolean getHidden()
|
||||
{
|
||||
return hidden;
|
||||
}
|
||||
|
||||
public void setHidden(boolean hidden)
|
||||
{
|
||||
this.hidden = hidden;
|
||||
}
|
||||
|
||||
public String getRedirect()
|
||||
{
|
||||
return redirect;
|
||||
}
|
||||
|
||||
public void setRedirect(String redirect)
|
||||
{
|
||||
this.redirect = redirect;
|
||||
}
|
||||
|
||||
public String getComponent()
|
||||
{
|
||||
return component;
|
||||
}
|
||||
|
||||
public void setComponent(String component)
|
||||
{
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
public String getQuery()
|
||||
{
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setQuery(String query)
|
||||
{
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
public Boolean getAlwaysShow()
|
||||
{
|
||||
return alwaysShow;
|
||||
}
|
||||
|
||||
public void setAlwaysShow(Boolean alwaysShow)
|
||||
{
|
||||
this.alwaysShow = alwaysShow;
|
||||
}
|
||||
|
||||
public MetaVo getMeta()
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
public void setMeta(MetaVo meta)
|
||||
{
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public List<RouterVo> getChildren()
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<RouterVo> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
package com.bonus.material.screen.domain.vo;
|
||||
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysMenu;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Treeselect树结构实体类
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
public class TreeSelect implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 节点ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String label;
|
||||
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 子节点
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeSelect> children;
|
||||
|
||||
public TreeSelect() {
|
||||
|
||||
}
|
||||
|
||||
public TreeSelect(SysDept dept) {
|
||||
this.id = dept.getDeptId();
|
||||
this.status = dept.getStatus();
|
||||
this.label = dept.getDeptName();
|
||||
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public TreeSelect(SysMenu menu) {
|
||||
this.id = menu.getMenuId();
|
||||
this.label = menu.getMenuName();
|
||||
this.status = menu.getStatus();
|
||||
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public List<TreeSelect> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<TreeSelect> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,76 +1,61 @@
|
|||
package com.bonus.material.screen.mapper;
|
||||
|
||||
import com.bonus.material.screen.domain.BmConfig;
|
||||
import java.util.List;
|
||||
import com.bonus.material.screen.domain.BmConfig;
|
||||
|
||||
/**
|
||||
* 参数配置 数据层
|
||||
* 功能参数配置Mapper接口
|
||||
*
|
||||
* @author bonus
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
public interface BmConfigMapper
|
||||
public interface BmConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
* 查询功能参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置信息
|
||||
* @param id 功能参数配置主键
|
||||
* @return 功能参数配置
|
||||
*/
|
||||
public BmConfig selectConfig(BmConfig config);
|
||||
public BmConfig selectBmConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 通过ID查询配置
|
||||
* 查询功能参数配置列表
|
||||
*
|
||||
* @param configId 参数ID
|
||||
* @return 参数配置信息
|
||||
* @param bmConfig 功能参数配置
|
||||
* @return 功能参数配置集合
|
||||
*/
|
||||
public BmConfig selectConfigById(Long configId);
|
||||
public List<BmConfig> selectBmConfigList(BmConfig bmConfig);
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
* 新增功能参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
public List<BmConfig> selectConfigList(BmConfig config);
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configKey 参数键名
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
public BmConfig checkConfigKeyUnique(String configKey);
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @param bmConfig 功能参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertConfig(BmConfig config);
|
||||
public int insertBmConfig(BmConfig bmConfig);
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
* 修改功能参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @param bmConfig 功能参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateConfig(BmConfig config);
|
||||
public int updateBmConfig(BmConfig bmConfig);
|
||||
|
||||
/**
|
||||
* 删除参数配置
|
||||
* 删除功能参数配置
|
||||
*
|
||||
* @param configId 参数ID
|
||||
* @param id 功能参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteConfigById(Long configId);
|
||||
public int deleteBmConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除参数信息
|
||||
* 批量删除功能参数配置
|
||||
*
|
||||
* @param configIds 需要删除的参数ID
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteConfigByIds(Long[] configIds);
|
||||
}
|
||||
public int deleteBmConfigByIds(Long[] ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,83 +1,61 @@
|
|||
package com.bonus.material.screen.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.material.screen.domain.BmConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层
|
||||
* 功能参数配置Service接口
|
||||
*
|
||||
* @author bonus
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
public interface IBmConfigService
|
||||
public interface IBmConfigService
|
||||
{
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
* 查询功能参数配置
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 参数配置信息
|
||||
* @param id 功能参数配置主键
|
||||
* @return 功能参数配置
|
||||
*/
|
||||
public BmConfig selectConfigById(Long configId);
|
||||
public BmConfig selectBmConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
* 查询功能参数配置列表
|
||||
*
|
||||
* @param configKey 参数键名
|
||||
* @return 参数键值
|
||||
* @param bmConfig 功能参数配置
|
||||
* @return 功能参数配置集合
|
||||
*/
|
||||
public String selectConfigByKey(String configKey);
|
||||
public List<BmConfig> selectBmConfigList(BmConfig bmConfig);
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
* 新增功能参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
public List<BmConfig> selectConfigList(BmConfig config);
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @param bmConfig 功能参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertConfig(BmConfig config);
|
||||
public int insertBmConfig(BmConfig bmConfig);
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
* 修改功能参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @param bmConfig 功能参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateConfig(BmConfig config);
|
||||
public int updateBmConfig(BmConfig bmConfig);
|
||||
|
||||
/**
|
||||
* 批量删除参数信息
|
||||
* 批量删除功能参数配置
|
||||
*
|
||||
* @param configIds 需要删除的参数ID
|
||||
*/
|
||||
public void deleteConfigByIds(Long[] configIds);
|
||||
|
||||
/**
|
||||
* 加载参数缓存数据
|
||||
*/
|
||||
public void loadingConfigCache();
|
||||
|
||||
/**
|
||||
* 清空参数缓存数据
|
||||
*/
|
||||
public void clearConfigCache();
|
||||
|
||||
/**
|
||||
* 重置参数缓存数据
|
||||
*/
|
||||
public void resetConfigCache();
|
||||
|
||||
/**
|
||||
* 校验参数键名是否唯一
|
||||
*
|
||||
* @param config 参数信息
|
||||
* @param ids 需要删除的功能参数配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkConfigKeyUnique(BmConfig config);
|
||||
public int deleteBmConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除功能参数配置信息
|
||||
*
|
||||
* @param id 功能参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmConfigById(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,213 +1,96 @@
|
|||
package com.bonus.material.screen.service.impl;
|
||||
|
||||
import com.bonus.common.core.constant.CacheConstants;
|
||||
import com.bonus.common.core.constant.UserConstants;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.text.Convert;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.material.screen.domain.BmConfig;
|
||||
import com.bonus.material.screen.mapper.BmConfigMapper;
|
||||
import com.bonus.material.screen.service.IBmConfigService;
|
||||
import java.util.List;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import com.bonus.material.screen.mapper.BmConfigMapper;
|
||||
import com.bonus.material.screen.domain.BmConfig;
|
||||
import com.bonus.material.screen.service.IBmConfigService;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层实现
|
||||
* 功能参数配置Service业务层处理
|
||||
*
|
||||
* @author bonus
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
@Service
|
||||
public class BmConfigServiceImpl implements IBmConfigService
|
||||
public class BmConfigServiceImpl implements IBmConfigService
|
||||
{
|
||||
@Autowired
|
||||
private BmConfigMapper bmConfigMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化参数到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init()
|
||||
{
|
||||
loadingConfigCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
* 查询功能参数配置
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 参数配置信息
|
||||
* @param id 功能参数配置主键
|
||||
* @return 功能参数配置
|
||||
*/
|
||||
@Override
|
||||
public BmConfig selectConfigById(Long configId)
|
||||
public BmConfig selectBmConfigById(Long id)
|
||||
{
|
||||
BmConfig config = new BmConfig();
|
||||
config.setConfigId(configId);
|
||||
return bmConfigMapper.selectConfig(config);
|
||||
return bmConfigMapper.selectBmConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
* 查询功能参数配置列表
|
||||
*
|
||||
* @param configKey 参数key
|
||||
* @return 参数键值
|
||||
* @param bmConfig 功能参数配置
|
||||
* @return 功能参数配置
|
||||
*/
|
||||
@Override
|
||||
public String selectConfigByKey(String configKey)
|
||||
public List<BmConfig> selectBmConfigList(BmConfig bmConfig)
|
||||
{
|
||||
String configValue = Convert.toStr(redisService.getCacheObject(getCacheKey(configKey)));
|
||||
if (StringUtils.isNotEmpty(configValue))
|
||||
{
|
||||
return configValue;
|
||||
}
|
||||
BmConfig config = new BmConfig();
|
||||
config.setConfigKey(configKey);
|
||||
BmConfig retConfig = bmConfigMapper.selectConfig(config);
|
||||
if (StringUtils.isNotNull(retConfig))
|
||||
{
|
||||
redisService.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
|
||||
return retConfig.getConfigValue();
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
return bmConfigMapper.selectBmConfigList(bmConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
* 新增功能参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
@Override
|
||||
public List<BmConfig> selectConfigList(BmConfig config)
|
||||
{
|
||||
return bmConfigMapper.selectConfigList(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @param bmConfig 功能参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertConfig(BmConfig config)
|
||||
public int insertBmConfig(BmConfig bmConfig)
|
||||
{
|
||||
int row = bmConfigMapper.insertConfig(config);
|
||||
if (row > 0)
|
||||
{
|
||||
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
return row;
|
||||
bmConfig.setCreateTime(DateUtils.getNowDate());
|
||||
return bmConfigMapper.insertBmConfig(bmConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
* 修改功能参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @param bmConfig 功能参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateConfig(BmConfig config)
|
||||
public int updateBmConfig(BmConfig bmConfig)
|
||||
{
|
||||
BmConfig temp = bmConfigMapper.selectConfigById(config.getConfigId());
|
||||
if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey()))
|
||||
{
|
||||
redisService.deleteObject(getCacheKey(temp.getConfigKey()));
|
||||
}
|
||||
|
||||
int row = bmConfigMapper.updateConfig(config);
|
||||
if (row > 0)
|
||||
{
|
||||
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
return row;
|
||||
bmConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
return bmConfigMapper.updateBmConfig(bmConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除参数信息
|
||||
* 批量删除功能参数配置
|
||||
*
|
||||
* @param configIds 需要删除的参数ID
|
||||
*/
|
||||
@Override
|
||||
public void deleteConfigByIds(Long[] configIds)
|
||||
{
|
||||
for (Long configId : configIds)
|
||||
{
|
||||
BmConfig config = selectConfigById(configId);
|
||||
if (StringUtils.equals(UserConstants.YES, config.getConfigType()))
|
||||
{
|
||||
throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
|
||||
}
|
||||
bmConfigMapper.deleteConfigById(configId);
|
||||
redisService.deleteObject(getCacheKey(config.getConfigKey()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void loadingConfigCache()
|
||||
{
|
||||
List<BmConfig> configsList = bmConfigMapper.selectConfigList(new BmConfig());
|
||||
for (BmConfig config : configsList)
|
||||
{
|
||||
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void clearConfigCache()
|
||||
{
|
||||
Collection<String> keys = redisService.keys(CacheConstants.SYS_CONFIG_KEY + "*");
|
||||
redisService.deleteObject(keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void resetConfigCache()
|
||||
{
|
||||
clearConfigCache();
|
||||
loadingConfigCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数键名是否唯一
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @param ids 需要删除的功能参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkConfigKeyUnique(BmConfig config)
|
||||
public int deleteBmConfigByIds(Long[] ids)
|
||||
{
|
||||
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
|
||||
BmConfig info = bmConfigMapper.checkConfigKeyUnique(config.getConfigKey());
|
||||
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
return bmConfigMapper.deleteBmConfigByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
* 删除功能参数配置信息
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
* @param id 功能参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
private String getCacheKey(String configKey)
|
||||
@Override
|
||||
public int deleteBmConfigById(Long id)
|
||||
{
|
||||
return CacheConstants.SYS_CONFIG_KEY + configKey;
|
||||
return bmConfigMapper.deleteBmConfigById(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,115 +3,74 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.screen.mapper.BmConfigMapper">
|
||||
|
||||
<resultMap type="com.bonus.material.screen.domain.BmConfig" id="BmConfigResult">
|
||||
<id property="configId" column="config_id" />
|
||||
<result property="configName" column="config_name" />
|
||||
<result property="configKey" column="config_key" />
|
||||
<result property="configValue" column="config_value" />
|
||||
<result property="configType" column="config_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="id" column="id" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="itemValue" column="item_value" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectConfigVo">
|
||||
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
|
||||
from sys_config
|
||||
|
||||
<sql id="selectBmConfigVo">
|
||||
select id, item_name, item_value, create_by, create_time, update_by, update_time from bm_config
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="sqlwhereSearch">
|
||||
<where>
|
||||
<if test="configId !=null">
|
||||
and config_id = #{configId}
|
||||
</if>
|
||||
<if test="configKey !=null and configKey != ''">
|
||||
and config_key = #{configKey}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="selectConfig" parameterType="com.bonus.material.screen.domain.BmConfig" resultMap="BmConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<include refid="sqlwhereSearch"/>
|
||||
|
||||
<select id="selectBmConfigList" parameterType="com.bonus.material.screen.domain.BmConfig" resultMap="BmConfigResult">
|
||||
<include refid="selectBmConfigVo"/>
|
||||
<where>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="itemValue != null and itemValue != ''"> and item_value = #{itemValue}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigList" parameterType="com.bonus.material.screen.domain.BmConfig" resultMap="BmConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<where>
|
||||
<if test="configName != null and configName != ''">
|
||||
AND config_name like concat('%', #{configName}, '%')
|
||||
</if>
|
||||
<if test="configType != null and configType != ''">
|
||||
AND config_type = #{configType}
|
||||
</if>
|
||||
<if test="configKey != null and configKey != ''">
|
||||
AND config_key like concat('%', #{configKey}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
<select id="selectBmConfigById" parameterType="Long" resultMap="BmConfigResult">
|
||||
<include refid="selectBmConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectConfigById" parameterType="Long" resultMap="BmConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_id = #{configId}
|
||||
</select>
|
||||
|
||||
<select id="checkConfigKeyUnique" parameterType="String" resultMap="BmConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_key = #{configKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertConfig" parameterType="com.bonus.material.screen.domain.BmConfig">
|
||||
insert into sys_config (
|
||||
<if test="configName != null and configName != '' ">config_name,</if>
|
||||
<if test="configKey != null and configKey != '' ">config_key,</if>
|
||||
<if test="configValue != null and configValue != '' ">config_value,</if>
|
||||
<if test="configType != null and configType != '' ">config_type,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="configName != null and configName != ''">#{configName},</if>
|
||||
<if test="configKey != null and configKey != ''">#{configKey},</if>
|
||||
<if test="configValue != null and configValue != ''">#{configValue},</if>
|
||||
<if test="configType != null and configType != ''">#{configType},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
sysdate()
|
||||
)
|
||||
|
||||
<insert id="insertBmConfig" parameterType="com.bonus.material.screen.domain.BmConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bm_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemName != null">item_name,</if>
|
||||
<if test="itemValue != null">item_value,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="itemName != null">#{itemName},</if>
|
||||
<if test="itemValue != null">#{itemValue},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateConfig" parameterType="com.bonus.material.screen.domain.BmConfig">
|
||||
update sys_config
|
||||
<set>
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
|
||||
<if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
|
||||
<if test="configType != null and configType != ''">config_type = #{configType},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where config_id = #{configId}
|
||||
|
||||
<update id="updateBmConfig" parameterType="com.bonus.material.screen.domain.BmConfig">
|
||||
update bm_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
<if test="itemValue != null">item_value = #{itemValue},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteConfigById" parameterType="Long">
|
||||
delete from sys_config where config_id = #{configId}
|
||||
|
||||
<delete id="deleteBmConfigById" parameterType="Long">
|
||||
delete from bm_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteConfigByIds" parameterType="Long">
|
||||
delete from sys_config where config_id in
|
||||
<foreach item="configId" collection="array" open="(" separator="," close=")">
|
||||
#{configId}
|
||||
|
||||
<delete id="deleteBmConfigByIds" parameterType="String">
|
||||
delete from bm_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue