feat(报表统计): 测试用例统计报表开发、测试用例趋势修改

测试用例统计报表开发,测试用例趋势报表增加保存功能
This commit is contained in:
song-tianyang 2021-09-10 16:36:27 +08:00 committed by 刘瑞斌
parent fbd163cdd4
commit 5912800ce0
19 changed files with 1311 additions and 24 deletions

View File

@ -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;
}

View File

@ -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<Criteria> oredCriteria;
public ReportStatisticsExample() {
oredCriteria = new ArrayList<Criteria>();
}
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<Criteria> 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<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> 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<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> 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<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> 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<String> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<String> 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<String> values) {
addCriterion("create_user in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotIn(List<String> 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<String> values) {
addCriterion("update_user in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotIn(List<String> 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<String> values) {
addCriterion("report_type in", values, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeNotIn(List<String> 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<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> 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<Long> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Long> 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);
}
}
}

View File

@ -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;
}

View File

@ -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<ReportStatisticsWithBLOBs> selectByExampleWithBLOBs(ReportStatisticsExample example);
List<ReportStatistics> 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);
}

View File

@ -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="io.metersphere.base.mapper.ReportStatisticsMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ReportStatistics">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
<result column="report_type" jdbcType="VARCHAR" property="reportType" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ReportStatisticsWithBLOBs">
<result column="select_option" jdbcType="LONGVARCHAR" property="selectOption" />
<result column="data_option" jdbcType="LONGVARCHAR" property="dataOption" />
</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`, project_id, create_user, update_user, report_type, create_time, update_time
</sql>
<sql id="Blob_Column_List">
select_option, data_option
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ReportStatisticsExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from report_statistics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ReportStatisticsExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from report_statistics
<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.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from report_statistics
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from report_statistics
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ReportStatisticsExample">
delete from report_statistics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ReportStatisticsWithBLOBs">
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>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ReportStatisticsWithBLOBs">
insert into report_statistics
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
`name`,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="updateUser != null">
update_user,
</if>
<if test="reportType != null">
report_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="selectOption != null">
select_option,
</if>
<if test="dataOption != null">
data_option,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="updateUser != null">
#{updateUser,jdbcType=VARCHAR},
</if>
<if test="reportType != null">
#{reportType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="selectOption != null">
#{selectOption,jdbcType=LONGVARCHAR},
</if>
<if test="dataOption != null">
#{dataOption,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.ReportStatisticsExample" resultType="java.lang.Long">
select count(*) from report_statistics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update report_statistics
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.updateUser != null">
update_user = #{record.updateUser,jdbcType=VARCHAR},
</if>
<if test="record.reportType != null">
report_type = #{record.reportType,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.selectOption != null">
select_option = #{record.selectOption,jdbcType=LONGVARCHAR},
</if>
<if test="record.dataOption != null">
data_option = #{record.dataOption,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ReportStatisticsWithBLOBs">
update report_statistics
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="updateUser != null">
update_user = #{updateUser,jdbcType=VARCHAR},
</if>
<if test="reportType != null">
report_type = #{reportType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="selectOption != null">
select_option = #{selectOption,jdbcType=LONGVARCHAR},
</if>
<if test="dataOption != null">
data_option = #{dataOption,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ReportStatisticsWithBLOBs">
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>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ReportStatistics">
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}
</update>
</mapper>

View File

@ -59,6 +59,14 @@ public class DateUtils {
return calendar.getTime(); 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 { public static void main(String[] args) throws Exception {
System.out.println("start:"); Date now = new Date();
Date paramTime = getTime(getTimeString(new Long("1607672440731"))); System.out.println(getTimeString(now));
Date afterDate = dateSum(now,-30,Calendar.DAY_OF_MONTH);
Map<String, Date> weekDate = getWeedFirstTimeAndLastTime(paramTime); System.out.println(getTimeString(afterDate));
afterDate = dateSum(now,-17,Calendar.MONTH);
for (Map.Entry<String, Date> entry : System.out.println(getTimeString(afterDate));
weekDate.entrySet()) { afterDate = dateSum(now,-20,Calendar.YEAR);
System.out.println(entry.getKey() + ":" + getTimeString(entry.getValue())+":"+entry.getValue().getTime()); System.out.println(getTimeString(afterDate));
}
long countTimeLong = new Long("1607672440731");
System.out.println(getTimeString(--countTimeLong));
} }

@ -1 +1 @@
Subproject commit 1c1f4df1be15befc8bc9fa09d969980e7cca179a Subproject commit 34ed45118000057395216122485cc10479d4fcc2

View File

@ -76,3 +76,18 @@ CREATE table if not exists `minder_extra_node` (
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE utf8mb4_general_ci; 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;

View File

@ -78,7 +78,7 @@
<table tableName="test_plan"/> <table tableName="test_plan"/>
<table tableName="test_case_test"/>--> <table tableName="test_case_test"/>-->
<!-- <table tableName="api_test_environment"></table>--> <!-- <table tableName="api_test_environment"></table>-->
<table tableName="notification"/> <table tableName="report_statistics"/>
<!-- <table tableName="custom_field"></table>--> <!-- <table tableName="custom_field"></table>-->
<!-- <table tableName="test_case"></table>--> <!-- <table tableName="test_case"></table>-->
<!-- <table tableName="test_case"></table>--> <!-- <table tableName="test_case"></table>-->

View File

@ -268,12 +268,18 @@ personal_information_personal_settings=Personal information personal settings
personal_information_apikeys=Personal information API Keys personal_information_apikeys=Personal information API Keys
auth_title=Auth auth_title=Auth
group_permission=Group group_permission=Group
test_case_status_prepare=Rrepare test_case_status_prepare=Prepare
test_case_status_running=Running test_case_status_running=Running
test_case_status_finished=Finished 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 # track home
api_case=API api_case=API
performance_case=PERFORMANCE performance_case=PERFORMANCE
scenario_case=SCENARIO scenario_case=SCENARIO
create_user=Create user
test_case_status=Case status
id_not_rightful=ID is not rightful id_not_rightful=ID is not rightful

View File

@ -274,5 +274,10 @@ test_case_status_finished=已完成
api_case=接口用例 api_case=接口用例
performance_case=性能用例 performance_case=性能用例
scenario_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 不合法 id_not_rightful=ID 不合法

View File

@ -275,5 +275,10 @@ scenario_case=場景用例
test_case_status_prepare=未開始 test_case_status_prepare=未開始
test_case_status_running=進行中 test_case_status_running=進行中
test_case_status_finished=已完成 test_case_status_finished=已完成
test_case_status_error=失敗
id_not_rightful=ID 不合法 test_case_status_success=成功
test_case_status_trash=廢棄
test_case_status_saved=已保存
create_user=創建人
test_case_status=用例狀態
id_not_rightful=ID 不合法

View File

@ -196,6 +196,9 @@
<logger name="io.metersphere.base.mapper" level="${logger.sql.level}"> <logger name="io.metersphere.base.mapper" level="${logger.sql.level}">
<appender-ref ref="console"/> <appender-ref ref="console"/>
</logger> </logger>
<logger name="io.metersphere.xpack.mapper" level="${logger.sql.level}">
<appender-ref ref="console"/>
</logger>
<logger name="io.metersphere.Application" additivity="false" level="${logger.level:INFO}"> <logger name="io.metersphere.Application" additivity="false" level="${logger.level:INFO}">
<appender-ref ref="infoAsyncAppender"/> <appender-ref ref="infoAsyncAppender"/>

View File

@ -29,7 +29,6 @@ export default {
}; };
}, },
mounted() { mounted() {
this.defaultInitOptions = this.defaultInitOptions || {}; this.defaultInitOptions = this.defaultInitOptions || {};
// svg // svg
// BUG: svg legend // BUG: svg legend

View File

@ -189,9 +189,7 @@
} else { } else {
console.log("单选:传入参数类型不匹配"); console.log("单选:传入参数类型不匹配");
return; return;
} }
} }
} }
}, },

@ -1 +1 @@
Subproject commit a9eedda56ce800f1d5313db0fb7ff398b91f6fc5 Subproject commit c5a2b1ad3e9d86dc19afeb2d2b4688d4de2ebcaf

View File

@ -259,6 +259,8 @@ export default {
title: "Report Statistics", title: "Report Statistics",
test_case_analysis: "Test case analysis", test_case_analysis: "Test case analysis",
test_case_activity: "Test case activity", test_case_activity: "Test case activity",
test_case_count: "Count test case",
test_case_count_activity: "Test case count activity",
name: "Report", name: "Report",
excel: "Excel", excel: "Excel",
add_case: "Add case", add_case: "Add case",
@ -267,9 +269,39 @@ export default {
options: "Options", options: "Options",
chart: "Chart", chart: "Chart",
line: "Line", line: "Line",
pie: "Pie",
bar: "Bar", bar: "Bar",
desc: "Desc", desc: "Desc",
asc: "Asc", 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: { license: {

View File

@ -258,8 +258,10 @@ export default {
}, },
report_statistics: { report_statistics: {
title: "报表统计", title: "报表统计",
test_case_analysis: "测试用例分析", test_case_analysis: "测试用例趋势",
test_case_activity: "测试用例活动情况", test_case_activity: "测试用例活动情况",
test_case_count: "测试用例统计",
test_case_count_activity: "测试用例统计情况",
name: "报表", name: "报表",
excel: "表格", excel: "表格",
add_case: "新增用例", add_case: "新增用例",
@ -268,9 +270,39 @@ export default {
options: "选项", options: "选项",
chart: "图表", chart: "图表",
line: "折线图", line: "折线图",
pie: "饼图",
bar: "柱状图", bar: "柱状图",
desc: "总数从高到低", desc: "总数从高到低",
asc: "总数从低到高", 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: { license: {

View File

@ -260,6 +260,8 @@ export default {
title: "報表統計", title: "報表統計",
test_case_analysis: "測試用例分析", test_case_analysis: "測試用例分析",
test_case_activity: "測試用例活動情況", test_case_activity: "測試用例活動情況",
test_case_count: "測試用例統計",
test_case_count_activity: "測試用例統計情況",
name: "報表", name: "報表",
excel: "表格", excel: "表格",
add_case: "新增用例", add_case: "新增用例",
@ -268,9 +270,39 @@ export default {
options: "選項", options: "選項",
chart: "圖表", chart: "圖表",
line: "折線圖", line: "折線圖",
pie: "餅圖",
bar: "柱狀圖", bar: "柱狀圖",
desc: "總數從高到低", desc: "總數從高到低",
asc: "總數從低到高", 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: { license: {