forked from sd_delivery/delivery
33 changed files with 2441 additions and 17 deletions
@ -0,0 +1,71 @@ |
|||||
|
package com.ccsens.delivery.api; |
||||
|
|
||||
|
import cn.hutool.core.lang.Snowflake; |
||||
|
import com.ccsens.delivery.annotation.MustLogin; |
||||
|
import com.ccsens.delivery.bean.dto.CommonDto; |
||||
|
import com.ccsens.delivery.bean.dto.HealthDto; |
||||
|
import com.ccsens.delivery.bean.vo.CommonVo; |
||||
|
import com.ccsens.delivery.bean.vo.FileVo; |
||||
|
import com.ccsens.delivery.bean.vo.HealthVo; |
||||
|
import com.ccsens.delivery.service.ICommonService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import io.swagger.annotations.*; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Api(tags = "共用的一些接口" , description = "") |
||||
|
@RestController |
||||
|
@RequestMapping() |
||||
|
@Slf4j |
||||
|
public class CommonController { |
||||
|
|
||||
|
@Resource |
||||
|
private ICommonService commonService; |
||||
|
@Resource |
||||
|
private Snowflake snowflake; |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "上传文件",notes = "文件大小不能超过20M") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/upload/file", 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 = commonService.uploadFile(f,params.getUserId()); |
||||
|
return JsonResponse.newInstance().ok(fileInfo); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@ApiOperation(value = "获取表单id",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
@ApiImplicitParam(name = "type", value = "表单类型,0健康码、1行程码、2核酸检测、3抗原检测、4活动轨迹、5物资需求、6药品需求", required = true) |
||||
|
}) |
||||
|
@RequestMapping(value = "getId", method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<FileVo.FileInfo> getFormId(@RequestParam(required = true) Byte type) throws Exception { |
||||
|
log.info("获取表单id:{}",type); |
||||
|
Long id = commonService.getFormId(type); |
||||
|
return JsonResponse.newInstance().ok(id); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "根据类型查看自己提交的表单信息",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/querySelf", method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<PageInfo<CommonVo.QuerySelf>> querySelf(@ApiParam @RequestBody @Validated QueryDto<CommonDto.QuerySelf> params) throws Exception { |
||||
|
log.info("根据类型查看自己提交的表单信息:{}",params); |
||||
|
PageInfo<CommonVo.QuerySelf> querySelfList = commonService.querySelf(params.getParam(),params.getUserId()); |
||||
|
return JsonResponse.newInstance().ok(querySelfList); |
||||
|
} |
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
package com.ccsens.delivery.api; |
||||
|
|
||||
|
import com.ccsens.delivery.annotation.MustLogin; |
||||
|
import com.ccsens.delivery.bean.dto.HealthDto; |
||||
|
import com.ccsens.delivery.bean.vo.FileVo; |
||||
|
import com.ccsens.delivery.bean.vo.HealthVo; |
||||
|
import com.ccsens.delivery.service.IHealthService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiImplicitParams; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
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; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Api(tags = "健康信息相关接口" , description = "0健康码、1行程码、2核酸检测、3抗原检测") |
||||
|
@RestController |
||||
|
@RequestMapping("/health") |
||||
|
@Slf4j |
||||
|
public class HealthController { |
||||
|
|
||||
|
@Resource |
||||
|
private IHealthService healthService; |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "提交健康信息相关的表单",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/submit", method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<FileVo.FileInfo> submitHealth(@ApiParam @RequestBody @Validated QueryDto<HealthDto.HealthForm> params) throws Exception { |
||||
|
log.info("提交健康信息相关的表单:{}",params); |
||||
|
healthService.submitHealth(params.getParam(),params.getUserId()); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
package com.ccsens.delivery.api; |
||||
|
|
||||
|
import com.ccsens.delivery.annotation.MustLogin; |
||||
|
import com.ccsens.delivery.bean.dto.CommonDto; |
||||
|
import com.ccsens.delivery.bean.dto.MaterialDto; |
||||
|
import com.ccsens.delivery.bean.dto.StudentDto; |
||||
|
import com.ccsens.delivery.bean.vo.CommonVo; |
||||
|
import com.ccsens.delivery.bean.vo.MaterialVo; |
||||
|
import com.ccsens.delivery.service.IMaterialService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiImplicitParams; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
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; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Api(tags = "物资相关的接口" , description = "") |
||||
|
@RestController |
||||
|
@RequestMapping("/material") |
||||
|
@Slf4j |
||||
|
public class MaterialController { |
||||
|
|
||||
|
@Resource |
||||
|
private IMaterialService materialService; |
||||
|
|
||||
|
@ApiOperation(value = "查找可以购买的物资列表",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/list", method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<List<MaterialVo.MaterialList>> queryMaterial() throws Exception { |
||||
|
log.info("查找可以购买的物资列表"); |
||||
|
List<MaterialVo.MaterialList> materialLists = materialService.queryMaterial(); |
||||
|
return JsonResponse.newInstance().ok(materialLists); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "提交物资需求记录",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/submit", method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse submitMaterial(@ApiParam @RequestBody @Validated QueryDto<MaterialDto.MaterialForm> params) throws Exception { |
||||
|
log.info("提交物资需求记录"); |
||||
|
materialService.submitMaterial(params.getParam(),params.getUserId()); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "/用户撤回物资需求订单", notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/revocation", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse revocationOrder(@ApiParam @RequestBody @Validated QueryDto<CommonDto.FormId> params) throws Exception { |
||||
|
log.info("用户撤回物资需求订单,{}",params); |
||||
|
materialService.revocationOrder(params.getUserId(), params.getParam()); |
||||
|
log.info("用户撤回物资需求订单成功"); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
package com.ccsens.delivery.api; |
||||
|
|
||||
|
import com.ccsens.delivery.annotation.MustLogin; |
||||
|
import com.ccsens.delivery.bean.dto.HealthDto; |
||||
|
import com.ccsens.delivery.bean.dto.TrailsDto; |
||||
|
import com.ccsens.delivery.bean.vo.FileVo; |
||||
|
import com.ccsens.delivery.service.ITrailsService; |
||||
|
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 io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Api(tags = "活动轨迹相关接口" , description = "") |
||||
|
@RestController |
||||
|
@RequestMapping("/trails") |
||||
|
@Slf4j |
||||
|
public class TrailsController { |
||||
|
|
||||
|
@Resource |
||||
|
private ITrailsService trailsService; |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "提交活动轨迹的表单",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/submit", method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse submitTrails(@ApiParam @RequestBody @Validated QueryDto<TrailsDto.TrailsForm> params) throws Exception { |
||||
|
log.info("提交健康信息相关的表单:{}",params); |
||||
|
trailsService.submitTrails(params.getParam(),params.getUserId()); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package com.ccsens.delivery.bean.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Max; |
||||
|
import javax.validation.constraints.Min; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CommonDto { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查看自己提交表单的记录") |
||||
|
public static class QuerySelf{ |
||||
|
@ApiModelProperty("类型 0健康码、1行程码、2核酸检测、3抗原检测") |
||||
|
private byte type; |
||||
|
@ApiModelProperty("第几页") |
||||
|
@Min(value = 1) |
||||
|
private int pageNum = 1; |
||||
|
@ApiModelProperty("每页多少条") |
||||
|
@Min(value = 1) |
||||
|
@Max(value=100) |
||||
|
private int pageSize = 10; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("请求-表单id") |
||||
|
public static class FormId{ |
||||
|
@ApiModelProperty("表单id") |
||||
|
private Long id; |
||||
|
} |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.ccsens.delivery.bean.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Max; |
||||
|
import javax.validation.constraints.Min; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class HealthDto { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("请求-提交健康相关的表单") |
||||
|
public static class HealthForm{ |
||||
|
@ApiModelProperty("表单页面id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("类型 0健康码、1行程码、2核酸检测、3抗原检测") |
||||
|
private byte type; |
||||
|
@ApiModelProperty("图片id") |
||||
|
private Long fileId; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package com.ccsens.delivery.bean.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MaterialDto { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("请求-提交物资购买的表单") |
||||
|
public static class MaterialForm{ |
||||
|
@ApiModelProperty("表单页面id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("希望配送时间") |
||||
|
private Long planTime; |
||||
|
@ApiModelProperty("备注") |
||||
|
private String remark; |
||||
|
private List<MaterialFormDetail> detailList; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("请求-提交物资购买的表单") |
||||
|
public static class MaterialFormDetail{ |
||||
|
@ApiModelProperty("物品id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("数量") |
||||
|
private int planTime; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
package com.ccsens.delivery.bean.dto; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TrailsDto { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("请求-提交活动轨迹记录") |
||||
|
public static class TrailsForm{ |
||||
|
@ApiModelProperty("表单页面id") |
||||
|
private Long id; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||
|
@ApiModelProperty("日期") |
||||
|
private Date trailsDate; |
||||
|
@ApiModelProperty("备注") |
||||
|
private String remark; |
||||
|
@ApiModelProperty("备注") |
||||
|
private List<TrailsDetail> trailsDetailList; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("请求-提交活动轨迹记录") |
||||
|
public static class TrailsDetail{ |
||||
|
@ApiModelProperty("开始时间") |
||||
|
private Long startTime; |
||||
|
@ApiModelProperty("结束时间") |
||||
|
private Long endTime; |
||||
|
@ApiModelProperty("轨迹详情") |
||||
|
private String trailsDetail; |
||||
|
@ApiModelProperty("轨迹详情") |
||||
|
private String vehicle; |
||||
|
@ApiModelProperty("轨迹详情") |
||||
|
private String vehicleRemark; |
||||
|
@ApiModelProperty("是否戴口罩 0否 1是") |
||||
|
private byte mask; |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,161 @@ |
|||||
|
package com.ccsens.delivery.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,23 @@ |
|||||
|
package com.ccsens.delivery.bean.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public class CommonVo { |
||||
|
@Data |
||||
|
@ApiModel("返回-提交的记录") |
||||
|
public static class QuerySelf{ |
||||
|
@ApiModelProperty("表单页面id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("类型 0健康码、1行程码、2核酸检测、3抗原检测") |
||||
|
private byte type; |
||||
|
@ApiModelProperty("提交时间") |
||||
|
private Long submitTime; |
||||
|
@ApiModelProperty("提交订单的状态") |
||||
|
private byte status; |
||||
|
} |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.ccsens.delivery.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,15 @@ |
|||||
|
package com.ccsens.delivery.bean.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class HealthVo { |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.ccsens.delivery.bean.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MaterialVo { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查找可以购买的物资列表") |
||||
|
public static class MaterialList{ |
||||
|
@ApiModelProperty("物资id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("物资名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("物资最多可购买数量") |
||||
|
private int max; |
||||
|
} |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.delivery.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.delivery.bean.po.FileCommit; |
||||
|
import com.ccsens.delivery.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,95 @@ |
|||||
|
package com.ccsens.delivery.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.delivery.bean.dto.CommonDto; |
||||
|
import com.ccsens.delivery.bean.po.FileCommit; |
||||
|
import com.ccsens.delivery.bean.vo.CommonVo; |
||||
|
import com.ccsens.delivery.bean.vo.FileVo; |
||||
|
import com.ccsens.delivery.persist.mapper.FileCommitMapper; |
||||
|
import com.ccsens.delivery.util.DeliveryCodeError; |
||||
|
import com.ccsens.delivery.util.DeliveryConstant; |
||||
|
import com.ccsens.util.PropUtil; |
||||
|
import com.ccsens.util.exception.BaseException; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
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.io.IOException; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
||||
|
public class CommonService implements ICommonService { |
||||
|
|
||||
|
@Resource |
||||
|
private Snowflake snowflake; |
||||
|
@Resource |
||||
|
private FileCommitMapper fileCommitMapper; |
||||
|
|
||||
|
@Override |
||||
|
public FileVo.FileInfo uploadFile(MultipartFile f, Long userId) throws IOException { |
||||
|
if(ObjectUtil.isNull(f)){ |
||||
|
throw new BaseException(DeliveryCodeError.NOT_FILE); |
||||
|
} |
||||
|
//文件类型验证
|
||||
|
String ext = FileUtil.extName(f.getOriginalFilename()); |
||||
|
log.info("文件类型:{}",ext); |
||||
|
if(StrUtil.isEmpty(ext) || (!DeliveryConstant.FILE_TYPE_IMG.contains(ext) && !DeliveryConstant.FILE_TYPE_DOCUMENT.contains(ext))){ |
||||
|
throw new BaseException(DeliveryCodeError.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; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Long getFormId(Byte type) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PageInfo<CommonVo.QuerySelf> querySelf(CommonDto.QuerySelf param, Long userId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.ccsens.delivery.service; |
||||
|
|
||||
|
import com.ccsens.delivery.bean.dto.HealthDto; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
||||
|
public class HealthService implements IHealthService { |
||||
|
@Override |
||||
|
public void submitHealth(HealthDto.HealthForm param, Long userId) { |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.ccsens.delivery.service; |
||||
|
|
||||
|
import com.ccsens.delivery.bean.dto.CommonDto; |
||||
|
import com.ccsens.delivery.bean.dto.HealthDto; |
||||
|
import com.ccsens.delivery.bean.vo.CommonVo; |
||||
|
import com.ccsens.delivery.bean.vo.FileVo; |
||||
|
import com.ccsens.delivery.bean.vo.HealthVo; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public interface ICommonService { |
||||
|
|
||||
|
/** |
||||
|
* 上传文件 |
||||
|
* @param f 文件信息 |
||||
|
* @param userId userId |
||||
|
* @return 返回文件id路径名称 |
||||
|
*/ |
||||
|
FileVo.FileInfo uploadFile(MultipartFile f, Long userId) throws IOException; |
||||
|
|
||||
|
/** |
||||
|
* 获取表单id |
||||
|
* @param type 表单类型 |
||||
|
* @return 返回表单id |
||||
|
*/ |
||||
|
Long getFormId(Byte type); |
||||
|
|
||||
|
/** |
||||
|
* 查看自己提交的表单的列表 |
||||
|
* @param param 类型和分页信息 |
||||
|
* @param userId userId |
||||
|
* @return 分页返回表单列表 |
||||
|
*/ |
||||
|
PageInfo<CommonVo.QuerySelf> querySelf(CommonDto.QuerySelf param, Long userId); |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.ccsens.delivery.service; |
||||
|
|
||||
|
import com.ccsens.delivery.bean.dto.HealthDto; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public interface IHealthService { |
||||
|
|
||||
|
/** |
||||
|
* 提交健康信息相关的表单 |
||||
|
* @param param 表单信息 |
||||
|
* @param userId userId |
||||
|
*/ |
||||
|
void submitHealth(HealthDto.HealthForm param, Long userId); |
||||
|
|
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
package com.ccsens.delivery.service; |
||||
|
|
||||
|
import com.ccsens.delivery.bean.dto.CommonDto; |
||||
|
import com.ccsens.delivery.bean.dto.MaterialDto; |
||||
|
import com.ccsens.delivery.bean.vo.MaterialVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public interface IMaterialService { |
||||
|
|
||||
|
/** |
||||
|
* 查找所有可以购买的物资信息 |
||||
|
* @return 返回物资列表 |
||||
|
*/ |
||||
|
List<MaterialVo.MaterialList> queryMaterial(); |
||||
|
|
||||
|
/** |
||||
|
* 提交物资需求表单 |
||||
|
* @param param 需求的物资详情 |
||||
|
* @param userId userId |
||||
|
*/ |
||||
|
void submitMaterial(MaterialDto.MaterialForm param, Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 撤回物资需求订单 |
||||
|
* @param userId userID |
||||
|
* @param param 订单id |
||||
|
*/ |
||||
|
void revocationOrder(Long userId, CommonDto.FormId param); |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.ccsens.delivery.service; |
||||
|
|
||||
|
import com.ccsens.delivery.bean.dto.TrailsDto; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public interface ITrailsService { |
||||
|
|
||||
|
/** |
||||
|
* 提交活动轨迹表单 |
||||
|
* @param param 活动轨迹 |
||||
|
* @param userId userId |
||||
|
*/ |
||||
|
void submitTrails(TrailsDto.TrailsForm param, Long userId); |
||||
|
|
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
package com.ccsens.delivery.service; |
||||
|
|
||||
|
import com.ccsens.delivery.bean.dto.CommonDto; |
||||
|
import com.ccsens.delivery.bean.dto.MaterialDto; |
||||
|
import com.ccsens.delivery.bean.vo.MaterialVo; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.List; |
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
||||
|
public class MaterialService implements IMaterialService { |
||||
|
@Override |
||||
|
public List<MaterialVo.MaterialList> queryMaterial() { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void submitMaterial(MaterialDto.MaterialForm param, Long userId) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void revocationOrder(Long userId, CommonDto.FormId param) { |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.ccsens.delivery.service; |
||||
|
|
||||
|
import com.ccsens.delivery.bean.dto.TrailsDto; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
||||
|
public class TrailsService implements ITrailsService { |
||||
|
@Override |
||||
|
public void submitTrails(TrailsDto.TrailsForm param, Long userId) { |
||||
|
|
||||
|
} |
||||
|
} |
@ -1,4 +1,4 @@ |
|||||
spring: |
spring: |
||||
profiles: |
profiles: |
||||
active: prod |
active: test |
||||
include: common |
include: common |
||||
|
@ -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.delivery.persist.mapper.FileCommitMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.delivery.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.delivery.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.delivery.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.delivery.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.delivery.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.delivery.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.delivery.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.delivery.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