任务模块编写

main
dongdingding 3 months ago
parent 644e4719fa
commit 7146fa69d6

@ -0,0 +1,94 @@
package com.ruoyi.tc.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.tc.domain.AssetLc;
import com.ruoyi.tc.domain.request.AssetLcRequest;
import com.ruoyi.tc.service.AssetLcService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
* (AssetLc)
*
* @author makejava
* @since 2024-11-18 14:46:40
*/
@Api("任务流程")
@RestController
@RequestMapping("/unit/assetLc")
public class AssetLcController extends BaseController {
/**
*
*/
@Resource
private AssetLcService assetLcService;
/**
*
*
* @param assetLc
* @param req
* @return
*/
@GetMapping("/page")
@ApiOperation(value = "分页查询", response = AssetLc.class)
public AjaxResult queryByPage(Page<AssetLc> assetLc, AssetLcRequest req) {
return AjaxResult.success(this.assetLcService.queryByPage(assetLc, req));
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "通过主键查询单条数据", response = AssetLc.class)
@GetMapping("{id}")
public AjaxResult queryById(@PathVariable("id") Integer id) {
return AjaxResult.success(this.assetLcService.queryById(id));
}
/**
*
*
* @param assetLc
* @return
*/
@ApiOperation(value = "新增数据")
@PostMapping("/add")
public AjaxResult add(@RequestBody @Valid AssetLc assetLc) {
return AjaxResult.success(this.assetLcService.insert(assetLc));
}
/**
*
*
* @param assetLc
* @return
*/
@ApiOperation(value = "新增数据")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody @Valid AssetLc assetLc) {
return AjaxResult.success(this.assetLcService.update(assetLc));
}
/**
*
*
* @param id
* @return
*/
@PostMapping("/deleteById/{id}")
public AjaxResult deleteById(@PathVariable("id") Integer id) {
return AjaxResult.success(this.assetLcService.deleteById(id));
}
}

@ -0,0 +1,85 @@
package com.ruoyi.tc.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.tc.domain.AssetTask;
import com.ruoyi.tc.service.AssetTaskService;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* (AssetTask)
*
* @author makejava
* @since 2024-11-18 13:22:58
*/
@RestController
@RequestMapping("/unit/assetTask")
public class AssetTaskController extends BaseController {
/**
*
*/
@Resource
private AssetTaskService assetTaskService;
/**
*
*
* @param assetTask
* @param pageRequest
* @return
*/
@GetMapping
public AjaxResult queryByPage(Page<AssetTask> assetTask, PageRequest pageRequest) {
return AjaxResult.success(this.assetTaskService.queryByPage(assetTask, pageRequest));
}
/**
*
*
* @param id
* @return
*/
@GetMapping("{id}")
public AjaxResult queryById(@PathVariable("id") Integer id) {
return AjaxResult.success(this.assetTaskService.queryById(id));
}
/**
*
*
* @param assetTask
* @return
*/
@PostMapping
public AjaxResult add(AssetTask assetTask) {
return AjaxResult.success(this.assetTaskService.insert(assetTask));
}
/**
*
*
* @param assetTask
* @return
*/
@PutMapping
public AjaxResult edit(AssetTask assetTask) {
return AjaxResult.success(this.assetTaskService.update(assetTask));
}
/**
*
*
* @param id
* @return
*/
@DeleteMapping
public AjaxResult deleteById(Integer id) {
return AjaxResult.success(this.assetTaskService.deleteById(id));
}
}

