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

fixed issues for formula validate

parent c1904df7
...@@ -248,7 +248,8 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp ...@@ -248,7 +248,8 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
List<FormulaConfig> dataSourceList = formulaConfigMapper.selectByExample(example); List<FormulaConfig> dataSourceList = formulaConfigMapper.selectByExample(example);
List<String> nameList = new ArrayList<>(); List<String> nameList = new ArrayList<>();
FormulaHelper formulaHelper = new FormulaHelper(); FormulaHelper formulaHelper = new FormulaHelper();
String tmpFormula = formulaHelper.formatFormula(formula).toUpperCase(); // String tmpFormula = formulaHelper.formatFormula(formula).toUpperCase();
String tmpFormula = formula.toUpperCase();
for (FormulaConfig dataSource : dataSourceList) { for (FormulaConfig dataSource : dataSourceList) {
if (tmpFormula.contains(dataSource.getFormulaName().toUpperCase() + "(") && !nameList.contains(dataSource.getDataSourceName())) { if (tmpFormula.contains(dataSource.getFormulaName().toUpperCase() + "(") && !nameList.contains(dataSource.getDataSourceName())) {
......
...@@ -65,7 +65,9 @@ public final class FormulaHelper { ...@@ -65,7 +65,9 @@ public final class FormulaHelper {
while (!regexMatchObjectStack.empty()) { while (!regexMatchObjectStack.empty()) {
RegexMatchObject obj = regexMatchObjectStack.pop(); RegexMatchObject obj = regexMatchObjectStack.pop();
formula = formula.substring(0, obj.getIndex()) + obj.getExpression() + formula.substring(obj.getIndex(), obj.getLength()); formula = formula.substring(0, obj.getIndex())
+ obj.getExpression()
+ formula.substring(obj.getIndex(), obj.getIndex() + obj.getLength());
} }
return formula.trim(); return formula.trim();
} }
......
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.FormulaParseException;
import org.apache.poi.ss.formula.FormulaParser;
import org.apache.poi.ss.formula.FormulaType;
import org.apache.poi.xssf.usermodel.XSSFEvaluationWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.TemplateFormulaService; import pwc.taxtech.atms.service.TemplateFormulaService;
...@@ -22,8 +27,17 @@ public class TemplateFormulaServiceImpl extends AbstractService implements Templ ...@@ -22,8 +27,17 @@ public class TemplateFormulaServiceImpl extends AbstractService implements Templ
} }
try { try {
String tidyFormula = formulaHelper.formatFormula(formula); //String tidyFormula = formulaHelper.formatFormula(formula);
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFEvaluationWorkbook xssfEvaluationWorkbook = XSSFEvaluationWorkbook.create(workbook);
try {
FormulaParser.parse(formula, xssfEvaluationWorkbook, FormulaType.CELL, 0);
result.setResult(true);
return result;
} catch (FormulaParseException e) {
result.setResult(false);
result.setResultMsg(e.getMessage());
}
/*todo: find the replace solution for here to check formual is correct or not /*todo: find the replace solution for here to check formual is correct or not
//var sourceCode = m_engine.CreateScriptSourceFromString(tidyFormula, SourceCodeKind.AutoDetect); //var sourceCode = m_engine.CreateScriptSourceFromString(tidyFormula, SourceCodeKind.AutoDetect);
//var compileCode = sourceCode.Compile(); //var compileCode = sourceCode.Compile();
......
...@@ -124,7 +124,9 @@ public interface DataSourceMapper extends MyVatMapper { ...@@ -124,7 +124,9 @@ public interface DataSourceMapper extends MyVatMapper {
void clearDataSourceDetailWithPeriod(@Param("period") Integer period); void clearDataSourceDetailWithPeriod(@Param("period") Integer period);
void clearCellDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs); void clearCellDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs,@Param("period")Integer period);
void clearReportWithPeriod(Integer period);
List<DataSourceExtendDto> getFormulaDataSource(Long reportID); List<DataSourceExtendDto> getFormulaDataSource(Long reportID);
} }
\ No newline at end of file
...@@ -105,4 +105,6 @@ public interface PeriodFormulaBlockMapper extends MyVatMapper { ...@@ -105,4 +105,6 @@ public interface PeriodFormulaBlockMapper extends MyVatMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(PeriodFormulaBlock record); int updateByPrimaryKey(PeriodFormulaBlock record);
void updateReportId(@Param("reportId") Long reportId,@Param("cellTemplateConfigIds") List<Long> cellTemplateConfigIds,@Param("period") Integer period);
} }
\ No newline at end of file
...@@ -24,14 +24,7 @@ import pwc.taxtech.atms.dto.vatdto.CellCalcInfoDto; ...@@ -24,14 +24,7 @@ import pwc.taxtech.atms.dto.vatdto.CellCalcInfoDto;
import pwc.taxtech.atms.dto.vatdto.CellTemplateConfigGroupDto; import pwc.taxtech.atms.dto.vatdto.CellTemplateConfigGroupDto;
import pwc.taxtech.atms.dto.vatdto.PeriodCellTemplateConfigExtendDto; import pwc.taxtech.atms.dto.vatdto.PeriodCellTemplateConfigExtendDto;
import pwc.taxtech.atms.entitiy.Project; import pwc.taxtech.atms.entitiy.Project;
import pwc.taxtech.atms.vat.entity.CellData; import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplate;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfigExample;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateExample;
import pwc.taxtech.atms.vat.entity.PeriodTemplate;
import pwc.taxtech.atms.vat.entity.PeriodTemplateExample;
import pwc.taxtech.atms.vat.entity.Report;
import pwc.taxtech.atms.vat.service.ReportGenerator; import pwc.taxtech.atms.vat.service.ReportGenerator;
import pwc.taxtech.atms.vat.service.impl.report.functions.FSJZ; import pwc.taxtech.atms.vat.service.impl.report.functions.FSJZ;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext; import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext;
...@@ -69,7 +62,9 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -69,7 +62,9 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample(); PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andIdIn(templateIds); periodTemplateExample.createCriteria().andIdIn(templateIds);
List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample); List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample);
List<Long> periodTemplateIDList = periodTemplateList.stream().map(PeriodTemplate::getTemplateId).collect(Collectors.toList()); List<Long> periodTemplateIDList = periodTemplateList.stream()
.map(PeriodTemplate::getTemplateId)
.collect(Collectors.toList());
Long templateGroupID = periodTemplateList.size() > 0 ? periodTemplateList.get(0).getTemplateGroupId() : 0; Long templateGroupID = periodTemplateList.size() > 0 ? periodTemplateList.get(0).getTemplateGroupId() : 0;
...@@ -80,7 +75,8 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -80,7 +75,8 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
PeriodCellTemplateConfigExample periodCellTemplateConfigExample = new PeriodCellTemplateConfigExample(); PeriodCellTemplateConfigExample periodCellTemplateConfigExample = new PeriodCellTemplateConfigExample();
// only get formula config // only get formula config
periodCellTemplateConfigExample.createCriteria().andReportTemplateIdIn(periodTemplateIDList); periodCellTemplateConfigExample.createCriteria().andReportTemplateIdIn(periodTemplateIDList);
List<PeriodCellTemplateConfig> periodCellTemplateConfigList = periodCellTemplateConfigMapper.selectByExample(periodCellTemplateConfigExample); List<PeriodCellTemplateConfig> periodCellTemplateConfigList =
periodCellTemplateConfigMapper.selectByExample(periodCellTemplateConfigExample);
Map<String, String> templateCodeAndPath = new HashMap<>(); Map<String, String> templateCodeAndPath = new HashMap<>();
periodTemplateList.forEach(a -> templateCodeAndPath.put(a.getCode(), getTemplatePath(a.getPath()))); periodTemplateList.forEach(a -> templateCodeAndPath.put(a.getCode(), getTemplatePath(a.getPath())));
...@@ -90,10 +86,10 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -90,10 +86,10 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
Workbook newWorkbook = workbook.get(); Workbook newWorkbook = workbook.get();
FormulaContext formulaContext = new FormulaContext(); FormulaContext formulaContext = new FormulaContext();
formulaContext.setFormulaAgent(formulaAgent); formulaContext.setFormulaAgent(formulaAgent);
formulaContext.setPeriod(6);//todo: assign value later formulaContext.setPeriod(period);
formulaContext.setReportTemplateGroupID(templateGroupID); formulaContext.setReportTemplateGroupID(templateGroupID);
formulaContext.setProjectID(project.getID()); formulaContext.setProjectID(project.getID());
formulaContext.setYear(project.getYear());//todo: assign value later formulaContext.setYear(project.getYear());
formulaContext.setOrganizationID(project.getOrganizationID()); formulaContext.setOrganizationID(project.getOrganizationID());
addFunctionsToWorkbook(newWorkbook, formulaContext); addFunctionsToWorkbook(newWorkbook, formulaContext);
...@@ -101,7 +97,9 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -101,7 +97,9 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
for (int i = 0; i < sheetCount; i++) { for (int i = 0; i < sheetCount; i++) {
Sheet sheet = newWorkbook.getSheetAt(i); Sheet sheet = newWorkbook.getSheetAt(i);
String code = sheet.getSheetName(); String code = sheet.getSheetName();
Optional<PeriodTemplate> periodTemplate = periodTemplateList.stream().filter(a -> a.getCode().equals(code)).findFirst(); Optional<PeriodTemplate> periodTemplate = periodTemplateList.stream()
.filter(a -> a.getCode().equals(code))
.findFirst();
Long templateID; Long templateID;
if (periodTemplate.isPresent()) { if (periodTemplate.isPresent()) {
templateID = periodTemplate.get().getTemplateId(); templateID = periodTemplate.get().getTemplateId();
...@@ -110,18 +108,18 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -110,18 +108,18 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
} }
if (templateID > 0) { if (templateID > 0) {
//todo: get cell template and cell template config with templateID //get cell template and cell template config with templateID
Map<PeriodCellTemplate, PeriodCellTemplateConfig> cellTemplatePeriodCellTemplateConfigMap = new HashMap<>(); Map<PeriodCellTemplate, PeriodCellTemplateConfig> cellTemplatePeriodCellTemplateConfigMap = new HashMap<>();
List<PeriodCellTemplate> tempPeriodCellTemplateList = periodCellTemplateList.stream() List<PeriodCellTemplate> tempPeriodCellTemplateList = periodCellTemplateList.stream()
.filter(a -> a.getReportTemplateId().equals(templateID)) .filter(a -> a.getReportTemplateId().equals(templateID))
.collect(Collectors.toList()); .collect(Collectors.toList());
tempPeriodCellTemplateList.forEach(a -> { tempPeriodCellTemplateList.forEach(a -> {
Optional<PeriodCellTemplateConfig> tempCellTemplateConfig = periodCellTemplateConfigList.stream() Optional<PeriodCellTemplateConfig> tempCellTemplateConfig = periodCellTemplateConfigList.stream()
.filter(item -> item.getCellTemplateId().equals(a.getCellTemplateId()) && item.getDataSourceType().equals(CellDataSourceType.Formula.getCode())) .filter(item -> item.getCellTemplateId().equals(a.getCellTemplateId())
&& item.getDataSourceType().equals(CellDataSourceType.Formula.getCode()))
.findFirst(); .findFirst();
if (tempCellTemplateConfig.isPresent()) { tempCellTemplateConfig.ifPresent(periodCellTemplateConfig ->
cellTemplatePeriodCellTemplateConfigMap.put(a, tempCellTemplateConfig.get()); cellTemplatePeriodCellTemplateConfigMap.put(a, periodCellTemplateConfig));
}
}); });
cellTemplatePeriodCellTemplateConfigMap.forEach((k, v) -> { cellTemplatePeriodCellTemplateConfigMap.forEach((k, v) -> {
...@@ -138,7 +136,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -138,7 +136,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
cell = row.getCell(k.getColumnIndex()); cell = row.getCell(k.getColumnIndex());
//todo:后面单独处理kv的公式 //todo:后面单独处理kv的公式
if (StringUtils.isNotBlank(v.getFormula())&&!v.getFormula().contains("@")) { if (StringUtils.isNotBlank(v.getFormula()) && !v.getFormula().contains("@")) {
cell.setCellFormula(v.getFormula()); cell.setCellFormula(v.getFormula());
} }
}); });
...@@ -151,7 +149,9 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -151,7 +149,9 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
for (int i = 0; i < sheetCount; i++) { for (int i = 0; i < sheetCount; i++) {
Sheet sheet = newWorkbook.getSheetAt(i); Sheet sheet = newWorkbook.getSheetAt(i);
String code = sheet.getSheetName(); String code = sheet.getSheetName();
Optional<PeriodTemplate> periodTemplate = periodTemplateList.stream().filter(a -> a.getCode().equals(code)).findFirst(); Optional<PeriodTemplate> periodTemplate = periodTemplateList.stream()
.filter(a -> a.getCode().equals(code))
.findFirst();
Long templateID; Long templateID;
if (periodTemplate.isPresent()) { if (periodTemplate.isPresent()) {
templateID = periodTemplate.get().getTemplateId(); templateID = periodTemplate.get().getTemplateId();
...@@ -173,23 +173,49 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -173,23 +173,49 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
report.setUpdateTime(createTime); report.setUpdateTime(createTime);
reportMapper.insertSelective(report); reportMapper.insertSelective(report);
List<PeriodCellTemplateConfig> periodCellTemplateConfigs = periodCellTemplateConfigList.stream().filter(a -> a.getReportTemplateId().equals(templateID)).collect(Collectors.toList()); List<PeriodCellTemplateConfig> periodCellTemplateConfigs = periodCellTemplateConfigList.stream()
.filter(a -> a.getReportTemplateId().equals(templateID))
.collect(Collectors.toList());
//update formulablock table reportid field
List<Long> cellTemplateConfigIds = periodCellTemplateConfigs.stream()
.map(PeriodCellTemplateConfig::getCellTemplateId)
.collect(Collectors.toList());
periodFormulaBlockMapper.updateReportId(reportID, cellTemplateConfigIds, period);
for (PeriodCellTemplateConfig periodCellTemplateConfig : periodCellTemplateConfigs) { for (PeriodCellTemplateConfig periodCellTemplateConfig : periodCellTemplateConfigs) {
Optional<PeriodCellTemplate> tempPeriodCellTemplate = periodCellTemplateList.stream().filter(a -> a.getCellTemplateId().equals(periodCellTemplateConfig.getCellTemplateId())).findFirst(); Optional<PeriodCellTemplate> tempPeriodCellTemplate = periodCellTemplateList.stream()
if (tempPeriodCellTemplate != null) { .filter(a -> a.getCellTemplateId().equals(periodCellTemplateConfig.getCellTemplateId()))
.findFirst();
if (tempPeriodCellTemplate.isPresent()) {
CellData cellData = new CellData(); CellData cellData = new CellData();
cellData.setId(distributedIDService.nextId()); cellData.setId(distributedIDService.nextId());
cellData.setReportId(reportID); cellData.setReportId(reportID);
cellData.setCellTemplateId(tempPeriodCellTemplate.get().getCellTemplateId()); cellData.setCellTemplateId(tempPeriodCellTemplate.get().getCellTemplateId());
String data; String data;
if (sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()) != null && sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()).getCell(tempPeriodCellTemplate.get().getColumnIndex()) != null) { if (sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()) != null
data = Double.toString(sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()).getCell(tempPeriodCellTemplate.get().getColumnIndex()).getNumericCellValue()); && sheet.getRow(tempPeriodCellTemplate.get().getRowIndex())
.getCell(tempPeriodCellTemplate.get().getColumnIndex()) != null) {
data = Double.toString(sheet.getRow(tempPeriodCellTemplate.get().getRowIndex())
.getCell(tempPeriodCellTemplate.get().getColumnIndex()).getNumericCellValue());
} else { } else {
data = EMPTY; data = EMPTY;
} }
cellData.setData(data); cellData.setData(data);
cellData.setFormulaExp(EMPTY); PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andPeriodEqualTo(period)
.andCellTemplateIdEqualTo(tempPeriodCellTemplate.get().getCellTemplateId());
//todo: 这里可能一个单元格不止一个公式,需要根据公式的内容来进行替换具体的解析公式
Optional<PeriodFormulaBlock> periodFormulaBlock =
periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample).stream().findFirst();
if (periodFormulaBlock.isPresent()) {
cellData.setFormulaExp(periodFormulaBlock.get().getFormulaExpression());
} else {
cellData.setFormulaExp(EMPTY);
}
cellData.setCreateBy("Admin"); cellData.setCreateBy("Admin");
cellData.setCreateTime(createTime); cellData.setCreateTime(createTime);
cellData.setUpdateBy("Admin"); cellData.setUpdateBy("Admin");
...@@ -203,7 +229,6 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -203,7 +229,6 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
} else { } else {
return "GenerateReport failed"; return "GenerateReport failed";
} }
return "generate report successful"; return "generate report successful";
} }
......
...@@ -114,7 +114,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -114,7 +114,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
dataSourceMapper.clearTaxPayerReportWithPeriod(period); dataSourceMapper.clearTaxPayerReportWithPeriod(period);
dataSourceMapper.clearDataSourceWithPeriod(period); dataSourceMapper.clearDataSourceWithPeriod(period);
dataSourceMapper.clearDataSourceDetailWithPeriod(period); dataSourceMapper.clearDataSourceDetailWithPeriod(period);
dataSourceMapper.clearCellDataWithPeriod(strExceptTemplateIDs); dataSourceMapper.clearCellDataWithPeriod(strExceptTemplateIDs,period);
dataSourceMapper.clearReportWithPeriod(period);
// 根据templategroupid 把 template 插入到 periodTemplate // 根据templategroupid 把 template 插入到 periodTemplate
TemplateExample example = new TemplateExample(); TemplateExample example = new TemplateExample();
......
...@@ -267,7 +267,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction { ...@@ -267,7 +267,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
PeriodFormulaBlock periodFormulaBlock = new PeriodFormulaBlock(); PeriodFormulaBlock periodFormulaBlock = new PeriodFormulaBlock();
periodFormulaBlock.setId(SpringContextUtil.distributedIDService.nextId()); periodFormulaBlock.setId(SpringContextUtil.distributedIDService.nextId());
periodFormulaBlock.setPeriod(period); periodFormulaBlock.setPeriod(period);
periodFormulaBlock.setReportId(0L); periodFormulaBlock.setReportId(0L);//todo:update reportID when report data generated
periodFormulaBlock.setCellTemplateId(cellTemplateID); periodFormulaBlock.setCellTemplateId(cellTemplateID);
periodFormulaBlock.setFormulaExpression(formulaExpression); periodFormulaBlock.setFormulaExpression(formulaExpression);
periodFormulaBlock.setData(val.toString()); periodFormulaBlock.setData(val.toString());
......
...@@ -36,6 +36,4 @@ public class FormulaContext { ...@@ -36,6 +36,4 @@ public class FormulaContext {
private FormulaAgent formulaAgent; private FormulaAgent formulaAgent;
//private Map<String, FormulaResult> replaceSpecialCellFormulaDic; //private Map<String, FormulaResult> replaceSpecialCellFormulaDic;
} }
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, `type`, `name`, amount, description, key_value_data_id, create_by, create_time, id, `type`, `name`, amount, description, key_value_data_id, create_by, create_time,
update_by, update_time, row_name, `column_name`, row_index, remap_batch_id, column_index update_by, update_time, row_name, `column_name`, row_index, remap_batch_id, column_index
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.DataSourceExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.DataSourceExample" resultMap="BaseResultMap">
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from data_source from data_source
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
...@@ -147,16 +147,16 @@ ...@@ -147,16 +147,16 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
insert into data_source (id, `type`, `name`, insert into data_source (id, `type`, `name`,
amount, description, key_value_data_id, amount, description, key_value_data_id,
create_by, create_time, update_by, create_by, create_time, update_by,
update_time, row_name, `column_name`, update_time, row_name, `column_name`,
row_index, remap_batch_id, column_index row_index, remap_batch_id, column_index
) )
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{amount,jdbcType=DECIMAL}, #{description,jdbcType=VARCHAR}, #{keyValueDataId,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{description,jdbcType=VARCHAR}, #{keyValueDataId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{rowName,jdbcType=VARCHAR}, #{columnName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{rowName,jdbcType=VARCHAR}, #{columnName,jdbcType=VARCHAR},
#{rowIndex,jdbcType=INTEGER}, #{remapBatchId,jdbcType=VARCHAR}, #{columnIndex,jdbcType=INTEGER} #{rowIndex,jdbcType=INTEGER}, #{remapBatchId,jdbcType=VARCHAR}, #{columnIndex,jdbcType=INTEGER}
) )
</insert> </insert>
...@@ -454,35 +454,38 @@ ...@@ -454,35 +454,38 @@
<delete id="clearCellTemplateWithPeriod"> <delete id="clearCellTemplateWithPeriod">
DELETE FROM period_cell_template WHERE period=#{period,jdbcType=INTEGER} DELETE FROM period_cell_template WHERE period=#{period,jdbcType=INTEGER}
<if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''"> <if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
and id not in (${exceptReportTemplateIDs}); and report_template_id not in (${exceptReportTemplateIDs});
</if> </if>
</delete> </delete>
<delete id="clearCellTemplateConfigWithPeriod"> <delete id="clearCellTemplateConfigWithPeriod">
DELETE FROM period_cell_template_config WHERE period=#{period,jdbcType=INTEGER} DELETE FROM period_cell_template_config WHERE period=#{period,jdbcType=INTEGER}
<if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''"> <if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
and id not in (${exceptReportTemplateIDs}); and report_template_id not in (${exceptReportTemplateIDs});
</if> </if>
</delete> </delete>
<delete id="clearTemplateWithPeriod"> <delete id="clearTemplateWithPeriod">
DELETE FROM period_template WHERE period=#{period,jdbcType=INTEGER} DELETE FROM period_template WHERE period=#{period,jdbcType=INTEGER}
<if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''"> <if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">
and id not in (${exceptReportTemplateIDs}); and template_id not in (${exceptReportTemplateIDs});
</if> </if>
</delete> </delete>
<delete id="clearTaxPayerReportWithPeriod"> <delete id="clearTaxPayerReportWithPeriod">
DELETE FROM period_tax_payer_report_rule WHERE period=#{period,jdbcType=INTEGER}; DELETE FROM period_tax_payer_report_rule WHERE period=#{period,jdbcType=INTEGER};
</delete> </delete>
<delete id="clearDataSourceWithPeriod"> <delete id="clearDataSourceWithPeriod">
DELETE d FROM data_source d JOIN period_formula_block f ON d.id = f.data_source_id WHERE f.Period = #{period,jdbcType=INTEGER}; DELETE d FROM data_source d JOIN period_formula_block f ON d.id = f.data_source_id WHERE f.period = #{period,jdbcType=INTEGER};
</delete> </delete>
<delete id="clearDataSourceDetailWithPeriod"> <delete id="clearDataSourceDetailWithPeriod">
DELETE d FROM data_source_detail d JOIN period_formula_block f ON d.data_source_id = f.data_source_id WHERE f.Period = #{period,jdbcType=INTEGER}; DELETE d FROM data_source_detail d JOIN period_formula_block f ON d.data_source_id = f.data_source_id WHERE f.period = #{period,jdbcType=INTEGER};
</delete> </delete>
<delete id="clearCellDataWithPeriod"> <delete id="clearCellDataWithPeriod">
DELETE FROM cell_data DELETE c FROM cell_data c join report r on c.report_id=r.id where r.period = #{period,jdbcType=INTEGER};
<if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''"> <!--<if test="exceptReportTemplateIDs!=null and exceptReportTemplateIDs!=''">-->
WHERE report_id not in (${exceptReportTemplateIDs}); <!--WHERE report_id not in (${exceptReportTemplateIDs});-->
</if> <!--</if>-->
</delete>
<delete id="clearReportWithPeriod">
DELETE FROM report WHERE period=#{period,jdbcType=INTEGER};
</delete> </delete>
<resultMap id="DataSourceExtendDtoMap" type="pwc.taxtech.atms.dto.vatdto.DataSourceExtendDto"> <resultMap id="DataSourceExtendDtoMap" type="pwc.taxtech.atms.dto.vatdto.DataSourceExtendDto">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
...@@ -504,7 +507,6 @@ ...@@ -504,7 +507,6 @@
<result column="cell_template_id" jdbcType="BIGINT" property="cellTemplateID" /> <result column="cell_template_id" jdbcType="BIGINT" property="cellTemplateID" />
<result column="cell_data_id" jdbcType="BIGINT" property="cellDataID" /> <result column="cell_data_id" jdbcType="BIGINT" property="cellDataID" />
</resultMap> </resultMap>
<select id="getFormulaDataSource" parameterType="java.lang.Long" resultMap="DataSourceExtendDtoMap"> <select id="getFormulaDataSource" parameterType="java.lang.Long" resultMap="DataSourceExtendDtoMap">
SELECT SELECT
ds.*, ds.*,
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.PeriodFormulaBlockMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.PeriodFormulaBlockMapper">
<resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock"> <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id"/>
<result column="period" jdbcType="INTEGER" property="period" /> <result column="period" jdbcType="INTEGER" property="period"/>
<result column="report_id" jdbcType="BIGINT" property="reportId" /> <result column="report_id" jdbcType="BIGINT" property="reportId"/>
<result column="cell_template_id" jdbcType="BIGINT" property="cellTemplateId" /> <result column="cell_template_id" jdbcType="BIGINT" property="cellTemplateId"/>
<result column="formula_expression" jdbcType="VARCHAR" property="formulaExpression" /> <result column="formula_expression" jdbcType="VARCHAR" property="formulaExpression"/>
<result column="data" jdbcType="VARCHAR" property="data" /> <result column="data" jdbcType="VARCHAR" property="data"/>
<result column="data_source_id" jdbcType="BIGINT" property="dataSourceId" /> <result column="data_source_id" jdbcType="BIGINT" property="dataSourceId"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")"> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion"> <foreach collection="criteria.criteria" item="criterion">
<choose> <choose>
<when test="criterion.noValue"> <when test="criterion.noValue">
and ${criterion.condition} and ${criterion.condition}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
#{listItem} separator=",">
</foreach> #{listItem}
</when> </foreach>
</choose> </when>
</choose>
</foreach>
</trim>
</if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Update_By_Example_Where_Clause">
</where> <!--
</sql> WARNING - @mbg.generated
<sql id="Update_By_Example_Where_Clause"> This element is automatically generated by MyBatis Generator, do not modify.
<!-- -->
WARNING - @mbg.generated <where>
This element is automatically generated by MyBatis Generator, do not modify. <foreach collection="example.oredCriteria" item="criteria" separator="or">
--> <if test="criteria.valid">
<where> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="criteria.criteria" item="criterion">
<if test="criteria.valid"> <choose>
<trim prefix="(" prefixOverrides="and" suffix=")"> <when test="criterion.noValue">
<foreach collection="criteria.criteria" item="criterion"> and ${criterion.condition}
<choose> </when>
<when test="criterion.noValue"> <when test="criterion.singleValue">
and ${criterion.condition} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.listValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition}
</when> <foreach close=")" collection="criterion.value" item="listItem" open="("
<when test="criterion.listValue"> separator=",">
and ${criterion.condition} #{listItem}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> </foreach>
#{listItem} </when>
</foreach> </choose>
</when> </foreach>
</choose> </trim>
</if>
</foreach> </foreach>
</trim> </where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, period, report_id, cell_template_id, formula_expression, `data`, data_source_id,
create_by, create_time, update_by, update_time
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample"
resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from period_formula_block
<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.Long" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List"/>
from period_formula_block
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from period_formula_block
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from period_formula_block
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into period_formula_block (id, period, report_id,
cell_template_id, formula_expression, `data`,
data_source_id, create_by, create_time,
update_by, update_time)
values (#{id,jdbcType=BIGINT}, #{period,jdbcType=INTEGER}, #{reportId,jdbcType=BIGINT},
#{cellTemplateId,jdbcType=BIGINT}, #{formulaExpression,jdbcType=VARCHAR}, #{data,jdbcType=VARCHAR},
#{dataSourceId,jdbcType=BIGINT}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into period_formula_block
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="period != null">
period,
</if>
<if test="reportId != null">
report_id,
</if>
<if test="cellTemplateId != null">
cell_template_id,
</if>
<if test="formulaExpression != null">
formula_expression,
</if>
<if test="data != null">
`data`,
</if>
<if test="dataSourceId != null">
data_source_id,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="reportId != null">
#{reportId,jdbcType=BIGINT},
</if>
<if test="cellTemplateId != null">
#{cellTemplateId,jdbcType=BIGINT},
</if>
<if test="formulaExpression != null">
#{formulaExpression,jdbcType=VARCHAR},
</if>
<if test="data != null">
#{data,jdbcType=VARCHAR},
</if>
<if test="dataSourceId != null">
#{dataSourceId,jdbcType=BIGINT},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample"
resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from period_formula_block
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if> </if>
</foreach> </select>
</where> <update id="updateByExampleSelective" parameterType="map">
</sql> <!--
<sql id="Base_Column_List"> WARNING - @mbg.generated
<!-- This element is automatically generated by MyBatis Generator, do not modify.
WARNING - @mbg.generated -->
This element is automatically generated by MyBatis Generator, do not modify. update period_formula_block
--> <set>
id, period, report_id, cell_template_id, formula_expression, `data`, data_source_id, <if test="record.id != null">
create_by, create_time, update_by, update_time id = #{record.id,jdbcType=BIGINT},
</sql> </if>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample" resultMap="BaseResultMap"> <if test="record.period != null">
<!-- period = #{record.period,jdbcType=INTEGER},
WARNING - @mbg.generated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="record.reportId != null">
--> report_id = #{record.reportId,jdbcType=BIGINT},
select </if>
<if test="distinct"> <if test="record.cellTemplateId != null">
distinct cell_template_id = #{record.cellTemplateId,jdbcType=BIGINT},
</if> </if>
<include refid="Base_Column_List" /> <if test="record.formulaExpression != null">
from period_formula_block formula_expression = #{record.formulaExpression,jdbcType=VARCHAR},
<if test="_parameter != null"> </if>
<include refid="Example_Where_Clause" /> <if test="record.data != null">
</if> `data` = #{record.data,jdbcType=VARCHAR},
<if test="orderByClause != null"> </if>
order by ${orderByClause} <if test="record.dataSourceId != null">
</if> data_source_id = #{record.dataSourceId,jdbcType=BIGINT},
</select> </if>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <if test="record.createBy != null">
<!-- create_by = #{record.createBy,jdbcType=VARCHAR},
WARNING - @mbg.generated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="record.createTime != null">
--> create_time = #{record.createTime,jdbcType=TIMESTAMP},
select </if>
<include refid="Base_Column_List" /> <if test="record.updateBy != null">
from period_formula_block update_by = #{record.updateBy,jdbcType=VARCHAR},
where id = #{id,jdbcType=BIGINT} </if>
</select> <if test="record.updateTime != null">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> update_time = #{record.updateTime,jdbcType=TIMESTAMP},
<!-- </if>
WARNING - @mbg.generated </set>
This element is automatically generated by MyBatis Generator, do not modify. <if test="_parameter != null">
--> <include refid="Update_By_Example_Where_Clause"/>
delete from period_formula_block </if>
where id = #{id,jdbcType=BIGINT} </update>
</delete> <update id="updateByExample" parameterType="map">
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample"> <!--
<!-- WARNING - @mbg.generated
WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify.
This element is automatically generated by MyBatis Generator, do not modify. -->
--> update period_formula_block
delete from period_formula_block set id = #{record.id,jdbcType=BIGINT},
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into period_formula_block (id, period, report_id,
cell_template_id, formula_expression, `data`,
data_source_id, create_by, create_time,
update_by, update_time)
values (#{id,jdbcType=BIGINT}, #{period,jdbcType=INTEGER}, #{reportId,jdbcType=BIGINT},
#{cellTemplateId,jdbcType=BIGINT}, #{formulaExpression,jdbcType=VARCHAR}, #{data,jdbcType=VARCHAR},
#{dataSourceId,jdbcType=BIGINT}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into period_formula_block
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="period != null">
period,
</if>
<if test="reportId != null">
report_id,
</if>
<if test="cellTemplateId != null">
cell_template_id,
</if>
<if test="formulaExpression != null">
formula_expression,
</if>
<if test="data != null">
`data`,
</if>
<if test="dataSourceId != null">
data_source_id,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="reportId != null">
#{reportId,jdbcType=BIGINT},
</if>
<if test="cellTemplateId != null">
#{cellTemplateId,jdbcType=BIGINT},
</if>
<if test="formulaExpression != null">
#{formulaExpression,jdbcType=VARCHAR},
</if>
<if test="data != null">
#{data,jdbcType=VARCHAR},
</if>
<if test="dataSourceId != null">
#{dataSourceId,jdbcType=BIGINT},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from period_formula_block
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update period_formula_block
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.period != null">
period = #{record.period,jdbcType=INTEGER}, period = #{record.period,jdbcType=INTEGER},
</if>
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=BIGINT}, report_id = #{record.reportId,jdbcType=BIGINT},
</if>
<if test="record.cellTemplateId != null">
cell_template_id = #{record.cellTemplateId,jdbcType=BIGINT}, cell_template_id = #{record.cellTemplateId,jdbcType=BIGINT},
</if>
<if test="record.formulaExpression != null">
formula_expression = #{record.formulaExpression,jdbcType=VARCHAR}, formula_expression = #{record.formulaExpression,jdbcType=VARCHAR},
</if>
<if test="record.data != null">
`data` = #{record.data,jdbcType=VARCHAR}, `data` = #{record.data,jdbcType=VARCHAR},
</if>
<if test="record.dataSourceId != null">
data_source_id = #{record.dataSourceId,jdbcType=BIGINT}, data_source_id = #{record.dataSourceId,jdbcType=BIGINT},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR}, create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR}, update_by = #{record.updateBy,jdbcType=VARCHAR},
</if> update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="record.updateTime != null"> <if test="_parameter != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</set> </update>
<if test="_parameter != null"> <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock">
<include refid="Update_By_Example_Where_Clause" /> <!--
</if> WARNING - @mbg.generated
</update> This element is automatically generated by MyBatis Generator, do not modify.
<update id="updateByExample" parameterType="map"> -->
<!-- update period_formula_block
WARNING - @mbg.generated <set>
This element is automatically generated by MyBatis Generator, do not modify. <if test="period != null">
--> period = #{period,jdbcType=INTEGER},
update period_formula_block </if>
set id = #{record.id,jdbcType=BIGINT}, <if test="reportId != null">
period = #{record.period,jdbcType=INTEGER}, report_id = #{reportId,jdbcType=BIGINT},
report_id = #{record.reportId,jdbcType=BIGINT}, </if>
cell_template_id = #{record.cellTemplateId,jdbcType=BIGINT}, <if test="cellTemplateId != null">
formula_expression = #{record.formulaExpression,jdbcType=VARCHAR}, cell_template_id = #{cellTemplateId,jdbcType=BIGINT},
`data` = #{record.data,jdbcType=VARCHAR}, </if>
data_source_id = #{record.dataSourceId,jdbcType=BIGINT}, <if test="formulaExpression != null">
create_by = #{record.createBy,jdbcType=VARCHAR}, formula_expression = #{formulaExpression,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, </if>
update_by = #{record.updateBy,jdbcType=VARCHAR}, <if test="data != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP} `data` = #{data,jdbcType=VARCHAR},
<if test="_parameter != null"> </if>
<include refid="Update_By_Example_Where_Clause" /> <if test="dataSourceId != null">
</if> data_source_id = #{dataSourceId,jdbcType=BIGINT},
</update> </if>
<update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock"> <if test="createBy != null">
<!-- create_by = #{createBy,jdbcType=VARCHAR},
WARNING - @mbg.generated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="createTime != null">
--> create_time = #{createTime,jdbcType=TIMESTAMP},
update period_formula_block </if>
<set> <if test="updateBy != null">
<if test="period != null"> update_by = #{updateBy,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER}, </if>
</if> <if test="updateTime != null">
<if test="reportId != null"> update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update period_formula_block
set period = #{period,jdbcType=INTEGER},
report_id = #{reportId,jdbcType=BIGINT}, report_id = #{reportId,jdbcType=BIGINT},
</if>
<if test="cellTemplateId != null">
cell_template_id = #{cellTemplateId,jdbcType=BIGINT}, cell_template_id = #{cellTemplateId,jdbcType=BIGINT},
</if>
<if test="formulaExpression != null">
formula_expression = #{formulaExpression,jdbcType=VARCHAR}, formula_expression = #{formulaExpression,jdbcType=VARCHAR},
</if>
<if test="data != null">
`data` = #{data,jdbcType=VARCHAR}, `data` = #{data,jdbcType=VARCHAR},
</if>
<if test="dataSourceId != null">
data_source_id = #{dataSourceId,jdbcType=BIGINT}, data_source_id = #{dataSourceId,jdbcType=BIGINT},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
</if> update_time = #{updateTime,jdbcType=TIMESTAMP}
<if test="updateTime != null"> where id = #{id,jdbcType=BIGINT}
update_time = #{updateTime,jdbcType=TIMESTAMP}, </update>
</if> <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample"
</set> resultMap="BaseResultMap">
where id = #{id,jdbcType=BIGINT} <!--
</update> WARNING - @mbg.generated
<update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlock"> This element is automatically generated by MyBatis Generator, do not modify.
<!-- -->
WARNING - @mbg.generated select
This element is automatically generated by MyBatis Generator, do not modify. <if test="distinct">
--> distinct
update period_formula_block </if>
set period = #{period,jdbcType=INTEGER}, <include refid="Base_Column_List"/>
report_id = #{reportId,jdbcType=BIGINT}, from period_formula_block
cell_template_id = #{cellTemplateId,jdbcType=BIGINT}, <if test="_parameter != null">
formula_expression = #{formulaExpression,jdbcType=VARCHAR}, <include refid="Example_Where_Clause"/>
`data` = #{data,jdbcType=VARCHAR}, </if>
data_source_id = #{dataSourceId,jdbcType=BIGINT}, <if test="orderByClause != null">
create_by = #{createBy,jdbcType=VARCHAR}, order by ${orderByClause}
create_time = #{createTime,jdbcType=TIMESTAMP}, </if>
update_by = #{updateBy,jdbcType=VARCHAR}, </select>
update_time = #{updateTime,jdbcType=TIMESTAMP} <update id="updateReportId">
where id = #{id,jdbcType=BIGINT} update period_formula_block
</update> set report_id=#{reportId,jdbcType=BIGINT}
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample" resultMap="BaseResultMap"> where period=#{period,jdbcType=INTEGER} and cell_template_id in
<!-- <foreach collection="cellTemplateConfigIds" open="(" close=")" separator="," item="item">
WARNING - @mbg.generated #{item}
This element is automatically generated by MyBatis Generator, do not modify. </foreach>
--> </update>
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from period_formula_block
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
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