Commit adb71540 authored by frank.xa.zhang's avatar frank.xa.zhang

[data migration] migration data from old table to new table

parent c7939ead
......@@ -111,4 +111,6 @@ public interface CellTemplateConfigMapper extends MyMapper {
int deleteCellTemplateConfigByCellTemplate(@Param("templateDbID") Long templateDbID);
void batchInsert(List<CellTemplateConfig> list);
void batchInser2(List<CellTemplateConfig> list);
}
\ No newline at end of file
......@@ -108,5 +108,6 @@ public interface CellTemplateMapper extends MyMapper {
void batchInsert(List<CellTemplate> list);
void batchInsert2(List<CellTemplate> list);
}
\ No newline at end of file
......@@ -119,6 +119,24 @@ public class CellTemplate implements Serializable {
*/
private Boolean isReadOnly;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cell_template.create_by
*
* @mbg.generated
*/
private String createBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cell_template.update_by
*
* @mbg.generated
*/
private String updateBy;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table cell_template
......@@ -415,6 +433,54 @@ public class CellTemplate implements Serializable {
this.isReadOnly = isReadOnly;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cell_template.create_by
*
* @return the value of cell_template.create_by
*
* @mbg.generated
*/
public String getCreateBy() {
return createBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cell_template.create_by
*
* @param createBy the value for cell_template.create_by
*
* @mbg.generated
*/
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cell_template.update_by
*
* @return the value of cell_template.update_by
*
* @mbg.generated
*/
public String getUpdateBy() {
return updateBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cell_template.update_by
*
* @param updateBy the value for cell_template.update_by
*
* @mbg.generated
*/
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cell_template
......@@ -439,6 +505,8 @@ public class CellTemplate implements Serializable {
sb.append(", copyFromId=").append(copyFromId);
sb.append(", dataType=").append(dataType);
sb.append(", isReadOnly=").append(isReadOnly);
sb.append(", createBy=").append(createBy);
sb.append(", updateBy=").append(updateBy);
sb.append("]");
return sb.toString();
}
......
......@@ -944,6 +944,146 @@ public class CellTemplateExample {
addCriterion("is_read_only not between", value1, value2, "isReadOnly");
return (Criteria) this;
}
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreateByEqualTo(String value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotEqualTo(String value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThan(String value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThanOrEqualTo(String value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThan(String value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThanOrEqualTo(String value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLike(String value) {
addCriterion("create_by like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotLike(String value) {
addCriterion("create_by not like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByIn(List<String> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotIn(List<String> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByBetween(String value1, String value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotBetween(String value1, String value2) {
addCriterion("create_by not between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andUpdateByIsNull() {
addCriterion("update_by is null");
return (Criteria) this;
}
public Criteria andUpdateByIsNotNull() {
addCriterion("update_by is not null");
return (Criteria) this;
}
public Criteria andUpdateByEqualTo(String value) {
addCriterion("update_by =", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByNotEqualTo(String value) {
addCriterion("update_by <>", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByGreaterThan(String value) {
addCriterion("update_by >", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByGreaterThanOrEqualTo(String value) {
addCriterion("update_by >=", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByLessThan(String value) {
addCriterion("update_by <", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByLessThanOrEqualTo(String value) {
addCriterion("update_by <=", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByLike(String value) {
addCriterion("update_by like", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByNotLike(String value) {
addCriterion("update_by not like", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByIn(List<String> values) {
addCriterion("update_by in", values, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByNotIn(List<String> values) {
addCriterion("update_by not in", values, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByBetween(String value1, String value2) {
addCriterion("update_by between", value1, value2, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByNotBetween(String value1, String value2) {
addCriterion("update_by not between", value1, value2, "updateBy");
return (Criteria) this;
}
}
/**
......
......@@ -564,4 +564,39 @@ WHERE
#{item.validationDescription,jdbcType=VARCHAR}, #{item.voucherKeyword,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsert2" parameterType="pwc.taxtech.atms.entitiy.CellTemplateConfig">
INSERT INTO tax_admin.cell_template_config
(id,
cell_template_id,
report_template_id,
data_source_type,
formula,
formula_description,
account_codes,
invoice_type,
tax_rate,
invoice_amount_type,
model_ids,
create_by,
create_time,
update_by,
update_time,
invoice_category,
formula_data_source,
validation,
validation_description,
voucher_keyword
)
VALUES
<foreach collection ="list" item="item" separator =",">
(#{item.id,jdbcType=INTEGER}, #{item.cellTemplateId,jdbcType=INTEGER}, #{item.reportTemplateId,jdbcType=INTEGER},
#{item.dataSourceType,jdbcType=INTEGER}, #{item.formula,jdbcType=VARCHAR}, #{item.formulaDescription,jdbcType=VARCHAR},
#{item.accountCodes,jdbcType=VARCHAR}, #{item.invoiceType,jdbcType=INTEGER}, #{item.taxRate,jdbcType=VARCHAR},
#{item.invoiceAmountType,jdbcType=INTEGER}, #{item.modelIds,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.invoiceCategory,jdbcType=VARCHAR}, #{item.formulaDataSource,jdbcType=VARCHAR}, #{item.validation,jdbcType=VARCHAR},
#{item.validationDescription,jdbcType=VARCHAR}, #{item.voucherKeyword,jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -18,6 +18,8 @@
<result column="copy_from_id" jdbcType="BIGINT" property="copyFromId" />
<result column="data_type" jdbcType="INTEGER" property="dataType" />
<result column="is_read_only" jdbcType="SMALLINT" property="isReadOnly" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -91,7 +93,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, report_template_id, row_index, row_name, column_index, column_name, comment,
create_time, update_time, copy_from_id, data_type, is_read_only
create_time, update_time, copy_from_id, data_type, is_read_only, create_by, update_by
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entitiy.CellTemplateExample" resultMap="BaseResultMap">
<!--
......@@ -147,13 +149,13 @@
insert into cell_template (id, report_template_id, row_index,
row_name, column_index, column_name,
comment, create_time, update_time,
copy_from_id, data_type, is_read_only
)
copy_from_id, data_type, is_read_only,
create_by, update_by)
values (#{id,jdbcType=BIGINT}, #{reportTemplateId,jdbcType=BIGINT}, #{rowIndex,jdbcType=INTEGER},
#{rowName,jdbcType=VARCHAR}, #{columnIndex,jdbcType=INTEGER}, #{columnName,jdbcType=VARCHAR},
#{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{copyFromId,jdbcType=BIGINT}, #{dataType,jdbcType=INTEGER}, #{isReadOnly,jdbcType=SMALLINT}
)
#{copyFromId,jdbcType=BIGINT}, #{dataType,jdbcType=INTEGER}, #{isReadOnly,jdbcType=SMALLINT},
#{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entitiy.CellTemplate">
<!--
......@@ -198,6 +200,12 @@
<if test="isReadOnly != null">
is_read_only,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -236,6 +244,12 @@
<if test="isReadOnly != null">
#{isReadOnly,jdbcType=SMALLINT},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.entitiy.CellTemplateExample" resultType="java.lang.Long">
......@@ -291,6 +305,12 @@
<if test="record.isReadOnly != null">
is_read_only = #{record.isReadOnly,jdbcType=SMALLINT},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -313,7 +333,9 @@
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
copy_from_id = #{record.copyFromId,jdbcType=BIGINT},
data_type = #{record.dataType,jdbcType=INTEGER},
is_read_only = #{record.isReadOnly,jdbcType=SMALLINT}
is_read_only = #{record.isReadOnly,jdbcType=SMALLINT},
create_by = #{record.createBy,jdbcType=VARCHAR},
update_by = #{record.updateBy,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -358,6 +380,12 @@
<if test="isReadOnly != null">
is_read_only = #{isReadOnly,jdbcType=SMALLINT},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -377,7 +405,9 @@
update_time = #{updateTime,jdbcType=TIMESTAMP},
copy_from_id = #{copyFromId,jdbcType=BIGINT},
data_type = #{dataType,jdbcType=INTEGER},
is_read_only = #{isReadOnly,jdbcType=SMALLINT}
is_read_only = #{isReadOnly,jdbcType=SMALLINT},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entitiy.CellTemplateExample" resultMap="BaseResultMap">
......@@ -406,12 +436,29 @@
CopyFromID, DataType, IsReadOnly
)
values
<foreach collection ="list" item="item" separator =",">
<foreach collection="list" item="item" separator=",">
(#{item.ID,jdbcType=VARCHAR}, #{item.reportTemplateID,jdbcType=VARCHAR}, #{item.rowIndex,jdbcType=INTEGER},
#{item.rowName,jdbcType=VARCHAR}, #{item.columnIndex,jdbcType=INTEGER}, #{item.columnName,jdbcType=VARCHAR},
#{item.comment,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.copyFromID,jdbcType=VARCHAR}, #{item.dataType,jdbcType=INTEGER}, #{item.isReadOnly,jdbcType=INTEGER}
)
</foreach >
</foreach>
</insert>
<insert id="batchInsert2">
insert into cell_template (id, report_template_id, row_index,
row_name, column_index, column_name,
comment, create_time, update_time,
copy_from_id, data_type, is_read_only, create_by, update_by
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=INTEGER}, #{item.reportTemplateId,jdbcType=INTEGER}, #{item.rowIndex,jdbcType=INTEGER},
#{item.rowName,jdbcType=VARCHAR}, #{item.columnIndex,jdbcType=INTEGER}, #{item.columnName,jdbcType=VARCHAR},
#{item.comment,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.copyFromId,jdbcType=INTEGER}, #{item.dataType,jdbcType=INTEGER}, #{item.isReadOnly,jdbcType=SMALLINT},
#{item.createBy,jdbcType=VARCHAR}, #{item.updateBy,jdbcType=VARCHAR}
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -16,48 +16,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.fasterxml.jackson.databind.ObjectMapper;
import pwc.taxtech.atms.dao.AccountMappingMapper;
import pwc.taxtech.atms.dao.AreaMapper;
import pwc.taxtech.atms.dao.AreaRegionMapper;
import pwc.taxtech.atms.dao.BusinessUnitMapper;
import pwc.taxtech.atms.dao.CacheMapper;
import pwc.taxtech.atms.dao.CustomerMapper;
import pwc.taxtech.atms.dao.DictionaryMapper;
import pwc.taxtech.atms.dao.DimensionMapper;
import pwc.taxtech.atms.dao.DimensionValueMapper;
import pwc.taxtech.atms.dao.DimensionValueOrgMapper;
import pwc.taxtech.atms.dao.EnterpriseAccountMapper;
import pwc.taxtech.atms.dao.EnterpriseAccountSetMapper;
import pwc.taxtech.atms.dao.EnterpriseAccountSetOrgMapper;
import pwc.taxtech.atms.dao.IndustryMapper;
import pwc.taxtech.atms.dao.MailQueueMapper;
import pwc.taxtech.atms.dao.MenuMapper;
import pwc.taxtech.atms.dao.OperationLogBasicDataMapper;
import pwc.taxtech.atms.dao.OperationLogEnterPriseMapper;
import pwc.taxtech.atms.dao.OperationLogOrganizationMapper;
import pwc.taxtech.atms.dao.OperationLogRoleMapper;
import pwc.taxtech.atms.dao.OperationLogUserMapper;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.OrganizationServiceTemplateGroupMapper;
import pwc.taxtech.atms.dao.OrganizationStructureMapper;
import pwc.taxtech.atms.dao.PermissionMapper;
import pwc.taxtech.atms.dao.ProjectClientMapper;
import pwc.taxtech.atms.dao.RegionMapper;
import pwc.taxtech.atms.dao.RoleCategoryMapper;
import pwc.taxtech.atms.dao.RoleMapper;
import pwc.taxtech.atms.dao.RolePermissionMapper;
import pwc.taxtech.atms.dao.ServiceTypeMapper;
import pwc.taxtech.atms.dao.StandardAccountMapper;
import pwc.taxtech.atms.dao.StatisticAttributeDimensionMapper;
import pwc.taxtech.atms.dao.StatisticAttributeMapper;
import pwc.taxtech.atms.dao.TemplateGroupMapper;
import pwc.taxtech.atms.dao.UserDimensionValueMapper;
import pwc.taxtech.atms.dao.UserDimensionValueOrgMapper;
import pwc.taxtech.atms.dao.UserDimensionValueRoleMapper;
import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.dao.UserOrganizationMapper;
import pwc.taxtech.atms.dao.UserOrganizationRoleMapper;
import pwc.taxtech.atms.dao.UserRoleMapper;
import org.springframework.test.context.web.WebAppConfiguration;
import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.entitiy.AreaExample;
import pwc.taxtech.atms.entitiy.AreaRegionExample;
import pwc.taxtech.atms.entitiy.CustomerExample;
......@@ -74,7 +34,9 @@ import pwc.taxtech.atms.entitiy.RegionExample;
import pwc.taxtech.atms.entitiy.ServiceTypeExample;
import pwc.taxtech.atms.entitiy.StandardAccountExample;
import pwc.taxtech.atms.entitiy.TemplateGroupExample;
import pwc.taxtech.atms.service.impl.DistributedIDService;
@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:applicationContext.xml" })
public abstract class CommonIT {
......@@ -131,6 +93,8 @@ public abstract class CommonIT {
@Autowired
protected TemplateGroupMapper templateGroupMapper;
@Autowired
protected TemplateMapper templateMapper;
@Autowired
protected ServiceTypeMapper serviceTypeMapper;
@Autowired
protected ProjectClientMapper projectClientMapper;
......@@ -174,6 +138,18 @@ public abstract class CommonIT {
protected OperationLogUserMapper operationLogUserMapper;
@Autowired
protected OrganizationServiceTemplateGroupMapper organizationServiceTemplateGroupMapper;
@Autowired
protected DistributedIDService distributedIDService;
@Autowired
protected CellTemplateMapper cellTemplateMapper;
@Autowired
protected CellTemplateConfigMapper cellTemplateConfigMapper;
@Autowired
protected TaxPayerReportRuleMapper taxPayerReportRuleMapper;
@Autowired
protected TaxRuleSettingOrganizationMapper taxRuleSettingOrganizationMapper;
@Autowired
protected TaxRuleSettingMapper taxRuleSettingMapper;
protected void execSqlFile(String sqlFilePath) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment