diff --git a/backend/src/main/java/io/metersphere/base/domain/ReportStatistics.java b/backend/src/main/java/io/metersphere/base/domain/ReportStatistics.java new file mode 100644 index 0000000000..2fb1acc13a --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ReportStatistics.java @@ -0,0 +1,25 @@ +package io.metersphere.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class ReportStatistics implements Serializable { + private String id; + + private String name; + + private String projectId; + + private String createUser; + + private String updateUser; + + private String reportType; + + private Long createTime; + + private Long updateTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ReportStatisticsExample.java b/backend/src/main/java/io/metersphere/base/domain/ReportStatisticsExample.java new file mode 100644 index 0000000000..dee4a82779 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ReportStatisticsExample.java @@ -0,0 +1,740 @@ +package io.metersphere.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class ReportStatisticsExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ReportStatisticsExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNull() { + addCriterion("project_id is null"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNotNull() { + addCriterion("project_id is not null"); + return (Criteria) this; + } + + public Criteria andProjectIdEqualTo(String value) { + addCriterion("project_id =", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotEqualTo(String value) { + addCriterion("project_id <>", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThan(String value) { + addCriterion("project_id >", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThanOrEqualTo(String value) { + addCriterion("project_id >=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThan(String value) { + addCriterion("project_id <", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThanOrEqualTo(String value) { + addCriterion("project_id <=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLike(String value) { + addCriterion("project_id like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotLike(String value) { + addCriterion("project_id not like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdIn(List values) { + addCriterion("project_id in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotIn(List values) { + addCriterion("project_id not in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdBetween(String value1, String value2) { + addCriterion("project_id between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotBetween(String value1, String value2) { + addCriterion("project_id not between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNull() { + addCriterion("create_user is null"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNotNull() { + addCriterion("create_user is not null"); + return (Criteria) this; + } + + public Criteria andCreateUserEqualTo(String value) { + addCriterion("create_user =", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotEqualTo(String value) { + addCriterion("create_user <>", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThan(String value) { + addCriterion("create_user >", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThanOrEqualTo(String value) { + addCriterion("create_user >=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThan(String value) { + addCriterion("create_user <", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThanOrEqualTo(String value) { + addCriterion("create_user <=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLike(String value) { + addCriterion("create_user like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotLike(String value) { + addCriterion("create_user not like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserIn(List values) { + addCriterion("create_user in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotIn(List values) { + addCriterion("create_user not in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserBetween(String value1, String value2) { + addCriterion("create_user between", value1, value2, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotBetween(String value1, String value2) { + addCriterion("create_user not between", value1, value2, "createUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserIsNull() { + addCriterion("update_user is null"); + return (Criteria) this; + } + + public Criteria andUpdateUserIsNotNull() { + addCriterion("update_user is not null"); + return (Criteria) this; + } + + public Criteria andUpdateUserEqualTo(String value) { + addCriterion("update_user =", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotEqualTo(String value) { + addCriterion("update_user <>", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserGreaterThan(String value) { + addCriterion("update_user >", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserGreaterThanOrEqualTo(String value) { + addCriterion("update_user >=", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserLessThan(String value) { + addCriterion("update_user <", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserLessThanOrEqualTo(String value) { + addCriterion("update_user <=", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserLike(String value) { + addCriterion("update_user like", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotLike(String value) { + addCriterion("update_user not like", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserIn(List values) { + addCriterion("update_user in", values, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotIn(List values) { + addCriterion("update_user not in", values, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserBetween(String value1, String value2) { + addCriterion("update_user between", value1, value2, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotBetween(String value1, String value2) { + addCriterion("update_user not between", value1, value2, "updateUser"); + return (Criteria) this; + } + + public Criteria andReportTypeIsNull() { + addCriterion("report_type is null"); + return (Criteria) this; + } + + public Criteria andReportTypeIsNotNull() { + addCriterion("report_type is not null"); + return (Criteria) this; + } + + public Criteria andReportTypeEqualTo(String value) { + addCriterion("report_type =", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeNotEqualTo(String value) { + addCriterion("report_type <>", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeGreaterThan(String value) { + addCriterion("report_type >", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeGreaterThanOrEqualTo(String value) { + addCriterion("report_type >=", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeLessThan(String value) { + addCriterion("report_type <", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeLessThanOrEqualTo(String value) { + addCriterion("report_type <=", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeLike(String value) { + addCriterion("report_type like", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeNotLike(String value) { + addCriterion("report_type not like", value, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeIn(List values) { + addCriterion("report_type in", values, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeNotIn(List values) { + addCriterion("report_type not in", values, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeBetween(String value1, String value2) { + addCriterion("report_type between", value1, value2, "reportType"); + return (Criteria) this; + } + + public Criteria andReportTypeNotBetween(String value1, String value2) { + addCriterion("report_type not between", value1, value2, "reportType"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Long value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Long value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Long value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Long value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Long value1, Long value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ReportStatisticsWithBLOBs.java b/backend/src/main/java/io/metersphere/base/domain/ReportStatisticsWithBLOBs.java new file mode 100644 index 0000000000..dc8e61d1f8 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ReportStatisticsWithBLOBs.java @@ -0,0 +1,17 @@ +package io.metersphere.base.domain; + +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ReportStatisticsWithBLOBs extends ReportStatistics implements Serializable { + private String selectOption; + + private String dataOption; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ReportStatisticsMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ReportStatisticsMapper.java new file mode 100644 index 0000000000..c92e93dd79 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ReportStatisticsMapper.java @@ -0,0 +1,37 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.ReportStatistics; +import io.metersphere.base.domain.ReportStatisticsExample; +import io.metersphere.base.domain.ReportStatisticsWithBLOBs; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ReportStatisticsMapper { + long countByExample(ReportStatisticsExample example); + + int deleteByExample(ReportStatisticsExample example); + + int deleteByPrimaryKey(String id); + + int insert(ReportStatisticsWithBLOBs record); + + int insertSelective(ReportStatisticsWithBLOBs record); + + List selectByExampleWithBLOBs(ReportStatisticsExample example); + + List selectByExample(ReportStatisticsExample example); + + ReportStatisticsWithBLOBs selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") ReportStatisticsWithBLOBs record, @Param("example") ReportStatisticsExample example); + + int updateByExampleWithBLOBs(@Param("record") ReportStatisticsWithBLOBs record, @Param("example") ReportStatisticsExample example); + + int updateByExample(@Param("record") ReportStatistics record, @Param("example") ReportStatisticsExample example); + + int updateByPrimaryKeySelective(ReportStatisticsWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(ReportStatisticsWithBLOBs record); + + int updateByPrimaryKey(ReportStatistics record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ReportStatisticsMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ReportStatisticsMapper.xml new file mode 100644 index 0000000000..9490a8d0b7 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ReportStatisticsMapper.xml @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, `name`, project_id, create_user, update_user, report_type, create_time, update_time + + + select_option, data_option + + + + + + delete from report_statistics + where id = #{id,jdbcType=VARCHAR} + + + delete from report_statistics + + + + + + insert into report_statistics (id, `name`, project_id, + create_user, update_user, report_type, + create_time, update_time, select_option, + data_option) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, + #{createUser,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR}, #{reportType,jdbcType=VARCHAR}, + #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{selectOption,jdbcType=LONGVARCHAR}, + #{dataOption,jdbcType=LONGVARCHAR}) + + + insert into report_statistics + + + id, + + + `name`, + + + project_id, + + + create_user, + + + update_user, + + + report_type, + + + create_time, + + + update_time, + + + select_option, + + + data_option, + + + + + #{id,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{projectId,jdbcType=VARCHAR}, + + + #{createUser,jdbcType=VARCHAR}, + + + #{updateUser,jdbcType=VARCHAR}, + + + #{reportType,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + #{selectOption,jdbcType=LONGVARCHAR}, + + + #{dataOption,jdbcType=LONGVARCHAR}, + + + + + + update report_statistics + + + id = #{record.id,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + project_id = #{record.projectId,jdbcType=VARCHAR}, + + + create_user = #{record.createUser,jdbcType=VARCHAR}, + + + update_user = #{record.updateUser,jdbcType=VARCHAR}, + + + report_type = #{record.reportType,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + select_option = #{record.selectOption,jdbcType=LONGVARCHAR}, + + + data_option = #{record.dataOption,jdbcType=LONGVARCHAR}, + + + + + + + + update report_statistics + set id = #{record.id,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + create_user = #{record.createUser,jdbcType=VARCHAR}, + update_user = #{record.updateUser,jdbcType=VARCHAR}, + report_type = #{record.reportType,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + select_option = #{record.selectOption,jdbcType=LONGVARCHAR}, + data_option = #{record.dataOption,jdbcType=LONGVARCHAR} + + + + + + update report_statistics + set id = #{record.id,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + create_user = #{record.createUser,jdbcType=VARCHAR}, + update_user = #{record.updateUser,jdbcType=VARCHAR}, + report_type = #{record.reportType,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + + + update report_statistics + + + `name` = #{name,jdbcType=VARCHAR}, + + + project_id = #{projectId,jdbcType=VARCHAR}, + + + create_user = #{createUser,jdbcType=VARCHAR}, + + + update_user = #{updateUser,jdbcType=VARCHAR}, + + + report_type = #{reportType,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + select_option = #{selectOption,jdbcType=LONGVARCHAR}, + + + data_option = #{dataOption,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=VARCHAR} + + + update report_statistics + set `name` = #{name,jdbcType=VARCHAR}, + project_id = #{projectId,jdbcType=VARCHAR}, + create_user = #{createUser,jdbcType=VARCHAR}, + update_user = #{updateUser,jdbcType=VARCHAR}, + report_type = #{reportType,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT}, + select_option = #{selectOption,jdbcType=LONGVARCHAR}, + data_option = #{dataOption,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + update report_statistics + set `name` = #{name,jdbcType=VARCHAR}, + project_id = #{projectId,jdbcType=VARCHAR}, + create_user = #{createUser,jdbcType=VARCHAR}, + update_user = #{updateUser,jdbcType=VARCHAR}, + report_type = #{reportType,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/commons/utils/DateUtils.java b/backend/src/main/java/io/metersphere/commons/utils/DateUtils.java index 62c0af9290..6e6a85d334 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/DateUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/DateUtils.java @@ -59,6 +59,14 @@ public class DateUtils { return calendar.getTime(); } + public static Date dateSum (Date date,int countUnit,int calendarType){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(calendarType,countUnit); + + return calendar.getTime(); + } + /** * 获取入参日期所在周的周一周末日期。 日期对应的时间为当日的零点 * @@ -100,19 +108,14 @@ public class DateUtils { public static void main(String[] args) throws Exception { - System.out.println("start:"); - Date paramTime = getTime(getTimeString(new Long("1607672440731"))); - - Map weekDate = getWeedFirstTimeAndLastTime(paramTime); - - for (Map.Entry entry : - weekDate.entrySet()) { - System.out.println(entry.getKey() + ":" + getTimeString(entry.getValue())+":"+entry.getValue().getTime()); - } - - long countTimeLong = new Long("1607672440731"); - - System.out.println(getTimeString(--countTimeLong)); + Date now = new Date(); + System.out.println(getTimeString(now)); + Date afterDate = dateSum(now,-30,Calendar.DAY_OF_MONTH); + System.out.println(getTimeString(afterDate)); + afterDate = dateSum(now,-17,Calendar.MONTH); + System.out.println(getTimeString(afterDate)); + afterDate = dateSum(now,-20,Calendar.YEAR); + System.out.println(getTimeString(afterDate)); } diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 1c1f4df1be..34ed451180 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 1c1f4df1be15befc8bc9fa09d969980e7cca179a +Subproject commit 34ed45118000057395216122485cc10479d4fcc2 diff --git a/backend/src/main/resources/db/migration/V95__v1.13_release.sql b/backend/src/main/resources/db/migration/V95__v1.13_release.sql index 4606080693..220459202d 100644 --- a/backend/src/main/resources/db/migration/V95__v1.13_release.sql +++ b/backend/src/main/resources/db/migration/V95__v1.13_release.sql @@ -76,3 +76,18 @@ CREATE table if not exists `minder_extra_node` ( ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE utf8mb4_general_ci; + +CREATE TABLE IF NOT EXISTS `report_statistics` +( + `id` varchar(50) NOT NULL, + `name` varchar(50) DEFAULT NULL, + `project_id` varchar(50) DEFAULT NULL COMMENT 'Test plan ID', + `create_user` varchar(64) DEFAULT NULL COMMENT 'create user', + `update_user` varchar(64) DEFAULT NULL COMMENT 'create user', + `select_option` longtext COMMENT 'select option (JSON format)', + `data_option` longtext COMMENT 'data option (JSON format)', + `report_type` varchar(50) NOT NULL, + `create_time` bigint(13) DEFAULT NULL, + `update_time` bigint(13) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE utf8mb4_general_ci; diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index 2ee3199724..53b716a52a 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -78,7 +78,7 @@
--> -
+
diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index 9104f87d65..34ea53303e 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -268,12 +268,18 @@ personal_information_personal_settings=Personal information personal settings personal_information_apikeys=Personal information API Keys auth_title=Auth group_permission=Group -test_case_status_prepare=Rrepare +test_case_status_prepare=Prepare test_case_status_running=Running test_case_status_finished=Finished +test_case_status_error=Error +test_case_status_success=Success +test_case_status_trash=Trash +test_case_status_saved=Saved # track home api_case=API performance_case=PERFORMANCE scenario_case=SCENARIO +create_user=Create user +test_case_status=Case status id_not_rightful=ID is not rightful \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 88a3ac1e21..6ef4e372de 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -274,5 +274,10 @@ test_case_status_finished=已完成 api_case=接口用例 performance_case=性能用例 scenario_case=场景用例 - +test_case_status_error=失败 +test_case_status_success=成功 +test_case_status_trash=废弃 +test_case_status_saved=已保存 +create_user=创建人 +test_case_status=用例状态 id_not_rightful=ID 不合法 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index a3bb77efa6..b6bf20c02e 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -275,5 +275,10 @@ scenario_case=場景用例 test_case_status_prepare=未開始 test_case_status_running=進行中 test_case_status_finished=已完成 - -id_not_rightful=ID 不合法 \ No newline at end of file +test_case_status_error=失敗 +test_case_status_success=成功 +test_case_status_trash=廢棄 +test_case_status_saved=已保存 +create_user=創建人 +test_case_status=用例狀態 +id_not_rightful=ID 不合法 diff --git a/backend/src/main/resources/logback.xml b/backend/src/main/resources/logback.xml index f431d64f3c..c1c231883d 100644 --- a/backend/src/main/resources/logback.xml +++ b/backend/src/main/resources/logback.xml @@ -196,6 +196,9 @@ + + + diff --git a/frontend/src/business/components/common/chart/MsChart.vue b/frontend/src/business/components/common/chart/MsChart.vue index 9724ee0180..2922c757df 100644 --- a/frontend/src/business/components/common/chart/MsChart.vue +++ b/frontend/src/business/components/common/chart/MsChart.vue @@ -29,7 +29,6 @@ export default { }; }, mounted() { - this.defaultInitOptions = this.defaultInitOptions || {}; // 默认渲染svg // BUG: 渲染svg之后 图上的legend 太多会不显示 diff --git a/frontend/src/business/components/common/select-tree/SelectTree.vue b/frontend/src/business/components/common/select-tree/SelectTree.vue index 00c2eeff1c..0921c4c590 100644 --- a/frontend/src/business/components/common/select-tree/SelectTree.vue +++ b/frontend/src/business/components/common/select-tree/SelectTree.vue @@ -189,9 +189,7 @@ } else { console.log("单选:传入参数类型不匹配"); return; - } - } } }, diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index a9eedda56c..c5a2b1ad3e 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit a9eedda56ce800f1d5313db0fb7ff398b91f6fc5 +Subproject commit c5a2b1ad3e9d86dc19afeb2d2b4688d4de2ebcaf diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 7608b60ffb..5ab985b87d 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -259,6 +259,8 @@ export default { title: "Report Statistics", test_case_analysis: "Test case analysis", test_case_activity: "Test case activity", + test_case_count: "Count test case", + test_case_count_activity: "Test case count activity", name: "Report", excel: "Excel", add_case: "Add case", @@ -267,9 +269,39 @@ export default { options: "Options", chart: "Chart", line: "Line", + pie: "Pie", bar: "Bar", desc: "Desc", asc: "Asc", + report_data: { + all_report: "All report", + my_report: "My report", + }, + report_filter: { + xaxis: "X-axis", + yaxis: "Y-axis", + recently: "Before", + more_options: "More", + belone: "In", + select_options: { + case_type: "Case type", + creator: "Create user", + maintainer: "Maintainer", + case_status: "Case status", + case_level: "Case level", + }, + time_options: { + fixed_time: "Fixed time", + dynamic_time: "Dynamic time", + day: "Day", + month: "Month", + year: "Year", + } + }, + alert: { + cannot_add_more_options: "Cannot add more options", + end_time_cannot_over_than_start_time: "End time cannot before than start time", + }, } }, license: { diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index ba571763d4..04b44c4563 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -258,8 +258,10 @@ export default { }, report_statistics: { title: "报表统计", - test_case_analysis: "测试用例分析", + test_case_analysis: "测试用例趋势", test_case_activity: "测试用例活动情况", + test_case_count: "测试用例统计", + test_case_count_activity: "测试用例统计情况", name: "报表", excel: "表格", add_case: "新增用例", @@ -268,9 +270,39 @@ export default { options: "选项", chart: "图表", line: "折线图", + pie: "饼图", bar: "柱状图", desc: "总数从高到低", asc: "总数从低到高", + report_data: { + all_report: "全部报表", + my_report: "我的报表", + }, + report_filter: { + xaxis: "水平轴系列", + yaxis: "纵向轴系列", + recently: "最近", + more_options: "更多选项", + belone: "属于", + select_options: { + case_type: "用例类型", + creator: "创建人", + maintainer: "维护人", + case_status: "用例状态", + case_level: "用例等级", + }, + time_options: { + fixed_time: "固定时间", + dynamic_time: "动态时间", + day: "天", + month: "月", + year: "年", + } + }, + alert: { + cannot_add_more_options: "无法添加更多条件", + end_time_cannot_over_than_start_time: "结束时间不能超过当前时间", + }, } }, license: { diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index a61e265aa8..f340584839 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -260,6 +260,8 @@ export default { title: "報表統計", test_case_analysis: "測試用例分析", test_case_activity: "測試用例活動情況", + test_case_count: "測試用例統計", + test_case_count_activity: "測試用例統計情況", name: "報表", excel: "表格", add_case: "新增用例", @@ -268,9 +270,39 @@ export default { options: "選項", chart: "圖表", line: "折線圖", + pie: "餅圖", bar: "柱狀圖", desc: "總數從高到低", asc: "總數從低到高", + report_data: { + all_report: "全部報表", + my_report: "我的報表", + }, + report_filter: { + xaxis: "水平軸系列", + yaxis: "縱向軸系列", + recently: "最近", + more_options: "更多選項", + belone: "屬於", + select_options: { + case_type: "用例類型", + creator: "創建人", + maintainer: "維護人", + case_status: "用例狀態", + case_level: "用例等級", + }, + time_options: { + fixed_time: "固定時間", + dynamic_time: "動態時間", + day: "天", + month: "月", + year: "年", + } + }, + alert: { + cannot_add_more_options: "無法添加更多條件", + end_time_cannot_over_than_start_time: "結束時間不能超過當前時間", + }, } }, license: {