数据字典表
This commit is contained in:
parent
c42f4d6e63
commit
8ce8c4cb6b
|
|
@ -0,0 +1,164 @@
|
|||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 数据字典对象 sys_dic
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public class SysDic extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 父id */
|
||||
@Excel(name = "父id")
|
||||
private Long pId;
|
||||
|
||||
/** 编码 */
|
||||
@Excel(name = "编码")
|
||||
private String code;
|
||||
|
||||
/** 字典名称 */
|
||||
@Excel(name = "字典名称")
|
||||
private String name;
|
||||
|
||||
/** 描述 */
|
||||
@Excel(name = "描述")
|
||||
private String description;
|
||||
|
||||
/** 值 */
|
||||
@Excel(name = "值")
|
||||
private String value;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private String sort;
|
||||
|
||||
/** 层级 */
|
||||
@Excel(name = "层级")
|
||||
private String level;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private String creator;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setpId(Long pId)
|
||||
{
|
||||
this.pId = pId;
|
||||
}
|
||||
|
||||
public Long getpId()
|
||||
{
|
||||
return pId;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setValue(String value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
public void setSort(String sort)
|
||||
{
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public String getSort()
|
||||
{
|
||||
return sort;
|
||||
}
|
||||
public void setLevel(String level)
|
||||
{
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getLevel()
|
||||
{
|
||||
return level;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setCreator(String creator)
|
||||
{
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getCreator()
|
||||
{
|
||||
return creator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("pId", getpId())
|
||||
.append("code", getCode())
|
||||
.append("name", getName())
|
||||
.append("description", getDescription())
|
||||
.append("value", getValue())
|
||||
.append("sort", getSort())
|
||||
.append("level", getLevel())
|
||||
.append("status", getStatus())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("creator", getCreator())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 字典类型对象 sys_dict_type
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public class SysDict extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 字典主键 */
|
||||
private Long dictId;
|
||||
|
||||
/** 字典名称 */
|
||||
@Excel(name = "字典名称")
|
||||
private String dictName;
|
||||
|
||||
/** 字典类型 */
|
||||
@Excel(name = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
public void setDictId(Long dictId)
|
||||
{
|
||||
this.dictId = dictId;
|
||||
}
|
||||
|
||||
public Long getDictId()
|
||||
{
|
||||
return dictId;
|
||||
}
|
||||
public void setDictName(String dictName)
|
||||
{
|
||||
this.dictName = dictName;
|
||||
}
|
||||
|
||||
public String getDictName()
|
||||
{
|
||||
return dictName;
|
||||
}
|
||||
public void setDictType(String dictType)
|
||||
{
|
||||
this.dictType = dictType;
|
||||
}
|
||||
|
||||
public String getDictType()
|
||||
{
|
||||
return dictType;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dictId", getDictId())
|
||||
.append("dictName", getDictName())
|
||||
.append("dictType", getDictType())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
package com.bonus.sgzb.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDic;
|
||||
import com.bonus.sgzb.base.service.ISysDicService;
|
||||
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.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 数据字典Controller
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dic")
|
||||
public class SysDicController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysDicService sysDicService;
|
||||
|
||||
/**
|
||||
* 查询数据字典列表
|
||||
*/
|
||||
@RequiresPermissions("domain:dic:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDic sysDic)
|
||||
{
|
||||
startPage();
|
||||
List<SysDic> list = sysDicService.selectSysDicList(sysDic);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据字典列表
|
||||
*/
|
||||
@RequiresPermissions("domain:dic:export")
|
||||
@Log(title = "数据字典", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDic sysDic)
|
||||
{
|
||||
List<SysDic> list = sysDicService.selectSysDicList(sysDic);
|
||||
ExcelUtil<SysDic> util = new ExcelUtil<SysDic>(SysDic.class);
|
||||
util.exportExcel(response, list, "数据字典数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据字典详细信息
|
||||
*/
|
||||
@RequiresPermissions("domain:dic:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysDicService.selectSysDicById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据字典
|
||||
*/
|
||||
@RequiresPermissions("domain:dic:add")
|
||||
@Log(title = "数据字典", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysDic sysDic)
|
||||
{
|
||||
return toAjax(sysDicService.insertSysDic(sysDic));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据字典
|
||||
*/
|
||||
@RequiresPermissions("domain:dic:edit")
|
||||
@Log(title = "数据字典", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysDic sysDic)
|
||||
{
|
||||
return toAjax(sysDicService.updateSysDic(sysDic));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据字典
|
||||
*/
|
||||
@RequiresPermissions("domain:dic:remove")
|
||||
@Log(title = "数据字典", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysDicService.deleteSysDicByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
package com.bonus.sgzb.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDict;
|
||||
import com.bonus.sgzb.base.service.ISysDictService;
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
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.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 字典类型Controller
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/type")
|
||||
public class SysDictController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysDictService sysDictService;
|
||||
|
||||
/**
|
||||
* 查询字典类型列表
|
||||
*/
|
||||
@RequiresPermissions("domain:type:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDict sysDict)
|
||||
{
|
||||
startPage();
|
||||
List<SysDict> list = sysDictService.selectSysDictTypeList(sysDict);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出字典类型列表
|
||||
*/
|
||||
@RequiresPermissions("domain:type:export")
|
||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDict sysDict)
|
||||
{
|
||||
List<SysDict> list = sysDictService.selectSysDictTypeList(sysDict);
|
||||
ExcelUtil<SysDict> util = new ExcelUtil<SysDict>(SysDict.class);
|
||||
util.exportExcel(response, list, "字典类型数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典类型详细信息
|
||||
*/
|
||||
@RequiresPermissions("domain:type:query")
|
||||
@GetMapping(value = "/{dictId}")
|
||||
public AjaxResult getInfo(@PathVariable("dictId") Long dictId)
|
||||
{
|
||||
return success(sysDictService.selectSysDictTypeByDictId(dictId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*/
|
||||
@RequiresPermissions("domain:type:add")
|
||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysDict sysDict)
|
||||
{
|
||||
return toAjax(sysDictService.insertSysDictType(sysDict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@RequiresPermissions("domain:type:edit")
|
||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysDict sysDict)
|
||||
{
|
||||
return toAjax(sysDictService.updateSysDictType(sysDict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典类型
|
||||
*/
|
||||
@RequiresPermissions("domain:type:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictIds)
|
||||
{
|
||||
return toAjax(sysDictService.deleteSysDictTypeByDictIds(dictIds));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.sgzb.base.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 数据字典Mapper接口
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public interface SysDicMapper
|
||||
{
|
||||
/**
|
||||
* 查询数据字典
|
||||
*
|
||||
* @param id 数据字典主键
|
||||
* @return 数据字典
|
||||
*/
|
||||
public SysDic selectSysDicById(Long id);
|
||||
|
||||
/**
|
||||
* 查询数据字典列表
|
||||
*
|
||||
* @param sysDic 数据字典
|
||||
* @return 数据字典集合
|
||||
*/
|
||||
public List<SysDic> selectSysDicList(SysDic sysDic);
|
||||
|
||||
/**
|
||||
* 新增数据字典
|
||||
*
|
||||
* @param sysDic 数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDic(SysDic sysDic);
|
||||
|
||||
/**
|
||||
* 修改数据字典
|
||||
*
|
||||
* @param sysDic 数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDic(SysDic sysDic);
|
||||
|
||||
/**
|
||||
* 删除数据字典
|
||||
*
|
||||
* @param id 数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDicById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除数据字典
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDicByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package com.bonus.sgzb.base.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDict;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典类型Mapper接口
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public interface SysDictMapper
|
||||
{
|
||||
/**
|
||||
* 查询字典类型
|
||||
*
|
||||
* @param dictId 字典类型主键
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDict selectSysDictByDictId(Long dictId);
|
||||
|
||||
/**
|
||||
* 查询字典类型列表
|
||||
*
|
||||
* @param sysDict 字典类型
|
||||
* @return 字典类型集合
|
||||
*/
|
||||
public List<SysDict> selectSysDictList(SysDict sysDict);
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*
|
||||
* @param sysDict 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDict(SysDict sysDict);
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*
|
||||
* @param sysDict 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDict(SysDict sysDict);
|
||||
|
||||
/**
|
||||
* 删除字典类型
|
||||
*
|
||||
* @param dictId 字典类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDictByDictId(Long dictId);
|
||||
|
||||
/**
|
||||
* 批量删除字典类型
|
||||
*
|
||||
* @param dictIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDictByDictIds(Long[] dictIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.sgzb.base.service;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 数据字典Service接口
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public interface ISysDicService
|
||||
{
|
||||
/**
|
||||
* 查询数据字典
|
||||
*
|
||||
* @param id 数据字典主键
|
||||
* @return 数据字典
|
||||
*/
|
||||
public SysDic selectSysDicById(Long id);
|
||||
|
||||
/**
|
||||
* 查询数据字典列表
|
||||
*
|
||||
* @param sysDic 数据字典
|
||||
* @return 数据字典集合
|
||||
*/
|
||||
public List<SysDic> selectSysDicList(SysDic sysDic);
|
||||
|
||||
/**
|
||||
* 新增数据字典
|
||||
*
|
||||
* @param sysDic 数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDic(SysDic sysDic);
|
||||
|
||||
/**
|
||||
* 修改数据字典
|
||||
*
|
||||
* @param sysDic 数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDic(SysDic sysDic);
|
||||
|
||||
/**
|
||||
* 批量删除数据字典
|
||||
*
|
||||
* @param ids 需要删除的数据字典主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDicByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除数据字典信息
|
||||
*
|
||||
* @param id 数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDicById(Long id);
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.bonus.sgzb.base.service;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDict;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 字典类型Service接口
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public interface ISysDictService
|
||||
{
|
||||
/**
|
||||
* 查询字典类型
|
||||
*
|
||||
* @param dictId 字典类型主键
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDict selectSysDictTypeByDictId(Long dictId);
|
||||
|
||||
/**
|
||||
* 查询字典类型列表
|
||||
*
|
||||
* @param sysDict 字典类型
|
||||
* @return 字典类型集合
|
||||
*/
|
||||
public List<SysDict> selectSysDictTypeList(SysDict sysDict);
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*
|
||||
* @param sysDict 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDictType(SysDict sysDict);
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*
|
||||
* @param sysDict 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDictType(SysDict sysDict);
|
||||
|
||||
/**
|
||||
* 批量删除字典类型
|
||||
*
|
||||
* @param dictIds 需要删除的字典类型主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDictTypeByDictIds(Long[] dictIds);
|
||||
|
||||
/**
|
||||
* 删除字典类型信息
|
||||
*
|
||||
* @param dictId 字典类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDictTypeByDictId(Long dictId);
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.bonus.sgzb.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDic;
|
||||
import com.bonus.sgzb.base.mapper.SysDicMapper;
|
||||
import com.bonus.sgzb.base.service.ISysDicService;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 数据字典Service业务层处理
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
@Service
|
||||
public class SysDicServiceImpl implements ISysDicService
|
||||
{
|
||||
@Autowired
|
||||
private SysDicMapper sysDicMapper;
|
||||
|
||||
/**
|
||||
* 查询数据字典
|
||||
*
|
||||
* @param id 数据字典主键
|
||||
* @return 数据字典
|
||||
*/
|
||||
@Override
|
||||
public SysDic selectSysDicById(Long id)
|
||||
{
|
||||
return sysDicMapper.selectSysDicById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据字典列表
|
||||
*
|
||||
* @param sysDic 数据字典
|
||||
* @return 数据字典
|
||||
*/
|
||||
@Override
|
||||
public List<SysDic> selectSysDicList(SysDic sysDic)
|
||||
{
|
||||
return sysDicMapper.selectSysDicList(sysDic);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据字典
|
||||
*
|
||||
* @param sysDic 数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysDic(SysDic sysDic)
|
||||
{
|
||||
sysDic.setCreateTime(DateUtils.getNowDate());
|
||||
return sysDicMapper.insertSysDic(sysDic);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据字典
|
||||
*
|
||||
* @param sysDic 数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysDic(SysDic sysDic)
|
||||
{
|
||||
return sysDicMapper.updateSysDic(sysDic);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除数据字典
|
||||
*
|
||||
* @param ids 需要删除的数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDicByIds(Long[] ids)
|
||||
{
|
||||
return sysDicMapper.deleteSysDicByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据字典信息
|
||||
*
|
||||
* @param id 数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDicById(Long id)
|
||||
{
|
||||
return sysDicMapper.deleteSysDicById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
package com.bonus.sgzb.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SysDict;
|
||||
import com.bonus.sgzb.base.mapper.SysDictMapper;
|
||||
import com.bonus.sgzb.base.service.ISysDictService;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.system.api.domain.SysDictType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 字典类型Service业务层处理
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
@Service
|
||||
public class SysDictServiceImpl implements ISysDictService
|
||||
{
|
||||
@Autowired
|
||||
private SysDictMapper sysDictMapper;
|
||||
|
||||
/**
|
||||
* 查询字典类型
|
||||
*
|
||||
* @param dictId 字典类型主键
|
||||
* @return 字典类型
|
||||
*/
|
||||
@Override
|
||||
public SysDict selectSysDictTypeByDictId(Long dictId)
|
||||
{
|
||||
return sysDictMapper.selectSysDictByDictId(dictId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典类型列表
|
||||
*
|
||||
* @param sysDict 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
@Override
|
||||
public List<SysDict> selectSysDictTypeList(SysDict sysDict)
|
||||
{
|
||||
return sysDictMapper.selectSysDictList(sysDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*
|
||||
* @param sysDict 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysDictType(SysDict sysDict)
|
||||
{
|
||||
sysDict.setCreateTime(DateUtils.getNowDate());
|
||||
return sysDictMapper.insertSysDict(sysDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*
|
||||
* @param sysDict 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysDictType(SysDict sysDict)
|
||||
{
|
||||
sysDict.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysDictMapper.updateSysDict(sysDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除字典类型
|
||||
*
|
||||
* @param dictIds 需要删除的字典类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDictTypeByDictIds(Long[] dictIds)
|
||||
{
|
||||
return sysDictMapper.deleteSysDictByDictIds(dictIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典类型信息
|
||||
*
|
||||
* @param dictId 字典类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDictTypeByDictId(Long dictId)
|
||||
{
|
||||
return sysDictMapper.deleteSysDictByDictId(dictId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.base.mapper.SysDicMapper">
|
||||
<resultMap type="com.bonus.sgzb.base.api.domain.SysDic" id="SysDicResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="pId" column="p_id"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="value" column="value"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="level" column="level"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="creator" column="creator"/>
|
||||
</resultMap>
|
||||
<sql id="selectSysDicVo"> select id, p_id, code, name, description, value, sort, level, status, create_time, creator from sys_dic </sql>
|
||||
<select id="selectSysDicList" parameterType="com.bonus.sgzb.base.api.domain.SysDic" resultMap="SysDicResult">
|
||||
<include refid="selectSysDicVo"/>
|
||||
<where>
|
||||
<if test="pId != null "> and p_id = #{pId}</if>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="value != null and value != ''"> and value = #{value}</if>
|
||||
<if test="sort != null and sort != ''"> and sort = #{sort}</if>
|
||||
<if test="level != null and level != ''"> and level = #{level}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="creator != null and creator != ''"> and creator = #{creator}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectSysDicById" parameterType="Long" resultMap="SysDicResult">
|
||||
<include refid="selectSysDicVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<insert id="insertSysDic" parameterType="com.bonus.sgzb.base.api.domain.SysDic">
|
||||
insert into sys_dic
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="pId != null">p_id,</if>
|
||||
<if test="code != null">code,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="value != null">value,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="level != null">level,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="creator != null">creator,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="pId != null">#{pId},</if>
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="value != null">#{value},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="level != null">#{level},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="creator != null">#{creator},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateSysDic" parameterType="com.bonus.sgzb.base.api.domain.SysDic">
|
||||
update sys_dic
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="pId != null">p_id = #{pId},</if>
|
||||
<if test="code != null">code = #{code},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="value != null">value = #{value},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="level != null">level = #{level},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="creator != null">creator = #{creator},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteSysDicById" parameterType="Long"> delete from sys_dic where id = #{id} </delete>
|
||||
<delete id="deleteSysDicByIds" parameterType="String">
|
||||
delete from sys_dic where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.base.mapper.SysDictMapper">
|
||||
|
||||
<resultMap type="com.bonus.sgzb.base.api.domain.SysDict" id="SysDictTypeResult">
|
||||
<result property="dictId" column="dict_id" />
|
||||
<result property="dictName" column="dict_name" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysDictTypeVo">
|
||||
select dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark from sys_dict_type
|
||||
</sql>
|
||||
|
||||
<select id="selectSysDictList" parameterType="com.bonus.sgzb.base.api.domain.SysDict" resultMap="SysDictTypeResult">
|
||||
<include refid="selectSysDictTypeVo"/>
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''"> and dict_name like concat('%', #{dictName}, '%')</if>
|
||||
<if test="dictType != null and dictType != ''"> and dict_type = #{dictType}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysDictByDictId" parameterType="Long" resultMap="SysDictTypeResult">
|
||||
<include refid="selectSysDictTypeVo"/>
|
||||
where dict_id = #{dictId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysDict" parameterType="com.bonus.sgzb.base.api.domain.SysDict" useGeneratedKeys="true" keyProperty="dictId">
|
||||
insert into sys_dict_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="dictName != null">dict_name,</if>
|
||||
<if test="dictType != null">dict_type,</if>
|
||||
<if test="status != null">status,</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>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dictName != null">#{dictName},</if>
|
||||
<if test="dictType != null">#{dictType},</if>
|
||||
<if test="status != null">#{status},</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>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysDict" parameterType="com.bonus.sgzb.base.api.domain.SysDict">
|
||||
update sys_dict_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="dictName != null">dict_name = #{dictName},</if>
|
||||
<if test="dictType != null">dict_type = #{dictType},</if>
|
||||
<if test="status != null">status = #{status},</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>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysDictByDictId" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id = #{dictId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysDictByDictIds" parameterType="String">
|
||||
delete from sys_dict_type where dict_id in
|
||||
<foreach item="dictId" collection="array" open="(" separator="," close=")">
|
||||
#{dictId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue