parent
b0dd19dc9c
commit
295453f76e
@ -0,0 +1,87 @@
|
|||||||
|
package com.ruoyi.gysl.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.gysl.entity.Ml;
|
||||||
|
import com.ruoyi.gysl.service.MlService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags ="目录管理" )
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/gysl/Ml")
|
||||||
|
public class MlController extends BaseController {
|
||||||
|
/**
|
||||||
|
* 服务对象
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private MlService mlService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询目录数据
|
||||||
|
*
|
||||||
|
* @param ml 查询条件实体
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("分页查询目录数据")
|
||||||
|
public TableDataInfo list(Ml ml) {
|
||||||
|
startPage(); // 开启分页
|
||||||
|
List<Ml> list = mlService.selectMl(ml);
|
||||||
|
return getDataTable(list);
|
||||||
|
// 封装分页结果
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过主键查询单条数据
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 单条数据
|
||||||
|
*/
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@ApiOperation("通过主键查询目录")
|
||||||
|
public AjaxResult select(@PathVariable Integer id){
|
||||||
|
return success(mlService.selectMlId(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据
|
||||||
|
*@param ml 实体对象
|
||||||
|
* @return 新增结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增数据")
|
||||||
|
public AjaxResult add(@RequestBody Ml ml) {
|
||||||
|
return success(mlService.saveMl(ml));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据
|
||||||
|
*
|
||||||
|
* @param ml 实体对象
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ApiOperation("修改数据")
|
||||||
|
public AjaxResult update(@RequestBody Ml ml) {
|
||||||
|
return success(mlService.updateById(ml));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除数据
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@ApiOperation("删除数据")
|
||||||
|
public AjaxResult delete(@PathVariable Integer id) {
|
||||||
|
return success(mlService.deleteMl(id));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.gysl.entity;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**目录管理(Ml)实体类
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "Ml", description = "目录管理")
|
||||||
|
public class Ml {
|
||||||
|
|
||||||
|
//主键id
|
||||||
|
@ApiModelProperty("主键id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
//上楼目录类别
|
||||||
|
@ApiModelProperty("上楼目录类别")
|
||||||
|
private Integer slmllb;
|
||||||
|
|
||||||
|
//工业大类
|
||||||
|
@ApiModelProperty("工业大类")
|
||||||
|
private String gydl;
|
||||||
|
|
||||||
|
//产业
|
||||||
|
@ApiModelProperty("产业")
|
||||||
|
private String cy;
|
||||||
|
|
||||||
|
//创建者id
|
||||||
|
@ApiModelProperty("创建者id")
|
||||||
|
private Integer createId;
|
||||||
|
|
||||||
|
//创建时间
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
//创建者
|
||||||
|
@ApiModelProperty("创建者")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
//更新者id
|
||||||
|
@ApiModelProperty("更新者id")
|
||||||
|
private Long updateId;
|
||||||
|
|
||||||
|
//更新者
|
||||||
|
@ApiModelProperty("更新者")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
//更新时间
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package com.ruoyi.gysl.service;
|
||||||
|
|
||||||
|
import com.ruoyi.gysl.entity.Ml;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目录管理(MlController)表服务接口
|
||||||
|
*/
|
||||||
|
public interface MlService {
|
||||||
|
/**
|
||||||
|
* 根据条件查目录数据列表
|
||||||
|
*
|
||||||
|
* @param ml 查询条件实体
|
||||||
|
* @return 目录数据列表
|
||||||
|
*/
|
||||||
|
public List<Ml> selectMl(Ml ml);
|
||||||
|
/**
|
||||||
|
* 根据条件查询目录的单条数据列表
|
||||||
|
*
|
||||||
|
* @param id 查询条件实体
|
||||||
|
* @return 单条数据
|
||||||
|
*/
|
||||||
|
Ml selectMlId(Integer id);
|
||||||
|
/**
|
||||||
|
* 增加目录
|
||||||
|
*
|
||||||
|
* @param ml 数据
|
||||||
|
* @return 新增结果
|
||||||
|
*/
|
||||||
|
int saveMl(Ml ml);
|
||||||
|
/**
|
||||||
|
* 修改目录
|
||||||
|
*
|
||||||
|
* @param ml 数据
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
int updateById(Ml ml);
|
||||||
|
/**
|
||||||
|
* 删除目录
|
||||||
|
* @param id 数据
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
int deleteMl(Integer id);
|
||||||
|
}
|
Loading…
Reference in new issue