任务类型及状态
This commit is contained in:
parent
94890fe73b
commit
41a63e5fdf
@ -179,5 +179,13 @@ public class Constants {
|
|||||||
*/
|
*/
|
||||||
public static final String SERVICE_MODE_ENCODING = "SME";
|
public static final String SERVICE_MODE_ENCODING = "SME";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务方式编码
|
||||||
|
*/
|
||||||
|
public static final String TASK_TYPE_CODE = "TTC";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务方式编码
|
||||||
|
*/
|
||||||
|
public static final String TASK_PARTITION_CODE = "TPC";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class TaskPartitionDictController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:partition:add')")
|
@PreAuthorize("@ss.hasPermi('system:partition:add')")
|
||||||
@Log(title = "任务细分字典", businessType = BusinessType.INSERT)
|
@Log(title = "任务细分字典", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping("/add")
|
||||||
public AjaxResult add(@RequestBody TaskPartitionDict taskPartitionDict) {
|
public AjaxResult add(@RequestBody TaskPartitionDict taskPartitionDict) {
|
||||||
return toAjax(taskPartitionDictService.insertTaskPartitionDict(taskPartitionDict));
|
return toAjax(taskPartitionDictService.insertTaskPartitionDict(taskPartitionDict));
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ public class TaskPartitionDictController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:partition:edit')")
|
@PreAuthorize("@ss.hasPermi('system:partition:edit')")
|
||||||
@Log(title = "任务细分字典", businessType = BusinessType.UPDATE)
|
@Log(title = "任务细分字典", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping("/edit")
|
||||||
public AjaxResult edit(@RequestBody TaskPartitionDict taskPartitionDict) {
|
public AjaxResult edit(@RequestBody TaskPartitionDict taskPartitionDict) {
|
||||||
return toAjax(taskPartitionDictService.updateTaskPartitionDict(taskPartitionDict));
|
return toAjax(taskPartitionDictService.updateTaskPartitionDict(taskPartitionDict));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,96 @@
|
|||||||
|
package com.xinelu.manage.controller.tasktypedict;
|
||||||
|
|
||||||
|
import com.xinelu.common.annotation.Log;
|
||||||
|
import com.xinelu.common.core.controller.BaseController;
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.common.core.page.TableDataInfo;
|
||||||
|
import com.xinelu.common.enums.BusinessType;
|
||||||
|
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||||
|
import com.xinelu.manage.domain.tasktypedict.TaskTypeDict;
|
||||||
|
import com.xinelu.manage.service.tasktypedict.ITaskTypeDictService;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型字典Controller
|
||||||
|
*
|
||||||
|
* @author xinelu
|
||||||
|
* @date 2024-03-11
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/taskType")
|
||||||
|
public class TaskTypeDictController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private ITaskTypeDictService taskTypeDictService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务类型字典列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:taskType:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TaskTypeDict taskTypeDict) {
|
||||||
|
startPage();
|
||||||
|
List<TaskTypeDict> list = taskTypeDictService.selectTaskTypeDictList(taskTypeDict);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/selectTaskTypeList")
|
||||||
|
public AjaxResult selectTaskTypeList(TaskTypeDict taskTypeDict) {
|
||||||
|
return AjaxResult.success(taskTypeDictService.selectTaskTypeDictList(taskTypeDict));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出任务类型字典列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:taskType:export')")
|
||||||
|
@Log(title = "任务类型字典", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, TaskTypeDict taskTypeDict) {
|
||||||
|
List<TaskTypeDict> list = taskTypeDictService.selectTaskTypeDictList(taskTypeDict);
|
||||||
|
ExcelUtil<TaskTypeDict> util = new ExcelUtil<TaskTypeDict>(TaskTypeDict.class);
|
||||||
|
util.exportExcel(response, list, "任务类型字典数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务类型字典详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:taskType:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
return AjaxResult.success(taskTypeDictService.selectTaskTypeDictById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增任务类型字典
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:taskType:add')")
|
||||||
|
@Log(title = "任务类型字典", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
public AjaxResult add(@RequestBody TaskTypeDict taskTypeDict) {
|
||||||
|
return toAjax(taskTypeDictService.insertTaskTypeDict(taskTypeDict));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改任务类型字典
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:taskType:edit')")
|
||||||
|
@Log(title = "任务类型字典", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public AjaxResult edit(@RequestBody TaskTypeDict taskTypeDict) {
|
||||||
|
return toAjax(taskTypeDictService.updateTaskTypeDict(taskTypeDict));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除任务类型字典
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:taskType:remove')")
|
||||||
|
@Log(title = "任务类型字典", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
|
return toAjax(taskTypeDictService.deleteTaskTypeDictByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -149,6 +149,16 @@ public class Agency extends BaseEntity {
|
|||||||
@Excel(name = "机构排序")
|
@Excel(name = "机构排序")
|
||||||
private Integer agencySort;
|
private Integer agencySort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机构经度(横坐标)
|
||||||
|
*/
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机构纬度(纵坐标)
|
||||||
|
*/
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|||||||
@ -12,6 +12,8 @@ import lombok.NoArgsConstructor;
|
|||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.sql.Time;
|
||||||
|
import java.time.LocalTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,9 +74,9 @@ public class TaskPartitionDict extends BaseEntity {
|
|||||||
* 执行时间,格式:HH:mm
|
* 执行时间,格式:HH:mm
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "执行时间,格式:HH:mm")
|
@ApiModelProperty(value = "执行时间,格式:HH:mm")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "HH:mm")
|
||||||
@Excel(name = "执行时间,格式:HH:mm", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "执行时间,格式:HH:mm", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date executionTime;
|
private LocalTime executionTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务细分排序
|
* 任务细分排序
|
||||||
|
|||||||
@ -0,0 +1,76 @@
|
|||||||
|
package com.xinelu.manage.domain.tasktypedict;
|
||||||
|
|
||||||
|
import com.xinelu.common.annotation.Excel;
|
||||||
|
import com.xinelu.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型字典对象 task_type_dict
|
||||||
|
*
|
||||||
|
* @author xinelu
|
||||||
|
* @date 2024-03-11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel(value = "任务类型字典对象", description = "task_type_dict")
|
||||||
|
public class TaskTypeDict extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "任务类型名称")
|
||||||
|
@Excel(name = "任务类型名称")
|
||||||
|
private String taskTypeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "任务类型编码")
|
||||||
|
@Excel(name = "任务类型编码")
|
||||||
|
private String taskTypeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型排序
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "任务类型排序")
|
||||||
|
@Excel(name = "任务类型排序")
|
||||||
|
private Integer taskTypeSort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型备注
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "任务类型备注")
|
||||||
|
@Excel(name = "任务类型备注")
|
||||||
|
private String taskTypeRemark;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("taskTypeName", getTaskTypeName())
|
||||||
|
.append("taskTypeCode", getTaskTypeCode())
|
||||||
|
.append("taskTypeSort", getTaskTypeSort())
|
||||||
|
.append("taskTypeRemark", getTaskTypeRemark())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.xinelu.manage.mapper.tasktypedict;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.tasktypedict.TaskTypeDict;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型字典Mapper接口
|
||||||
|
*
|
||||||
|
* @author xinelu
|
||||||
|
* @date 2024-03-11
|
||||||
|
*/
|
||||||
|
public interface TaskTypeDictMapper {
|
||||||
|
/**
|
||||||
|
* 查询任务类型字典
|
||||||
|
*
|
||||||
|
* @param id 任务类型字典主键
|
||||||
|
* @return 任务类型字典
|
||||||
|
*/
|
||||||
|
public TaskTypeDict selectTaskTypeDictById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务类型字典列表
|
||||||
|
*
|
||||||
|
* @param taskTypeDict 任务类型字典
|
||||||
|
* @return 任务类型字典集合
|
||||||
|
*/
|
||||||
|
public List<TaskTypeDict> selectTaskTypeDictList(TaskTypeDict taskTypeDict);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增任务类型字典
|
||||||
|
*
|
||||||
|
* @param taskTypeDict 任务类型字典
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTaskTypeDict(TaskTypeDict taskTypeDict);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改任务类型字典
|
||||||
|
*
|
||||||
|
* @param taskTypeDict 任务类型字典
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTaskTypeDict(TaskTypeDict taskTypeDict);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除任务类型字典
|
||||||
|
*
|
||||||
|
* @param id 任务类型字典主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTaskTypeDictById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除任务类型字典
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTaskTypeDictByIds(Long[] ids);
|
||||||
|
}
|
||||||
@ -1,6 +1,9 @@
|
|||||||
package com.xinelu.manage.service.taskpartitiondict.impl;
|
package com.xinelu.manage.service.taskpartitiondict.impl;
|
||||||
|
|
||||||
|
import com.xinelu.common.constant.Constants;
|
||||||
import com.xinelu.common.utils.DateUtils;
|
import com.xinelu.common.utils.DateUtils;
|
||||||
|
import com.xinelu.common.utils.SecurityUtils;
|
||||||
|
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||||
import com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict;
|
import com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict;
|
||||||
import com.xinelu.manage.mapper.taskpartitiondict.TaskPartitionDictMapper;
|
import com.xinelu.manage.mapper.taskpartitiondict.TaskPartitionDictMapper;
|
||||||
import com.xinelu.manage.service.taskpartitiondict.ITaskPartitionDictService;
|
import com.xinelu.manage.service.taskpartitiondict.ITaskPartitionDictService;
|
||||||
@ -20,6 +23,8 @@ import java.util.List;
|
|||||||
public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService {
|
public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService {
|
||||||
@Resource
|
@Resource
|
||||||
private TaskPartitionDictMapper taskPartitionDictMapper;
|
private TaskPartitionDictMapper taskPartitionDictMapper;
|
||||||
|
@Resource
|
||||||
|
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询任务细分字典
|
* 查询任务细分字典
|
||||||
@ -51,7 +56,9 @@ public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertTaskPartitionDict(TaskPartitionDict taskPartitionDict) {
|
public int insertTaskPartitionDict(TaskPartitionDict taskPartitionDict) {
|
||||||
|
taskPartitionDict.setTaskPartitionCode(Constants.TASK_PARTITION_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_PARTITION_CODE));
|
||||||
taskPartitionDict.setCreateTime(DateUtils.getNowDate());
|
taskPartitionDict.setCreateTime(DateUtils.getNowDate());
|
||||||
|
taskPartitionDict.setCreateBy(SecurityUtils.getUsername());
|
||||||
return taskPartitionDictMapper.insertTaskPartitionDict(taskPartitionDict);
|
return taskPartitionDictMapper.insertTaskPartitionDict(taskPartitionDict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,6 +71,7 @@ public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService {
|
|||||||
@Override
|
@Override
|
||||||
public int updateTaskPartitionDict(TaskPartitionDict taskPartitionDict) {
|
public int updateTaskPartitionDict(TaskPartitionDict taskPartitionDict) {
|
||||||
taskPartitionDict.setUpdateTime(DateUtils.getNowDate());
|
taskPartitionDict.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
taskPartitionDict.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return taskPartitionDictMapper.updateTaskPartitionDict(taskPartitionDict);
|
return taskPartitionDictMapper.updateTaskPartitionDict(taskPartitionDict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,61 @@
|
|||||||
|
package com.xinelu.manage.service.tasktypedict;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.tasktypedict.TaskTypeDict;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型字典Service接口
|
||||||
|
*
|
||||||
|
* @author xinelu
|
||||||
|
* @date 2024-03-11
|
||||||
|
*/
|
||||||
|
public interface ITaskTypeDictService {
|
||||||
|
/**
|
||||||
|
* 查询任务类型字典
|
||||||
|
*
|
||||||
|
* @param id 任务类型字典主键
|
||||||
|
* @return 任务类型字典
|
||||||
|
*/
|
||||||
|
TaskTypeDict selectTaskTypeDictById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务类型字典列表
|
||||||
|
*
|
||||||
|
* @param taskTypeDict 任务类型字典
|
||||||
|
* @return 任务类型字典集合
|
||||||
|
*/
|
||||||
|
List<TaskTypeDict> selectTaskTypeDictList(TaskTypeDict taskTypeDict);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增任务类型字典
|
||||||
|
*
|
||||||
|
* @param taskTypeDict 任务类型字典
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertTaskTypeDict(TaskTypeDict taskTypeDict);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改任务类型字典
|
||||||
|
*
|
||||||
|
* @param taskTypeDict 任务类型字典
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateTaskTypeDict(TaskTypeDict taskTypeDict);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除任务类型字典
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的任务类型字典主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTaskTypeDictByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除任务类型字典信息
|
||||||
|
*
|
||||||
|
* @param id 任务类型字典主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTaskTypeDictById(Long id);
|
||||||
|
}
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
package com.xinelu.manage.service.tasktypedict.impl;
|
||||||
|
|
||||||
|
import com.xinelu.common.constant.Constants;
|
||||||
|
import com.xinelu.common.utils.DateUtils;
|
||||||
|
import com.xinelu.common.utils.SecurityUtils;
|
||||||
|
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||||
|
import com.xinelu.manage.domain.tasktypedict.TaskTypeDict;
|
||||||
|
import com.xinelu.manage.mapper.tasktypedict.TaskTypeDictMapper;
|
||||||
|
import com.xinelu.manage.service.tasktypedict.ITaskTypeDictService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型字典Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xinelu
|
||||||
|
* @date 2024-03-11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TaskTypeDictServiceImpl implements ITaskTypeDictService {
|
||||||
|
@Resource
|
||||||
|
private TaskTypeDictMapper taskTypeDictMapper;
|
||||||
|
@Resource
|
||||||
|
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务类型字典
|
||||||
|
*
|
||||||
|
* @param id 任务类型字典主键
|
||||||
|
* @return 任务类型字典
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TaskTypeDict selectTaskTypeDictById(Long id) {
|
||||||
|
return taskTypeDictMapper.selectTaskTypeDictById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务类型字典列表
|
||||||
|
*
|
||||||
|
* @param taskTypeDict 任务类型字典
|
||||||
|
* @return 任务类型字典
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TaskTypeDict> selectTaskTypeDictList(TaskTypeDict taskTypeDict) {
|
||||||
|
return taskTypeDictMapper.selectTaskTypeDictList(taskTypeDict);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增任务类型字典
|
||||||
|
*
|
||||||
|
* @param taskTypeDict 任务类型字典
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTaskTypeDict(TaskTypeDict taskTypeDict) {
|
||||||
|
taskTypeDict.setTaskTypeCode(Constants.TASK_TYPE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_TYPE_CODE));
|
||||||
|
taskTypeDict.setCreateTime(DateUtils.getNowDate());
|
||||||
|
taskTypeDict.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
return taskTypeDictMapper.insertTaskTypeDict(taskTypeDict);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改任务类型字典
|
||||||
|
*
|
||||||
|
* @param taskTypeDict 任务类型字典
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTaskTypeDict(TaskTypeDict taskTypeDict) {
|
||||||
|
taskTypeDict.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
taskTypeDict.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return taskTypeDictMapper.updateTaskTypeDict(taskTypeDict);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除任务类型字典
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的任务类型字典主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTaskTypeDictByIds(Long[] ids) {
|
||||||
|
return taskTypeDictMapper.deleteTaskTypeDictByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除任务类型字典信息
|
||||||
|
*
|
||||||
|
* @param id 任务类型字典主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTaskTypeDictById(Long id) {
|
||||||
|
return taskTypeDictMapper.deleteTaskTypeDictById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,140 @@
|
|||||||
|
<?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.xinelu.manage.mapper.tasktypedict.TaskTypeDictMapper">
|
||||||
|
|
||||||
|
<resultMap type="TaskTypeDict" id="TaskTypeDictResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="taskTypeName" column="task_type_name"/>
|
||||||
|
<result property="taskTypeCode" column="task_type_code"/>
|
||||||
|
<result property="taskTypeSort" column="task_type_sort"/>
|
||||||
|
<result property="taskTypeRemark" column="task_type_remark"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectTaskTypeDictVo">
|
||||||
|
select id,
|
||||||
|
task_type_name,
|
||||||
|
task_type_code,
|
||||||
|
task_type_sort,
|
||||||
|
task_type_remark,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time
|
||||||
|
from task_type_dict
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectTaskTypeDictList" parameterType="TaskTypeDict" resultMap="TaskTypeDictResult">
|
||||||
|
<include refid="selectTaskTypeDictVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="taskTypeName != null and taskTypeName != ''">
|
||||||
|
and task_type_name like concat('%', #{taskTypeName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeCode != null and taskTypeCode != ''">
|
||||||
|
and task_type_code = #{taskTypeCode}
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeSort != null ">
|
||||||
|
and task_type_sort = #{taskTypeSort}
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeRemark != null and taskTypeRemark != ''">
|
||||||
|
and task_type_remark = #{taskTypeRemark}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTaskTypeDictById" parameterType="Long"
|
||||||
|
resultMap="TaskTypeDictResult">
|
||||||
|
<include refid="selectTaskTypeDictVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTaskTypeDict" parameterType="TaskTypeDict" useGeneratedKeys="true"
|
||||||
|
keyProperty="id">
|
||||||
|
insert into task_type_dict
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="taskTypeName != null">task_type_name,
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeCode != null">task_type_code,
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeSort != null">task_type_sort,
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeRemark != null">task_type_remark,
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">create_by,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">update_by,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="taskTypeName != null">#{taskTypeName},
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeCode != null">#{taskTypeCode},
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeSort != null">#{taskTypeSort},
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeRemark != null">#{taskTypeRemark},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTaskTypeDict" parameterType="TaskTypeDict">
|
||||||
|
update task_type_dict
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="taskTypeName != null">task_type_name =
|
||||||
|
#{taskTypeName},
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeCode != null">task_type_code =
|
||||||
|
#{taskTypeCode},
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeSort != null">task_type_sort =
|
||||||
|
#{taskTypeSort},
|
||||||
|
</if>
|
||||||
|
<if test="taskTypeRemark != null">task_type_remark =
|
||||||
|
#{taskTypeRemark},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">create_by =
|
||||||
|
#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">create_time =
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">update_by =
|
||||||
|
#{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">update_time =
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteTaskTypeDictById" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from task_type_dict
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTaskTypeDictByIds" parameterType="String">
|
||||||
|
delete from task_type_dict where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user