Commit 525e6b0d authored by wdy's avatar wdy

任务与样品关系

parent 505ab031
package com.ruoyi.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 任务表
*/
@ApiModel
@TableName(value ="t_task_sample_relation", autoResultMap = true)
@Accessors(chain = true)
@Data
public class TaskSampleRelation {
@ApiModelProperty("主键")
@TableId(type = IdType.ASSIGN_ID)
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
@ApiModelProperty("任务id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long taskId;
@ApiModelProperty("样品id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long sampleId;
@ApiModelProperty("0:整车样品 1:零部件样品")
private String flag;
}
package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.TaskSampleRelation;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface TaskSampleRelationMapper extends BaseMapper<TaskSampleRelation> {
/**
* 根据任务id查询
* @param taskId
* @return
*/
List<TaskSampleRelation> selectByTaskId(@Param("taskId") Long taskId);
}
package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.TaskSampleRelation;
import java.util.List;
public interface TaskSampleRelationService extends IService<TaskSampleRelation> {
List<TaskSampleRelation> selectByTaskId(Long taskId);
}
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.TaskSampleRelation;
import com.ruoyi.mapper.TaskSampleRelationMapper;
import com.ruoyi.service.TaskSampleRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class TaskSampleRelationServiceImpl extends ServiceImpl<TaskSampleRelationMapper, TaskSampleRelation> implements TaskSampleRelationService {
@Autowired
private TaskSampleRelationMapper taskSampleRelationMapper;
@Override
public List<TaskSampleRelation> selectByTaskId(Long taskId) {
return taskSampleRelationMapper.selectByTaskId(taskId);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment