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

add code for jxfpmx, need debug later

parent 5ace3d48
...@@ -39,7 +39,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -39,7 +39,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public static OutputVATInvoiceMapper outputVATInvoiceMapper; public static OutputVATInvoiceMapper outputVATInvoiceMapper;
public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper; public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper;
public static InputVatInvoiceDao inputVatInvoiceDao; public static InputVatInvoiceDao inputVatInvoiceDao;
public static InputVATInvoiceMapper inputVATInvoiceMapper;
/** /**
* 获取bean * 获取bean
...@@ -68,7 +68,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -68,7 +68,7 @@ public class SpringContextUtil implements ApplicationContextAware {
projectDao = webApplicationContext.getBean(ProjectDao.class); projectDao = webApplicationContext.getBean(ProjectDao.class);
balanceMapper = webApplicationContext.getBean(BalanceMapper.class); balanceMapper = webApplicationContext.getBean(BalanceMapper.class);
dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class); dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class);
dataSourceDetailMapper=webApplicationContext.getBean(DataSourceDetailMapper.class); dataSourceDetailMapper = webApplicationContext.getBean(DataSourceDetailMapper.class);
periodFormulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class); periodFormulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class);
vatEnterpriseAccountDao = webApplicationContext.getBean(VatEnterpriseAccountDao.class); vatEnterpriseAccountDao = webApplicationContext.getBean(VatEnterpriseAccountDao.class);
vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class); vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class);
...@@ -76,5 +76,6 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -76,5 +76,6 @@ public class SpringContextUtil implements ApplicationContextAware {
outputVATInvoiceMapper = webApplicationContext.getBean(OutputVATInvoiceMapper.class); outputVATInvoiceMapper = webApplicationContext.getBean(OutputVATInvoiceMapper.class);
periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class); periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class);
inputVatInvoiceDao = webApplicationContext.getBean(InputVatInvoiceDao.class); inputVatInvoiceDao = webApplicationContext.getBean(InputVatInvoiceDao.class);
inputVATInvoiceMapper = webApplicationContext.getBean(InputVATInvoiceMapper.class);
} }
} }
...@@ -4,19 +4,24 @@ public enum FormulaDataSourceDetailType { ...@@ -4,19 +4,24 @@ public enum FormulaDataSourceDetailType {
BSPLFormulaDataSourceDto(1, pwc.taxtech.atms.dto.vatdto.BSPLFormulaDataSourceDto.class), BSPLFormulaDataSourceDto(1, pwc.taxtech.atms.dto.vatdto.BSPLFormulaDataSourceDto.class),
FormulaDataSourceDto(2, pwc.taxtech.atms.dto.vatdto.FormulaDataSourceDto.class), FormulaDataSourceDto(2, pwc.taxtech.atms.dto.vatdto.FormulaDataSourceDto.class),
InputInvoiceDataSourceDto(3, pwc.taxtech.atms.dto.vatdto.FormulaDataSourceDto.class), InputInvoiceDataSourceDto(3, pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto.class),
OutputInvoiceDataSourceDto(4, pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto.class); InputInvoiceDetailDataSourceDto(4, pwc.taxtech.atms.dto.vatdto.InputInvoiceDetailDataSourceDto.class),
OutputInvoiceDataSourceDto(5, pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto.class);
private Integer code; private Integer code;
private Class clas; private Class clas;
FormulaDataSourceDetailType(Integer code,Class clas) { FormulaDataSourceDetailType(Integer code, Class clas) {
this.code = code;this.clas = clas; this.code = code;
this.clas = clas;
} }
public Integer getCode() { public Integer getCode() {
return code; return code;
} }
public Class getClas(){return clas;}
public Class getClas() {
return clas;
}
} }
package pwc.taxtech.atms.dto.vatdto;
import lombok.Getter;
import lombok.Setter;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import java.math.BigDecimal;
import java.util.Date;
@Setter
@Getter
public class InputInvoiceDetailDataSourceDto extends FormulaDataSourceDto {
public InputInvoiceDetailDataSourceDto() {
super();
this.setType(FormulaDataSourceType.InputInvoiceDetail.getCode());
}
public int Period;
public Date InvoiceDate;
public String InvoiceCode;
public String InvoiceNumber;
public BigDecimal TaxAmount;
public BigDecimal TaxRate;
public String ProductionName;
}
package pwc.taxtech.atms.dto.vatdto;
import lombok.Getter;
import lombok.Setter;
import pwc.taxtech.atms.vat.entity.GoodsMapping;
import pwc.taxtech.atms.vat.entity.InputVATInvoice;
import pwc.taxtech.atms.vat.entity.InputVATInvoiceItem;
@Setter
@Getter
public class InputVATInvoiceResultDto {
private String invoiceID;
private InputVATInvoice inputVATInvoice;
private InputVATInvoiceItem inputVATInvoiceItem;
private GoodsMapping goodsMapping;
}
...@@ -197,7 +197,7 @@ public class PermissionServiceImpl extends AbstractService implements Permission ...@@ -197,7 +197,7 @@ public class PermissionServiceImpl extends AbstractService implements Permission
.filter(rPermissionDto -> currentNode.getId().equals(rPermissionDto.getParentID())).collect(Collectors.toList()); .filter(rPermissionDto -> currentNode.getId().equals(rPermissionDto.getParentID())).collect(Collectors.toList());
if(subRolePermissionDtoList!=null && !subRolePermissionDtoList.isEmpty()) { if(subRolePermissionDtoList!=null && !subRolePermissionDtoList.isEmpty()) {
currentNode.setExpanded(true); currentNode.setExpanded(true);
currentNode.setItems(new ArrayList()); currentNode.setItems(new ArrayList<>());
for(RolePermissionDto rolePermissionDto : subRolePermissionDtoList) { for(RolePermissionDto rolePermissionDto : subRolePermissionDtoList) {
DevTreeDto subNode = new DevTreeDto(); DevTreeDto subNode = new DevTreeDto();
subNode.setId(rolePermissionDto.getPermissionID()); subNode.setId(rolePermissionDto.getPermissionID());
...@@ -210,7 +210,7 @@ public class PermissionServiceImpl extends AbstractService implements Permission ...@@ -210,7 +210,7 @@ public class PermissionServiceImpl extends AbstractService implements Permission
} }
else { else {
currentNode.setExpanded(false); currentNode.setExpanded(false);
currentNode.setItems(new ArrayList()); currentNode.setItems(new ArrayList<>());
} }
} }
...@@ -221,7 +221,7 @@ public class PermissionServiceImpl extends AbstractService implements Permission ...@@ -221,7 +221,7 @@ public class PermissionServiceImpl extends AbstractService implements Permission
.filter(permission -> currentNode.getId().equals(permission.getParentID())).collect(Collectors.toList()); .filter(permission -> currentNode.getId().equals(permission.getParentID())).collect(Collectors.toList());
if(subPermissionList!=null && !subPermissionList.isEmpty()) { if(subPermissionList!=null && !subPermissionList.isEmpty()) {
currentNode.setExpanded(true); currentNode.setExpanded(true);
currentNode.setItems(new ArrayList()); currentNode.setItems(new ArrayList<>());
for(Permission permission : subPermissionList) { for(Permission permission : subPermissionList) {
DevTreeDto subNode = new DevTreeDto(); DevTreeDto subNode = new DevTreeDto();
subNode.setId(permission.getID()); subNode.setId(permission.getID());
...@@ -235,7 +235,7 @@ public class PermissionServiceImpl extends AbstractService implements Permission ...@@ -235,7 +235,7 @@ public class PermissionServiceImpl extends AbstractService implements Permission
} }
else { else {
currentNode.setExpanded(false); currentNode.setExpanded(false);
currentNode.setItems(new ArrayList()); currentNode.setItems(new ArrayList<>());
} }
} }
} }
...@@ -6,6 +6,8 @@ import org.apache.ibatis.annotations.Param; ...@@ -6,6 +6,8 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam; import pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceResultDto;
import pwc.taxtech.atms.vat.entity.InputVATInvoice; import pwc.taxtech.atms.vat.entity.InputVATInvoice;
import pwc.taxtech.atms.vat.entity.InputVATInvoiceExample; import pwc.taxtech.atms.vat.entity.InputVATInvoiceExample;
...@@ -110,4 +112,6 @@ public interface InputVATInvoiceMapper extends MyVatMapper { ...@@ -110,4 +112,6 @@ public interface InputVATInvoiceMapper extends MyVatMapper {
long getInputVATInvoiceCountByCondition(@Param("paras") InputInvoicePreviewQueryParam param); long getInputVATInvoiceCountByCondition(@Param("paras") InputInvoicePreviewQueryParam param);
List<InputVATInvoice> getInputVATInvoiceCountByConditionWithPaging(@Param("paras") InputInvoicePreviewQueryParam param,@Param("limitFrom") int limitFrom); List<InputVATInvoice> getInputVATInvoiceCountByConditionWithPaging(@Param("paras") InputInvoicePreviewQueryParam param,@Param("limitFrom") int limitFrom);
List<InputVATInvoiceResultDto> getInputVATInvoiceResultDto(String dbName);
} }
\ No newline at end of file
...@@ -263,7 +263,7 @@ public class VoucherServiceImpl extends VatAbstractService implements VoucherSer ...@@ -263,7 +263,7 @@ public class VoucherServiceImpl extends VatAbstractService implements VoucherSer
"`VID`"; "`VID`";
} }
List<Map<String, Object>> queryForList = jdbcTemplate.queryForList(sql); List<Map<String, Object>> queryForList = jdbcTemplate.queryForList(sql);
List<VoucherDto> voucherDtos = new ArrayList(); List<VoucherDto> voucherDtos = new ArrayList<>();
queryForList.forEach(a -> { queryForList.forEach(a -> {
VoucherDto dto = new VoucherDto(); VoucherDto dto = new VoucherDto();
dto.setVoucherID(a.get("VoucherID").toString()); dto.setVoucherID(a.get("VoucherID").toString());
......
...@@ -20,7 +20,8 @@ import java.util.List; ...@@ -20,7 +20,8 @@ import java.util.List;
public class FunctionBase { public class FunctionBase {
protected final Logger logger = LoggerFactory.getLogger(this.getClass()); protected final Logger logger = LoggerFactory.getLogger(this.getClass());
public static final BigDecimal[] defaultTaxRates = {new BigDecimal("0.17"), new BigDecimal("0.13")
, new BigDecimal("0.11"), new BigDecimal("0.06"), new BigDecimal(" 0.05"), new BigDecimal("0.03")};
protected FormulaContext formulaContext; protected FormulaContext formulaContext;
final FormulaAgent agent; final FormulaAgent agent;
......
...@@ -121,7 +121,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -121,7 +121,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
} }
} }
List<InputInvoiceDataSourceDto> dataSource = new ArrayList(); List<InputInvoiceDataSourceDto> dataSource = new ArrayList<>();
for (InputVATInvoice x : inputVATInvoices) { for (InputVATInvoice x : inputVATInvoices) {
InputInvoiceDataSourceDto inputInvoiceDataSourceDto = new InputInvoiceDataSourceDto(); InputInvoiceDataSourceDto inputInvoiceDataSourceDto = new InputInvoiceDataSourceDto();
inputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(x.getAmount(), KeyValueConfigResultType.Accounting, inputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(x.getAmount(), KeyValueConfigResultType.Accounting,
......
...@@ -5,9 +5,17 @@ import org.apache.poi.ss.formula.OperationEvaluationContext; ...@@ -5,9 +5,17 @@ import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.EnumOperationType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dto.vatdto.InputInvoiceDetailDataSourceDto;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceResultDto;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/// <summary> /// <summary>
...@@ -64,8 +72,67 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction { ...@@ -64,8 +72,67 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
taxRateVal = taxRateVal.divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP); taxRateVal = taxRateVal.divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP);
} }
String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgID(formulaContext.getOrganizationID(), curYear);
List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputVATInvoiceMapper.getInputVATInvoiceResultDto(dbName);
if (!goodsName.equals("99")) {
inputInvoice = inputInvoice.stream()
.filter(a -> a.getGoodsMapping() != null && a.getGoodsMapping().getStdGoodsName().equals(goodsName))
.collect(Collectors.toList());
}
if (taxRateVal.compareTo(new BigDecimal("-1")) == 0) {
inputInvoice = inputInvoice.stream()
.filter(a -> Arrays.asList(FunctionBase.defaultTaxRates).contains(a.getInputVATInvoiceItem().getTaxRate()))
.collect(Collectors.toList());
} else if (taxRateVal.compareTo(new BigDecimal("99")) != 0) {
BigDecimal finalTaxRateVal = taxRateVal;
inputInvoice = inputInvoice.stream()
.filter(a -> a.getInputVATInvoiceItem().getTaxRate().equals(finalTaxRateVal))
.collect(Collectors.toList());
}
if (period != 99) {
int finalPeriod = period;
inputInvoice = inputInvoice.stream()
.filter(a -> a.getInputVATInvoice().getPeriodID() == finalPeriod)
.collect(Collectors.toList());
}
List<InputInvoiceDetailDataSourceDto> dataSouce = new ArrayList<>();
for (InputVATInvoiceResultDto x : inputInvoice) {
InputInvoiceDetailDataSourceDto inputInvoiceDetailDataSourceDto = new InputInvoiceDetailDataSourceDto();
inputInvoiceDetailDataSourceDto.setAmount(FormulaHelper.roundValue(x.getInputVATInvoiceItem().getAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
inputInvoiceDetailDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode());
inputInvoiceDetailDataSourceDto.setTaxAmount(FormulaHelper.roundValue(x.getInputVATInvoiceItem().getTaxAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
inputInvoiceDetailDataSourceDto.setTaxRate(x.getInputVATInvoiceItem().getTaxRate());
inputInvoiceDetailDataSourceDto.setInvoiceNumber(x.getInputVATInvoice().getInvoiceNumber());
inputInvoiceDetailDataSourceDto.setInvoiceDate(x.getInputVATInvoice().getInvoiceDate());
inputInvoiceDetailDataSourceDto.setInvoiceCode(x.getInputVATInvoice().getInvoiceCode());
inputInvoiceDetailDataSourceDto.setPeriod(x.getInputVATInvoice().getPeriodID());
inputInvoiceDetailDataSourceDto.setProductionName(x.getInputVATInvoiceItem().getProductionName());
inputInvoiceDetailDataSourceDto.setName(Constant.DataSourceName.InputDetailInvoiceDataSource);
inputInvoiceDetailDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
dataSouce.add(inputInvoiceDetailDataSourceDto);
}
dataSouce = dataSouce.stream()
.sorted(Comparator.comparing(InputInvoiceDetailDataSourceDto::getInvoiceDate)
.thenComparing(InputInvoiceDetailDataSourceDto::getInvoiceCode)
.thenComparing(InputInvoiceDetailDataSourceDto::getInvoiceNumber))
.collect(Collectors.toList());
if (amountType == 0) {
double val = dataSouce.stream().mapToDouble(a -> a.getAmount().doubleValue()).sum();
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSouce), FormulaDataSourceDetailType.InputInvoiceDetailDataSourceDto, new BigDecimal(val));
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSourceId);
return new NumberEval(val);
} else if (amountType == 1) {
double val = dataSouce.stream().mapToDouble(a -> a.getTaxAmount().doubleValue()).sum();
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSouce), FormulaDataSourceDetailType.InputInvoiceDetailDataSourceDto, new BigDecimal(val));
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSourceId);
return new NumberEval(val);
}
return NumberEval.ZERO; return NumberEval.ZERO;
} }
......
...@@ -91,7 +91,7 @@ public class XXFP extends FunctionBase implements FreeRefFunction { ...@@ -91,7 +91,7 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
outputInvoice = outputInvoice.stream().filter(a -> a.getInvoice().getPeriodID().equals(finalPeriod)).collect(Collectors.toList()); outputInvoice = outputInvoice.stream().filter(a -> a.getInvoice().getPeriodID().equals(finalPeriod)).collect(Collectors.toList());
} }
List<OutputInvoiceDataSourceDto> dataSource = new ArrayList(); List<OutputInvoiceDataSourceDto> dataSource = new ArrayList<>();
for (OutputVATInvoiceDto x : outputInvoice) { for (OutputVATInvoiceDto x : outputInvoice) {
OutputInvoiceDataSourceDto outputInvoiceDataSourceDto = new OutputInvoiceDataSourceDto(); OutputInvoiceDataSourceDto outputInvoiceDataSourceDto = new OutputInvoiceDataSourceDto();
outputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(x.getInvoiceItem().getAmount(), outputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(x.getInvoiceItem().getAmount(),
......
<?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.InputVATInvoiceMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.InputVATInvoiceMapper">
<resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.InputVATInvoice"> <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.InputVATInvoice">
<!-- <!--
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="VARCHAR" property="ID" /> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="PeriodID" jdbcType="INTEGER" property="periodID" /> <result column="PeriodID" jdbcType="INTEGER" property="periodID"/>
<result column="InvoiceCode" jdbcType="VARCHAR" property="invoiceCode" /> <result column="InvoiceCode" jdbcType="VARCHAR" property="invoiceCode"/>
<result column="InvoiceNumber" jdbcType="VARCHAR" property="invoiceNumber" /> <result column="InvoiceNumber" jdbcType="VARCHAR" property="invoiceNumber"/>
<result column="InvoiceDate" jdbcType="TIMESTAMP" property="invoiceDate" /> <result column="InvoiceDate" jdbcType="TIMESTAMP" property="invoiceDate"/>
<result column="SellerTaxNumber" jdbcType="VARCHAR" property="sellerTaxNumber" /> <result column="SellerTaxNumber" jdbcType="VARCHAR" property="sellerTaxNumber"/>
<result column="Amount" jdbcType="DECIMAL" property="amount" /> <result column="Amount" jdbcType="DECIMAL" property="amount"/>
<result column="TaxAmount" jdbcType="DECIMAL" property="taxAmount" /> <result column="TaxAmount" jdbcType="DECIMAL" property="taxAmount"/>
<result column="InvoiceType" jdbcType="INTEGER" property="invoiceType" /> <result column="InvoiceType" jdbcType="INTEGER" property="invoiceType"/>
<result column="CertificationResult" jdbcType="VARCHAR" property="certificationResult" /> <result column="CertificationResult" jdbcType="VARCHAR" property="certificationResult"/>
<result column="CertificationDate" jdbcType="TIMESTAMP" property="certificationDate" /> <result column="CertificationDate" jdbcType="TIMESTAMP" property="certificationDate"/>
<result column="CreatorID" jdbcType="VARCHAR" property="creatorID" /> <result column="CreatorID" jdbcType="VARCHAR" property="creatorID"/>
<result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" /> <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime"/>
<result column="Status" jdbcType="INTEGER" property="status" /> <result column="Status" jdbcType="INTEGER" property="status"/>
<result column="PartAccntedPeriod" jdbcType="INTEGER" property="partAccntedPeriod" /> <result column="PartAccntedPeriod" jdbcType="INTEGER" property="partAccntedPeriod"/>
<result column="AccntedPeriod" jdbcType="INTEGER" property="accntedPeriod" /> <result column="AccntedPeriod" jdbcType="INTEGER" property="accntedPeriod"/>
</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>
</if> </sql>
</foreach> <sql id="Base_Column_List">
</where> <!--
</sql> WARNING - @mbg.generated
<sql id="Base_Column_List"> This element is automatically generated by MyBatis Generator, do not modify.
<!-- -->
WARNING - @mbg.generated ID, PeriodID, InvoiceCode, InvoiceNumber, InvoiceDate, SellerTaxNumber, Amount, TaxAmount,
This element is automatically generated by MyBatis Generator, do not modify. InvoiceType, CertificationResult, CertificationDate, CreatorID, CreateTime, `Status`,
--> PartAccntedPeriod, AccntedPeriod
ID, PeriodID, InvoiceCode, InvoiceNumber, InvoiceDate, SellerTaxNumber, Amount, TaxAmount, </sql>
InvoiceType, CertificationResult, CertificationDate, CreatorID, CreateTime, `Status`, <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoiceExample"
PartAccntedPeriod, AccntedPeriod resultMap="BaseResultMap">
</sql> <!--
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoiceExample" resultMap="BaseResultMap"> 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. select
--> <if test="distinct">
select distinct
<if test="distinct"> </if>
distinct <include refid="Base_Column_List"/>
</if> from InputVATInvoice
<include refid="Base_Column_List" /> <if test="_parameter != null">
from InputVATInvoice <include refid="Example_Where_Clause"/>
<if test="_parameter != null"> </if>
<include refid="Example_Where_Clause" /> <if test="orderByClause != null">
</if> order by ${orderByClause}
<if test="orderByClause != null"> </if>
order by ${orderByClause} </select>
</if> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
</select> <!--
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> 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. select
--> <include refid="Base_Column_List"/>
select from InputVATInvoice
<include refid="Base_Column_List" /> where ID = #{ID,jdbcType=VARCHAR}
from InputVATInvoice </select>
where ID = #{ID,jdbcType=VARCHAR} <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
</select> <!--
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> 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. delete from InputVATInvoice
--> where ID = #{ID,jdbcType=VARCHAR}
delete from InputVATInvoice </delete>
where ID = #{ID,jdbcType=VARCHAR} <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoiceExample">
</delete> <!--
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoiceExample"> 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. delete from InputVATInvoice
--> <if test="_parameter != null">
delete from InputVATInvoice <include refid="Example_Where_Clause"/>
<if test="_parameter != null"> </if>
<include refid="Example_Where_Clause" /> </delete>
</if> <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoice">
</delete> <!--
<insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoice"> 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. insert into InputVATInvoice (ID, PeriodID, InvoiceCode,
--> InvoiceNumber, InvoiceDate, SellerTaxNumber,
insert into InputVATInvoice (ID, PeriodID, InvoiceCode, Amount, TaxAmount, InvoiceType,
InvoiceNumber, InvoiceDate, SellerTaxNumber, CertificationResult, CertificationDate,
Amount, TaxAmount, InvoiceType, CreatorID, CreateTime, `Status`,
CertificationResult, CertificationDate, PartAccntedPeriod, AccntedPeriod)
CreatorID, CreateTime, `Status`, values (#{ID,jdbcType=VARCHAR}, #{periodID,jdbcType=INTEGER}, #{invoiceCode,jdbcType=VARCHAR},
PartAccntedPeriod, AccntedPeriod) #{invoiceNumber,jdbcType=VARCHAR}, #{invoiceDate,jdbcType=TIMESTAMP}, #{sellerTaxNumber,jdbcType=VARCHAR},
values (#{ID,jdbcType=VARCHAR}, #{periodID,jdbcType=INTEGER}, #{invoiceCode,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{taxAmount,jdbcType=DECIMAL}, #{invoiceType,jdbcType=INTEGER},
#{invoiceNumber,jdbcType=VARCHAR}, #{invoiceDate,jdbcType=TIMESTAMP}, #{sellerTaxNumber,jdbcType=VARCHAR}, #{certificationResult,jdbcType=VARCHAR}, #{certificationDate,jdbcType=TIMESTAMP},
#{amount,jdbcType=DECIMAL}, #{taxAmount,jdbcType=DECIMAL}, #{invoiceType,jdbcType=INTEGER}, #{creatorID,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER},
#{certificationResult,jdbcType=VARCHAR}, #{certificationDate,jdbcType=TIMESTAMP}, #{partAccntedPeriod,jdbcType=INTEGER}, #{accntedPeriod,jdbcType=INTEGER})
#{creatorID,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, </insert>
#{partAccntedPeriod,jdbcType=INTEGER}, #{accntedPeriod,jdbcType=INTEGER}) <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoice">
</insert> <!--
<insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoice"> 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. insert into InputVATInvoice
--> <trim prefix="(" suffix=")" suffixOverrides=",">
insert into InputVATInvoice <if test="ID != null">
<trim prefix="(" suffix=")" suffixOverrides=","> ID,
<if test="ID != null"> </if>
ID, <if test="periodID != null">
</if> PeriodID,
<if test="periodID != null"> </if>
PeriodID, <if test="invoiceCode != null">
</if> InvoiceCode,
<if test="invoiceCode != null"> </if>
InvoiceCode, <if test="invoiceNumber != null">
</if> InvoiceNumber,
<if test="invoiceNumber != null"> </if>
InvoiceNumber, <if test="invoiceDate != null">
</if> InvoiceDate,
<if test="invoiceDate != null"> </if>
InvoiceDate, <if test="sellerTaxNumber != null">
</if> SellerTaxNumber,
<if test="sellerTaxNumber != null"> </if>
SellerTaxNumber, <if test="amount != null">
</if> Amount,
<if test="amount != null"> </if>
Amount, <if test="taxAmount != null">
</if> TaxAmount,
<if test="taxAmount != null"> </if>
TaxAmount, <if test="invoiceType != null">
</if> InvoiceType,
<if test="invoiceType != null"> </if>
InvoiceType, <if test="certificationResult != null">
</if> CertificationResult,
<if test="certificationResult != null"> </if>
CertificationResult, <if test="certificationDate != null">
</if> CertificationDate,
<if test="certificationDate != null"> </if>
CertificationDate, <if test="creatorID != null">
</if> CreatorID,
<if test="creatorID != null"> </if>
CreatorID, <if test="createTime != null">
</if> CreateTime,
<if test="createTime != null"> </if>
CreateTime, <if test="status != null">
</if> `Status`,
<if test="status != null"> </if>
`Status`, <if test="partAccntedPeriod != null">
</if> PartAccntedPeriod,
<if test="partAccntedPeriod != null"> </if>
PartAccntedPeriod, <if test="accntedPeriod != null">
</if> AccntedPeriod,
<if test="accntedPeriod != null"> </if>
AccntedPeriod, </trim>
</if> <trim prefix="values (" suffix=")" suffixOverrides=",">
</trim> <if test="ID != null">
<trim prefix="values (" suffix=")" suffixOverrides=","> #{ID,jdbcType=VARCHAR},
<if test="ID != null"> </if>
#{ID,jdbcType=VARCHAR}, <if test="periodID != null">
</if> #{periodID,jdbcType=INTEGER},
<if test="periodID != null"> </if>
#{periodID,jdbcType=INTEGER}, <if test="invoiceCode != null">
</if> #{invoiceCode,jdbcType=VARCHAR},
<if test="invoiceCode != null"> </if>
#{invoiceCode,jdbcType=VARCHAR}, <if test="invoiceNumber != null">
</if> #{invoiceNumber,jdbcType=VARCHAR},
<if test="invoiceNumber != null"> </if>
#{invoiceNumber,jdbcType=VARCHAR}, <if test="invoiceDate != null">
</if> #{invoiceDate,jdbcType=TIMESTAMP},
<if test="invoiceDate != null"> </if>
#{invoiceDate,jdbcType=TIMESTAMP}, <if test="sellerTaxNumber != null">
</if> #{sellerTaxNumber,jdbcType=VARCHAR},
<if test="sellerTaxNumber != null"> </if>
#{sellerTaxNumber,jdbcType=VARCHAR}, <if test="amount != null">
</if> #{amount,jdbcType=DECIMAL},
<if test="amount != null"> </if>
#{amount,jdbcType=DECIMAL}, <if test="taxAmount != null">
</if> #{taxAmount,jdbcType=DECIMAL},
<if test="taxAmount != null"> </if>
#{taxAmount,jdbcType=DECIMAL}, <if test="invoiceType != null">
</if> #{invoiceType,jdbcType=INTEGER},
<if test="invoiceType != null"> </if>
#{invoiceType,jdbcType=INTEGER}, <if test="certificationResult != null">
</if> #{certificationResult,jdbcType=VARCHAR},
<if test="certificationResult != null"> </if>
#{certificationResult,jdbcType=VARCHAR}, <if test="certificationDate != null">
</if> #{certificationDate,jdbcType=TIMESTAMP},
<if test="certificationDate != null"> </if>
#{certificationDate,jdbcType=TIMESTAMP}, <if test="creatorID != null">
</if> #{creatorID,jdbcType=VARCHAR},
<if test="creatorID != null"> </if>
#{creatorID,jdbcType=VARCHAR}, <if test="createTime != null">
</if> #{createTime,jdbcType=TIMESTAMP},
<if test="createTime != null"> </if>
#{createTime,jdbcType=TIMESTAMP}, <if test="status != null">
</if> #{status,jdbcType=INTEGER},
<if test="status != null"> </if>
#{status,jdbcType=INTEGER}, <if test="partAccntedPeriod != null">
</if> #{partAccntedPeriod,jdbcType=INTEGER},
<if test="partAccntedPeriod != null"> </if>
#{partAccntedPeriod,jdbcType=INTEGER}, <if test="accntedPeriod != null">
</if> #{accntedPeriod,jdbcType=INTEGER},
<if test="accntedPeriod != null"> </if>
#{accntedPeriod,jdbcType=INTEGER}, </trim>
</if> </insert>
</trim> <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoiceExample"
</insert> resultType="java.lang.Long">
<select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoiceExample" resultType="java.lang.Long"> <!--
<!-- 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 count(*) from InputVATInvoice
select count(*) from InputVATInvoice <if test="_parameter != null">
<if test="_parameter != null"> <include refid="Example_Where_Clause"/>
<include refid="Example_Where_Clause" /> </if>
</if> </select>
</select> <update id="updateByExampleSelective" parameterType="map">
<update id="updateByExampleSelective" parameterType="map"> <!--
<!-- 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 InputVATInvoice
update InputVATInvoice <set>
<set> <if test="record.ID != null">
<if test="record.ID != null"> ID = #{record.ID,jdbcType=VARCHAR},
ID = #{record.ID,jdbcType=VARCHAR}, </if>
</if> <if test="record.periodID != null">
<if test="record.periodID != null"> PeriodID = #{record.periodID,jdbcType=INTEGER},
</if>
<if test="record.invoiceCode != null">
InvoiceCode = #{record.invoiceCode,jdbcType=VARCHAR},
</if>
<if test="record.invoiceNumber != null">
InvoiceNumber = #{record.invoiceNumber,jdbcType=VARCHAR},
</if>
<if test="record.invoiceDate != null">
InvoiceDate = #{record.invoiceDate,jdbcType=TIMESTAMP},
</if>
<if test="record.sellerTaxNumber != null">
SellerTaxNumber = #{record.sellerTaxNumber,jdbcType=VARCHAR},
</if>
<if test="record.amount != null">
Amount = #{record.amount,jdbcType=DECIMAL},
</if>
<if test="record.taxAmount != null">
TaxAmount = #{record.taxAmount,jdbcType=DECIMAL},
</if>
<if test="record.invoiceType != null">
InvoiceType = #{record.invoiceType,jdbcType=INTEGER},
</if>
<if test="record.certificationResult != null">
CertificationResult = #{record.certificationResult,jdbcType=VARCHAR},
</if>
<if test="record.certificationDate != null">
CertificationDate = #{record.certificationDate,jdbcType=TIMESTAMP},
</if>
<if test="record.creatorID != null">
CreatorID = #{record.creatorID,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.status != null">
`Status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.partAccntedPeriod != null">
PartAccntedPeriod = #{record.partAccntedPeriod,jdbcType=INTEGER},
</if>
<if test="record.accntedPeriod != null">
AccntedPeriod = #{record.accntedPeriod,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update InputVATInvoice
set ID = #{record.ID,jdbcType=VARCHAR},
PeriodID = #{record.periodID,jdbcType=INTEGER}, PeriodID = #{record.periodID,jdbcType=INTEGER},
</if>
<if test="record.invoiceCode != null">
InvoiceCode = #{record.invoiceCode,jdbcType=VARCHAR}, InvoiceCode = #{record.invoiceCode,jdbcType=VARCHAR},
</if>
<if test="record.invoiceNumber != null">
InvoiceNumber = #{record.invoiceNumber,jdbcType=VARCHAR}, InvoiceNumber = #{record.invoiceNumber,jdbcType=VARCHAR},
</if>
<if test="record.invoiceDate != null">
InvoiceDate = #{record.invoiceDate,jdbcType=TIMESTAMP}, InvoiceDate = #{record.invoiceDate,jdbcType=TIMESTAMP},
</if>
<if test="record.sellerTaxNumber != null">
SellerTaxNumber = #{record.sellerTaxNumber,jdbcType=VARCHAR}, SellerTaxNumber = #{record.sellerTaxNumber,jdbcType=VARCHAR},
</if>
<if test="record.amount != null">
Amount = #{record.amount,jdbcType=DECIMAL}, Amount = #{record.amount,jdbcType=DECIMAL},
</if>
<if test="record.taxAmount != null">
TaxAmount = #{record.taxAmount,jdbcType=DECIMAL}, TaxAmount = #{record.taxAmount,jdbcType=DECIMAL},
</if>
<if test="record.invoiceType != null">
InvoiceType = #{record.invoiceType,jdbcType=INTEGER}, InvoiceType = #{record.invoiceType,jdbcType=INTEGER},
</if>
<if test="record.certificationResult != null">
CertificationResult = #{record.certificationResult,jdbcType=VARCHAR}, CertificationResult = #{record.certificationResult,jdbcType=VARCHAR},
</if>
<if test="record.certificationDate != null">
CertificationDate = #{record.certificationDate,jdbcType=TIMESTAMP}, CertificationDate = #{record.certificationDate,jdbcType=TIMESTAMP},
</if>
<if test="record.creatorID != null">
CreatorID = #{record.creatorID,jdbcType=VARCHAR}, CreatorID = #{record.creatorID,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
CreateTime = #{record.createTime,jdbcType=TIMESTAMP}, CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.status != null">
`Status` = #{record.status,jdbcType=INTEGER}, `Status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.partAccntedPeriod != null">
PartAccntedPeriod = #{record.partAccntedPeriod,jdbcType=INTEGER}, PartAccntedPeriod = #{record.partAccntedPeriod,jdbcType=INTEGER},
</if> AccntedPeriod = #{record.accntedPeriod,jdbcType=INTEGER}
<if test="record.accntedPeriod != null"> <if test="_parameter != null">
AccntedPeriod = #{record.accntedPeriod,jdbcType=INTEGER}, <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</set> </update>
<if test="_parameter != null"> <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoice">
<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 InputVATInvoice
WARNING - @mbg.generated <set>
This element is automatically generated by MyBatis Generator, do not modify. <if test="periodID != null">
--> PeriodID = #{periodID,jdbcType=INTEGER},
update InputVATInvoice </if>
set ID = #{record.ID,jdbcType=VARCHAR}, <if test="invoiceCode != null">
PeriodID = #{record.periodID,jdbcType=INTEGER}, InvoiceCode = #{invoiceCode,jdbcType=VARCHAR},
InvoiceCode = #{record.invoiceCode,jdbcType=VARCHAR}, </if>
InvoiceNumber = #{record.invoiceNumber,jdbcType=VARCHAR}, <if test="invoiceNumber != null">
InvoiceDate = #{record.invoiceDate,jdbcType=TIMESTAMP}, InvoiceNumber = #{invoiceNumber,jdbcType=VARCHAR},
SellerTaxNumber = #{record.sellerTaxNumber,jdbcType=VARCHAR}, </if>
Amount = #{record.amount,jdbcType=DECIMAL}, <if test="invoiceDate != null">
TaxAmount = #{record.taxAmount,jdbcType=DECIMAL}, InvoiceDate = #{invoiceDate,jdbcType=TIMESTAMP},
InvoiceType = #{record.invoiceType,jdbcType=INTEGER}, </if>
CertificationResult = #{record.certificationResult,jdbcType=VARCHAR}, <if test="sellerTaxNumber != null">
CertificationDate = #{record.certificationDate,jdbcType=TIMESTAMP}, SellerTaxNumber = #{sellerTaxNumber,jdbcType=VARCHAR},
CreatorID = #{record.creatorID,jdbcType=VARCHAR}, </if>
CreateTime = #{record.createTime,jdbcType=TIMESTAMP}, <if test="amount != null">
`Status` = #{record.status,jdbcType=INTEGER}, Amount = #{amount,jdbcType=DECIMAL},
PartAccntedPeriod = #{record.partAccntedPeriod,jdbcType=INTEGER}, </if>
AccntedPeriod = #{record.accntedPeriod,jdbcType=INTEGER} <if test="taxAmount != null">
<if test="_parameter != null"> TaxAmount = #{taxAmount,jdbcType=DECIMAL},
<include refid="Update_By_Example_Where_Clause" /> </if>
</if> <if test="invoiceType != null">
</update> InvoiceType = #{invoiceType,jdbcType=INTEGER},
<update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoice"> </if>
<!-- <if test="certificationResult != null">
WARNING - @mbg.generated CertificationResult = #{certificationResult,jdbcType=VARCHAR},
This element is automatically generated by MyBatis Generator, do not modify. </if>
--> <if test="certificationDate != null">
update InputVATInvoice CertificationDate = #{certificationDate,jdbcType=TIMESTAMP},
<set> </if>
<if test="periodID != null"> <if test="creatorID != null">
PeriodID = #{periodID,jdbcType=INTEGER}, CreatorID = #{creatorID,jdbcType=VARCHAR},
</if> </if>
<if test="invoiceCode != null"> <if test="createTime != null">
CreateTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
`Status` = #{status,jdbcType=INTEGER},
</if>
<if test="partAccntedPeriod != null">
PartAccntedPeriod = #{partAccntedPeriod,jdbcType=INTEGER},
</if>
<if test="accntedPeriod != null">
AccntedPeriod = #{accntedPeriod,jdbcType=INTEGER},
</if>
</set>
where ID = #{ID,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoice">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update InputVATInvoice
set PeriodID = #{periodID,jdbcType=INTEGER},
InvoiceCode = #{invoiceCode,jdbcType=VARCHAR}, InvoiceCode = #{invoiceCode,jdbcType=VARCHAR},
</if>
<if test="invoiceNumber != null">
InvoiceNumber = #{invoiceNumber,jdbcType=VARCHAR}, InvoiceNumber = #{invoiceNumber,jdbcType=VARCHAR},
</if>
<if test="invoiceDate != null">
InvoiceDate = #{invoiceDate,jdbcType=TIMESTAMP}, InvoiceDate = #{invoiceDate,jdbcType=TIMESTAMP},
</if>
<if test="sellerTaxNumber != null">
SellerTaxNumber = #{sellerTaxNumber,jdbcType=VARCHAR}, SellerTaxNumber = #{sellerTaxNumber,jdbcType=VARCHAR},
</if>
<if test="amount != null">
Amount = #{amount,jdbcType=DECIMAL}, Amount = #{amount,jdbcType=DECIMAL},
</if>
<if test="taxAmount != null">
TaxAmount = #{taxAmount,jdbcType=DECIMAL}, TaxAmount = #{taxAmount,jdbcType=DECIMAL},
</if>
<if test="invoiceType != null">
InvoiceType = #{invoiceType,jdbcType=INTEGER}, InvoiceType = #{invoiceType,jdbcType=INTEGER},
</if>
<if test="certificationResult != null">
CertificationResult = #{certificationResult,jdbcType=VARCHAR}, CertificationResult = #{certificationResult,jdbcType=VARCHAR},
</if>
<if test="certificationDate != null">
CertificationDate = #{certificationDate,jdbcType=TIMESTAMP}, CertificationDate = #{certificationDate,jdbcType=TIMESTAMP},
</if>
<if test="creatorID != null">
CreatorID = #{creatorID,jdbcType=VARCHAR}, CreatorID = #{creatorID,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
CreateTime = #{createTime,jdbcType=TIMESTAMP}, CreateTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
`Status` = #{status,jdbcType=INTEGER}, `Status` = #{status,jdbcType=INTEGER},
</if>
<if test="partAccntedPeriod != null">
PartAccntedPeriod = #{partAccntedPeriod,jdbcType=INTEGER}, PartAccntedPeriod = #{partAccntedPeriod,jdbcType=INTEGER},
</if> AccntedPeriod = #{accntedPeriod,jdbcType=INTEGER}
<if test="accntedPeriod != null"> where ID = #{ID,jdbcType=VARCHAR}
AccntedPeriod = #{accntedPeriod,jdbcType=INTEGER}, </update>
</if> <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoiceExample"
</set> resultMap="BaseResultMap">
where ID = #{ID,jdbcType=VARCHAR} <!--
</update> WARNING - @mbg.generated
<update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoice"> 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 InputVATInvoice </if>
set PeriodID = #{periodID,jdbcType=INTEGER}, <include refid="Base_Column_List"/>
InvoiceCode = #{invoiceCode,jdbcType=VARCHAR}, from InputVATInvoice
InvoiceNumber = #{invoiceNumber,jdbcType=VARCHAR}, <if test="_parameter != null">
InvoiceDate = #{invoiceDate,jdbcType=TIMESTAMP}, <include refid="Example_Where_Clause"/>
SellerTaxNumber = #{sellerTaxNumber,jdbcType=VARCHAR}, </if>
Amount = #{amount,jdbcType=DECIMAL}, <if test="orderByClause != null">
TaxAmount = #{taxAmount,jdbcType=DECIMAL}, order by ${orderByClause}
InvoiceType = #{invoiceType,jdbcType=INTEGER}, </if>
CertificationResult = #{certificationResult,jdbcType=VARCHAR}, </select>
CertificationDate = #{certificationDate,jdbcType=TIMESTAMP}, <select id="getInputVATInvoiceCountByCondition"
CreatorID = #{creatorID,jdbcType=VARCHAR}, parameterType="pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam" resultType="java.lang.Long">
CreateTime = #{createTime,jdbcType=TIMESTAMP},
`Status` = #{status,jdbcType=INTEGER},
PartAccntedPeriod = #{partAccntedPeriod,jdbcType=INTEGER},
AccntedPeriod = #{accntedPeriod,jdbcType=INTEGER}
where ID = #{ID,jdbcType=VARCHAR}
</update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoiceExample" 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 InputVATInvoice
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="getInputVATInvoiceCountByCondition" parameterType="pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam" resultType="java.lang.Long">
SELECT COUNT(1) FROM InputVATInvoice WHERE 1=1 SELECT COUNT(1) FROM InputVATInvoice WHERE 1=1
<if test="paras.periodStart"> <if test="paras.periodStart">
AND PeriodID&gt;=#{paras.periodStart,jdbcType=VARCHAR} AND PeriodID&gt;=#{paras.periodStart,jdbcType=VARCHAR}
...@@ -555,4 +561,91 @@ ...@@ -555,4 +561,91 @@
LIMIT #{limitFrom,jdbcType=INTEGER},#{paras.pageInfo.pageSize,jdbcType=INTEGER} LIMIT #{limitFrom,jdbcType=INTEGER},#{paras.pageInfo.pageSize,jdbcType=INTEGER}
</if> </if>
</select> </select>
<resultMap id="inputVATInvoiceResultDto" type="pwc.taxtech.atms.dto.vatdto.InputVATInvoiceResultDto">
<id property="invoiceID" column="invoice_id"/>
<association property="inputVATInvoice" javaType="pwc.taxtech.atms.vat.entity.InputVATInvoice">
<id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="PeriodID" jdbcType="INTEGER" property="periodID"/>
<result column="InvoiceCode" jdbcType="VARCHAR" property="invoiceCode"/>
<result column="InvoiceNumber" jdbcType="VARCHAR" property="invoiceNumber"/>
<result column="InvoiceDate" jdbcType="TIMESTAMP" property="invoiceDate"/>
<result column="SellerTaxNumber" jdbcType="VARCHAR" property="sellerTaxNumber"/>
<result column="Amount" jdbcType="DECIMAL" property="amount"/>
<result column="TaxAmount" jdbcType="DECIMAL" property="taxAmount"/>
<result column="InvoiceType" jdbcType="INTEGER" property="invoiceType"/>
<result column="CertificationResult" jdbcType="VARCHAR" property="certificationResult"/>
<result column="CertificationDate" jdbcType="TIMESTAMP" property="certificationDate"/>
<result column="CreatorID" jdbcType="VARCHAR" property="creatorID"/>
<result column="CreateTime" jdbcType="TIMESTAMP" property="createTime"/>
<result column="Status" jdbcType="INTEGER" property="status"/>
<result column="PartAccntedPeriod" jdbcType="INTEGER" property="partAccntedPeriod"/>
<result column="AccntedPeriod" jdbcType="INTEGER" property="accntedPeriod"/>
</association>
<association property="inputVATInvoiceItem" javaType="pwc.taxtech.atms.vat.entity.InputVATInvoiceItem">
<id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="InputVATInvoiceID" jdbcType="VARCHAR" property="inputVATInvoiceID"/>
<result column="PeriodID" jdbcType="INTEGER" property="periodID"/>
<result column="InvoiceCode" jdbcType="VARCHAR" property="invoiceCode"/>
<result column="InvoiceNumber" jdbcType="VARCHAR" property="invoiceNumber"/>
<result column="Amount" jdbcType="DECIMAL" property="amount"/>
<result column="TaxAmount" jdbcType="DECIMAL" property="taxAmount"/>
<result column="TaxRate" jdbcType="DECIMAL" property="taxRate"/>
<result column="ProductionName" jdbcType="VARCHAR" property="productionName"/>
<result column="CreatorID" jdbcType="VARCHAR" property="creatorID"/>
<result column="CreateTime" jdbcType="TIMESTAMP" property="createTime"/>
<result column="ProductionCode" jdbcType="VARCHAR" property="productionCode"/>
</association>
<association property="goodsMapping" javaType="pwc.taxtech.atms.vat.entity.GoodsMapping">
<id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="CustGoodsName" jdbcType="VARCHAR" property="custGoodsName"/>
<result column="StdGoodsName" jdbcType="VARCHAR" property="stdGoodsName"/>
<result column="CreatorID" jdbcType="VARCHAR" property="creatorID"/>
<result column="CreateTime" jdbcType="TIMESTAMP" property="createTime"/>
<result column="UpdateTime" jdbcType="TIMESTAMP" property="updateTime"/>
</association>
</resultMap>
<select id="getInputVATInvoiceResultDto" resultMap="inputVATInvoiceResultDto" parameterType="java.lang.String">
SELECT
inputVatInvoice.ID AS invoice_id,
inputVatInvoice.ID,
inputVatInvoice.PeriodID,
inputVatInvoice.InvoiceCode,
inputVatInvoice.InvoiceNumber,
inputVatInvoice.InvoiceDate,
inputVatInvoice.SellerTaxNumber,
inputVatInvoice.Amount,
inputVatInvoice.TaxAmount,
inputVatInvoice.InvoiceType,
inputVatInvoice.CertificationResult,
inputVatInvoice.CertificationDate,
inputVatInvoice.CreatorID,
inputVatInvoice.CreateTime,
inputVatInvoice.`STATUS`,
inputVatInvoice.PartAccntedPeriod,
inputVatInvoice.AccntedPeriod,
inputVatInvoiceItem.ID,
inputVatInvoiceItem.InputVATInvoiceID,
inputVatInvoiceItem.PeriodID,
inputVatInvoiceItem.InvoiceCode,
inputVatInvoiceItem.InvoiceNumber,
inputVatInvoiceItem.Amount,
inputVatInvoiceItem.TaxAmount,
inputVatInvoiceItem.TaxRate,
inputVatInvoiceItem.ProductionName,
inputVatInvoiceItem.CreatorID,
inputVatInvoiceItem.CreateTime,
inputVatInvoiceItem.ProductionCode,
goodsMapping.ID,
goodsMapping.CustGoodsName,
goodsMapping.StdGoodsName,
goodsMapping.CreatorID,
goodsMapping.CreateTime,
goodsMapping.UpdateTime
FROM ${dbName}.InputVATInvoice inputVatInvoice
JOIN ${dbName}.InputVATInvoiceItem inputVatInvoiceItem
ON inputVatInvoice.ID = inputVatInvoiceItem.InputVATInvoiceID
AND inputVatInvoice.PeriodID = inputVatInvoiceItem.PeriodID
LEFT JOIN ${dbName}.GoodsMapping goodsMapping
ON inputVatInvoiceItem.ProductionName = goodsMapping.CustGoodsName
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -571,43 +571,43 @@ ...@@ -571,43 +571,43 @@
</association> </association>
</resultMap> </resultMap>
<select id="getVatInvoiceWithItems" resultMap="outputVATInvoiceDto" parameterType="java.lang.String"> <select id="getVatInvoiceWithItems" resultMap="outputVATInvoiceDto" parameterType="java.lang.String">
SELECT SELECT
invoice.InvoiceID, invoice.InvoiceID,
invoice.InvoiceType, invoice.InvoiceType,
invoice.ClassCode, invoice.ClassCode,
invoice.InvoiceNumber, invoice.InvoiceNumber,
invoice.BuyerName, invoice.BuyerName,
invoice.BuyerTaxNumber, invoice.BuyerTaxNumber,
invoice.BankAccount, invoice.BankAccount,
invoice.PhoneNum, invoice.PhoneNum,
invoice.InvoiceDate, invoice.InvoiceDate,
invoice.SeqNo, invoice.SeqNo,
invoice.PeriodID, invoice.PeriodID,
invoice.`STATUS`, invoice.`STATUS`,
invoice.CreatorID, invoice.CreatorID,
invoice.CreateTime, invoice.CreateTime,
invoice.PartAccntedPeriod, invoice.PartAccntedPeriod,
invoice.AccntedPeriod, invoice.AccntedPeriod,
invoiceItem.ItemID, invoiceItem.ItemID,
invoiceItem.InvoiceID, invoiceItem.InvoiceID,
invoiceItem.CodeVersion, invoiceItem.CodeVersion,
invoiceItem.ProductName, invoiceItem.ProductName,
invoiceItem.DocumentNum, invoiceItem.DocumentNum,
invoiceItem.ProductStandard, invoiceItem.ProductStandard,
invoiceItem.Unit, invoiceItem.Unit,
invoiceItem.Quantity, invoiceItem.Quantity,
invoiceItem.UnitPrice, invoiceItem.UnitPrice,
invoiceItem.Amount, invoiceItem.Amount,
invoiceItem.TaxRate, invoiceItem.TaxRate,
invoiceItem.TaxAmount, invoiceItem.TaxAmount,
invoiceItem.SeqNo, invoiceItem.SeqNo,
invoiceItem.TaxClassCode, invoiceItem.TaxClassCode,
invoiceItem.CreatorID, invoiceItem.CreatorID,
invoiceItem.CreateTime, invoiceItem.CreateTime,
invoiceItem.PeriodID invoiceItem.PeriodID
FROM ${dbName}.OutputVATInvoice invoice FROM ${dbName}.OutputVATInvoice invoice
JOIN ${dbName}.OutputVATInvoiceItem invoiceItem JOIN ${dbName}.OutputVATInvoiceItem invoiceItem
ON invoice.InvoiceID = invoiceItem.InvoiceID ON invoice.InvoiceID = invoiceItem.InvoiceID AND invoice.PeriodID=invoiceItem.PeriodID
ORDER BY invoice.PeriodID,invoice.ClassCode,invoice.InvoiceNumber,invoiceItem.SeqNo ORDER BY invoice.PeriodID,invoice.ClassCode,invoice.InvoiceNumber,invoiceItem.SeqNo
</select> </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