添加“task”相关CRUD代码
This commit is contained in:
parent
ccaeada98b
commit
c62d2c2f70
@ -2,6 +2,7 @@ package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.broker.entity.BrokerEntity;
|
||||
import com.ycwl.basic.model.pc.broker.req.BrokerReqQuery;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -10,6 +11,7 @@ import java.util.List;
|
||||
* @Date:2024/11/29 14:15
|
||||
* 推客/推广人
|
||||
*/
|
||||
@Mapper
|
||||
public interface BrokerMapper {
|
||||
List<BrokerEntity> list(BrokerReqQuery brokerReqQuery);
|
||||
BrokerEntity getById(Long id);
|
||||
|
@ -3,6 +3,7 @@ package com.ycwl.basic.mapper.pc;
|
||||
import com.ycwl.basic.model.pc.device.entity.DeviceEntity;
|
||||
import com.ycwl.basic.model.pc.device.req.DeviceReqQuery;
|
||||
import com.ycwl.basic.model.pc.device.resp.DeviceRespVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -11,6 +12,7 @@ import java.util.List;
|
||||
* @Date:2024/11/29 14:48
|
||||
* device(设备管理)
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceMapper {
|
||||
List<DeviceRespVO> list(DeviceReqQuery deviceReqQuery);
|
||||
DeviceRespVO getById(Long id);
|
||||
|
@ -3,6 +3,7 @@ package com.ycwl.basic.mapper.pc;
|
||||
import com.ycwl.basic.model.pc.face.entity.FaceEntity;
|
||||
import com.ycwl.basic.model.pc.face.req.FaceReqQuery;
|
||||
import com.ycwl.basic.model.pc.face.resp.FaceRespVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -12,6 +13,7 @@ import java.util.List;
|
||||
* @Date:2024/11/29 15:09
|
||||
* 用户人脸
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaceMapper {
|
||||
List<FaceRespVO> list(FaceReqQuery faceReqQuery);
|
||||
FaceRespVO getById(Long id);
|
||||
|
@ -3,6 +3,7 @@ package com.ycwl.basic.mapper.pc;
|
||||
import com.ycwl.basic.model.pc.faceSample.entity.FaceSampleEntity;
|
||||
import com.ycwl.basic.model.pc.faceSample.req.FaceSampleReqQuery;
|
||||
import com.ycwl.basic.model.pc.faceSample.resp.FaceSampleRespVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -12,6 +13,7 @@ import java.util.List;
|
||||
* @Date:2024/11/29 15:38
|
||||
* 人脸样本(设备上报)检索
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaceSampleMapper {
|
||||
List<FaceSampleRespVO> list(FaceSampleReqQuery faceSampleReqQuery);
|
||||
FaceSampleRespVO getById(Long id);
|
||||
|
@ -2,6 +2,7 @@ package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.member.entity.MemberEntity;
|
||||
import com.ycwl.basic.model.pc.member.req.MemberReqQuery;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -10,6 +11,7 @@ import java.util.List;
|
||||
* @Date:2024/11/29 15:57
|
||||
* 用户(前台)
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberMapper {
|
||||
List<MemberEntity> list(MemberReqQuery memberReqQuery);
|
||||
MemberEntity getById(Long id);
|
||||
|
@ -3,6 +3,7 @@ package com.ycwl.basic.mapper.pc;
|
||||
import com.ycwl.basic.model.pc.order.entity.OrderEntity;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -11,6 +12,7 @@ import java.util.List;
|
||||
* @Date:2024/11/29 16:32
|
||||
* 订单
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderMapper {
|
||||
List<OrderRespVO> list(OrderReqQuery orderReqQuery);
|
||||
OrderEntity getById(Long id);
|
||||
|
@ -2,6 +2,7 @@ package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.renderWorker.entity.RenderWorkerEntity;
|
||||
import com.ycwl.basic.model.pc.renderWorker.req.RenderWorkerReqQuery;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -10,6 +11,7 @@ import java.util.List;
|
||||
* @Date:2024/11/29 17:22
|
||||
* 渲染机管理表
|
||||
*/
|
||||
@Mapper
|
||||
public interface RenderWorkerMapper {
|
||||
List<RenderWorkerEntity> list(RenderWorkerReqQuery renderWorkerReqQuery);
|
||||
RenderWorkerEntity getById(Long id);
|
||||
|
@ -4,6 +4,7 @@ import com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity;
|
||||
import com.ycwl.basic.model.pc.scenic.entity.ScenicEntity;
|
||||
import com.ycwl.basic.model.pc.scenic.req.ScenicReqQuery;
|
||||
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -12,6 +13,7 @@ import java.util.List;
|
||||
* @Date:2024/12/2 10:07
|
||||
* 景区管理表
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScenicMapper {
|
||||
List<ScenicRespVO> list(ScenicReqQuery scenicReqQuery);
|
||||
ScenicRespVO getById(Long id);
|
||||
|
@ -1,18 +1,18 @@
|
||||
package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.scenic.entity.ScenicEntity;
|
||||
import com.ycwl.basic.model.pc.scenic.req.ScenicReqQuery;
|
||||
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
||||
import com.ycwl.basic.model.pc.source.entity.SourceEntity;
|
||||
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
||||
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/2 11:21
|
||||
* 视频源
|
||||
*/
|
||||
@Mapper
|
||||
public interface SourceMapper {
|
||||
List<SourceRespVO> list(SourceReqQuery sourceReqQuery);
|
||||
SourceRespVO getById(Long id);
|
||||
|
26
src/main/java/com/ycwl/basic/mapper/pc/TaskMapper.java
Normal file
26
src/main/java/com/ycwl/basic/mapper/pc/TaskMapper.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.scenic.entity.ScenicEntity;
|
||||
import com.ycwl.basic.model.pc.scenic.req.ScenicReqQuery;
|
||||
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
||||
import com.ycwl.basic.model.pc.task.entity.TaskEntity;
|
||||
import com.ycwl.basic.model.pc.task.req.TaskReqQuery;
|
||||
import com.ycwl.basic.model.pc.task.resp.TaskRespVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/2 14:06
|
||||
* 任务列表
|
||||
*/
|
||||
@Mapper
|
||||
public interface TaskMapper {
|
||||
List<TaskRespVO> list(TaskReqQuery taskReqQuery);
|
||||
TaskRespVO getById(Long id);
|
||||
int add(TaskEntity task);
|
||||
int deleteById(Long id);
|
||||
int update(TaskEntity task);
|
||||
int updateStatus(Long id,Integer status);
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.ycwl.basic.model.pc.task.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/02 14:10
|
||||
* 任务列表
|
||||
*/
|
||||
@Data
|
||||
@TableName("task")
|
||||
public class TaskEntity {
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 执行任务的机器ID,render_worker.id
|
||||
*/
|
||||
private Long workerId;
|
||||
/**
|
||||
* 用户ID,可以不和用户关联
|
||||
*/
|
||||
private Long memberId;
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private Long templateId;
|
||||
/**
|
||||
* 景区ID
|
||||
*/
|
||||
private Long scenicId;
|
||||
/**
|
||||
* 任务参数,JSON字符串
|
||||
*/
|
||||
private String taskParams;
|
||||
/**
|
||||
* 视频链接,未完成状态下没有
|
||||
*/
|
||||
private String videoUrl;
|
||||
/**
|
||||
* 状态,0未完成,1已完成,2正在处理
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 结果,不管成功还是失败
|
||||
*/
|
||||
private String result;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ycwl.basic.model.pc.task.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
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/02 14:10
|
||||
* 任务列表
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("任务列表查询参数")
|
||||
public class TaskReqQuery extends BaseQueryParameterReq {
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 执行任务的机器ID,render_worker.id
|
||||
*/
|
||||
@ApiModelProperty("执行任务的机器ID")
|
||||
private Long workerId;
|
||||
/**
|
||||
* 用户ID,可以不和用户关联
|
||||
*/
|
||||
@ApiModelProperty("用户ID")
|
||||
private Long memberId;
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
@ApiModelProperty("模板ID")
|
||||
private Long templateId;
|
||||
/**
|
||||
* 景区ID
|
||||
*/
|
||||
@ApiModelProperty("景区ID")
|
||||
private Long scenicId;
|
||||
/**
|
||||
* 任务参数,JSON字符串
|
||||
*/
|
||||
@ApiModelProperty("任务参数")
|
||||
private String taskParams;
|
||||
/**
|
||||
* 视频链接,未完成状态下没有
|
||||
*/
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
/**
|
||||
* 状态,0未完成,1已完成,2正在处理
|
||||
*/
|
||||
@ApiModelProperty("状态")
|
||||
private Integer status;
|
||||
/**
|
||||
* 结果,不管成功还是失败
|
||||
*/
|
||||
@ApiModelProperty("结果")
|
||||
private String result;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ycwl.basic.model.pc.task.resp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/02 14:10
|
||||
* 任务列表
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("查询任务列表响应参数")
|
||||
public class TaskRespVO {
|
||||
private Long id;
|
||||
/**
|
||||
* 执行任务的机器ID,render_worker.id
|
||||
*/
|
||||
@ApiModelProperty("执行任务的机器ID")
|
||||
private Long workerId;
|
||||
/**
|
||||
* 用户ID,可以不和用户关联
|
||||
*/
|
||||
@ApiModelProperty("用户ID")
|
||||
private Long memberId;
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
@ApiModelProperty("模板ID")
|
||||
private Long templateId;
|
||||
/**
|
||||
* 景区ID
|
||||
*/
|
||||
@ApiModelProperty("景区ID")
|
||||
private Long scenicId;
|
||||
/**
|
||||
* 任务参数,JSON字符串
|
||||
*/
|
||||
@ApiModelProperty("任务参数")
|
||||
private String taskParams;
|
||||
/**
|
||||
* 视频链接,未完成状态下没有
|
||||
*/
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
/**
|
||||
* 状态,0未完成,1已完成,2正在处理
|
||||
*/
|
||||
@ApiModelProperty("状态")
|
||||
private Integer status;
|
||||
/**
|
||||
* 结果,不管成功还是失败
|
||||
*/
|
||||
@ApiModelProperty("结果")
|
||||
private String result;
|
||||
@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;
|
||||
}
|
@ -90,6 +90,12 @@
|
||||
<if test="status!=null">
|
||||
and `status` = #{status}
|
||||
</if>
|
||||
<if test="startTime!=null">
|
||||
and s.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null">
|
||||
and s.create_time <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultMap="scenicAndConfig">
|
||||
|
@ -27,6 +27,8 @@
|
||||
<if test="deviceId!= null">and device_id = #{deviceId} </if>
|
||||
<if test="memberId!= null">and member_id = #{memberId} </if>
|
||||
<if test="url!= null">and url = #{url} </if>
|
||||
<if test="startTime!= null">and so.create_time >= #{startTime} </if>
|
||||
<if test="endTime!= null">and so.create_time <= #{endTime} </if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
||||
|
48
src/main/resources/mapper/pc/TaskMapper.xml
Normal file
48
src/main/resources/mapper/pc/TaskMapper.xml
Normal file
@ -0,0 +1,48 @@
|
||||
<?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.TaskMapper">
|
||||
<insert id="add">
|
||||
insert into task(id, worker_id, member_id, template_id, scenic_id, task_params, video_url, `status`, result)
|
||||
values (#{id}, #{workerId}, #{memberId}, #{templateId}, #{scenicId}, #{taskParams}, #{videoUrl}, #{status}, #{result})
|
||||
</insert>
|
||||
<update id="update">
|
||||
update task
|
||||
<set>
|
||||
<if test="workerId!= null">worker_id = #{workerId}, </if>
|
||||
<if test="memberId!= null">member_id = #{memberId}, </if>
|
||||
<if test="templateId!= null">template_id = #{templateId}, </if>
|
||||
<if test="scenicId!= null">scenic_id = #{scenicId}, </if>
|
||||
<if test="taskParams!= null">task_params = #{taskParams}, </if>
|
||||
<if test="videoUrl!= null">video_url = #{videoUrl}, </if>
|
||||
<if test="status!= null">status = #{status}, </if>
|
||||
<if test="result!= null">result = #{result}, </if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateStatus">
|
||||
update task
|
||||
set status = #{status}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteById">
|
||||
delete from task where id = #{id}
|
||||
</delete>
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.task.resp.TaskRespVO">
|
||||
select id, worker_id, member_id, template_id, scenic_id, task_params, video_url, `status`, result, create_time, update_time
|
||||
from task
|
||||
<where>
|
||||
<if test="workerId!= null">and worker_id = #{workerId} </if>
|
||||
<if test="memberId!= null">and member_id = #{memberId} </if>
|
||||
<if test="templateId!= null">and template_id = #{templateId} </if>
|
||||
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
|
||||
<if test="status!= null">and `status` = #{status} </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.task.resp.TaskRespVO">
|
||||
select id, worker_id, member_id, template_id, scenic_id, task_params, video_url, `status`, result, create_time, update_time
|
||||
from task
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user