18 changed files with 1807 additions and 47 deletions
@ -0,0 +1,42 @@ |
|||
package com.ccsens.defaultwbs.api; |
|||
|
|||
import com.ccsens.cloudutil.annotation.MustLogin; |
|||
import com.ccsens.defaultwbs.bean.vo.FileVo; |
|||
import com.ccsens.defaultwbs.service.IFileService; |
|||
import com.ccsens.util.JsonResponse; |
|||
import com.ccsens.util.bean.dto.QueryDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiImplicitParams; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.annotation.Resource; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Api(tags = "文件相关相关" ) |
|||
@RestController |
|||
@RequestMapping("/file") |
|||
@Slf4j |
|||
public class FileController { |
|||
@Resource |
|||
private IFileService fileService; |
|||
|
|||
@MustLogin |
|||
@ApiOperation(value = "上传文件",notes = "文件大小不能超过20M") |
|||
@ApiImplicitParams({ |
|||
}) |
|||
@RequestMapping(value = "upload", method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<FileVo.FileInfo> uploadFile(QueryDto<MultipartFile> params) throws Exception { |
|||
log.info("上传文件:{}",params); |
|||
MultipartFile f = params.getParam(); |
|||
FileVo.FileInfo fileInfo = fileService.uploadFile(f,params.getUserId()); |
|||
|
|||
return JsonResponse.newInstance().ok(fileInfo); |
|||
} |
|||
} |
@ -0,0 +1,161 @@ |
|||
package com.ccsens.defaultwbs.bean.po; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
public class FileCommit implements Serializable { |
|||
private Long id; |
|||
|
|||
private String name; |
|||
|
|||
private String path; |
|||
|
|||
private String visitPath; |
|||
|
|||
private String md5; |
|||
|
|||
private String sha1; |
|||
|
|||
private Long time; |
|||
|
|||
private Integer count; |
|||
|
|||
private Byte status; |
|||
|
|||
private Long operator; |
|||
|
|||
private Date createdAt; |
|||
|
|||
private Date updatedAt; |
|||
|
|||
private Byte recStatus; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public Long getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Long id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name == null ? null : name.trim(); |
|||
} |
|||
|
|||
public String getPath() { |
|||
return path; |
|||
} |
|||
|
|||
public void setPath(String path) { |
|||
this.path = path == null ? null : path.trim(); |
|||
} |
|||
|
|||
public String getVisitPath() { |
|||
return visitPath; |
|||
} |
|||
|
|||
public void setVisitPath(String visitPath) { |
|||
this.visitPath = visitPath == null ? null : visitPath.trim(); |
|||
} |
|||
|
|||
public String getMd5() { |
|||
return md5; |
|||
} |
|||
|
|||
public void setMd5(String md5) { |
|||
this.md5 = md5 == null ? null : md5.trim(); |
|||
} |
|||
|
|||
public String getSha1() { |
|||
return sha1; |
|||
} |
|||
|
|||
public void setSha1(String sha1) { |
|||
this.sha1 = sha1 == null ? null : sha1.trim(); |
|||
} |
|||
|
|||
public Long getTime() { |
|||
return time; |
|||
} |
|||
|
|||
public void setTime(Long time) { |
|||
this.time = time; |
|||
} |
|||
|
|||
public Integer getCount() { |
|||
return count; |
|||
} |
|||
|
|||
public void setCount(Integer count) { |
|||
this.count = count; |
|||
} |
|||
|
|||
public Byte getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Byte status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public Long getOperator() { |
|||
return operator; |
|||
} |
|||
|
|||
public void setOperator(Long operator) { |
|||
this.operator = operator; |
|||
} |
|||
|
|||
public Date getCreatedAt() { |
|||
return createdAt; |
|||
} |
|||
|
|||
public void setCreatedAt(Date createdAt) { |
|||
this.createdAt = createdAt; |
|||
} |
|||
|
|||
public Date getUpdatedAt() { |
|||
return updatedAt; |
|||
} |
|||
|
|||
public void setUpdatedAt(Date updatedAt) { |
|||
this.updatedAt = updatedAt; |
|||
} |
|||
|
|||
public Byte getRecStatus() { |
|||
return recStatus; |
|||
} |
|||
|
|||
public void setRecStatus(Byte recStatus) { |
|||
this.recStatus = recStatus; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
StringBuilder sb = new StringBuilder(); |
|||
sb.append(getClass().getSimpleName()); |
|||
sb.append(" ["); |
|||
sb.append("Hash = ").append(hashCode()); |
|||
sb.append(", id=").append(id); |
|||
sb.append(", name=").append(name); |
|||
sb.append(", path=").append(path); |
|||
sb.append(", visitPath=").append(visitPath); |
|||
sb.append(", md5=").append(md5); |
|||
sb.append(", sha1=").append(sha1); |
|||
sb.append(", time=").append(time); |
|||
sb.append(", count=").append(count); |
|||
sb.append(", status=").append(status); |
|||
sb.append(", operator=").append(operator); |
|||
sb.append(", createdAt=").append(createdAt); |
|||
sb.append(", updatedAt=").append(updatedAt); |
|||
sb.append(", recStatus=").append(recStatus); |
|||
sb.append("]"); |
|||
return sb.toString(); |
|||
} |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,22 @@ |
|||
package com.ccsens.defaultwbs.bean.vo; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Data |
|||
public class FileVo { |
|||
@Data |
|||
@ApiModel("插件详情") |
|||
public static class FileInfo{ |
|||
@ApiModelProperty("文件id") |
|||
private Long fileId; |
|||
@ApiModelProperty("文件名称") |
|||
private String name; |
|||
@ApiModelProperty("访问路径") |
|||
private String path; |
|||
} |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.ccsens.defaultwbs.persist.mapper; |
|||
|
|||
import com.ccsens.defaultwbs.bean.po.FileCommit; |
|||
import com.ccsens.defaultwbs.bean.po.FileCommitExample; |
|||
import java.util.List; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
public interface FileCommitMapper { |
|||
long countByExample(FileCommitExample example); |
|||
|
|||
int deleteByExample(FileCommitExample example); |
|||
|
|||
int deleteByPrimaryKey(Long id); |
|||
|
|||
int insert(FileCommit record); |
|||
|
|||
int insertSelective(FileCommit record); |
|||
|
|||
List<FileCommit> selectByExample(FileCommitExample example); |
|||
|
|||
FileCommit selectByPrimaryKey(Long id); |
|||
|
|||
int updateByExampleSelective(@Param("record") FileCommit record, @Param("example") FileCommitExample example); |
|||
|
|||
int updateByExample(@Param("record") FileCommit record, @Param("example") FileCommitExample example); |
|||
|
|||
int updateByPrimaryKeySelective(FileCommit record); |
|||
|
|||
int updateByPrimaryKey(FileCommit record); |
|||
} |
@ -0,0 +1,77 @@ |
|||
package com.ccsens.defaultwbs.service; |
|||
|
|||
import cn.hutool.core.date.DateUtil; |
|||
import cn.hutool.core.io.FileUtil; |
|||
import cn.hutool.core.lang.Snowflake; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.ccsens.defaultwbs.bean.po.FileCommit; |
|||
import com.ccsens.defaultwbs.bean.vo.FileVo; |
|||
import com.ccsens.defaultwbs.persist.mapper.FileCommitMapper; |
|||
import com.ccsens.defaultwbs.util.Constant; |
|||
import com.ccsens.defaultwbs.util.DefaultCodeError; |
|||
import com.ccsens.util.PropUtil; |
|||
import com.ccsens.util.exception.BaseException; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Propagation; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.io.File; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
|||
public class FileService implements IFileService { |
|||
@Resource |
|||
private Snowflake snowflake; |
|||
@Resource |
|||
private FileCommitMapper fileCommitMapper; |
|||
|
|||
@Override |
|||
public FileVo.FileInfo uploadFile(MultipartFile f, Long userId) throws Exception { |
|||
if(ObjectUtil.isNull(f)){ |
|||
throw new BaseException(DefaultCodeError.NOT_FILE); |
|||
} |
|||
//文件类型验证
|
|||
String ext = FileUtil.extName(f.getOriginalFilename()); |
|||
log.info("文件类型:{}",ext); |
|||
if(StrUtil.isEmpty(ext) || (!Constant.FILE_TYPE_IMG.contains(ext) && !Constant.FILE_TYPE_DOCUMENT.contains(ext))){ |
|||
throw new BaseException(DefaultCodeError.FILE_FORMAT_ERROR); |
|||
} |
|||
//文件路径
|
|||
String dir = PropUtil.path; |
|||
String extraPath = DateUtil.format(new Date(), "yyyyMMdd"); |
|||
String path = extraPath + "/" + IdUtil.simpleUUID() + "." + ext; |
|||
//转成file
|
|||
File file = new File(dir + extraPath); |
|||
if (!file.exists()) { |
|||
file.mkdirs(); |
|||
} |
|||
String fullPath = dir + path; |
|||
//写入文件
|
|||
FileUtil.writeFromStream(f.getInputStream(), fullPath); |
|||
|
|||
//保存数据库
|
|||
FileCommit fileCommit = new FileCommit(); |
|||
fileCommit.setId(snowflake.nextId()); |
|||
fileCommit.setName(f.getOriginalFilename()); |
|||
fileCommit.setVisitPath(PropUtil.imgDomain + path); |
|||
fileCommit.setTime(System.currentTimeMillis()); |
|||
fileCommit.setOperator(userId); |
|||
fileCommitMapper.insertSelective(fileCommit); |
|||
//返回
|
|||
FileVo.FileInfo fileInfo = new FileVo.FileInfo(); |
|||
fileInfo.setFileId(fileCommit.getId()); |
|||
fileInfo.setName(fileCommit.getName()); |
|||
fileInfo.setPath(fileCommit.getVisitPath()); |
|||
return fileInfo; |
|||
} |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.ccsens.defaultwbs.service; |
|||
|
|||
import com.ccsens.defaultwbs.bean.vo.FileVo; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
public interface IFileService { |
|||
/** |
|||
* 上传文件 |
|||
* @param f 文件 |
|||
* @param userId userId |
|||
* @return 返回文件id和路径 |
|||
* @throws Exception io |
|||
*/ |
|||
FileVo.FileInfo uploadFile(MultipartFile f, Long userId) throws Exception; |
|||
|
|||
} |
@ -1,4 +1,4 @@ |
|||
spring: |
|||
profiles: |
|||
active: dev |
|||
include: common, util-dev |
|||
active: test |
|||
include: common, util-test |
|||
|
@ -0,0 +1,338 @@ |
|||
<?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.ccsens.defaultwbs.persist.mapper.FileCommitMapper"> |
|||
<resultMap id="BaseResultMap" type="com.ccsens.defaultwbs.bean.po.FileCommit"> |
|||
<id column="id" jdbcType="BIGINT" property="id" /> |
|||
<result column="name" jdbcType="VARCHAR" property="name" /> |
|||
<result column="path" jdbcType="VARCHAR" property="path" /> |
|||
<result column="visit_path" jdbcType="VARCHAR" property="visitPath" /> |
|||
<result column="md5" jdbcType="VARCHAR" property="md5" /> |
|||
<result column="sha1" jdbcType="VARCHAR" property="sha1" /> |
|||
<result column="time" jdbcType="BIGINT" property="time" /> |
|||
<result column="count" jdbcType="INTEGER" property="count" /> |
|||
<result column="status" jdbcType="TINYINT" property="status" /> |
|||
<result column="operator" jdbcType="BIGINT" property="operator" /> |
|||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
|||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
|||
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
|||
</resultMap> |
|||
<sql id="Example_Where_Clause"> |
|||
<where> |
|||
<foreach collection="oredCriteria" item="criteria" separator="or"> |
|||
<if test="criteria.valid"> |
|||
<trim prefix="(" prefixOverrides="and" suffix=")"> |
|||
<foreach collection="criteria.criteria" item="criterion"> |
|||
<choose> |
|||
<when test="criterion.noValue"> |
|||
and ${criterion.condition} |
|||
</when> |
|||
<when test="criterion.singleValue"> |
|||
and ${criterion.condition} #{criterion.value} |
|||
</when> |
|||
<when test="criterion.betweenValue"> |
|||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
|||
</when> |
|||
<when test="criterion.listValue"> |
|||
and ${criterion.condition} |
|||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
|||
#{listItem} |
|||
</foreach> |
|||
</when> |
|||
</choose> |
|||
</foreach> |
|||
</trim> |
|||
</if> |
|||
</foreach> |
|||
</where> |
|||
</sql> |
|||
<sql id="Update_By_Example_Where_Clause"> |
|||
<where> |
|||
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
|||
<if test="criteria.valid"> |
|||
<trim prefix="(" prefixOverrides="and" suffix=")"> |
|||
<foreach collection="criteria.criteria" item="criterion"> |
|||
<choose> |
|||
<when test="criterion.noValue"> |
|||
and ${criterion.condition} |
|||
</when> |
|||
<when test="criterion.singleValue"> |
|||
and ${criterion.condition} #{criterion.value} |
|||
</when> |
|||
<when test="criterion.betweenValue"> |
|||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
|||
</when> |
|||
<when test="criterion.listValue"> |
|||
and ${criterion.condition} |
|||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
|||
#{listItem} |
|||
</foreach> |
|||
</when> |
|||
</choose> |
|||
</foreach> |
|||
</trim> |
|||
</if> |
|||
</foreach> |
|||
</where> |
|||
</sql> |
|||
<sql id="Base_Column_List"> |
|||
id, name, path, visit_path, md5, sha1, time, count, status, operator, created_at, |
|||
updated_at, rec_status |
|||
</sql> |
|||
<select id="selectByExample" parameterType="com.ccsens.defaultwbs.bean.po.FileCommitExample" resultMap="BaseResultMap"> |
|||
select |
|||
<if test="distinct"> |
|||
distinct |
|||
</if> |
|||
<include refid="Base_Column_List" /> |
|||
from t_file_commit |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
<if test="orderByClause != null"> |
|||
order by ${orderByClause} |
|||
</if> |
|||
</select> |
|||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
|||
select |
|||
<include refid="Base_Column_List" /> |
|||
from t_file_commit |
|||
where id = #{id,jdbcType=BIGINT} |
|||
</select> |
|||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
|||
delete from t_file_commit |
|||
where id = #{id,jdbcType=BIGINT} |
|||
</delete> |
|||
<delete id="deleteByExample" parameterType="com.ccsens.defaultwbs.bean.po.FileCommitExample"> |
|||
delete from t_file_commit |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
</delete> |
|||
<insert id="insert" parameterType="com.ccsens.defaultwbs.bean.po.FileCommit"> |
|||
insert into t_file_commit (id, name, path, |
|||
visit_path, md5, sha1, |
|||
time, count, status, |
|||
operator, created_at, updated_at, |
|||
rec_status) |
|||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, |
|||
#{visitPath,jdbcType=VARCHAR}, #{md5,jdbcType=VARCHAR}, #{sha1,jdbcType=VARCHAR}, |
|||
#{time,jdbcType=BIGINT}, #{count,jdbcType=INTEGER}, #{status,jdbcType=TINYINT}, |
|||
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, |
|||
#{recStatus,jdbcType=TINYINT}) |
|||
</insert> |
|||
<insert id="insertSelective" parameterType="com.ccsens.defaultwbs.bean.po.FileCommit"> |
|||
insert into t_file_commit |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="id != null"> |
|||
id, |
|||
</if> |
|||
<if test="name != null"> |
|||
name, |
|||
</if> |
|||
<if test="path != null"> |
|||
path, |
|||
</if> |
|||
<if test="visitPath != null"> |
|||
visit_path, |
|||
</if> |
|||
<if test="md5 != null"> |
|||
md5, |
|||
</if> |
|||
<if test="sha1 != null"> |
|||
sha1, |
|||
</if> |
|||
<if test="time != null"> |
|||
time, |
|||
</if> |
|||
<if test="count != null"> |
|||
count, |
|||
</if> |
|||
<if test="status != null"> |
|||
status, |
|||
</if> |
|||
<if test="operator != null"> |
|||
operator, |
|||
</if> |
|||
<if test="createdAt != null"> |
|||
created_at, |
|||
</if> |
|||
<if test="updatedAt != null"> |
|||
updated_at, |
|||
</if> |
|||
<if test="recStatus != null"> |
|||
rec_status, |
|||
</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="id != null"> |
|||
#{id,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="name != null"> |
|||
#{name,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="path != null"> |
|||
#{path,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="visitPath != null"> |
|||
#{visitPath,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="md5 != null"> |
|||
#{md5,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="sha1 != null"> |
|||
#{sha1,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="time != null"> |
|||
#{time,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="count != null"> |
|||
#{count,jdbcType=INTEGER}, |
|||
</if> |
|||
<if test="status != null"> |
|||
#{status,jdbcType=TINYINT}, |
|||
</if> |
|||
<if test="operator != null"> |
|||
#{operator,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="createdAt != null"> |
|||
#{createdAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="updatedAt != null"> |
|||
#{updatedAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="recStatus != null"> |
|||
#{recStatus,jdbcType=TINYINT}, |
|||
</if> |
|||
</trim> |
|||
</insert> |
|||
<select id="countByExample" parameterType="com.ccsens.defaultwbs.bean.po.FileCommitExample" resultType="java.lang.Long"> |
|||
select count(*) from t_file_commit |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
</select> |
|||
<update id="updateByExampleSelective" parameterType="map"> |
|||
update t_file_commit |
|||
<set> |
|||
<if test="record.id != null"> |
|||
id = #{record.id,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="record.name != null"> |
|||
name = #{record.name,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.path != null"> |
|||
path = #{record.path,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.visitPath != null"> |
|||
visit_path = #{record.visitPath,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.md5 != null"> |
|||
md5 = #{record.md5,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.sha1 != null"> |
|||
sha1 = #{record.sha1,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.time != null"> |
|||
time = #{record.time,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="record.count != null"> |
|||
count = #{record.count,jdbcType=INTEGER}, |
|||
</if> |
|||
<if test="record.status != null"> |
|||
status = #{record.status,jdbcType=TINYINT}, |
|||
</if> |
|||
<if test="record.operator != null"> |
|||
operator = #{record.operator,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="record.createdAt != null"> |
|||
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.updatedAt != null"> |
|||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.recStatus != null"> |
|||
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
|||
</if> |
|||
</set> |
|||
<if test="_parameter != null"> |
|||
<include refid="Update_By_Example_Where_Clause" /> |
|||
</if> |
|||
</update> |
|||
<update id="updateByExample" parameterType="map"> |
|||
update t_file_commit |
|||
set id = #{record.id,jdbcType=BIGINT}, |
|||
name = #{record.name,jdbcType=VARCHAR}, |
|||
path = #{record.path,jdbcType=VARCHAR}, |
|||
visit_path = #{record.visitPath,jdbcType=VARCHAR}, |
|||
md5 = #{record.md5,jdbcType=VARCHAR}, |
|||
sha1 = #{record.sha1,jdbcType=VARCHAR}, |
|||
time = #{record.time,jdbcType=BIGINT}, |
|||
count = #{record.count,jdbcType=INTEGER}, |
|||
status = #{record.status,jdbcType=TINYINT}, |
|||
operator = #{record.operator,jdbcType=BIGINT}, |
|||
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
|||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
|||
rec_status = #{record.recStatus,jdbcType=TINYINT} |
|||
<if test="_parameter != null"> |
|||
<include refid="Update_By_Example_Where_Clause" /> |
|||
</if> |
|||
</update> |
|||
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.defaultwbs.bean.po.FileCommit"> |
|||
update t_file_commit |
|||
<set> |
|||
<if test="name != null"> |
|||
name = #{name,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="path != null"> |
|||
path = #{path,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="visitPath != null"> |
|||
visit_path = #{visitPath,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="md5 != null"> |
|||
md5 = #{md5,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="sha1 != null"> |
|||
sha1 = #{sha1,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="time != null"> |
|||
time = #{time,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="count != null"> |
|||
count = #{count,jdbcType=INTEGER}, |
|||
</if> |
|||
<if test="status != null"> |
|||
status = #{status,jdbcType=TINYINT}, |
|||
</if> |
|||
<if test="operator != null"> |
|||
operator = #{operator,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="createdAt != null"> |
|||
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="updatedAt != null"> |
|||
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="recStatus != null"> |
|||
rec_status = #{recStatus,jdbcType=TINYINT}, |
|||
</if> |
|||
</set> |
|||
where id = #{id,jdbcType=BIGINT} |
|||
</update> |
|||
<update id="updateByPrimaryKey" parameterType="com.ccsens.defaultwbs.bean.po.FileCommit"> |
|||
update t_file_commit |
|||
set name = #{name,jdbcType=VARCHAR}, |
|||
path = #{path,jdbcType=VARCHAR}, |
|||
visit_path = #{visitPath,jdbcType=VARCHAR}, |
|||
md5 = #{md5,jdbcType=VARCHAR}, |
|||
sha1 = #{sha1,jdbcType=VARCHAR}, |
|||
time = #{time,jdbcType=BIGINT}, |
|||
count = #{count,jdbcType=INTEGER}, |
|||
status = #{status,jdbcType=TINYINT}, |
|||
operator = #{operator,jdbcType=BIGINT}, |
|||
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
|||
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
|||
rec_status = #{recStatus,jdbcType=TINYINT} |
|||
where id = #{id,jdbcType=BIGINT} |
|||
</update> |
|||
</mapper> |
Loading…
Reference in new issue