机床之家后台
1.插入数据库将需要的数据传入后台
INSERT INTO blade_menu
(id
, parent_id
, code
, name
, alias
, path
, source
, sort
, category
, action
, is_open
, remark
, is_deleted
)
VALUES ('1821002902310400002', '1552200887580160001', 'parameterinfo', '机床参数信息', 'menu', '/parameter/parameterinfo', NULL, 2, 1, 0, 1, NULL, 0);
INSERT INTO blade_menu
(id
, parent_id
, code
, name
, alias
, path
, source
, sort
, category
, action
, is_open
, remark
, is_deleted
)
VALUES ('1821005064486694913', '1821002902310400002', 'parameterinfo_add', '新增', 'add', '/parameter/parameterinfo/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO blade_menu
(id
, parent_id
, code
, name
, alias
, path
, source
, sort
, category
, action
, is_open
, remark
, is_deleted
)
VALUES ('1821005064486694914', '1821002902310400002', 'parameterinfo_edit', '修改', 'edit', '/parameter/parameterinfo/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu
(id
, parent_id
, code
, name
, alias
, path
, source
, sort
, category
, action
, is_open
, remark
, is_deleted
)
VALUES ('1821005064486694915', '1821002902310400002', 'parameterinfo_delete', '删除', 'delete', '/api//parameter/parameterinfo/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO blade_menu
(id
, parent_id
, code
, name
, alias
, path
, source
, sort
, category
, action
, is_open
, remark
, is_deleted
)
VALUES ('1821005064486694916', '1821002902310400002', 'parameterinfo_view', '查看', 'view', '/parameter/parameterinfo/view', 'file-text', 4, 2, 2, 1, NULL, 0);
2.机床参数信息菜单栏对应在产品管理菜单栏下,产品管理菜单栏对应prooduct包添加机床参数信息控制层controller项
@RestController
@AllArgsConstructor
@RequestMapping("/product/parameter")
@Api(value = "机床参数信息表", tags = "机床参数信息表")
public class ParameterInfoController extends BladeController {
** private IParameterInfoService parameterInfoService;**
(detail、list、all、save、updata、submit、remove、page等配置接口)
(例如:
/**
** * 详情**
** /*
** @GetMapping("/detail")**
** @ApiOperationSupport(order = 1)**
** @ApiOperation(value = "详情", notes = "传入parameterInfo")**
** public R
** ParameterInfo detail = parameterInfoService.getOne(Condition.getQueryWrapper(parameterInfo));**
** return R.data(detail);**
** }**
)
}
3.实体层entity
将数据库内容实体化 注意:命名标准必须严谨
例如:
命名格式下划线后第一个单词大写 注:下划线后必须大写
第一个单词小写
@Data
@TableName("t_parameter_info")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ParameterInfo对象", description = "机床参数信息表")
public class ParameterInfo extends BaseEntity {
** private static final long serialVersionUID = 1L;**
例如:
@ApiModelProperty(value = "床身上最大工件回转直径")
** private Integer Bedmaxdiameter;**
}
4.映射层mapper
mapper层需要两种接口
mapper.java和mapper.xml
mapper.java:
public interface ParameterInfoMapper extends BaseMapper
** /****
** * 自定义分页**
** * @param page**
** * @param parameterInfo**
** * @return**
** /*
** List
}
mapper.xml: