添加字段和表
parent
1f1d8c7680
commit
190ec316eb
|
@ -0,0 +1,45 @@
|
|||
package com.muyu.common.domian;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "node_joint")
|
||||
public class NodeJoint {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long nodeId;
|
||||
/**
|
||||
* 联查方式
|
||||
*/
|
||||
private String joint;
|
||||
/**
|
||||
* 字段
|
||||
*/
|
||||
private String oneFie;
|
||||
/**
|
||||
* 字段
|
||||
*/
|
||||
private String twoFie;
|
||||
|
||||
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package com.muyu.common.domian;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -16,6 +18,7 @@ public class NodeTable {
|
|||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 节点id
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.muyu.task.server.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.domian.NodeJoint;
|
||||
import com.muyu.task.server.service.NodeJointService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("nodeJoint")
|
||||
public class NodeJointController {
|
||||
|
||||
@Autowired
|
||||
private NodeJointService nodeJointService;
|
||||
|
||||
|
||||
@PostMapping("add")
|
||||
public Result save(@RequestBody NodeJoint nodeJoint){
|
||||
QueryWrapper<NodeJoint> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("node_id",nodeJoint.getNodeId());
|
||||
nodeJointService.remove(wrapper);
|
||||
boolean save = nodeJointService.save(nodeJoint);
|
||||
return Result.success(save);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.task.server.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.common.domian.NodeJoint;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface NodeJointMapper extends BaseMapper<NodeJoint> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu.task.server.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.domian.NodeJoint;
|
||||
|
||||
public interface NodeJointService extends IService<NodeJoint> {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.muyu.task.server.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.domian.NodeJoint;
|
||||
import com.muyu.task.server.mapper.NodeJointMapper;
|
||||
import com.muyu.task.server.service.NodeJointService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class NodeJointServiceImpl extends ServiceImpl<NodeJointMapper, NodeJoint> implements NodeJointService {
|
||||
}
|
Loading…
Reference in New Issue