@ -0,0 +1,124 @@
package com.ruoyi.tc.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* (AssetLc)
*
* @author makejava
* @since 2024-11-18 14:46:40
*/
@Data
@ApiModel("任务流程实体类")
public class AssetLc implements Serializable {
private static final long serialVersionUID = 660117917021496292L;
/**
* id
*/
@ApiModelProperty("主键id")
private Integer id;
/**
* id
*/
@ApiModelProperty("任务id")
private Integer taskId;
/**
*
*/
@ApiModelProperty("管理员下发时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime xfTime;
/**
*
*/
@ApiModelProperty("单位核查完成提交时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime dwhcTime;
/**
*
*/
@ApiModelProperty("管理员审核驳回时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime shbhTime;
/**
*
*/
@ApiModelProperty("单位重新核查提交时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime dwcxhcTime;
/**
*
*/
@ApiModelProperty("管理员审核通过时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime shtgTime;
/**
* id
*/
@ApiModelProperty("用户id")
private Integer ueserId;
/**
* id
*/
@ApiModelProperty("部门id")
private Integer deptId;
/**
* id
*/
@ApiModelProperty("创建者id")
private Integer createId;
/**
*
*/
@ApiModelProperty("创建人")
private String createBy;
/**
*
*/
@ApiModelProperty("创建时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* id
*/
@ApiModelProperty("更新着id")
private Integer updateId;
/**
*
*/
@ApiModelProperty("更新者")
private String updateBy;
/**
*
*/
@ApiModelProperty("更新时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
/**
*
*/
@ApiModelProperty("版本")
private String version;
/**
*
*/
@ApiModelProperty("备注")
private String remark;
}

@ -0,0 +1,125 @@
package com.ruoyi.tc.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* (AssetTask)
*
* @author makejava
* @since 2024-11-18 13:23:05
*/
@Data
@ApiModel("任务主表实体类")
public class AssetTask implements Serializable {
private static final long serialVersionUID = -32109581884572792L;
/**
* id
*/
@ApiModelProperty("主键id")
private Integer id;
/**
*
*/
@ApiModelProperty("任务编号")
private String taskId;
/**
*
*/
@ApiModelProperty("任务名称")
private String taskName;
/**
*
*/
@ApiModelProperty("任务下发时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime taskTime;
/**
*
*/
@ApiModelProperty("任务截至时间")
private String taskDeadline;
/**
*
*/
@ApiModelProperty("任务完成时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime taskFinishTime;
/**
* 12345
*/
@ApiModelProperty("任务状态1进行中2正常完成3超期完成4正常完成5审核驳回")
private String taskStatus;
/**
* id
*/
@ApiModelProperty("单位id")
private Integer dwId;
/**
* id
*/
/**
* id
*/
@ApiModelProperty("用户id")
private Integer userId;
/**
* id
*/
@ApiModelProperty("部门id")
private Integer deptId;
/**
* id
*/
@ApiModelProperty("创建者id")
private Integer createId;
/**
*
*/
@ApiModelProperty("创建人")
private String createBy;
/**
*
*/
@ApiModelProperty("创建时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* id
*/
@ApiModelProperty("更新着id")
private Integer updateId;
/**
*
*/
@ApiModelProperty("更新者")
private String updateBy;
/**
*
*/
@ApiModelProperty("更新时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
/**
*
*/
@ApiModelProperty("版本")
private String version;
/**
*
*/
@ApiModelProperty("备注")
private String reamark;
}

@ -0,0 +1,56 @@
package com.ruoyi.tc.domain.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* @author dong
* @since 2024/11/18 15:12
*/
@Data
@Api("任务主表查询请求类")
public class AssetLcRequest {
/**
*
*/
@ApiModelProperty("任务名称")
private String taskName;
/**
*
*/
@ApiModelProperty("任务编号")
private String taskId;
/**
* 12345
*/
@ApiModelProperty("任务状态1进行中2正常完成3超期完成4正常完成5审核驳回")
private String taskStatus;
/**
*
*/
@ApiModelProperty("任务开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime begainTime;
/**
*
*/
@ApiModelProperty("任务结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
}

@ -0,0 +1,97 @@
package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.tc.domain.AssetLc;
import com.ruoyi.tc.domain.request.AssetLcRequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* (AssetLc)访
*
* @author makejava
* @since 2024-11-18 14:46:40
*/
public interface AssetLcMapper {
/**
*
*
* @param page
* @param pageRequest
* @return
*/
Page<AssetLc> queryByPage(Page<AssetLc> page, @Param("req") AssetLcRequest pageRequest);
/**
* ID
*
* @param id
* @return
*/
AssetLc queryById(Integer id);
/**
*
*
* @param assetLc
* @param pageable
* @return
*/
List<AssetLc> queryAllByLimit(AssetLc assetLc, @Param("pageable") Pageable pageable);
/**
*
*
* @param assetLc
* @return
*/
long count(AssetLc assetLc);
/**
*
*
* @param assetLc
* @return
*/
int insert(AssetLc assetLc);
/**
* MyBatisforeach
*
* @param entities List<AssetLc>
* @return
*/
int insertBatch(@Param("entities") List<AssetLc> entities);
/**
* MyBatisforeach
*
* @param entities List<AssetLc>
* @return
* @throws org.springframework.jdbc.BadSqlGrammarException ListSQL
*/
int insertOrUpdateBatch(@Param("entities") List<AssetLc> entities);
/**
*
*
* @param assetLc
* @return
*/
int update(AssetLc assetLc);
/**
*
*
* @param id
* @return
*/
int deleteById(Integer id);
}

@ -0,0 +1,95 @@
package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.tc.domain.AssetTask;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* (AssetTask)访
*
* @author makejava
* @since 2024-11-18 13:22:58
*/
public interface AssetTaskMapper extends BaseMapper<AssetTask> {
/**
*
*
* @param page
* @param pageRequest
* @return
*/
Page<AssetTask> queryByPage(Page<AssetTask> page, @Param("req") PageRequest pageRequest);
/**
* ID
*
* @param id
* @return
*/
AssetTask queryById(Integer id);
/**
*
*
* @param assetTask
* @param pageable
* @return
*/
List<AssetTask> queryAllByLimit(AssetTask assetTask, @Param("pageable") Pageable pageable);
/**
*
*
* @param assetTask
* @return
*/
long count(AssetTask assetTask);
/**
*
*
* @param assetTask
* @return
*/
int insert(AssetTask assetTask);
/**
* MyBatisforeach
*
* @param entities List<AssetTask>
* @return
*/
int insertBatch(@Param("entities") List<AssetTask> entities);
/**
* MyBatisforeach
*
* @param entities List<AssetTask>
* @return
* @throws org.springframework.jdbc.BadSqlGrammarException ListSQL
*/
int insertOrUpdateBatch(@Param("entities") List<AssetTask> entities);
/**
*
*
* @param assetTask
* @return
*/
int update(AssetTask assetTask);
/**
*
*
* @param id
* @return
*/
int deleteById(Integer id);
}

@ -0,0 +1,57 @@
package com.ruoyi.tc.service;
import com.ruoyi.tc.domain.AssetLc;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.tc.domain.request.AssetLcRequest;
import org.springframework.data.domain.PageRequest;
/**
* (AssetLc)
*
* @author makejava
* @since 2024-11-18 14:46:40
*/
public interface AssetLcService {
/**
* ID
*
* @param id
* @return
*/
AssetLc queryById(Integer id);
/**
*
*
* @param assetLc
* @param pageRequest
* @return
*/
Page<AssetLc> queryByPage(Page<AssetLc>assetLc, AssetLcRequest pageRequest);
/**
*
*
* @param assetLc
* @return
*/
AssetLc insert(AssetLc assetLc);
/**
*
*
* @param assetLc
* @return
*/
AssetLc update(AssetLc assetLc);
/**
*
*
* @param id
* @return
*/
boolean deleteById(Integer id);
}

@ -0,0 +1,57 @@
package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.domain.AssetTask;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.data.domain.PageRequest;
/**
* (AssetTask)
*
* @author makejava
* @since 2024-11-18 13:23:09
*/
public interface AssetTaskService extends IService<AssetTask> {
/**
* ID
*
* @param id
* @return
*/
AssetTask queryById(Integer id);
/**
*
*
* @param assetTask
* @param pageRequest
* @return
*/
Page<AssetTask> queryByPage(Page<AssetTask> assetTask, PageRequest pageRequest);
/**
*
*
* @param assetTask
* @return
*/
AssetTask insert(AssetTask assetTask);
/**
*
*
* @param assetTask
* @return
*/
AssetTask update(AssetTask assetTask);
/**
*
*
* @param id
* @return
*/
boolean deleteById(Integer id);
}

@ -0,0 +1,87 @@
package com.ruoyi.tc.service.impl;
import com.ruoyi.tc.domain.AssetLc;
import com.ruoyi.tc.domain.AssetTask;
import com.ruoyi.tc.domain.request.AssetLcRequest;
import com.ruoyi.tc.mapper.AssetLcMapper;
import com.ruoyi.tc.service.AssetLcService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import javax.annotation.Resource;
/**
* (AssetLc)
*
* @author makejava
* @since 2024-11-18 14:46:40
*/
@Service("assetLcService")
public class AssetLcServiceImpl implements AssetLcService {
@Resource
private AssetLcMapper assetLcDao;
/**
* ID
*
* @param id
* @return
*/
@Override
public AssetLc queryById(Integer id) {
return this.assetLcDao.queryById(id);
}
/**
*
*
* @param assetLc
* @param pageRequest
* @return
*/
@Override
public Page<AssetLc> queryByPage(Page<AssetLc> assetLc, AssetLcRequest pageRequest) {
return assetLcDao.queryByPage(assetLc, pageRequest);
}
/**
*
*
* @param assetLc
* @return
*/
@Override
public AssetLc insert(AssetLc assetLc) {
this.assetLcDao.insert(assetLc);
return assetLc;
}
/**
*
*
* @param assetLc
* @return
*/
@Override
public AssetLc update(AssetLc assetLc) {
this.assetLcDao.update(assetLc);
return this.queryById(assetLc.getId());
}
/**
*
*
* @param id
* @return
*/
@Override
public boolean deleteById(Integer id) {
return this.assetLcDao.deleteById(id) > 0;
}
}

@ -0,0 +1,81 @@
package com.ruoyi.tc.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.domain.AssetTask;
import com.ruoyi.tc.mapper.AssetTaskMapper;
import com.ruoyi.tc.service.AssetTaskService;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* (AssetTask)
*
* @author makejava
* @since 2024-11-18 13:23:09
*/
@Service("assetTaskService")
public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask> implements AssetTaskService {
@Resource
private AssetTaskMapper assetTaskDao;
/**
* ID
*
* @param id
* @return
*/
@Override
public AssetTask queryById(Integer id) {
return this.assetTaskDao.queryById(id);
}
/**
*
*
* @param assetTask
* @param pageRequest
* @return
*/
@Override
public Page<AssetTask> queryByPage(Page<AssetTask> assetTask, PageRequest pageRequest) {
return assetTaskDao.queryByPage(assetTask, pageRequest);
}
/**
*
*
* @param assetTask
* @return
*/
@Override
public AssetTask insert(AssetTask assetTask) {
this.assetTaskDao.insert(assetTask);
return assetTask;
}
/**
*
*
* @param assetTask
* @return
*/
@Override
public AssetTask update(AssetTask assetTask) {
this.assetTaskDao.update(assetTask);
return this.queryById(assetTask.getId());
}
/**
*
*
* @param id
* @return
*/
@Override
public boolean deleteById(Integer id) {
return this.assetTaskDao.deleteById(id) > 0;
}
}

@ -0,0 +1,262 @@
<?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.ruoyi.tc.mapper.AssetLcMapper">
<resultMap type="com.ruoyi.tc.domain.AssetLc" id="AssetLcMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="taskId" column="task_id" jdbcType="INTEGER"/>
<result property="xfTime" column="xf_time" jdbcType="TIMESTAMP"/>
<result property="dwhcTime" column="dwhc_time" jdbcType="TIMESTAMP"/>
<result property="shbhTime" column="shbh_time" jdbcType="TIMESTAMP"/>
<result property="dwcxhcTime" column="dwcxhc_time" jdbcType="TIMESTAMP"/>
<result property="shtgTime" column="shtg_time" jdbcType="TIMESTAMP"/>
<result property="ueserId" column="ueser_id" jdbcType="INTEGER"/>
<result property="deptId" column="dept_id" jdbcType="INTEGER"/>
<result property="createId" column="create_id" jdbcType="INTEGER"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateId" column="update_id" jdbcType="INTEGER"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="version" column="version" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="AssetLcMap">
select id,
task_id,
xf_time,
dwhc_time,
shbh_time,
dwcxhc_time,
shtg_time,
ueser_i,
ddept_id,
create_id,
create_by,
create_time,
update_id,
update_by,
update_time,
version,
remark
from asset_lc
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="AssetLcMap">
select
id,task_id,xf_time,dwhc_time,shbh_time,dwcxhc_time,shtg_time,ueser_i,ddept_id,create_id,create_by,create_time,update_id,update_by,update_time,version,remark
from asset_lc
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="taskId != null">
and task_id = #{taskId}
</if>
<if test="xfTime != null">
and xf_time = #{xfTime}
</if>
<if test="dwhcTime != null">
and dwhc_time = #{dwhcTime}
</if>
<if test="shbhTime != null">
and shbh_time = #{shbhTime}
</if>
<if test="dwcxhcTime != null">
and dwcxhc_time = #{dwcxhcTime}
</if>
<if test="shtgTime != null">
and shtg_time = #{shtgTime}
</if>
<if test="ueserId != null">
and ueser_id = #{ueserId}
</if>
<if test="deptId != null">
and dept_id = #{deptId}
</if>
<if test="createId != null">
and create_id = #{createId}
</if>
<if test="createBy != null and createBy != ''">
and create_by = #{createBy}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateId != null">
and update_id = #{updateId}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="version != null and version != ''">
and version = #{version}
</if>
<if test="remark != null and remark != ''">
and remark = #{remark}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from asset_lc
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="taskId != null">
and task_id = #{taskId}
</if>
<if test="xfTime != null">
and xf_time = #{xfTime}
</if>
<if test="dwhcTime != null">
and dwhc_time = #{dwhcTime}
</if>
<if test="shbhTime != null">
and shbh_time = #{shbhTime}
</if>
<if test="dwcxhcTime != null">
and dwcxhc_time = #{dwcxhcTime}
</if>
<if test="shtgTime != null">
and shtg_time = #{shtgTime}
</if>
<if test="ueserId != null">
and ueser_id = #{ueserId}
</if>
<if test="deptId != null">
and dept_id = #{deptId}
</if>
<if test="createId != null">
and create_id = #{createId}
</if>
<if test="createBy != null and createBy != ''">
and create_by = #{createBy}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateId != null">
and update_id = #{updateId}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="version != null and version != ''">
and version = #{version}
</if>
<if test="remark != null and remark != ''">
and remark = #{remark}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into asset_lc(task_idxf_timedwhc_timeshbh_timedwcxhc_timeshtg_timeueser_iddept_idcreate_idcreate_bycreate_timeupdate_idupdate_byupdate_timeversionremark)
values (#{taskId}#{xfTime}#{dwhcTime}#{shbhTime}#{dwcxhcTime}#{shtgTime}#{ueserId}#{deptId}#{createId}#{createBy}#{createTime}#{updateId}#{updateBy}#{updateTime}#{version}#{remark})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into
asset_lc(task_idxf_timedwhc_timeshbh_timedwcxhc_timeshtg_timeueser_iddept_idcreate_idcreate_bycreate_timeupdate_idupdate_byupdate_timeversionremark)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.taskId}#{entity.xfTime}#{entity.dwhcTime}#{entity.shbhTime}#{entity.dwcxhcTime}#{entity.shtgTime}#{entity.ueserId}#{entity.deptId}#{entity.createId}#{entity.createBy}#{entity.createTime}#{entity.updateId}#{entity.updateBy}#{entity.updateTime}#{entity.version}#{entity.remark})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into
asset_lc(task_idxf_timedwhc_timeshbh_timedwcxhc_timeshtg_timeueser_iddept_idcreate_idcreate_bycreate_timeupdate_idupdate_byupdate_timeversionremark)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.taskId}#{entity.xfTime}#{entity.dwhcTime}#{entity.shbhTime}#{entity.dwcxhcTime}#{entity.shtgTime}#{entity.ueserId}#{entity.deptId}#{entity.createId}#{entity.createBy}#{entity.createTime}#{entity.updateId}#{entity.updateBy}#{entity.updateTime}#{entity.version}#{entity.remark})
</foreach>
on duplicate key update
task_id = values(task_id)xf_time = values(xf_time)dwhc_time = values(dwhc_time)shbh_time =
values(shbh_time)dwcxhc_time = values(dwcxhc_time)shtg_time = values(shtg_time)ueser_id =
values(ueser_id)dept_id = values(dept_id)create_id = values(create_id)create_by = values(create_by)create_time =
values(create_time)update_id = values(update_id)update_by = values(update_by)update_time =
values(update_time)version = values(version)remark = values(remark)
</insert>
<!--通过主键修改数据-->
<update id="update">
update asset_lc
<set>
<if test="taskId != null">
task_id = #{taskId},
</if>
<if test="xfTime != null">
xf_time = #{xfTime},
</if>
<if test="dwhcTime != null">
dwhc_time = #{dwhcTime},
</if>
<if test="shbhTime != null">
shbh_time = #{shbhTime},
</if>
<if test="dwcxhcTime != null">
dwcxhc_time = #{dwcxhcTime},
</if>
<if test="shtgTime != null">
shtg_time = #{shtgTime},
</if>
<if test="ueserId != null">
ueser_id = #{ueserId},
</if>
<if test="deptId != null">
dept_id = #{deptId},
</if>
<if test="createId != null">
create_id = #{createId},
</if>
<if test="createBy != null and createBy != ''">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateId != null">
update_id = #{updateId},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="version != null and version != ''">
version = #{version},
</if>
<if test="remark != null and remark != ''">
remark = #{remark},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from asset_lc
where id = #{id}
</delete>
</mapper>

@ -0,0 +1,304 @@
<?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.ruoyi.tc.mapper.AssetTaskMapper">
<resultMap type="com.ruoyi.tc.domain.AssetTask" id="AssetTaskMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
<result property="taskTime" column="task_time" jdbcType="TIMESTAMP"/>
<result property="taskDeadline" column="task_deadline" jdbcType="VARCHAR"/>
<result property="taskFinishTime" column="task_finish_time" jdbcType="TIMESTAMP"/>
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="dwId" column="dw_id" jdbcType="INTEGER"/>
<result property="createId" column="create_id" jdbcType="INTEGER"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateId" column="update_id" jdbcType="INTEGER"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="userId" column="user_id" jdbcType="INTEGER"/>
<result property="deptId" column="dept_id" jdbcType="INTEGER"/>
<result property="version" column="version" jdbcType="VARCHAR"/>
<result property="reamark" column="reamark" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="AssetTaskMap">
select id,
task_id,
task_name,
task_time,
task_deadline,
task_finish_time,
task_status,
dw_id,
create_id,
create_by,
create_time,
update_id,
update_by,
update_time,
user_id,
dept_id,
version,
reamark
from asset_task
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="AssetTaskMap">
select
id,task_id,task_name,task_time,task_deadline,task_finish_time,task_status,dw_id,create_id,create_by,create_time,update_id,update_by,update_time,user_id,dept_id,version,reamark
from asset_task
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="taskId != null and taskId != ''">
and task_id = #{taskId}
</if>
<if test="taskName != null and taskName != ''">
and task_name = #{taskName}
</if>
<if test="taskTime != null">
and task_time = #{taskTime}
</if>
<if test="taskDeadline != null and taskDeadline != ''">
and task_deadline = #{taskDeadline}
</if>
<if test="taskFinishTime != null">
and task_finish_time = #{taskFinishTime}
</if>
<if test="taskStatus != null and taskStatus != ''">
and task_status = #{taskStatus}
</if>
<if test="dwId != null">
and dw_id = #{dwId}
</if>
<if test="createId != null">
and create_id = #{createId}
</if>
<if test="createBy != null and createBy != ''">
and create_by = #{createBy}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateId != null">
and update_id = #{updateId}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="deptId != null">
and dept_id = #{deptId}
</if>
<if test="version != null and version != ''">
and version = #{version}
</if>
<if test="reamark != null and reamark != ''">
and reamark = #{reamark}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from asset_task
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="taskId != null and taskId != ''">
and task_id = #{taskId}
</if>
<if test="taskName != null and taskName != ''">
and task_name = #{taskName}
</if>
<if test="taskTime != null">
and task_time = #{taskTime}
</if>
<if test="taskDeadline != null and taskDeadline != ''">
and task_deadline = #{taskDeadline}
</if>
<if test="taskFinishTime != null">
and task_finish_time = #{taskFinishTime}
</if>
<if test="taskStatus != null and taskStatus != ''">
and task_status = #{taskStatus}
</if>
<if test="dwId != null">
and dw_id = #{dwId}
</if>
<if test="createId != null">
and create_id = #{createId}
</if>
<if test="createBy != null and createBy != ''">
and create_by = #{createBy}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateId != null">
and update_id = #{updateId}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="deptId != null">
and dept_id = #{deptId}
</if>
<if test="version != null and version != ''">
and version = #{version}
</if>
<if test="reamark != null and reamark != ''">
and reamark = #{reamark}
</if>
</where>
</select>
<select id="queryByPage" resultType="com.ruoyi.tc.domain.AssetTask">
select
id,task_id,task_name,task_time,task_deadline,task_finish_time,task_status,dw_id,create_id,create_by,create_time,update_id,update_by,update_time,user_id,dept_id,version,reamark
from asset_task
<where>
<if test="taskName != null and taskName != ''">
and task_name = #{taskName}
</if>
<if test="taskFinishTime != null">
and task_finish_time = #{taskFinishTime}
</if>
<if test="begainTime != null">
and task_finish_time &gt;= #{begainTime}
</if>
<if test="endTime != null">
and task_finish_time &lt;= #{endTime}
</if>
<if test="taskStatus != null and taskStatus != ''">
and task_status = #{taskStatus}
</if>
<if test="taskId != null and taskId != ''">
and task_id = #{taskId}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into asset_task(task_id, task_name, task_time, task_deadline, task_finish_time, task_status, dw_id,
create_id, create_by, create_time, update_id, update_by, update_time, user_id, dept_id,
version, reamark)
values (#{taskId}, #{taskName}, #{taskTime}, #{taskDeadline}, #{taskFinishTime}, #{taskStatus}, #{dwId},
#{createId}, #{createBy}, #{createTime}, #{updateId}, #{updateBy}, #{updateTime}, #{userId}, #{deptId},
#{version}, #{reamark})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into
asset_task(task_id,task_name,task_time,task_deadline,task_finish_time,task_status,dw_id,create_id,create_by,create_time,update_id,update_by,update_time,user_id,dept_id,version,reamark)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.taskId},#{entity.taskName},#{entity.taskTime},#{entity.taskDeadline},#{entity.taskFinishTime},#{entity.taskStatus},#{entity.dwId},#{entity.createId},#{entity.createBy},#{entity.createTime},#{entity.updateId},#{entity.updateBy},#{entity.updateTime},#{entity.userId},#{entity.deptId},#{entity.version},#{entity.reamark})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into
asset_task(task_id,task_name,task_time,task_deadline,task_finish_time,task_status,dw_id,create_id,create_by,create_time,update_id,update_by,update_time,user_id,dept_id,version,reamark)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.taskId},#{entity.taskName},#{entity.taskTime},#{entity.taskDeadline}#{entity.taskFinishTime}#{entity.taskStatus}#{entity.dwId}#{entity.createId}#{entity.createBy}#{entity.createTime}#{entity.updateId}#{entity.updateBy}#{entity.updateTime}#{entity.userId}#{entity.deptId}#{entity.version}#{entity.reamark})
</foreach>
on duplicate key update
task_id = values(task_id)task_name = values(task_name)task_time = values(task_time)task_deadline =
values(task_deadline)task_finish_time = values(task_finish_time)task_status = values(task_status)dw_id =
values(dw_id)create_id = values(create_id)create_by = values(create_by)create_time =
values(create_time)update_id = values(update_id)update_by = values(update_by)update_time =
values(update_time)user_id = values(user_id)dept_id = values(dept_id)version = values(version)reamark =
values(reamark)
</insert>
<!--通过主键修改数据-->
<update id="update">
update asset_task
<set>
<if test="taskId != null and taskId != ''">
task_id = #{taskId},
</if>
<if test="taskName != null and taskName != ''">
task_name = #{taskName},
</if>
<if test="taskTime != null">
task_time = #{taskTime},
</if>
<if test="taskDeadline != null and taskDeadline != ''">
task_deadline = #{taskDeadline},
</if>
<if test="taskFinishTime != null">
task_finish_time = #{taskFinishTime},
</if>
<if test="taskStatus != null and taskStatus != ''">
task_status = #{taskStatus},
</if>
<if test="dwId != null">
dw_id = #{dwId},
</if>
<if test="createId != null">
create_id = #{createId},
</if>
<if test="createBy != null and createBy != ''">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateId != null">
update_id = #{updateId},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="userId != null">
user_id = #{userId},
</if>
<if test="deptId != null">
dept_id = #{deptId},
</if>
<if test="version != null and version != ''">
version = #{version},
</if>
<if test="reamark != null and reamark != ''">
reamark = #{reamark},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from asset_task
where id = #{id}
</delete>
</mapper>

@ -1,105 +1,105 @@
<?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.ruoyi.system.mapper.SysDictTypeMapper">
<resultMap type="SysDictType" id="SysDictTypeResult">
<id property="dictId" column="dict_id" />
<result property="dictName" column="dict_name" />
<result property="dictType" column="dict_type" />
<result property="status" column="status" />
<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="selectDictTypeVo">
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
from sys_dict_type
</sql>
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
<where>
<if test="dictName != null and dictName != ''">
AND dict_name like concat('%', #{dictName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="dictType != null and dictType != ''">
AND dict_type like concat('%', #{dictType}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
</if>
</where>
</select>
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
</select>
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_id = #{dictId}
</select>
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType}
</select>
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType} limit 1
</select>
<delete id="deleteDictTypeById" parameterType="Long">
delete from sys_dict_type where dict_id = #{dictId}
</delete>
<delete id="deleteDictTypeByIds" parameterType="Long">
delete from sys_dict_type where dict_id in
<foreach collection="array" item="dictId" open="(" separator="," close=")">
#{dictId}
</foreach>
</delete>
<update id="updateDictType" parameterType="SysDictType">
update sys_dict_type
<set>
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dict_id = #{dictId}
</update>
<insert id="insertDictType" parameterType="SysDictType">
insert into sys_dict_type(
<if test="dictName != null and dictName != ''">dict_name,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="dictName != null and dictName != ''">#{dictName},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<?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.ruoyi.system.mapper.SysDictTypeMapper">
<resultMap type="SysDictType" id="SysDictTypeResult">
<id property="dictId" column="dict_id" />
<result property="dictName" column="dict_name" />
<result property="dictType" column="dict_type" />
<result property="status" column="status" />
<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="selectDictTypeVo">
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
from sys_dict_type
</sql>
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
<where>
<if test="dictName != null and dictName != ''">
AND dict_name like concat('%', #{dictName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="dictType != null and dictType != ''">
AND dict_type like concat('%', #{dictType}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
</if>
</where>
</select>
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
</select>
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_id = #{dictId}
</select>
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType}
</select>
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType} limit 1
</select>
<delete id="deleteDictTypeById" parameterType="Long">
delete from sys_dict_type where dict_id = #{dictId}
</delete>
<delete id="deleteDictTypeByIds" parameterType="Long">
delete from sys_dict_type where dict_id in
<foreach collection="array" item="dictId" open="(" separator="," close=")">
#{dictId}
</foreach>
</delete>
<update id="updateDictType" parameterType="SysDictType">
update sys_dict_type
<set>
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dict_id = #{dictId}
</update>
<insert id="insertDictType" parameterType="SysDictType">
insert into sys_dict_type(
<if test="dictName != null and dictName != ''">dict_name,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="dictName != null and dictName != ''">#{dictName},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
</mapper>
Loading…
Cancel
Save