From a3901bed96a95f4b2747b45fa2acab143304f65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Fri, 4 Dec 2020 14:23:13 +0800 Subject: [PATCH] fix --- .../com/lz/modules/sys/dao/PrintMapper.java | 33 ++ .../lz/modules/sys/dao/ResourceMapper.java | 26 ++ .../java/com/lz/modules/sys/entity/Print.java | 234 ++++++++++++ .../com/lz/modules/sys/entity/Resource.java | 361 ++++++++++++++++++ src/main/resources/mapper/sys/PrintMapper.xml | 103 +++++ .../resources/mapper/sys/ResourceMapper.xml | 138 +++++++ src/test/java/com/lz/mysql/MysqlMain.java | 4 +- 7 files changed, 897 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/lz/modules/sys/dao/PrintMapper.java create mode 100644 src/main/java/com/lz/modules/sys/dao/ResourceMapper.java create mode 100644 src/main/java/com/lz/modules/sys/entity/Print.java create mode 100644 src/main/java/com/lz/modules/sys/entity/Resource.java create mode 100644 src/main/resources/mapper/sys/PrintMapper.xml create mode 100644 src/main/resources/mapper/sys/ResourceMapper.xml diff --git a/src/main/java/com/lz/modules/sys/dao/PrintMapper.java b/src/main/java/com/lz/modules/sys/dao/PrintMapper.java new file mode 100644 index 00000000..808924d6 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/dao/PrintMapper.java @@ -0,0 +1,33 @@ +package com.lz.modules.sys.dao; +/** +*

+* 流转表 服务类 +*

+* +* @author quyixiao +* @since 2020-12-04 +*/ +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lz.modules.sys.entity.Print; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +@Mapper +public interface PrintMapper extends BaseMapper { + + + Print selectPrintById(@Param("id") Long id); + + + Long insertPrint(Print print); + + + int updatePrintById(Print print); + + + int updateCoverPrintById(Print print); + + + int deletePrintById(@Param("id") Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/dao/ResourceMapper.java b/src/main/java/com/lz/modules/sys/dao/ResourceMapper.java new file mode 100644 index 00000000..9d5451c0 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/dao/ResourceMapper.java @@ -0,0 +1,26 @@ +package com.lz.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lz.modules.sys.entity.Resource; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +@Mapper +public interface ResourceMapper extends BaseMapper { + + + Resource selectResourceById(@Param("id") Long id); + + + Long insertResource(Resource resource); + + + int updateResourceById(Resource resource); + + + int updateCoverResourceById(Resource resource); + + + int deleteResourceById(@Param("id") Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/entity/Print.java b/src/main/java/com/lz/modules/sys/entity/Print.java new file mode 100644 index 00000000..cadb7712 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/entity/Print.java @@ -0,0 +1,234 @@ +package com.lz.modules.sys.entity; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.util.Date; +/** +*

+*

*流转表 +* @author quyixiao +* @since 2020-12-04 +*/ + +@Data +@TableName("lz_print") +@ApiModel(value = "流转表") +public class Print implements java.io.Serializable { + // + @TableId(value = "id", type = IdType.AUTO) + private Long id; + //是否删除状态,1:删除,0:有效 + @ApiModelProperty(value = "是否删除状态,1:删除,0:有效", name = "isDelete") + private Integer isDelete; + //创建时间 + @ApiModelProperty(value = "创建时间", name = "gmtCreate") + private Date gmtCreate; + //最后修改时间 + @ApiModelProperty(value = "最后修改时间", name = "gmtModified") + private Date gmtModified; + //打印详情的url + @ApiModelProperty(value = "打印详情的url", name = "url") + private String url; + //备注 + @ApiModelProperty(value = "备注", name = "remark") + private String remark; + //打印批次号 + @ApiModelProperty(value = "打印批次号", name = "batchNo") + private String batchNo; + //0未打印,1打印成功,2打印失败 + @ApiModelProperty(value = "0未打印,1打印成功,2打印失败", name = "status") + private Integer status; + //生成图片上传阿里云url + @ApiModelProperty(value = "生成图片上传阿里云url", name = "imageUrl") + private String imageUrl; + //0不生成图片,1生成图片 + @ApiModelProperty(value = "0不生成图片,1生成图片", name = "isImage") + private Integer isImage; + //0不打印,1 打印 + @ApiModelProperty(value = "0不打印,1 打印", name = "isPrint") + private Integer isPrint; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * 是否删除状态,1:删除,0:有效 + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * 是否删除状态,1:删除,0:有效 + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * 创建时间 + * @return + */ + public Date getGmtCreate() { + return gmtCreate; + } + /** + * 创建时间 + * @param gmtCreate + */ + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + /** + * 最后修改时间 + * @return + */ + public Date getGmtModified() { + return gmtModified; + } + /** + * 最后修改时间 + * @param gmtModified + */ + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + /** + * 打印详情的url + * @return + */ + public String getUrl() { + return url; + } + /** + * 打印详情的url + * @param url + */ + public void setUrl(String url) { + this.url = url; + } + + /** + * 备注 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + /** + * 打印批次号 + * @return + */ + public String getBatchNo() { + return batchNo; + } + /** + * 打印批次号 + * @param batchNo + */ + public void setBatchNo(String batchNo) { + this.batchNo = batchNo; + } + + /** + * 0未打印,1打印成功,2打印失败 + * @return + */ + public Integer getStatus() { + return status; + } + /** + * 0未打印,1打印成功,2打印失败 + * @param status + */ + public void setStatus(Integer status) { + this.status = status; + } + + /** + * 生成图片上传阿里云url + * @return + */ + public String getImageUrl() { + return imageUrl; + } + /** + * 生成图片上传阿里云url + * @param imageUrl + */ + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * 0不生成图片,1生成图片 + * @return + */ + public Integer getIsImage() { + return isImage; + } + /** + * 0不生成图片,1生成图片 + * @param isImage + */ + public void setIsImage(Integer isImage) { + this.isImage = isImage; + } + + /** + * 0不打印,1 打印 + * @return + */ + public Integer getIsPrint() { + return isPrint; + } + /** + * 0不打印,1 打印 + * @param isPrint + */ + public void setIsPrint(Integer isPrint) { + this.isPrint = isPrint; + } + + @Override + public String toString() { + return "Print{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",gmtCreate=" + gmtCreate + + ",gmtModified=" + gmtModified + + ",url=" + url + + ",remark=" + remark + + ",batchNo=" + batchNo + + ",status=" + status + + ",imageUrl=" + imageUrl + + ",isImage=" + isImage + + ",isPrint=" + isPrint + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/entity/Resource.java b/src/main/java/com/lz/modules/sys/entity/Resource.java new file mode 100644 index 00000000..cbb92d62 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/entity/Resource.java @@ -0,0 +1,361 @@ +package com.lz.modules.sys.entity; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.util.Date; + +@Data +@TableName("lz_resource") +@ApiModel(value = "资源配置及业务配置表,针对一些会变更的配置,如白名单配置、客服电话等或者是某些数据量很少的业务数据,如首页bannel、 /* comment truncated */ /*首页广告位等数据*/") +public class Resource implements java.io.Serializable { + //主键,自增id + @TableId(value = "id", type = IdType.AUTO) + private Long id; + //是否删除状态,1:删除,0:有效 + @ApiModelProperty(value = "是否删除状态,1:删除,0:有效", name = "isDelete") + private Integer isDelete; + //创建时间 + @ApiModelProperty(value = "创建时间", name = "gmtCreate") + private Date gmtCreate; + //最后修改时间 + @ApiModelProperty(value = "最后修改时间", name = "gmtModified") + private Date gmtModified; + //创建人 + @ApiModelProperty(value = "创建人", name = "creator") + private String creator; + //最后修改人 + @ApiModelProperty(value = "最后修改人", name = "modifier") + private String modifier; + //配置类型,S:系统配置,B:业务配置 + @ApiModelProperty(value = "配置类型,S:系统配置,B:业务配置", name = "dataType") + private String dataType; + //配置类型,即配置的KEY,用于定位配置;所有字母大写,多个字母中间用下划线“_”分割;如:用户白名单类型USER_WHITE_LIST + @ApiModelProperty(value = "配置类型,即配置的KEY,用于定位配置;所有字母大写,多个字母中间用下划线“_”分割;如:用户白名单类型USER_WHITE_LIST", name = "type") + private String type; + //类型,可针对某一类型的配置做分类 + @ApiModelProperty(value = "类型,可针对某一类型的配置做分类", name = "secType") + private String secType; + //配置类型描述,如针对TYPE=USER_WHITE_LIST该值可描述为:用户白名单列表 + @ApiModelProperty(value = "配置类型描述,如针对TYPE=USER_WHITE_LIST该值可描述为:用户白名单列表", name = "typeDesc") + private String typeDesc; + //名称 + @ApiModelProperty(value = "名称", name = "name") + private String name; + //值 + @ApiModelProperty(value = "值", name = "value") + private String value; + //描述 + @ApiModelProperty(value = "描述", name = "description") + private String description; + //扩展值1 + @ApiModelProperty(value = "扩展值1", name = "value1") + private String value1; + //扩展值2 + @ApiModelProperty(value = "扩展值2", name = "value2") + private String value2; + //扩展值3 + @ApiModelProperty(value = "扩展值3", name = "value3") + private String value3; + //扩展值4 + @ApiModelProperty(value = "扩展值4", name = "value4") + private String value4; + //排序 + @ApiModelProperty(value = "排序", name = "sort") + private Long sort; + /** + * 主键,自增id + * @return + */ + public Long getId() { + return id; + } + /** + * 主键,自增id + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * 是否删除状态,1:删除,0:有效 + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * 是否删除状态,1:删除,0:有效 + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * 创建时间 + * @return + */ + public Date getGmtCreate() { + return gmtCreate; + } + /** + * 创建时间 + * @param gmtCreate + */ + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + /** + * 最后修改时间 + * @return + */ + public Date getGmtModified() { + return gmtModified; + } + /** + * 最后修改时间 + * @param gmtModified + */ + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + /** + * 创建人 + * @return + */ + public String getCreator() { + return creator; + } + /** + * 创建人 + * @param creator + */ + public void setCreator(String creator) { + this.creator = creator; + } + + /** + * 最后修改人 + * @return + */ + public String getModifier() { + return modifier; + } + /** + * 最后修改人 + * @param modifier + */ + public void setModifier(String modifier) { + this.modifier = modifier; + } + + /** + * 配置类型,S:系统配置,B:业务配置 + * @return + */ + public String getDataType() { + return dataType; + } + /** + * 配置类型,S:系统配置,B:业务配置 + * @param dataType + */ + public void setDataType(String dataType) { + this.dataType = dataType; + } + + /** + * 配置类型,即配置的KEY,用于定位配置;所有字母大写,多个字母中间用下划线“_”分割;如:用户白名单类型USER_WHITE_LIST + * @return + */ + public String getType() { + return type; + } + /** + * 配置类型,即配置的KEY,用于定位配置;所有字母大写,多个字母中间用下划线“_”分割;如:用户白名单类型USER_WHITE_LIST + * @param type + */ + public void setType(String type) { + this.type = type; + } + + /** + * 类型,可针对某一类型的配置做分类 + * @return + */ + public String getSecType() { + return secType; + } + /** + * 类型,可针对某一类型的配置做分类 + * @param secType + */ + public void setSecType(String secType) { + this.secType = secType; + } + + /** + * 配置类型描述,如针对TYPE=USER_WHITE_LIST该值可描述为:用户白名单列表 + * @return + */ + public String getTypeDesc() { + return typeDesc; + } + /** + * 配置类型描述,如针对TYPE=USER_WHITE_LIST该值可描述为:用户白名单列表 + * @param typeDesc + */ + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + /** + * 名称 + * @return + */ + public String getName() { + return name; + } + /** + * 名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 值 + * @return + */ + public String getValue() { + return value; + } + /** + * 值 + * @param value + */ + public void setValue(String value) { + this.value = value; + } + + /** + * 描述 + * @return + */ + public String getDescription() { + return description; + } + /** + * 描述 + * @param description + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * 扩展值1 + * @return + */ + public String getValue1() { + return value1; + } + /** + * 扩展值1 + * @param value1 + */ + public void setValue1(String value1) { + this.value1 = value1; + } + + /** + * 扩展值2 + * @return + */ + public String getValue2() { + return value2; + } + /** + * 扩展值2 + * @param value2 + */ + public void setValue2(String value2) { + this.value2 = value2; + } + + /** + * 扩展值3 + * @return + */ + public String getValue3() { + return value3; + } + /** + * 扩展值3 + * @param value3 + */ + public void setValue3(String value3) { + this.value3 = value3; + } + + /** + * 扩展值4 + * @return + */ + public String getValue4() { + return value4; + } + /** + * 扩展值4 + * @param value4 + */ + public void setValue4(String value4) { + this.value4 = value4; + } + + /** + * 排序 + * @return + */ + public Long getSort() { + return sort; + } + /** + * 排序 + * @param sort + */ + public void setSort(Long sort) { + this.sort = sort; + } + + @Override + public String toString() { + return "Resource{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",gmtCreate=" + gmtCreate + + ",gmtModified=" + gmtModified + + ",creator=" + creator + + ",modifier=" + modifier + + ",dataType=" + dataType + + ",type=" + type + + ",secType=" + secType + + ",typeDesc=" + typeDesc + + ",name=" + name + + ",value=" + value + + ",description=" + description + + ",value1=" + value1 + + ",value2=" + value2 + + ",value3=" + value3 + + ",value4=" + value4 + + ",sort=" + sort + + "}"; + } +} \ No newline at end of file diff --git a/src/main/resources/mapper/sys/PrintMapper.xml b/src/main/resources/mapper/sys/PrintMapper.xml new file mode 100644 index 00000000..ad022c37 --- /dev/null +++ b/src/main/resources/mapper/sys/PrintMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, url AS url, remark AS remark, batch_no AS batchNo, status AS status, image_url AS imageUrl, is_image AS isImage, is_print AS isPrint + + + + + + + + + + insert into lz_print( + url, + remark, + batch_no, + status, + image_url, + is_image, + is_print, + is_delete, + gmt_create, + gmt_modified + )values( + #{ url}, + #{ remark}, + #{ batchNo}, + #{ status}, + #{ imageUrl}, + #{ isImage}, + #{ isPrint}, + 0, + now(), + now() + ) + + + + + update + lz_print + + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + url = #{url}, + remark = #{remark}, + batch_no = #{batchNo}, + status = #{status}, + image_url = #{imageUrl}, + is_image = #{isImage}, + is_print = #{isPrint} + + ,gmt_modified = now() + where id = #{id} + + + + + update + lz_print + set + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + url = #{url}, + remark = #{remark}, + batch_no = #{batchNo}, + status = #{status}, + image_url = #{imageUrl}, + is_image = #{isImage}, + is_print = #{isPrint} + ,gmt_modified = now() + where id = #{id} + + + + + update lz_print set is_delete = 1 where id=#{id} limit 1 + + + + diff --git a/src/main/resources/mapper/sys/ResourceMapper.xml b/src/main/resources/mapper/sys/ResourceMapper.xml new file mode 100644 index 00000000..eb1f3c28 --- /dev/null +++ b/src/main/resources/mapper/sys/ResourceMapper.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, creator AS creator, modifier AS modifier, data_type AS dataType, type AS type, sec_type AS secType, type_desc AS typeDesc, name AS name, value AS value, description AS description, value_1 AS value1, value_2 AS value2, value_3 AS value3, value_4 AS value4, sort AS sort + + + + + + + + + + insert into lz_resource( + creator, + modifier, + data_type, + type, + sec_type, + type_desc, + name, + value, + description, + value_1, + value_2, + value_3, + value_4, + sort, + is_delete, + gmt_create, + gmt_modified + )values( + #{ creator}, + #{ modifier}, + #{ dataType}, + #{ type}, + #{ secType}, + #{ typeDesc}, + #{ name}, + #{ value}, + #{ description}, + #{ value1}, + #{ value2}, + #{ value3}, + #{ value4}, + #{ sort}, + 0, + now(), + now() + ) + + + + + update + lz_resource + + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + creator = #{creator}, + modifier = #{modifier}, + data_type = #{dataType}, + type = #{type}, + sec_type = #{secType}, + type_desc = #{typeDesc}, + name = #{name}, + value = #{value}, + description = #{description}, + value_1 = #{value1}, + value_2 = #{value2}, + value_3 = #{value3}, + value_4 = #{value4}, + sort = #{sort} + + ,gmt_modified = now() + where id = #{id} + + + + + update + lz_resource + set + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + creator = #{creator}, + modifier = #{modifier}, + data_type = #{dataType}, + type = #{type}, + sec_type = #{secType}, + type_desc = #{typeDesc}, + name = #{name}, + value = #{value}, + description = #{description}, + value_1 = #{value1}, + value_2 = #{value2}, + value_3 = #{value3}, + value_4 = #{value4}, + sort = #{sort} + ,gmt_modified = now() + where id = #{id} + + + + + update lz_resource set is_delete = 1 where id=#{id} limit 1 + + + + diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 6410c7a3..00ac715c 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -84,8 +84,8 @@ public class MysqlMain { List list = new ArrayList(); - list.add(new TablesBean("lz_result_score")); - list.add(new TablesBean("lz_result_detail")); + list.add(new TablesBean("lz_resource")); + list.add(new TablesBean("lz_print")); List list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments();