添加“video”相关CRUD代码
This commit is contained in:
parent
8b89ba9505
commit
5161b22094
25
src/main/java/com/ycwl/basic/mapper/pc/VideoMapper.java
Normal file
25
src/main/java/com/ycwl/basic/mapper/pc/VideoMapper.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.template.entity.TemplateEntity;
|
||||
import com.ycwl.basic.model.pc.template.req.TemplateReqQuery;
|
||||
import com.ycwl.basic.model.pc.template.resp.TemplateRespVO;
|
||||
import com.ycwl.basic.model.pc.video.entity.VideoEntity;
|
||||
import com.ycwl.basic.model.pc.video.req.VideoReqQuery;
|
||||
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/2 15:27
|
||||
* 成片
|
||||
*/
|
||||
@Mapper
|
||||
public interface VideoMapper {
|
||||
List<VideoRespVO> list(VideoReqQuery videoReqQuery);
|
||||
VideoRespVO getById(Long id);
|
||||
int add(VideoEntity task);
|
||||
int deleteById(Long id);
|
||||
int update(VideoEntity task);
|
||||
}
|
@ -19,8 +19,6 @@ import java.util.Date;
|
||||
@Data
|
||||
@ApiModel("模版查询请求类")
|
||||
public class TemplateReqQuery extends BaseQueryParameterReq {
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 模版名称
|
||||
*/
|
||||
@ -73,6 +71,6 @@ public class TemplateReqQuery extends BaseQueryParameterReq {
|
||||
*/
|
||||
@ApiModelProperty("是否启用,0不是,1是")
|
||||
private Integer status;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
}
|
||||
|
@ -0,0 +1,45 @@
|
||||
package com.ycwl.basic.model.pc.video.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/2 15:28
|
||||
* 视频成片
|
||||
*/
|
||||
@Data
|
||||
@TableName("video")
|
||||
public class VideoEntity {
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 景区id
|
||||
*/
|
||||
private Long scenicId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long memberId;
|
||||
/**
|
||||
* 模版id
|
||||
*/
|
||||
private Long templateId;
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
/**
|
||||
* 执行任务的机器ID,render_worker.id
|
||||
*/
|
||||
private Long workerId;
|
||||
/**
|
||||
* 视频链接
|
||||
*/
|
||||
private String videoUrl;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.ycwl.basic.model.pc.video.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/2 15:28
|
||||
* 视频成片
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("成片查询请求类")
|
||||
public class VideoReqQuery {
|
||||
/**
|
||||
* 景区id
|
||||
*/
|
||||
@ApiModelProperty("景区id")
|
||||
private Long scenicId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty("用户id")
|
||||
private Long memberId;
|
||||
/**
|
||||
* 模版id
|
||||
*/
|
||||
@ApiModelProperty("模版id")
|
||||
private Long templateId;
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@ApiModelProperty("任务id")
|
||||
private Long taskId;
|
||||
/**
|
||||
* 执行任务的机器ID,render_worker.id
|
||||
*/
|
||||
@ApiModelProperty("执行任务的机器ID,render_worker.id")
|
||||
private Long workerId;
|
||||
/**
|
||||
* 视频链接
|
||||
*/
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.ycwl.basic.model.pc.video.resp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ycwl.basic.model.common.BaseQueryParameterReq;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/2 15:28
|
||||
* 视频成片
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("成片查询请求类")
|
||||
public class VideoRespVO extends BaseQueryParameterReq {
|
||||
private Long id;
|
||||
/**
|
||||
* 景区id
|
||||
*/
|
||||
@ApiModelProperty("景区id")
|
||||
private Long scenicId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty("用户id")
|
||||
private Long memberId;
|
||||
/**
|
||||
* 模版id
|
||||
*/
|
||||
@ApiModelProperty("模版id")
|
||||
private Long templateId;
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@ApiModelProperty("任务id")
|
||||
private Long taskId;
|
||||
/**
|
||||
* 执行任务的机器ID,render_worker.id
|
||||
*/
|
||||
@ApiModelProperty("执行任务的机器ID,render_worker.id")
|
||||
private Long workerId;
|
||||
/**
|
||||
* 视频链接
|
||||
*/
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
}
|
43
src/main/resources/mapper/pc/VideoMapper.xml
Normal file
43
src/main/resources/mapper/pc/VideoMapper.xml
Normal file
@ -0,0 +1,43 @@
|
||||
<?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.ycwl.basic.mapper.pc.VideoMapper">
|
||||
<insert id="add">
|
||||
insert into video(id, scenic_id, member_id, template_id, task_id, worker_id, video_url)
|
||||
values (#{id}, #{scenicId}, #{memberId}, #{templateId}, #{taskId}, #{workerId}, #{videoUrl})
|
||||
</insert>
|
||||
<update id="update">
|
||||
update video
|
||||
<set>
|
||||
<if test="scenicId!= null">scenic_id = #{scenicId}, </if>
|
||||
<if test="memberId!= null">member_id = #{memberId}, </if>
|
||||
<if test="templateId!= null">template_id = #{templateId}, </if>
|
||||
<if test="taskId!= null">task_id = #{taskId}, </if>
|
||||
<if test="workerId!= null">worker_id = #{workerId}, </if>
|
||||
<if test="videoUrl!= null">video_url = #{videoUrl}, </if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteById">
|
||||
delete from video where id = #{id}
|
||||
</delete>
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||
select id, scenic_id, member_id, template_id, task_id, worker_id, video_url, create_time, update_time
|
||||
from video
|
||||
<where>
|
||||
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
|
||||
<if test="memberId!= null">and member_id = #{memberId} </if>
|
||||
<if test="templateId!= null">and template_id = #{templateId} </if>
|
||||
<if test="taskId!=null">
|
||||
and task_id = #{taskId}
|
||||
</if>
|
||||
<if test="workerId!= null">and worker_id = #{workerId} </if>
|
||||
<if test="startTime!= null">and create_time >= #{startTime} </if>
|
||||
<if test="endTime!= null">and create_time <= #{endTime} </if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||
select id, scenic_id, member_id, template_id, task_id, worker_id, video_url, create_time, update_time
|
||||
from video
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user