提交 4ec3cdb6 authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' into pr@dev@sqlserver

......@@ -4,9 +4,9 @@ ARG IMAGE_TAG
RUN mkdir -p /opt/apps
ADD backend/target/backend-1.0.0.jar /opt/apps
ADD backend/target/backend-$IMAGE_TAG.jar /opt/apps
ENV JAVA_APP_JAR=/opt/apps/backend-1.0.0.jar
ENV JAVA_APP_JAR=/opt/apps/backend-$IMAGE_TAG.jar
ENV AB_OFF=true
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>dataease-server</artifactId>
<groupId>io.dataease</groupId>
<version>1.0.0</version>
<version>1.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -341,7 +341,7 @@
<dependency>
<groupId>io.dataease</groupId>
<artifactId>dataease-plugin-interface</artifactId>
<version>1.0</version>
<version>1.2</version>
</dependency>
<dependency>
......@@ -384,7 +384,7 @@
<includes>
<include>**/*</include>
</includes>
<filtering>true</filtering>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
......@@ -414,11 +414,11 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</plugin>
</plugin>-->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
......
......@@ -21,6 +21,8 @@ public class ChartViewWithBLOBs extends ChartView implements Serializable {
private String customFilter;
private String drillFields;
private String snapshot;
private static final long serialVersionUID = 1L;
......
package io.dataease.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class PanelViewLinkage implements Serializable {
private String id;
private String panelId;
private String sourceViewId;
private String targetViewId;
private Long updateTime;
private String updatePeople;
private String ext1;
private String ext2;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package io.dataease.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class PanelViewLinkageField implements Serializable {
private String id;
private String linkageId;
private String sourceFiled;
private String targetFiled;
private Long updateTime;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -20,6 +20,7 @@
<result column="custom_attr" jdbcType="LONGVARCHAR" property="customAttr" />
<result column="custom_style" jdbcType="LONGVARCHAR" property="customStyle" />
<result column="custom_filter" jdbcType="LONGVARCHAR" property="customFilter" />
<result column="drill_fields" jdbcType="LONGVARCHAR" property="drillFields" />
<result column="snapshot" jdbcType="LONGVARCHAR" property="snapshot" />
</resultMap>
<sql id="Example_Where_Clause">
......@@ -85,7 +86,8 @@
style_priority
</sql>
<sql id="Blob_Column_List">
x_axis, y_axis, ext_stack, custom_attr, custom_style, custom_filter, snapshot
x_axis, y_axis, ext_stack, custom_attr, custom_style, custom_filter, drill_fields,
snapshot
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.dataease.base.domain.ChartViewExample" resultMap="ResultMapWithBLOBs">
select
......@@ -141,13 +143,15 @@
create_by, create_time, update_time,
style_priority, x_axis, y_axis,
ext_stack, custom_attr, custom_style,
custom_filter, snapshot)
custom_filter, drill_fields, snapshot
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sceneId,jdbcType=VARCHAR},
#{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{stylePriority,jdbcType=VARCHAR}, #{xAxis,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR},
#{extStack,jdbcType=LONGVARCHAR}, #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR},
#{customFilter,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR})
#{customFilter,jdbcType=LONGVARCHAR}, #{drillFields,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.ChartViewWithBLOBs">
insert into chart_view
......@@ -200,6 +204,9 @@
<if test="customFilter != null">
custom_filter,
</if>
<if test="drillFields != null">
drill_fields,
</if>
<if test="snapshot != null">
snapshot,
</if>
......@@ -253,6 +260,9 @@
<if test="customFilter != null">
#{customFilter,jdbcType=LONGVARCHAR},
</if>
<if test="drillFields != null">
#{drillFields,jdbcType=LONGVARCHAR},
</if>
<if test="snapshot != null">
#{snapshot,jdbcType=LONGVARCHAR},
</if>
......@@ -315,6 +325,9 @@
<if test="record.customFilter != null">
custom_filter = #{record.customFilter,jdbcType=LONGVARCHAR},
</if>
<if test="record.drillFields != null">
drill_fields = #{record.drillFields,jdbcType=LONGVARCHAR},
</if>
<if test="record.snapshot != null">
snapshot = #{record.snapshot,jdbcType=LONGVARCHAR},
</if>
......@@ -341,6 +354,7 @@
custom_attr = #{record.customAttr,jdbcType=LONGVARCHAR},
custom_style = #{record.customStyle,jdbcType=LONGVARCHAR},
custom_filter = #{record.customFilter,jdbcType=LONGVARCHAR},
drill_fields = #{record.drillFields,jdbcType=LONGVARCHAR},
snapshot = #{record.snapshot,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -410,6 +424,9 @@
<if test="customFilter != null">
custom_filter = #{customFilter,jdbcType=LONGVARCHAR},
</if>
<if test="drillFields != null">
drill_fields = #{drillFields,jdbcType=LONGVARCHAR},
</if>
<if test="snapshot != null">
snapshot = #{snapshot,jdbcType=LONGVARCHAR},
</if>
......@@ -433,6 +450,7 @@
custom_attr = #{customAttr,jdbcType=LONGVARCHAR},
custom_style = #{customStyle,jdbcType=LONGVARCHAR},
custom_filter = #{customFilter,jdbcType=LONGVARCHAR},
drill_fields = #{drillFields,jdbcType=LONGVARCHAR},
snapshot = #{snapshot,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
......
package io.dataease.base.mapper;
import io.dataease.base.domain.PanelViewLinkageField;
import io.dataease.base.domain.PanelViewLinkageFieldExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PanelViewLinkageFieldMapper {
long countByExample(PanelViewLinkageFieldExample example);
int deleteByExample(PanelViewLinkageFieldExample example);
int deleteByPrimaryKey(String id);
int insert(PanelViewLinkageField record);
int insertSelective(PanelViewLinkageField record);
List<PanelViewLinkageField> selectByExample(PanelViewLinkageFieldExample example);
PanelViewLinkageField selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") PanelViewLinkageField record, @Param("example") PanelViewLinkageFieldExample example);
int updateByExample(@Param("record") PanelViewLinkageField record, @Param("example") PanelViewLinkageFieldExample example);
int updateByPrimaryKeySelective(PanelViewLinkageField record);
int updateByPrimaryKey(PanelViewLinkageField record);
}
\ No newline at end of file
<?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.dataease.base.mapper.PanelViewLinkageFieldMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.PanelViewLinkageField">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="linkage_id" jdbcType="VARCHAR" property="linkageId" />
<result column="source_filed" jdbcType="VARCHAR" property="sourceFiled" />
<result column="target_filed" jdbcType="VARCHAR" property="targetFiled" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</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, linkage_id, source_filed, target_filed, update_time
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.PanelViewLinkageFieldExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from panel_view_linkage_field
<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="BaseResultMap">
select
<include refid="Base_Column_List" />
from panel_view_linkage_field
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from panel_view_linkage_field
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.PanelViewLinkageFieldExample">
delete from panel_view_linkage_field
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.PanelViewLinkageField">
insert into panel_view_linkage_field (id, linkage_id, source_filed,
target_filed, update_time)
values (#{id,jdbcType=VARCHAR}, #{linkageId,jdbcType=VARCHAR}, #{sourceFiled,jdbcType=VARCHAR},
#{targetFiled,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.PanelViewLinkageField">
insert into panel_view_linkage_field
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="linkageId != null">
linkage_id,
</if>
<if test="sourceFiled != null">
source_filed,
</if>
<if test="targetFiled != null">
target_filed,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="linkageId != null">
#{linkageId,jdbcType=VARCHAR},
</if>
<if test="sourceFiled != null">
#{sourceFiled,jdbcType=VARCHAR},
</if>
<if test="targetFiled != null">
#{targetFiled,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.PanelViewLinkageFieldExample" resultType="java.lang.Long">
select count(*) from panel_view_linkage_field
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update panel_view_linkage_field
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.linkageId != null">
linkage_id = #{record.linkageId,jdbcType=VARCHAR},
</if>
<if test="record.sourceFiled != null">
source_filed = #{record.sourceFiled,jdbcType=VARCHAR},
</if>
<if test="record.targetFiled != null">
target_filed = #{record.targetFiled,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update panel_view_linkage_field
set id = #{record.id,jdbcType=VARCHAR},
linkage_id = #{record.linkageId,jdbcType=VARCHAR},
source_filed = #{record.sourceFiled,jdbcType=VARCHAR},
target_filed = #{record.targetFiled,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.PanelViewLinkageField">
update panel_view_linkage_field
<set>
<if test="linkageId != null">
linkage_id = #{linkageId,jdbcType=VARCHAR},
</if>
<if test="sourceFiled != null">
source_filed = #{sourceFiled,jdbcType=VARCHAR},
</if>
<if test="targetFiled != null">
target_filed = #{targetFiled,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.PanelViewLinkageField">
update panel_view_linkage_field
set linkage_id = #{linkageId,jdbcType=VARCHAR},
source_filed = #{sourceFiled,jdbcType=VARCHAR},
target_filed = #{targetFiled,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
package io.dataease.base.mapper;
import io.dataease.base.domain.PanelViewLinkage;
import io.dataease.base.domain.PanelViewLinkageExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PanelViewLinkageMapper {
long countByExample(PanelViewLinkageExample example);
int deleteByExample(PanelViewLinkageExample example);
int deleteByPrimaryKey(String id);
int insert(PanelViewLinkage record);
int insertSelective(PanelViewLinkage record);
List<PanelViewLinkage> selectByExample(PanelViewLinkageExample example);
PanelViewLinkage selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") PanelViewLinkage record, @Param("example") PanelViewLinkageExample example);
int updateByExample(@Param("record") PanelViewLinkage record, @Param("example") PanelViewLinkageExample example);
int updateByPrimaryKeySelective(PanelViewLinkage record);
int updateByPrimaryKey(PanelViewLinkage record);
}
\ No newline at end of file
<?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.dataease.base.mapper.PanelViewLinkageMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.PanelViewLinkage">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="panel_id" jdbcType="VARCHAR" property="panelId" />
<result column="source_view_id" jdbcType="VARCHAR" property="sourceViewId" />
<result column="target_view_id" jdbcType="VARCHAR" property="targetViewId" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="update_people" jdbcType="VARCHAR" property="updatePeople" />
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
</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, panel_id, source_view_id, target_view_id, update_time, update_people, ext1, ext2
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.PanelViewLinkageExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from panel_view_linkage
<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="BaseResultMap">
select
<include refid="Base_Column_List" />
from panel_view_linkage
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from panel_view_linkage
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.PanelViewLinkageExample">
delete from panel_view_linkage
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.PanelViewLinkage">
insert into panel_view_linkage (id, panel_id, source_view_id,
target_view_id, update_time, update_people,
ext1, ext2)
values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{sourceViewId,jdbcType=VARCHAR},
#{targetViewId,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{updatePeople,jdbcType=VARCHAR},
#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.PanelViewLinkage">
insert into panel_view_linkage
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="panelId != null">
panel_id,
</if>
<if test="sourceViewId != null">
source_view_id,
</if>
<if test="targetViewId != null">
target_view_id,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="updatePeople != null">
update_people,
</if>
<if test="ext1 != null">
ext1,
</if>
<if test="ext2 != null">
ext2,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="panelId != null">
#{panelId,jdbcType=VARCHAR},
</if>
<if test="sourceViewId != null">
#{sourceViewId,jdbcType=VARCHAR},
</if>
<if test="targetViewId != null">
#{targetViewId,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="updatePeople != null">
#{updatePeople,jdbcType=VARCHAR},
</if>
<if test="ext1 != null">
#{ext1,jdbcType=VARCHAR},
</if>
<if test="ext2 != null">
#{ext2,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.PanelViewLinkageExample" resultType="java.lang.Long">
select count(*) from panel_view_linkage
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update panel_view_linkage
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.panelId != null">
panel_id = #{record.panelId,jdbcType=VARCHAR},
</if>
<if test="record.sourceViewId != null">
source_view_id = #{record.sourceViewId,jdbcType=VARCHAR},
</if>
<if test="record.targetViewId != null">
target_view_id = #{record.targetViewId,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.updatePeople != null">
update_people = #{record.updatePeople,jdbcType=VARCHAR},
</if>
<if test="record.ext1 != null">
ext1 = #{record.ext1,jdbcType=VARCHAR},
</if>
<if test="record.ext2 != null">
ext2 = #{record.ext2,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update panel_view_linkage
set id = #{record.id,jdbcType=VARCHAR},
panel_id = #{record.panelId,jdbcType=VARCHAR},
source_view_id = #{record.sourceViewId,jdbcType=VARCHAR},
target_view_id = #{record.targetViewId,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=BIGINT},
update_people = #{record.updatePeople,jdbcType=VARCHAR},
ext1 = #{record.ext1,jdbcType=VARCHAR},
ext2 = #{record.ext2,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.PanelViewLinkage">
update panel_view_linkage
<set>
<if test="panelId != null">
panel_id = #{panelId,jdbcType=VARCHAR},
</if>
<if test="sourceViewId != null">
source_view_id = #{sourceViewId,jdbcType=VARCHAR},
</if>
<if test="targetViewId != null">
target_view_id = #{targetViewId,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="updatePeople != null">
update_people = #{updatePeople,jdbcType=VARCHAR},
</if>
<if test="ext1 != null">
ext1 = #{ext1,jdbcType=VARCHAR},
</if>
<if test="ext2 != null">
ext2 = #{ext2,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.PanelViewLinkage">
update panel_view_linkage
set panel_id = #{panelId,jdbcType=VARCHAR},
source_view_id = #{sourceViewId,jdbcType=VARCHAR},
target_view_id = #{targetViewId,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT},
update_people = #{updatePeople,jdbcType=VARCHAR},
ext1 = #{ext1,jdbcType=VARCHAR},
ext2 = #{ext2,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
package io.dataease.base.mapper.ext;
import io.dataease.base.domain.DatasetTableField;
import io.dataease.dto.PanelViewLinkageDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtPanelViewLinkageMapper {
List<PanelViewLinkageDTO> getViewLinkageGather(@Param("panelId") String panelId,@Param("sourceViewId") String sourceViewId,@Param("targetViewIds") List<String> targetViewIds);
List<DatasetTableField> queryTableField(@Param("tableId") String tableId);
}
<?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.dataease.base.mapper.ext.ExtPanelViewLinkageMapper">
<resultMap id="TableFieldMap" type="io.dataease.base.domain.DatasetTableField">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="table_id" jdbcType="VARCHAR" property="tableId"/>
<result column="origin_name" jdbcType="VARCHAR" property="originName"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="de_type" jdbcType="INTEGER" property="deType"/>
</resultMap>
<resultMap id="LinkageGatherMap" type="io.dataease.dto.PanelViewLinkageDTO">
<result column="target_view_id" jdbcType="VARCHAR" property="targetViewId"/>
<result column="table_id" jdbcType="VARCHAR" property="tableId"/>
<result column="targetViewName" jdbcType="VARCHAR" property="targetViewName"/>
<result column="linkageActive" property="linkageActive"/>
<!-- <collection property="targetViewFields" ofType="io.dataease.base.domain.DatasetTableField" column="table_id"-->
<!-- select="queryTableField">-->
<!-- </collection>-->
<collection property="linkageFields" ofType="io.dataease.dto.PanelViewLinkageFieldDTO">
<result column="source_filed" jdbcType="VARCHAR" property="sourceFiled"/>
<result column="target_filed" jdbcType="VARCHAR" property="targetFiled"/>
</collection>
</resultMap>
<select id="getViewLinkageGather" resultMap="LinkageGatherMap">
SELECT
chart_view.`name` as 'targetViewName',
chart_view.id as 'target_view_id',
chart_view.table_id,
(case when panel_view_linkage.target_view_id is null then 0 else 1 end) as 'linkageActive',
panel_view_linkage_field.source_filed,
panel_view_linkage_field.target_filed
FROM
chart_view
LEFT JOIN panel_view_linkage ON chart_view.id = panel_view_linkage.target_view_id
LEFT JOIN panel_view_linkage_field ON panel_view_linkage.id = panel_view_linkage_field.linkage_id
AND panel_view_linkage.panel_id = #{panelId}
AND panel_view_linkage.source_view_id = #{sourceViewId}
where chart_view.id in
<foreach collection="targetViewIds" item="targetViewId" index="index" open="(" close=")" separator=",">
#{targetViewId}
</foreach>
</select>
<select id="queryTableField" resultMap="TableFieldMap">
select
dataset_table_field.id,
dataset_table_field.table_id,
dataset_table_field.origin_name,
dataset_table_field.name,
dataset_table_field.de_type
from dataset_table_field where table_id = #{tableId}
</select>
</mapper>
package io.dataease.commons.filter;
import io.dataease.commons.holder.ThreadLocalContextHolder;
import io.dataease.commons.wrapper.XssAndSqlHttpServletRequestWrapper;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
public class SqlFilter implements Filter {
@Override
public void destroy() {
// TODO Auto-generated method stub
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
String method = "GET";
String param = "";
XssAndSqlHttpServletRequestWrapper xssRequest = null;
if (request instanceof HttpServletRequest) {
method = ((HttpServletRequest) request).getMethod();
xssRequest = new XssAndSqlHttpServletRequestWrapper((HttpServletRequest) request);
}
if ("POST".equalsIgnoreCase(method)) {
param = this.getBodyString(xssRequest.getReader());
if(StringUtils.isNotBlank(param)){
if(xssRequest.checkXSSAndSql(param)){
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=UTF-8");
PrintWriter out = response.getWriter();
String msg = ThreadLocalContextHolder.getData().toString();
out.write(msg);
return;
}
}
}
if (xssRequest.checkParameter()) {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=UTF-8");
PrintWriter out = response.getWriter();
String msg = ThreadLocalContextHolder.getData().toString();
out.write(msg);
return;
}
chain.doFilter(xssRequest, response);
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
// 获取request请求body中参数
public static String getBodyString(BufferedReader br) {
String inputLine;
String str = "";
try {
while ((inputLine = br.readLine()) != null) {
str += inputLine;
}
br.close();
} catch (IOException e) {
System.out.println("IOException: " + e);
}
return str;
}
}
package io.dataease.commons.holder;
public class ThreadLocalContextHolder {
private static ThreadLocal<Object> sceneThreadLocal = new ThreadLocal<>();
public static Object getData() {
return sceneThreadLocal.get();
}
public static void setData(Object data) {
if (ThreadLocalContextHolder.sceneThreadLocal == null) {
ThreadLocalContextHolder.sceneThreadLocal = new ThreadLocal<>();
}
ThreadLocalContextHolder.sceneThreadLocal.set(data);
}
public static void clearScene() {
setData(null);
}
}
package io.dataease.config;
import io.dataease.commons.filter.SqlFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class FilterConfig {
@Bean
public FilterRegistrationBean registration(){
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
filterRegistrationBean.setFilter(new SqlFilter());//实例化Filter类
filterRegistrationBean.addUrlPatterns("/*");//设置匹配模式,这里设置为所有,可以按需求设置为"/hello"等等
filterRegistrationBean.setName("SqlFilter");//设置过滤器名称
filterRegistrationBean.setOrder(1);//设置执行顺序
return filterRegistrationBean;
}
}
package io.dataease.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Value("${geo.rootpath:file:/opt/dataease/data/feature/full/}")
private String geoPath;
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/geo/**").addResourceLocations(geoPath);
}
}
......@@ -66,7 +66,7 @@ public class DataSetTableTaskController {
@ApiOperation("更新状态")
@PostMapping("/updateStatus")
public void updateStatus(@RequestBody DatasetTableTask datasetTableTask) {
public void updateStatus(@RequestBody DatasetTableTask datasetTableTask) throws Exception{
dataSetTableTaskService.updateDatasetTableTaskStatus(datasetTableTask);
}
......
package io.dataease.controller.panel;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.controller.request.panel.PanelLinkageRequest;
import io.dataease.service.panel.PanelViewLinkageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Map;
/**
* Author: wangjiahao
* Date: 8/4/21
* Description:
*/
@Api(tags = "仪表板:视图联动")
@ApiSupport(order = 171)
@RestController
@RequestMapping("linkage")
public class PanelViewLinkageController {
@Resource
private PanelViewLinkageService panelViewLinkageService;
@ApiOperation("获取仪表板视图联动信息")
@PostMapping("/getViewLinkageGather")
public Map getViewLinkageGather(@RequestBody PanelLinkageRequest request){
return panelViewLinkageService.getViewLinkageGather(request);
}
}
package io.dataease.controller.request.panel;
import java.util.List;
/**
* Author: wangjiahao
* Date: 8/4/21
* Description:
*/
public class PanelLinkageRequest {
private String panelId;
private String sourceViewId;
private List<String> targetViewIds;
public String getPanelId() {
return panelId;
}
public void setPanelId(String panelId) {
this.panelId = panelId;
}
public String getSourceViewId() {
return sourceViewId;
}
public void setSourceViewId(String sourceViewId) {
this.sourceViewId = sourceViewId;
}
public List<String> getTargetViewIds() {
return targetViewIds;
}
public void setTargetViewIds(List<String> targetViewIds) {
this.targetViewIds = targetViewIds;
}
}
package io.dataease.dto;
import io.dataease.base.domain.DatasetTableField;
import io.dataease.base.domain.PanelViewLinkage;
import java.util.ArrayList;
import java.util.List;
/**
* Author: wangjiahao
* Date: 8/4/21
* Description:
*/
public class PanelViewLinkageDTO extends PanelViewLinkage {
//目标视图名称
private String targetViewName;
//关联状态
private boolean linkageActive = false;
private List<PanelViewLinkageFieldDTO> linkageFields = new ArrayList<>();
private List<DatasetTableField> targetViewFields = new ArrayList<>();
private String tableId;
public PanelViewLinkageDTO() {
}
public String getTableId() {
return tableId;
}
public void setTableId(String tableId) {
this.tableId = tableId;
}
public List<DatasetTableField> getTargetViewFields() {
return targetViewFields;
}
public void setTargetViewFields(List<DatasetTableField> targetViewFields) {
this.targetViewFields = targetViewFields;
}
public String getTargetViewName() {
return targetViewName;
}
public void setTargetViewName(String targetViewName) {
this.targetViewName = targetViewName;
}
public PanelViewLinkageDTO(boolean linkageActive) {
this.linkageActive = linkageActive;
}
public boolean isLinkageActive() {
return linkageActive;
}
public void setLinkageActive(boolean linkageActive) {
this.linkageActive = linkageActive;
}
public List<PanelViewLinkageFieldDTO> getLinkageFields() {
return linkageFields;
}
public void setLinkageFields(List<PanelViewLinkageFieldDTO> linkageFields) {
this.linkageFields = linkageFields;
}
}
package io.dataease.dto;
import io.dataease.base.domain.PanelViewLinkageField;
/**
* Author: wangjiahao
* Date: 8/4/21
* Description:
*/
public class PanelViewLinkageFieldDTO extends PanelViewLinkageField {
private String sourceViewId;
private String targetViewId;
public String getSourceViewId() {
return sourceViewId;
}
public void setSourceViewId(String sourceViewId) {
this.sourceViewId = sourceViewId;
}
public String getTargetViewId() {
return targetViewId;
}
public void setTargetViewId(String targetViewId) {
this.targetViewId = targetViewId;
}
}
......@@ -494,7 +494,12 @@ public class ChartViewService {
}
}
if (StringUtils.equals(a.toString(), x.get(i))) {
ss.getData().set(i, new BigDecimal(row[xAxis.size() + extStack.size()]));
if (row.length > xAxis.size() + extStack.size()) {
String s = row[xAxis.size() + extStack.size()];
if (StringUtils.isNotEmpty(s)) {
ss.getData().set(i, new BigDecimal(s));
}
}
break;
}
}
......
......@@ -4,7 +4,6 @@ import io.dataease.base.domain.*;
import io.dataease.base.mapper.DatasetTableMapper;
import io.dataease.base.mapper.DatasetTableTaskMapper;
import io.dataease.base.mapper.ext.ExtDataSetTaskMapper;
import io.dataease.base.mapper.ext.UtilMapper;
import io.dataease.base.mapper.ext.query.GridExample;
import io.dataease.commons.constants.JobStatus;
import io.dataease.commons.constants.ScheduleType;
......@@ -52,8 +51,6 @@ public class DataSetTableTaskService {
private ExtDataSetTaskMapper extDataSetTaskMapper;
@Resource
private DatasetTableMapper datasetTableMapper;
@Resource
private UtilMapper utilMapper;
public DatasetTableTask save(DataSetTaskRequest dataSetTaskRequest) throws Exception {
checkName(dataSetTaskRequest);
......@@ -95,12 +92,15 @@ public class DataSetTableTaskService {
datasetTableTaskMapper.updateByPrimaryKeySelective(datasetTableTask);
}
scheduleService.addSchedule(datasetTableTask);
// simple
if (datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())) { // SIMPLE 类型,提前占位
execNow(datasetTableTask);
}else {
checkTaskIsStopped(datasetTableTask);
}
scheduleService.addSchedule(datasetTableTask);
checkTaskIsStopped(datasetTableTask);
return datasetTableTask;
}
......@@ -281,7 +281,13 @@ public class DataSetTableTaskService {
}
}
public void updateDatasetTableTaskStatus(DatasetTableTask datasetTableTask){
public void updateDatasetTableTaskStatus(DatasetTableTask datasetTableTask)throws Exception{
DatasetTableTask dbDatasetTableTask = datasetTableTaskMapper.selectByPrimaryKey(datasetTableTask.getId());
if(dbDatasetTableTask.getStatus().equalsIgnoreCase(TaskStatus.Exec.name()) || dbDatasetTableTask.getStatus().equals(TaskStatus.Stopped.name())){
throw new Exception(Translator.get("i18n_change_task_status_error") + Translator.get("i18n_" + dbDatasetTableTask.getStatus()));
}
DatasetTableTaskExample datasetTableTaskExample = new DatasetTableTaskExample();
DatasetTableTaskExample.Criteria criteria = datasetTableTaskExample.createCriteria();
criteria.andIdEqualTo(datasetTableTask.getId());
......
......@@ -283,7 +283,7 @@ public class ExtractDataService {
createDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId)), dorisTablColumnSql);
generateTransFile("all_scope", datasetTable, datasource, datasetTableFields, null);
if (datasetTable.getType().equalsIgnoreCase("sql")) {
generateJobFile("all_scope", datasetTable, fetchSqlField(new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getSql(), datasource));
generateJobFile("all_scope", datasetTable, String.join(",", datasetTableFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList())));
} else {
generateJobFile("all_scope", datasetTable, String.join(",", datasetTableFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList())));
}
......@@ -297,6 +297,7 @@ public class ExtractDataService {
saveErrorLog(datasetTableId, taskId, e);
msg = false;
lastExecStatus = JobStatus.Error;
execTime = null;
} finally {
try { deleteFile("all_scope", datasetTableId); }catch (Exception ignore){ System.out.println(ignore.getMessage());}
try { sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog, msg); }catch (Exception ignore){ System.out.println(ignore.getMessage());}
......@@ -316,14 +317,17 @@ public class ExtractDataService {
return;
}
if (datasetTable.getLastUpdateTime() == 0 || datasetTable.getLastUpdateTime() == null) {
if (datasetTableTask == null ) {
datasetTableTaskLog = writeDatasetTableTaskLog(datasetTableId, taskId);
}
if (datasetTable.getLastUpdateTime() == null || datasetTable.getLastUpdateTime() == 0) {
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, null);
saveErrorLog(datasetTableId, taskId, new Exception("未进行全量同步"));
lastExecStatus = JobStatus.Error;
return;
}
if (datasetTableTask == null ) {
datasetTableTaskLog = writeDatasetTableTaskLog(datasetTableId, taskId);
}
execTime = System.currentTimeMillis();
if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd()) && StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd().replace(" ", ""))) {// 增量添加
String sql = datasetTableIncrementalConfig.getIncrementalAdd().replace(lastUpdateTime, datasetTable.getLastUpdateTime().toString())
......@@ -348,6 +352,7 @@ public class ExtractDataService {
saveErrorLog(datasetTableId, taskId, e);
msg = false;
lastExecStatus = JobStatus.Error;
execTime = null;
} finally {
try { deleteFile("incremental_add", datasetTableId); deleteFile("incremental_delete", datasetTableId); }catch (Exception ignore){}
try { sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog, msg); }catch (Exception ignore){}
......
package io.dataease.service.panel;
import io.dataease.base.mapper.PanelViewLinkageMapper;
import io.dataease.base.mapper.ext.ExtPanelViewLinkageMapper;
import io.dataease.controller.request.panel.PanelLinkageRequest;
import io.dataease.dto.PanelViewLinkageDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* Author: wangjiahao
* Date: 8/4/21
* Description:
*/
@Service
public class PanelViewLinkageService {
@Resource
private PanelViewLinkageMapper panelViewLinkageMapper;
@Resource
private ExtPanelViewLinkageMapper extPanelViewLinkageMapper;
public Map<String, PanelViewLinkageDTO> getViewLinkageGather(PanelLinkageRequest request) {
if(CollectionUtils.isNotEmpty(request.getTargetViewIds())){
List<PanelViewLinkageDTO> linkageDTOList = extPanelViewLinkageMapper.getViewLinkageGather(request.getPanelId(),request.getSourceViewId(),request.getTargetViewIds());
linkageDTOList.stream().forEach(linkage ->{
linkage.setTargetViewFields(extPanelViewLinkageMapper.queryTableField(linkage.getTableId()));
});
Map<String, PanelViewLinkageDTO> result = linkageDTOList.stream()
.collect(Collectors.toMap(PanelViewLinkageDTO::getTargetViewId,PanelViewLinkageDTO->PanelViewLinkageDTO));
return result;
}
return new HashMap<>();
}
}
......@@ -76,6 +76,8 @@ pagehelper.PageRowBounds=true
#excel等用户上传文件路径
upload.file.path=/opt/dataease/data/kettle/
dataease.sqlinjection.whitelists=/dataset/table/sqlPreview,/dataset/table/update
......
/*
Navicat Premium Data Transfer
Source Server : ali_sh_mysql
Source Server Type : MySQL
Source Server Version : 50732
Source Host : 47.117.200.215:3306
Source Schema : dataease
Target Server Type : MySQL
Target Server Version : 50732
File Encoding : 65001
Date: 13/07/2021 18:09:09
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论