任务基础代码更新
This commit is contained in:
parent
cd2bba5b56
commit
edac08c351
|
|
@ -0,0 +1,25 @@
|
|||
package com.playlet.web.controller.app;
|
||||
|
||||
import com.playlet.common.core.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-21 23:54
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 短剧任务app控制层
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "短剧任务app控制层")
|
||||
@RestController
|
||||
@RequestMapping(value = "/app/task")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class PlayletTaskAppController extends BaseController {
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -29,8 +30,7 @@ import com.playlet.common.utils.file.FileUtils;
|
|||
*/
|
||||
@Controller
|
||||
@RequestMapping("/common")
|
||||
public class CommonController
|
||||
{
|
||||
public class CommonController {
|
||||
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
||||
|
||||
@Autowired
|
||||
|
|
@ -42,15 +42,12 @@ public class CommonController
|
|||
* 通用下载请求
|
||||
*
|
||||
* @param fileName 文件名称
|
||||
* @param delete 是否删除
|
||||
* @param delete 是否删除
|
||||
*/
|
||||
@GetMapping("/download")
|
||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!FileUtils.checkAllowDownload(fileName))
|
||||
{
|
||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
|
||||
try {
|
||||
if (!FileUtils.checkAllowDownload(fileName)) {
|
||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||
}
|
||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||
|
|
@ -59,13 +56,10 @@ public class CommonController
|
|||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||
if (delete)
|
||||
{
|
||||
if (delete) {
|
||||
FileUtils.deleteFile(filePath);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
|
|
@ -75,10 +69,8 @@ public class CommonController
|
|||
*/
|
||||
@PostMapping("/upload")
|
||||
@ResponseBody
|
||||
public AjaxResult uploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
public AjaxResult uploadFile(MultipartFile file) throws Exception {
|
||||
try {
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
|
|
@ -90,9 +82,7 @@ public class CommonController
|
|||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -102,18 +92,15 @@ public class CommonController
|
|||
*/
|
||||
@PostMapping("/uploads")
|
||||
@ResponseBody
|
||||
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception {
|
||||
try {
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
List<String> originalFilenames = new ArrayList<String>();
|
||||
for (MultipartFile file : files)
|
||||
{
|
||||
for (MultipartFile file : files) {
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
|
|
@ -128,9 +115,7 @@ public class CommonController
|
|||
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
|
||||
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -140,12 +125,9 @@ public class CommonController
|
|||
*/
|
||||
@GetMapping("/download/resource")
|
||||
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!FileUtils.checkAllowDownload(resource))
|
||||
{
|
||||
throws Exception {
|
||||
try {
|
||||
if (!FileUtils.checkAllowDownload(resource)) {
|
||||
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
||||
}
|
||||
// 本地资源路径
|
||||
|
|
@ -157,9 +139,7 @@ public class CommonController
|
|||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,119 @@
|
|||
package com.playlet.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.playlet.common.annotation.Log;
|
||||
import com.playlet.common.enums.BusinessType;
|
||||
import com.playlet.system.domain.PlayletTask;
|
||||
import com.playlet.system.service.IPlayletTaskService;
|
||||
import com.playlet.common.core.controller.BaseController;
|
||||
import com.playlet.common.core.domain.AjaxResult;
|
||||
import com.playlet.common.utils.poi.ExcelUtil;
|
||||
import com.playlet.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-21 23:51
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 任务Controller
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/task")
|
||||
public class PlayletTaskController extends BaseController {
|
||||
private String prefix = "system/task";
|
||||
|
||||
@Autowired
|
||||
private IPlayletTaskService playletTaskService;
|
||||
|
||||
@RequiresPermissions("system:task:view")
|
||||
@GetMapping()
|
||||
public String task() {
|
||||
return prefix + "/task";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务列表
|
||||
*/
|
||||
@RequiresPermissions("system:task:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(PlayletTask playletTask) {
|
||||
startPage();
|
||||
List<PlayletTask> list = playletTaskService.selectPlayletTaskList(playletTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出任务列表
|
||||
*/
|
||||
@RequiresPermissions("system:task:export")
|
||||
@Log(title = "任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(PlayletTask playletTask) {
|
||||
List<PlayletTask> list = playletTaskService.selectPlayletTaskList(playletTask);
|
||||
ExcelUtil<PlayletTask> util = new ExcelUtil<PlayletTask>(PlayletTask.class);
|
||||
return util.exportExcel(list, "任务数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add() {
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存任务
|
||||
*/
|
||||
@RequiresPermissions("system:task:add")
|
||||
@Log(title = "任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(PlayletTask playletTask) {
|
||||
return toAjax(playletTaskService.insertPlayletTask(playletTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务
|
||||
*/
|
||||
@RequiresPermissions("system:task:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
|
||||
PlayletTask playletTask = playletTaskService.selectPlayletTaskById(id);
|
||||
mmap.put("playletTask", playletTask);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存任务
|
||||
*/
|
||||
@RequiresPermissions("system:task:edit")
|
||||
@Log(title = "任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(PlayletTask playletTask) {
|
||||
return toAjax(playletTaskService.updatePlayletTask(playletTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*/
|
||||
@RequiresPermissions("system:task:remove")
|
||||
@Log(title = "任务", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids) {
|
||||
return toAjax(playletTaskService.deletePlayletTaskByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
package com.playlet.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.playlet.common.annotation.Log;
|
||||
import com.playlet.common.enums.BusinessType;
|
||||
import com.playlet.system.domain.PlayletUserTask;
|
||||
import com.playlet.system.service.IPlayletUserTaskService;
|
||||
import com.playlet.common.core.controller.BaseController;
|
||||
import com.playlet.common.core.domain.AjaxResult;
|
||||
import com.playlet.common.utils.poi.ExcelUtil;
|
||||
import com.playlet.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-22 12:03
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 短剧用户任务Controller
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/task")
|
||||
public class PlayletUserTaskController extends BaseController {
|
||||
private String prefix = "system/task";
|
||||
|
||||
@Autowired
|
||||
private IPlayletUserTaskService playletUserTaskService;
|
||||
|
||||
@RequiresPermissions("system:task:view")
|
||||
@GetMapping()
|
||||
public String task() {
|
||||
return prefix + "/task";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询短剧用户任务列表
|
||||
*/
|
||||
@RequiresPermissions("system:task:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(PlayletUserTask playletUserTask) {
|
||||
startPage();
|
||||
List<PlayletUserTask> list = playletUserTaskService.selectPlayletUserTaskList(playletUserTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出短剧用户任务列表
|
||||
*/
|
||||
@RequiresPermissions("system:task:export")
|
||||
@Log(title = "短剧用户任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(PlayletUserTask playletUserTask) {
|
||||
List<PlayletUserTask> list = playletUserTaskService.selectPlayletUserTaskList(playletUserTask);
|
||||
ExcelUtil<PlayletUserTask> util = new ExcelUtil<PlayletUserTask>(PlayletUserTask.class);
|
||||
return util.exportExcel(list, "短剧用户任务数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增短剧用户任务
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add() {
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存短剧用户任务
|
||||
*/
|
||||
@RequiresPermissions("system:task:add")
|
||||
@Log(title = "短剧用户任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(PlayletUserTask playletUserTask) {
|
||||
return toAjax(playletUserTaskService.insertPlayletUserTask(playletUserTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改短剧用户任务
|
||||
*/
|
||||
@RequiresPermissions("system:task:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
|
||||
PlayletUserTask playletUserTask = playletUserTaskService.selectPlayletUserTaskById(id);
|
||||
mmap.put("playletUserTask", playletUserTask);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存短剧用户任务
|
||||
*/
|
||||
@RequiresPermissions("system:task:edit")
|
||||
@Log(title = "短剧用户任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(PlayletUserTask playletUserTask) {
|
||||
return toAjax(playletUserTaskService.updatePlayletUserTask(playletUserTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除短剧用户任务
|
||||
*/
|
||||
@RequiresPermissions("system:task:remove")
|
||||
@Log(title = "短剧用户任务", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids) {
|
||||
return toAjax(playletUserTaskService.deletePlayletUserTaskByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.playlet.web.service.app;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-22 00:02
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description:
|
||||
*/
|
||||
public interface PlayletTaskAppService {
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.playlet.web.service.app.impl;
|
||||
|
||||
import com.playlet.web.service.app.PlayletTaskAppService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-22 00:02
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description:
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class PlayletTaskAppServiceImpl implements PlayletTaskAppService {
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
package com.playlet.system.domain;
|
||||
|
||||
|
||||
import com.playlet.common.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.playlet.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-21 23:44
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 短剧任务对象
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "playlet_task")
|
||||
public class PlayletTask extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 任务主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "任务主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务id 保留字段
|
||||
*/
|
||||
@Excel(name = "任务id 保留字段")
|
||||
@ApiModelProperty(value = "任务id 保留字段")
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
@Excel(name = "任务名称")
|
||||
@ApiModelProperty(value = "任务名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 任务开始时间
|
||||
*/
|
||||
@Excel(name = "任务开始时间")
|
||||
@ApiModelProperty(value = "任务开始时间")
|
||||
private Long startTime;
|
||||
|
||||
/**
|
||||
* 任务结束时间
|
||||
*/
|
||||
@Excel(name = "任务结束时间")
|
||||
@ApiModelProperty(value = "任务结束时间")
|
||||
private Long endTime;
|
||||
|
||||
/**
|
||||
* 任务短剧平台
|
||||
*/
|
||||
@Excel(name = "任务短剧平台")
|
||||
@ApiModelProperty(value = "任务短剧平台")
|
||||
private Long platformType;
|
||||
|
||||
/**
|
||||
* 任务规则
|
||||
*/
|
||||
@Excel(name = "任务规则")
|
||||
@ApiModelProperty(value = "任务规则")
|
||||
private String rule;
|
||||
|
||||
/**
|
||||
* 任务投稿开始时间
|
||||
*/
|
||||
@Excel(name = "任务投稿开始时间")
|
||||
@ApiModelProperty(value = "任务投稿开始时间")
|
||||
private Long contributeStartTime;
|
||||
|
||||
/**
|
||||
* 任务投稿结束时间
|
||||
*/
|
||||
@Excel(name = "任务投稿结束时间")
|
||||
@ApiModelProperty(value = "任务投稿结束时间")
|
||||
private Long contributeEndTime;
|
||||
|
||||
/**
|
||||
* 任务要求
|
||||
*/
|
||||
@Excel(name = "任务要求")
|
||||
@ApiModelProperty(value = "任务要求")
|
||||
private String askFor;
|
||||
|
||||
/**
|
||||
* 任务总奖金,单位分 保留
|
||||
*/
|
||||
@Excel(name = "任务总奖金,单位分 保留")
|
||||
@ApiModelProperty(value = "任务总奖金,单位分 保留")
|
||||
private Long totalBonus;
|
||||
|
||||
/**
|
||||
* 任务奖励描述
|
||||
*/
|
||||
@Excel(name = "任务奖励描述")
|
||||
@ApiModelProperty(value = "任务奖励描述")
|
||||
private String awardDescribe;
|
||||
|
||||
/**
|
||||
* 任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成
|
||||
*/
|
||||
@Excel(name = "任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成")
|
||||
@ApiModelProperty(value = "任务状态 0 未开始 1 已开始 2 已结束 3 已失效 4 已完成")
|
||||
private Long state;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.playlet.system.domain;
|
||||
|
||||
import com.playlet.common.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.playlet.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-22 11:56
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 短剧用户任务对象 playlet_user_task
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "playlet_user_task")
|
||||
public class PlayletUserTask extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 短剧用户任务主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "短剧用户任务主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@ApiModelProperty(value = "任务id")
|
||||
@Excel(name = "任务id")
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
@ApiModelProperty(value = "用户Id")
|
||||
@Excel(name = "用户Id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户任务状态
|
||||
*/
|
||||
@ApiModelProperty(value = "用户任务状态")
|
||||
@Excel(name = "用户任务状态")
|
||||
private Long userTasklState;
|
||||
|
||||
/**
|
||||
* 任务开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "任务开始时间")
|
||||
@Excel(name = "任务开始时间")
|
||||
private Long taskStartTime;
|
||||
|
||||
/**
|
||||
* 任务结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "任务结束时间")
|
||||
@Excel(name = "任务结束时间")
|
||||
private Long taskEndTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.playlet.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.playlet.system.domain.PlayletTask;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-21 23:47
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 任务Mapper接口
|
||||
*/
|
||||
public interface PlayletTaskMapper extends BaseMapper<PlayletTask> {
|
||||
/**
|
||||
* 查询任务
|
||||
*
|
||||
* @param id 任务主键
|
||||
* @return 任务
|
||||
*/
|
||||
public PlayletTask selectPlayletTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 查询任务列表
|
||||
*
|
||||
* @param playletTask 任务
|
||||
* @return 任务集合
|
||||
*/
|
||||
public List<PlayletTask> selectPlayletTaskList(PlayletTask playletTask);
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
*
|
||||
* @param playletTask 任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPlayletTask(PlayletTask playletTask);
|
||||
|
||||
/**
|
||||
* 修改任务
|
||||
*
|
||||
* @param playletTask 任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePlayletTask(PlayletTask playletTask);
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*
|
||||
* @param id 任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePlayletTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除任务
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePlayletTaskByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.playlet.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.playlet.system.domain.PlayletUserTask;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-22 12:00
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 短剧用户任务Mapper接口
|
||||
*/
|
||||
public interface PlayletUserTaskMapper extends BaseMapper<PlayletUserTask> {
|
||||
/**
|
||||
* 查询短剧用户任务
|
||||
*
|
||||
* @param id 短剧用户任务主键
|
||||
* @return 短剧用户任务
|
||||
*/
|
||||
public PlayletUserTask selectPlayletUserTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 查询短剧用户任务列表
|
||||
*
|
||||
* @param playletUserTask 短剧用户任务
|
||||
* @return 短剧用户任务集合
|
||||
*/
|
||||
public List<PlayletUserTask> selectPlayletUserTaskList(PlayletUserTask playletUserTask);
|
||||
|
||||
/**
|
||||
* 新增短剧用户任务
|
||||
*
|
||||
* @param playletUserTask 短剧用户任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPlayletUserTask(PlayletUserTask playletUserTask);
|
||||
|
||||
/**
|
||||
* 修改短剧用户任务
|
||||
*
|
||||
* @param playletUserTask 短剧用户任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePlayletUserTask(PlayletUserTask playletUserTask);
|
||||
|
||||
/**
|
||||
* 删除短剧用户任务
|
||||
*
|
||||
* @param id 短剧用户任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePlayletUserTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除短剧用户任务
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePlayletUserTaskByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.playlet.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.playlet.system.domain.PlayletTask;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-21 23:48
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 任务Service接口
|
||||
*/
|
||||
public interface IPlayletTaskService extends IService<PlayletTask> {
|
||||
/**
|
||||
* 查询任务
|
||||
*
|
||||
* @param id 任务主键
|
||||
* @return 任务
|
||||
*/
|
||||
public PlayletTask selectPlayletTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 查询任务列表
|
||||
*
|
||||
* @param playletTask 任务
|
||||
* @return 任务集合
|
||||
*/
|
||||
public List<PlayletTask> selectPlayletTaskList(PlayletTask playletTask);
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
*
|
||||
* @param playletTask 任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPlayletTask(PlayletTask playletTask);
|
||||
|
||||
/**
|
||||
* 修改任务
|
||||
*
|
||||
* @param playletTask 任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePlayletTask(PlayletTask playletTask);
|
||||
|
||||
/**
|
||||
* 批量删除任务
|
||||
*
|
||||
* @param ids 需要删除的任务主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePlayletTaskByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除任务信息
|
||||
*
|
||||
* @param id 任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePlayletTaskById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.playlet.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.playlet.system.domain.PlayletUserTask;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-22 12:01
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 短剧用户任务Service接口
|
||||
*/
|
||||
public interface IPlayletUserTaskService extends IService<PlayletUserTask> {
|
||||
/**
|
||||
* 查询短剧用户任务
|
||||
*
|
||||
* @param id 短剧用户任务主键
|
||||
* @return 短剧用户任务
|
||||
*/
|
||||
public PlayletUserTask selectPlayletUserTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 查询短剧用户任务列表
|
||||
*
|
||||
* @param playletUserTask 短剧用户任务
|
||||
* @return 短剧用户任务集合
|
||||
*/
|
||||
public List<PlayletUserTask> selectPlayletUserTaskList(PlayletUserTask playletUserTask);
|
||||
|
||||
/**
|
||||
* 新增短剧用户任务
|
||||
*
|
||||
* @param playletUserTask 短剧用户任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPlayletUserTask(PlayletUserTask playletUserTask);
|
||||
|
||||
/**
|
||||
* 修改短剧用户任务
|
||||
*
|
||||
* @param playletUserTask 短剧用户任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePlayletUserTask(PlayletUserTask playletUserTask);
|
||||
|
||||
/**
|
||||
* 批量删除短剧用户任务
|
||||
*
|
||||
* @param ids 需要删除的短剧用户任务主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePlayletUserTaskByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除短剧用户任务信息
|
||||
*
|
||||
* @param id 短剧用户任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePlayletUserTaskById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.playlet.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.playlet.common.utils.DateUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.playlet.system.mapper.PlayletTaskMapper;
|
||||
import com.playlet.system.domain.PlayletTask;
|
||||
import com.playlet.system.service.IPlayletTaskService;
|
||||
import com.playlet.common.core.text.Convert;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-21 23:50
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 任务Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class PlayletTaskServiceImpl extends ServiceImpl<PlayletTaskMapper, PlayletTask> implements IPlayletTaskService {
|
||||
|
||||
private final PlayletTaskMapper playletTaskMapper;
|
||||
|
||||
/**
|
||||
* 查询任务
|
||||
*
|
||||
* @param id 任务主键
|
||||
* @return 任务
|
||||
*/
|
||||
@Override
|
||||
public PlayletTask selectPlayletTaskById(Long id) {
|
||||
return playletTaskMapper.selectPlayletTaskById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务列表
|
||||
*
|
||||
* @param playletTask 任务
|
||||
* @return 任务
|
||||
*/
|
||||
@Override
|
||||
public List<PlayletTask> selectPlayletTaskList(PlayletTask playletTask) {
|
||||
return playletTaskMapper.selectPlayletTaskList(playletTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
*
|
||||
* @param playletTask 任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPlayletTask(PlayletTask playletTask) {
|
||||
playletTask.setCreateTime(DateUtils.getNowDate());
|
||||
return playletTaskMapper.insertPlayletTask(playletTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务
|
||||
*
|
||||
* @param playletTask 任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePlayletTask(PlayletTask playletTask) {
|
||||
playletTask.setUpdateTime(DateUtils.getNowDate());
|
||||
return playletTaskMapper.updatePlayletTask(playletTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除任务
|
||||
*
|
||||
* @param ids 需要删除的任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayletTaskByIds(String ids) {
|
||||
return playletTaskMapper.deletePlayletTaskByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务信息
|
||||
*
|
||||
* @param id 任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayletTaskById(Long id) {
|
||||
return playletTaskMapper.deletePlayletTaskById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.playlet.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.playlet.common.utils.DateUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.playlet.system.mapper.PlayletUserTaskMapper;
|
||||
import com.playlet.system.domain.PlayletUserTask;
|
||||
import com.playlet.system.service.IPlayletUserTaskService;
|
||||
import com.playlet.common.core.text.Convert;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Date: 2024-03-22 12:02
|
||||
* @Author: 但星霖
|
||||
* @Version: v1.0
|
||||
* @Description: 短剧用户任务Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class PlayletUserTaskServiceImpl extends ServiceImpl<PlayletUserTaskMapper, PlayletUserTask> implements IPlayletUserTaskService {
|
||||
|
||||
private final PlayletUserTaskMapper playletUserTaskMapper;
|
||||
|
||||
/**
|
||||
* 查询短剧用户任务
|
||||
*
|
||||
* @param id 短剧用户任务主键
|
||||
* @return 短剧用户任务
|
||||
*/
|
||||
@Override
|
||||
public PlayletUserTask selectPlayletUserTaskById(Long id) {
|
||||
return playletUserTaskMapper.selectPlayletUserTaskById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询短剧用户任务列表
|
||||
*
|
||||
* @param playletUserTask 短剧用户任务
|
||||
* @return 短剧用户任务
|
||||
*/
|
||||
@Override
|
||||
public List<PlayletUserTask> selectPlayletUserTaskList(PlayletUserTask playletUserTask) {
|
||||
return playletUserTaskMapper.selectPlayletUserTaskList(playletUserTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增短剧用户任务
|
||||
*
|
||||
* @param playletUserTask 短剧用户任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPlayletUserTask(PlayletUserTask playletUserTask) {
|
||||
playletUserTask.setCreateTime(DateUtils.getNowDate());
|
||||
return playletUserTaskMapper.insertPlayletUserTask(playletUserTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改短剧用户任务
|
||||
*
|
||||
* @param playletUserTask 短剧用户任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePlayletUserTask(PlayletUserTask playletUserTask) {
|
||||
playletUserTask.setUpdateTime(DateUtils.getNowDate());
|
||||
return playletUserTaskMapper.updatePlayletUserTask(playletUserTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除短剧用户任务
|
||||
*
|
||||
* @param ids 需要删除的短剧用户任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayletUserTaskByIds(String ids) {
|
||||
return playletUserTaskMapper.deletePlayletUserTaskByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除短剧用户任务信息
|
||||
*
|
||||
* @param id 短剧用户任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayletUserTaskById(Long id) {
|
||||
return playletUserTaskMapper.deletePlayletUserTaskById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
<?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.playlet.system.mapper.PlayletTaskMapper">
|
||||
|
||||
<resultMap type="PlayletTask" id="PlayletTaskResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="taskId" column="task_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="platformType" column="platform_type"/>
|
||||
<result property="rule" column="rule"/>
|
||||
<result property="contributeStartTime" column="contribute_start_time"/>
|
||||
<result property="contributeEndTime" column="contribute_end_time"/>
|
||||
<result property="askFor" column="ask_for"/>
|
||||
<result property="totalBonus" column="total_bonus"/>
|
||||
<result property="awardDescribe" column="award_describe"/>
|
||||
<result property="state" column="state"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPlayletTaskVo">
|
||||
select id,
|
||||
task_id,
|
||||
name,
|
||||
start_time,
|
||||
end_time,
|
||||
platform_type,
|
||||
rule,
|
||||
contribute_start_time,
|
||||
contribute_end_time,
|
||||
ask_for,
|
||||
total_bonus,
|
||||
award_describe,
|
||||
state,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by,
|
||||
remark
|
||||
from playlet_task
|
||||
</sql>
|
||||
|
||||
<select id="selectPlayletTaskList" parameterType="PlayletTask" resultMap="PlayletTaskResult">
|
||||
<include refid="selectPlayletTaskVo"/>
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''">and task_id = #{taskId}</if>
|
||||
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
||||
<if test="startTime != null ">and start_time = #{startTime}</if>
|
||||
<if test="endTime != null ">and end_time = #{endTime}</if>
|
||||
<if test="platformType != null ">and platform_type = #{platformType}</if>
|
||||
<if test="rule != null and rule != ''">and rule = #{rule}</if>
|
||||
<if test="contributeStartTime != null ">and contribute_start_time = #{contributeStartTime}</if>
|
||||
<if test="contributeEndTime != null ">and contribute_end_time = #{contributeEndTime}</if>
|
||||
<if test="askFor != null and askFor != ''">and ask_for = #{askFor}</if>
|
||||
<if test="totalBonus != null ">and total_bonus = #{totalBonus}</if>
|
||||
<if test="awardDescribe != null and awardDescribe != ''">and award_describe = #{awardDescribe}</if>
|
||||
<if test="state != null ">and state = #{state}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPlayletTaskById" parameterType="Long" resultMap="PlayletTaskResult">
|
||||
<include refid="selectPlayletTaskVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPlayletTask" parameterType="PlayletTask" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into playlet_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null and taskId != ''">task_id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="platformType != null">platform_type,</if>
|
||||
<if test="rule != null and rule != ''">rule,</if>
|
||||
<if test="contributeStartTime != null">contribute_start_time,</if>
|
||||
<if test="contributeEndTime != null">contribute_end_time,</if>
|
||||
<if test="askFor != null and askFor != ''">ask_for,</if>
|
||||
<if test="totalBonus != null">total_bonus,</if>
|
||||
<if test="awardDescribe != null and awardDescribe != ''">award_describe,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null and taskId != ''">#{taskId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="platformType != null">#{platformType},</if>
|
||||
<if test="rule != null and rule != ''">#{rule},</if>
|
||||
<if test="contributeStartTime != null">#{contributeStartTime},</if>
|
||||
<if test="contributeEndTime != null">#{contributeEndTime},</if>
|
||||
<if test="askFor != null and askFor != ''">#{askFor},</if>
|
||||
<if test="totalBonus != null">#{totalBonus},</if>
|
||||
<if test="awardDescribe != null and awardDescribe != ''">#{awardDescribe},</if>
|
||||
<if test="state != null">#{state},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePlayletTask" parameterType="PlayletTask">
|
||||
update playlet_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null and taskId != ''">task_id = #{taskId},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="platformType != null">platform_type = #{platformType},</if>
|
||||
<if test="rule != null and rule != ''">rule = #{rule},</if>
|
||||
<if test="contributeStartTime != null">contribute_start_time = #{contributeStartTime},</if>
|
||||
<if test="contributeEndTime != null">contribute_end_time = #{contributeEndTime},</if>
|
||||
<if test="askFor != null and askFor != ''">ask_for = #{askFor},</if>
|
||||
<if test="totalBonus != null">total_bonus = #{totalBonus},</if>
|
||||
<if test="awardDescribe != null and awardDescribe != ''">award_describe = #{awardDescribe},</if>
|
||||
<if test="state != null">state = #{state},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePlayletTaskById" parameterType="Long">
|
||||
delete
|
||||
from playlet_task
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePlayletTaskByIds" parameterType="String">
|
||||
delete from playlet_task where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
<?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.playlet.system.mapper.PlayletUserTaskMapper">
|
||||
|
||||
<resultMap type="PlayletUserTask" id="PlayletUserTaskResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="taskId" column="task_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="userTaskState" column="user_task_state"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="taskStartTime" column="task_start_time"/>
|
||||
<result property="taskEndTime" column="task_end_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPlayletUserTaskVo">
|
||||
select id,
|
||||
task_id,
|
||||
user_id,
|
||||
user_task_state,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by,
|
||||
remark,
|
||||
task_start_time,
|
||||
task_end_time
|
||||
from playlet_user_task
|
||||
</sql>
|
||||
|
||||
<select id="selectPlayletUserTaskList" parameterType="PlayletUserTask" resultMap="PlayletUserTaskResult">
|
||||
<include refid="selectPlayletUserTaskVo"/>
|
||||
<where>
|
||||
<if test="taskId != null ">and task_id = #{taskId}</if>
|
||||
<if test="userId != null ">and user_id = #{userId}</if>
|
||||
<if test="userTaskState != null ">and user_task_state = #{userTaskState}</if>
|
||||
<if test="taskStartTime != null ">and task_start_time = #{taskStartTime}</if>
|
||||
<if test="taskEndTime != null ">and task_end_time = #{taskEndTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPlayletUserTaskById" parameterType="Long" resultMap="PlayletUserTaskResult">
|
||||
<include refid="selectPlayletUserTaskVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPlayletUserTask" parameterType="PlayletUserTask" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into playlet_user_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userTaskState != null">user_task_state,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="taskStartTime != null">task_start_time,</if>
|
||||
<if test="taskEndTime != null">task_end_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userTaskState != null">#{userTaskState},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="taskStartTime != null">#{taskStartTime},</if>
|
||||
<if test="taskEndTime != null">#{taskEndTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePlayletUserTask" parameterType="PlayletUserTask">
|
||||
update playlet_user_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userTaskState != null">user_task_state = #{userTaskState},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="taskStartTime != null">task_start_time = #{taskStartTime},</if>
|
||||
<if test="taskEndTime != null">task_end_time = #{taskEndTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePlayletUserTaskById" parameterType="Long">
|
||||
delete
|
||||
from playlet_user_task
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePlayletUserTaskByIds" parameterType="String">
|
||||
delete from playlet_user_task where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue