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

add new api inputInvoicePreviewList

add new api queryOutputInvoiceList
parent de46aed1
package pwc.taxtech.atms.common;
import pwc.taxtech.atms.dto.PagingDto;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class PagingList<T> {
private List<T> sourceData;
private PagingDto pagingDto;
/**
* 总页数
*/
private int totalPage = 0;
/**
* 当前是第几页
*/
private int curPageNo = 0;
/**
* 每页的大小
*/
private int pageSize = 0;
/**
* 每页默认大小
*/
private static final int DEFAULT_PAGE_SIZE = 500;
private int totalCount = 0;
public PagingList(List<T> sourceData, PagingDto pagingDto) {
this.sourceData = sourceData;
this.pagingDto = pagingDto;
this.pageSize = pagingDto.getPageSize();
this.curPageNo = pagingDto.getPageIndex();
this.totalCount = pagingDto.getTotalCount();
init();
}
private void init() {
if (pagingDto.getPageSize() <= 0) {
throw new IllegalArgumentException("Paging size must be greater than zero.");
}
if (null == sourceData) {
throw new NullPointerException("Paging resource list must be not null.");
}
if (totalCount % pageSize > 0) {
this.totalPage = (totalCount / pageSize) + 1;
} else {
this.totalPage = totalCount / pageSize;
}
}
public List<T> getPagingList() {
if (curPageNo <= totalPage) {
if (curPageNo < totalCount) {
return sourceData.stream().skip((curPageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
} else {
int lastPageItemCount = totalCount - (curPageNo - 1) * pageSize;
return sourceData.stream().skip((curPageNo - 1) * pageSize).limit(lastPageItemCount).collect(Collectors.toList());
}
} else {
return new ArrayList<>();
}
}
}
package pwc.taxtech.atms.constant.enums;
public enum EnumInvoiceType {
VATInvoice(1, "增值税专票"),
FreightTransport(2, "货运发票"),
MotorVehicle(3, "机动车发票"),
AgriculturalProduct(4, "农产品发票"),
Other(5, "其他发票");
private int code;
private String name;
EnumInvoiceType(int code, String name) {
this.code = code;
this.name = name;
}
public int getCode() {
return code;
}
public String getName() {
return name;
}
}
package pwc.taxtech.atms.constant.enums;
public enum EnumOutputInvoiceType {
Normal(0, "普通发票"),
Special(1, "专用发票"),
MotorVehicle(2, "机动车销售发票");
private int code;
private String name;
EnumOutputInvoiceType(int code, String name) {
this.code = code;
this.name = name;
}
public int getCode() {
return code;
}
public String getName() {
return name;
}
}
package pwc.taxtech.atms.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto;
import pwc.taxtech.atms.vat.service.InputInvoiceDataImportService;
@RestController
@RequestMapping(value = "api/v1/inputInvoiceImport")
public class InputInvoiceImportController {
@Autowired
InputInvoiceDataImportService inputInvoiceDataImportService;
@RequestMapping(value = "inputInvoicePreviewList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public PagingResultDto<InputVATInvoiceDto> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras) {
return inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras);
}
}
package pwc.taxtech.atms.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.dto.vatdto.QueryOutputDto;
import pwc.taxtech.atms.vat.service.OutputInvoiceService;
@RestController
@RequestMapping(value = "api/v1/outputInvoiceImport")
public class OutputInvoiceController {
@Autowired
OutputInvoiceService outputInvoiceService;
@RequestMapping(value = "queryOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public PagingResultDto<OutputVATInvoiceInfoDto> queryOutputInvoiceList(QueryOutputDto queryDto) {
return outputInvoiceService.queryOutputInvoiceList(queryDto);
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dto.PagingDto;
import java.math.BigDecimal;
import java.util.Date;
public class InputInvoicePreviewQueryParam {
private PagingDto pageInfo;
private int periodStart;
private int periodEnd;
private Date certificationDateStart;
private Date certificationDateEnd;
private String invoiceCode;
private String invoiceNumber;
private String sellerTaxNumber;
private BigDecimal amountStart;
private BigDecimal amountEnd;
private Integer invoiceType;
private BigDecimal taxAmountStart;
private BigDecimal taxAmountEnd;
/**
* 1:认证通过,2:认证不通过,3:全部
*/
private int certificationStatus;
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public int getPeriodStart() {
return periodStart;
}
public void setPeriodStart(int periodStart) {
this.periodStart = periodStart;
}
public int getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(int periodEnd) {
this.periodEnd = periodEnd;
}
public Date getCertificationDateStart() {
return certificationDateStart;
}
public void setCertificationDateStart(Date certificationDateStart) {
this.certificationDateStart = certificationDateStart;
}
public Date getCertificationDateEnd() {
return certificationDateEnd;
}
public void setCertificationDateEnd(Date certificationDateEnd) {
this.certificationDateEnd = certificationDateEnd;
}
public String getInvoiceCode() {
return invoiceCode;
}
public void setInvoiceCode(String invoiceCode) {
this.invoiceCode = invoiceCode;
}
public String getInvoiceNumber() {
return invoiceNumber;
}
public void setInvoiceNumber(String invoiceNumber) {
this.invoiceNumber = invoiceNumber;
}
public String getSellerTaxNumber() {
return sellerTaxNumber;
}
public void setSellerTaxNumber(String sellerTaxNumber) {
this.sellerTaxNumber = sellerTaxNumber;
}
public BigDecimal getAmountStart() {
return amountStart;
}
public void setAmountStart(BigDecimal amountStart) {
this.amountStart = amountStart;
}
public BigDecimal getAmountEnd() {
return amountEnd;
}
public void setAmountEnd(BigDecimal amountEnd) {
this.amountEnd = amountEnd;
}
public Integer getInvoiceType() {
return invoiceType;
}
public void setInvoiceType(Integer invoiceType) {
this.invoiceType = invoiceType;
}
public BigDecimal getTaxAmountStart() {
return taxAmountStart;
}
public void setTaxAmountStart(BigDecimal taxAmountStart) {
this.taxAmountStart = taxAmountStart;
}
public BigDecimal getTaxAmountEnd() {
return taxAmountEnd;
}
public void setTaxAmountEnd(BigDecimal taxAmountEnd) {
this.taxAmountEnd = taxAmountEnd;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.constant.enums.EnumInvoiceType;
import java.math.BigDecimal;
import java.util.Date;
public class InputVATInvoiceDto {
private String ID ;
private int periodID ;
private String invoiceCode ;
private String invoiceNumber ;
private Date invoiceDate ;
private String sellerTaxNumber ;
private BigDecimal amount ;
private BigDecimal taxAmount ;
private String invoiceTypeName;
private int invoiceType ;
private String certificationResult ;
private Date certificationDate ;
private String creatorID ;
private Date createTime ;
private boolean isDuplicate ;
public String getID() {
return ID;
}
public void setID(String ID) {
this.ID = ID;
}
public int getPeriodID() {
return periodID;
}
public void setPeriodID(int periodID) {
this.periodID = periodID;
}
public String getInvoiceCode() {
return invoiceCode;
}
public void setInvoiceCode(String invoiceCode) {
this.invoiceCode = invoiceCode;
}
public String getInvoiceNumber() {
return invoiceNumber;
}
public void setInvoiceNumber(String invoiceNumber) {
this.invoiceNumber = invoiceNumber;
}
public Date getInvoiceDate() {
return invoiceDate;
}
public void setInvoiceDate(Date invoiceDate) {
this.invoiceDate = invoiceDate;
}
public String getSellerTaxNumber() {
return sellerTaxNumber;
}
public void setSellerTaxNumber(String sellerTaxNumber) {
this.sellerTaxNumber = sellerTaxNumber;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public BigDecimal getTaxAmount() {
return taxAmount;
}
public void setTaxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount;
}
public int getInvoiceType() {
return invoiceType;
}
public void setInvoiceType(int invoiceType) {
this.invoiceType = invoiceType;
}
public String getCertificationResult() {
return certificationResult;
}
public void setCertificationResult(String certificationResult) {
this.certificationResult = certificationResult;
}
public Date getCertificationDate() {
return certificationDate;
}
public void setCertificationDate(Date certificationDate) {
this.certificationDate = certificationDate;
}
public String getCreatorID() {
return creatorID;
}
public void setCreatorID(String creatorID) {
this.creatorID = creatorID;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public boolean isDuplicate() {
return isDuplicate;
}
public void setDuplicate(boolean duplicate) {
isDuplicate = duplicate;
}
public String getInvoiceTypeName() {
return EnumInvoiceType.values()[this.invoiceType].getName();
}
}
package pwc.taxtech.atms.dto.vatdto;
public class OutputVATInvoiceDto {
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.constant.enums.EnumOutputInvoiceType;
import java.math.BigDecimal;
import java.util.Date;
public class OutputVATInvoiceInfoDto {
private String invoiceID;
private Integer invoiceType;
private String invoiceTypeName;
private String classCode;
private String invoiceNumber;
private String buyerName;
private String buyerTaxNumber;
private String bankAccount;
private String phoneNum;
private Date invoiceDate;
private String codeVersion;
private String productName;
private String documentNum;
private String productStandard;
private String unit;
private Integer quantity;
private Double unitPrice;
private BigDecimal amount;
private BigDecimal taxRate;
private BigDecimal taxAmount;
private String taxClassCode;
private int periodID;
private boolean isDuplicate;
private BigDecimal amountDifference;
public String getInvoiceID() {
return invoiceID;
}
public void setInvoiceID(String invoiceID) {
this.invoiceID = invoiceID;
}
public Integer getInvoiceType() {
return invoiceType;
}
public void setInvoiceType(Integer invoiceType) {
this.invoiceType = invoiceType;
}
public String getClassCode() {
return classCode;
}
public void setClassCode(String classCode) {
this.classCode = classCode;
}
public String getInvoiceNumber() {
return invoiceNumber;
}
public void setInvoiceNumber(String invoiceNumber) {
this.invoiceNumber = invoiceNumber;
}
public String getBuyerName() {
return buyerName;
}
public void setBuyerName(String buyerName) {
this.buyerName = buyerName;
}
public String getBuyerTaxNumber() {
return buyerTaxNumber;
}
public void setBuyerTaxNumber(String buyerTaxNumber) {
this.buyerTaxNumber = buyerTaxNumber;
}
public String getBankAccount() {
return bankAccount;
}
public void setBankAccount(String bankAccount) {
this.bankAccount = bankAccount;
}
public String getPhoneNum() {
return phoneNum;
}
public void setPhoneNum(String phoneNum) {
this.phoneNum = phoneNum;
}
public Date getInvoiceDate() {
return invoiceDate;
}
public void setInvoiceDate(Date invoiceDate) {
this.invoiceDate = invoiceDate;
}
public String getCodeVersion() {
return codeVersion;
}
public void setCodeVersion(String codeVersion) {
this.codeVersion = codeVersion;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getDocumentNum() {
return documentNum;
}
public void setDocumentNum(String documentNum) {
this.documentNum = documentNum;
}
public String getProductStandard() {
return productStandard;
}
public void setProductStandard(String productStandard) {
this.productStandard = productStandard;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public Double getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(Double unitPrice) {
this.unitPrice = unitPrice;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public BigDecimal getTaxRate() {
return taxRate;
}
public void setTaxRate(BigDecimal taxRate) {
this.taxRate = taxRate;
}
public BigDecimal getTaxAmount() {
return taxAmount;
}
public void setTaxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount;
}
public String getTaxClassCode() {
return taxClassCode;
}
public void setTaxClassCode(String taxClassCode) {
this.taxClassCode = taxClassCode;
}
public int getPeriodID() {
return periodID;
}
public void setPeriodID(int periodID) {
this.periodID = periodID;
}
public boolean isDuplicate() {
return isDuplicate;
}
public void setDuplicate(boolean duplicate) {
isDuplicate = duplicate;
}
public BigDecimal getAmountDifference() {
return amountDifference;
}
public void setAmountDifference(BigDecimal amountDifference) {
this.amountDifference = amountDifference;
}
public String getInvoiceTypeName() {
return EnumOutputInvoiceType.values()[this.invoiceType].getName();
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dto.PagingDto;
import java.math.BigDecimal;
import java.util.Date;
public class QueryOutputDto {
private PagingDto pageInfo;
private int periodStart;
private int periodEnd;
private Integer invoiceType;
private Date startInvoiceDate;
private Date endInvoiceDate;
private String classCode;
private String invoiceNumber;
private String buyerName;
private String productName;
private BigDecimal amountStart;
private BigDecimal amountEnd;
private BigDecimal taxAmountStart;
private BigDecimal taxAmountEnd;
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public int getPeriodStart() {
return periodStart;
}
public void setPeriodStart(int periodStart) {
this.periodStart = periodStart;
}
public int getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(int periodEnd) {
this.periodEnd = periodEnd;
}
public Integer getInvoiceType() {
return invoiceType;
}
public void setInvoiceType(Integer invoiceType) {
this.invoiceType = invoiceType;
}
public Date getStartInvoiceDate() {
return startInvoiceDate;
}
public void setStartInvoiceDate(Date startInvoiceDate) {
this.startInvoiceDate = startInvoiceDate;
}
public Date getEndInvoiceDate() {
return endInvoiceDate;
}
public void setEndInvoiceDate(Date endInvoiceDate) {
this.endInvoiceDate = endInvoiceDate;
}
public String getClassCode() {
return classCode;
}
public void setClassCode(String classCode) {
this.classCode = classCode;
}
public String getInvoiceNumber() {
return invoiceNumber;
}
public void setInvoiceNumber(String invoiceNumber) {
this.invoiceNumber = invoiceNumber;
}
public String getBuyerName() {
return buyerName;
}
public void setBuyerName(String buyerName) {
this.buyerName = buyerName;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public BigDecimal getAmountStart() {
return amountStart;
}
public void setAmountStart(BigDecimal amountStart) {
this.amountStart = amountStart;
}
public BigDecimal getAmountEnd() {
return amountEnd;
}
public void setAmountEnd(BigDecimal amountEnd) {
this.amountEnd = amountEnd;
}
public BigDecimal getTaxAmountStart() {
return taxAmountStart;
}
public void setTaxAmountStart(BigDecimal taxAmountStart) {
this.taxAmountStart = taxAmountStart;
}
public BigDecimal getTaxAmountEnd() {
return taxAmountEnd;
}
public void setTaxAmountEnd(BigDecimal taxAmountEnd) {
this.taxAmountEnd = taxAmountEnd;
}
}
...@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; 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.vat.entity.InputVATInvoice; import pwc.taxtech.atms.vat.entity.InputVATInvoice;
import pwc.taxtech.atms.vat.entity.InputVATInvoiceExample; import pwc.taxtech.atms.vat.entity.InputVATInvoiceExample;
...@@ -105,4 +106,8 @@ public interface InputVATInvoiceMapper extends MyVatMapper { ...@@ -105,4 +106,8 @@ public interface InputVATInvoiceMapper extends MyVatMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(InputVATInvoice record); int updateByPrimaryKey(InputVATInvoice record);
int getInputVATInvoiceCountByCondition(@Param("paras") InputInvoicePreviewQueryParam param);
List<InputVATInvoice> getInputVATInvoiceCountByConditionWithPaging(@Param("paras") InputInvoicePreviewQueryParam param,@Param("limitFrom") int limitFrom);
} }
\ No newline at end of file
...@@ -5,6 +5,8 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -5,6 +5,8 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; 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.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.dto.vatdto.QueryOutputDto;
import pwc.taxtech.atms.vat.entity.OutputVATInvoice; import pwc.taxtech.atms.vat.entity.OutputVATInvoice;
import pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample; import pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample;
...@@ -105,4 +107,6 @@ public interface OutputVATInvoiceMapper extends MyVatMapper { ...@@ -105,4 +107,6 @@ public interface OutputVATInvoiceMapper extends MyVatMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(OutputVATInvoice record); int updateByPrimaryKey(OutputVATInvoice record);
List<OutputVATInvoiceInfoDto> selectOutputVATInvoiceInfoLeftJoinItem(@Param("queryDto")QueryOutputDto queryDto);
} }
\ No newline at end of file
package pwc.taxtech.atms.vat.service;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto;
public interface InputInvoiceDataImportService {
PagingResultDto<InputVATInvoiceDto> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras);
}
package pwc.taxtech.atms.vat.service;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.dto.vatdto.QueryOutputDto;
public interface OutputInvoiceService {
PagingResultDto<OutputVATInvoiceInfoDto> queryOutputInvoiceList(QueryOutputDto queryDto);
}
package pwc.taxtech.atms.vat.service.impl;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto;
import pwc.taxtech.atms.vat.service.InputInvoiceDataImportService;
import java.util.ArrayList;
import java.util.List;
@Service
public class InputInvoiceDataImportServiceImpl extends VatAbstractService implements InputInvoiceDataImportService {
@Override
public PagingResultDto<InputVATInvoiceDto> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras) {
PagingResultDto<InputVATInvoiceDto> qResult = new PagingResultDto<>();
qResult.setPageInfo(paras.getPageInfo());
qResult.setList(new ArrayList<>());
long result = inputVATInvoiceMapper.getInputVATInvoiceCountByCondition(paras);
qResult.getPageInfo().setTotalCount((int) result);
if (result > 0) {
int limitFrom = paras.getPageInfo().getPageSize() * (paras.getPageInfo().getPageIndex() - 1);
List<InputVATInvoiceDto> fResult = new ArrayList<>();
inputVATInvoiceMapper.getInputVATInvoiceCountByConditionWithPaging(paras, limitFrom).forEach(a -> {
InputVATInvoiceDto inputVATInvoiceDto = new InputVATInvoiceDto();
CommonUtils.copyProperties(a, inputVATInvoiceDto);
fResult.add(inputVATInvoiceDto);
});
qResult.setList(fResult);
}
return qResult;
}
}
package pwc.taxtech.atms.vat.service.impl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.PagingList;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.dto.vatdto.QueryOutputDto;
import pwc.taxtech.atms.vat.service.OutputInvoiceService;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
public class OutputInvoiceServiceImpl extends VatAbstractService implements OutputInvoiceService {
@Override
public PagingResultDto<OutputVATInvoiceInfoDto> queryOutputInvoiceList(QueryOutputDto queryDto) {
PagingResultDto<OutputVATInvoiceInfoDto> qResult = new PagingResultDto<>();
qResult.setPageInfo(queryDto.getPageInfo());
qResult.setList(new ArrayList<>());
List<OutputVATInvoiceInfoDto> rList = outputVATInvoiceMapper.selectOutputVATInvoiceInfoLeftJoinItem(queryDto);
Function<OutputVATInvoiceInfoDto, List<Object>> compositeKey = outputVATInvoiceInfoDto ->
Arrays.asList(outputVATInvoiceInfoDto.getInvoiceID()
, outputVATInvoiceInfoDto.getClassCode()
, outputVATInvoiceInfoDto.getInvoiceNumber());
List<OutputVATInvoiceInfoDto> groupedList = new ArrayList<>();
rList.stream().collect(Collectors.groupingBy(compositeKey, Collectors.toList())).forEach((k, v) -> {
if (v.stream().findFirst().isPresent()) {
OutputVATInvoiceInfoDto fItem = v.stream().findFirst().get();
OutputVATInvoiceInfoDto outputVATInvoiceInfoDto = new OutputVATInvoiceInfoDto();
CommonUtils.copyProperties(fItem, outputVATInvoiceInfoDto);
outputVATInvoiceInfoDto.setAmount(new BigDecimal(v.stream().mapToDouble(a -> a.getAmount().doubleValue()).sum()));
outputVATInvoiceInfoDto.setTaxAmount(new BigDecimal(v.stream().mapToDouble(a -> a.getTaxAmount().doubleValue()).sum()));
groupedList.add(outputVATInvoiceInfoDto);
}
});
Stream<OutputVATInvoiceInfoDto> stream = groupedList.stream();
if (queryDto.getInvoiceType() != null && queryDto.getInvoiceType() != 999) {
stream = stream.filter(a -> a.getInvoiceType().equals(queryDto.getInvoiceType()));
}
if (queryDto.getStartInvoiceDate() != null) {
stream = stream.filter(a -> a.getInvoiceDate().after(queryDto.getStartInvoiceDate()));
}
if (queryDto.getEndInvoiceDate() != null) {
stream = stream.filter(a -> a.getInvoiceDate().before(queryDto.getEndInvoiceDate()));
}
if (StringUtils.isNotBlank(queryDto.getClassCode())) {
stream = stream.filter(a -> a.getClassCode().contains(queryDto.getClassCode()));
}
if (StringUtils.isNotBlank(queryDto.getInvoiceNumber())) {
stream = stream.filter(a -> a.getInvoiceNumber().contains(queryDto.getInvoiceNumber()));
}
if (StringUtils.isNotBlank(queryDto.getBuyerName())) {
stream = stream.filter(a -> a.getBuyerName().contains(queryDto.getBuyerName()));
}
if (queryDto.getAmountStart() != null) {
stream = stream.filter(a -> a.getAmount().compareTo(queryDto.getAmountStart()) > 0);
}
if (queryDto.getAmountEnd() != null) {
stream = stream.filter(a -> a.getAmount().compareTo(queryDto.getAmountEnd()) < 0);
}
if (queryDto.getTaxAmountStart() != null) {
stream = stream.filter(a -> a.getTaxAmount().compareTo(queryDto.getTaxAmountStart()) > 0);
}
if (queryDto.getTaxAmountEnd() != null) {
stream = stream.filter(a -> a.getTaxAmount().compareTo(queryDto.getTaxAmountEnd()) < 0);
}
List<OutputVATInvoiceInfoDto> finalList = stream.sorted(Comparator.comparing(OutputVATInvoiceInfoDto::getInvoiceDate)).collect(Collectors.toList());
qResult.getPageInfo().setTotalCount(finalList.size());
if (finalList.size() > 0) {
PagingList pagingList = new PagingList(finalList, qResult.getPageInfo());
qResult.setList(pagingList.getPagingList());
}
return qResult;
}
}
...@@ -3,9 +3,7 @@ package pwc.taxtech.atms.vat.service.impl; ...@@ -3,9 +3,7 @@ package pwc.taxtech.atms.vat.service.impl;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.vat.dao.CompanyBalanceMapper; import pwc.taxtech.atms.vat.dao.*;
import pwc.taxtech.atms.vat.dao.VatEnterpriseAccountMapper;
import pwc.taxtech.atms.vat.dao.VatStandardAccountMapper;
public class VatAbstractService { public class VatAbstractService {
protected final Logger logger = LoggerFactory.getLogger(this.getClass()); protected final Logger logger = LoggerFactory.getLogger(this.getClass());
...@@ -16,4 +14,9 @@ public class VatAbstractService { ...@@ -16,4 +14,9 @@ public class VatAbstractService {
VatEnterpriseAccountMapper vatEnterpriseAccountMapper; VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
@Autowired @Autowired
VatStandardAccountMapper vatStandardAccountMapper; VatStandardAccountMapper vatStandardAccountMapper;
@Autowired
InputVATInvoiceMapper inputVATInvoiceMapper;
@Autowired
OutputVATInvoiceMapper outputVATInvoiceMapper;
} }
<?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}, SELECT COUNT(1) FROM InputVATInvoice WHERE 1=1
Status = #{status,jdbcType=INTEGER}, <if test="paras.periodStart">
PartAccntedPeriod = #{partAccntedPeriod,jdbcType=INTEGER}, AND PeriodID&gt;=#{paras.periodStart,jdbcType=VARCHAR}
AccntedPeriod = #{accntedPeriod,jdbcType=INTEGER} </if>
where ID = #{ID,jdbcType=VARCHAR} <if test="paras.periodEnd">
</update> AND PeriodID&lt;=#{paras.periodEnd,jdbcType=VARCHAR}
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.InputVATInvoiceExample" resultMap="BaseResultMap"> </if>
<!-- <if test="paras.certificationDateStart != null">
WARNING - @mbg.generated AND CertificationDate&gt;=#{paras.certificationDateStart,jdbcType=VARCHAR}
This element is automatically generated by MyBatis Generator, do not modify. </if>
--> <if test="paras.certificationDateEnd != null">
select AND CertificationDate&lt;=#{paras.certificationDateEnd,jdbcType=VARCHAR}
<if test="distinct"> </if>
distinct <if test="paras.invoiceCode != null and paras.invoiceCode!=''">
</if> AND InvoiceCode LIKE concat('%',#{paras.invoiceCode,jdbcType=VARCHAR},'%')
<include refid="Base_Column_List" /> </if>
from InputVATInvoice <if test="paras.invoiceNumber!=null and paras.invoiceNumber!=''">
<if test="_parameter != null"> AND InvoiceNumber LIKE concat('%',#{paras.invoiceNumber,jdbcType=VARCHAR},'%')
<include refid="Example_Where_Clause" /> </if>
</if> <if test="paras.sellerTaxNumber!=null and paras.sellerTaxNumber!=''">
<if test="orderByClause != null"> AND SellerTaxNumber LIKE concat('%',#{paras.sellerTaxNumber,jdbcType=VARCHAR},'%')
order by ${orderByClause} </if>
</if> <if test="paras.amountStart != null">
</select> AND Amount&gt;=#{paras.amountStart,jdbcType=DECIMAL}
</if>
<if test="paras.amountEnd != null">
AND Amount&lt;=#{paras.amountEnd,jdbcType=DECIMAL}
</if>
<if test="paras.taxAmountStart != null">
AND TaxAmount&gt;=#{paras.taxAmountStart,jdbcType=DECIMAL}
</if>
<if test="paras.taxAmountEnd != null">
AND TaxAmount&lt;=#{paras.taxAmountEnd,jdbcType=DECIMAL}
</if>
<if test="paras.invoiceType!=null and paras.invoiceType!=999">
AND InvoiceType=#{param.invoiceType,jdbcType=INTEGER}
</if>
<if test="paras.certificationStatus==1">
AND CertificationResult LIKE '%1%'
</if>
<if test="paras.certificationStatus==2">
AND CertificationResult LIKE '%2%'
</if>
</select>
<select id="getInputVATInvoiceCountByConditionWithPaging" resultMap="BaseResultMap">
SELECT * FROM InputVATInvoice WHERE 1=1
<if test="paras.periodStart">
AND PeriodID&gt;=#{paras.periodStart,jdbcType=VARCHAR}
</if>
<if test="paras.periodEnd">
AND PeriodID&lt;=#{paras.periodEnd,jdbcType=VARCHAR}
</if>
<if test="paras.certificationDateStart != null">
AND CertificationDate&gt;=#{paras.certificationDateStart,jdbcType=VARCHAR}
</if>
<if test="paras.certificationDateEnd != null">
AND CertificationDate&lt;=#{paras.certificationDateEnd,jdbcType=VARCHAR}
</if>
<if test="paras.invoiceCode != null and paras.invoiceCode!=''">
AND InvoiceCode LIKE concat('%',#{paras.invoiceCode,jdbcType=VARCHAR},'%')
</if>
<if test="paras.invoiceNumber!=null and paras.invoiceNumber!=''">
AND InvoiceNumber LIKE concat('%',#{paras.invoiceNumber,jdbcType=VARCHAR},'%')
</if>
<if test="paras.sellerTaxNumber!=null and paras.sellerTaxNumber!=''">
AND SellerTaxNumber LIKE concat('%',#{paras.sellerTaxNumber,jdbcType=VARCHAR},'%')
</if>
<if test="paras.amountStart != null">
AND Amount&gt;=#{paras.amountStart,jdbcType=DECIMAL}
</if>
<if test="paras.amountEnd != null">
AND Amount&lt;=#{paras.amountEnd,jdbcType=DECIMAL}
</if>
<if test="paras.taxAmountStart != null">
AND TaxAmount&gt;=#{paras.taxAmountStart,jdbcType=DECIMAL}
</if>
<if test="paras.taxAmountEnd != null">
AND TaxAmount&lt;=#{paras.taxAmountEnd,jdbcType=DECIMAL}
</if>
<if test="paras.invoiceType!=null and paras.invoiceType!=999">
AND InvoiceType=#{param.invoiceType,jdbcType=INTEGER}
</if>
<if test="paras.certificationStatus==1">
AND CertificationResult LIKE '%1%'
</if>
<if test="paras.certificationStatus==2">
AND CertificationResult LIKE '%2%'
</if>
ORDER BY InvoiceDate
<if test="paras.pageInfo!=null and paras.pageInfo.pageSize!=null and limitFrom!=null">
LIMIT #{limitFrom,jdbcType=INTEGER},#{paras.pageInfo.pageSize,jdbcType=INTEGER}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
<?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.OutputVATInvoiceMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.OutputVATInvoiceMapper">
<resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.OutputVATInvoice"> <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.OutputVATInvoice">
<!-- <!--
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="InvoiceID" jdbcType="VARCHAR" property="invoiceID" /> <id column="InvoiceID" jdbcType="VARCHAR" property="invoiceID"/>
<result column="InvoiceType" jdbcType="INTEGER" property="invoiceType" /> <result column="InvoiceType" jdbcType="INTEGER" property="invoiceType"/>
<result column="ClassCode" jdbcType="VARCHAR" property="classCode" /> <result column="ClassCode" jdbcType="VARCHAR" property="classCode"/>
<result column="InvoiceNumber" jdbcType="VARCHAR" property="invoiceNumber" /> <result column="InvoiceNumber" jdbcType="VARCHAR" property="invoiceNumber"/>
<result column="BuyerName" jdbcType="VARCHAR" property="buyerName" /> <result column="BuyerName" jdbcType="VARCHAR" property="buyerName"/>
<result column="BuyerTaxNumber" jdbcType="VARCHAR" property="buyerTaxNumber" /> <result column="BuyerTaxNumber" jdbcType="VARCHAR" property="buyerTaxNumber"/>
<result column="BankAccount" jdbcType="VARCHAR" property="bankAccount" /> <result column="BankAccount" jdbcType="VARCHAR" property="bankAccount"/>
<result column="PhoneNum" jdbcType="VARCHAR" property="phoneNum" /> <result column="PhoneNum" jdbcType="VARCHAR" property="phoneNum"/>
<result column="InvoiceDate" jdbcType="TIMESTAMP" property="invoiceDate" /> <result column="InvoiceDate" jdbcType="TIMESTAMP" property="invoiceDate"/>
<result column="SeqNo" jdbcType="INTEGER" property="seqNo" /> <result column="SeqNo" jdbcType="INTEGER" property="seqNo"/>
<result column="PeriodID" jdbcType="INTEGER" property="periodID" /> <result column="PeriodID" jdbcType="INTEGER" property="periodID"/>
<result column="Status" jdbcType="INTEGER" property="status" /> <result column="Status" jdbcType="INTEGER" property="status"/>
<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="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>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
InvoiceID, InvoiceType, ClassCode, InvoiceNumber, BuyerName, BuyerTaxNumber, BankAccount,
PhoneNum, InvoiceDate, SeqNo, PeriodID, Status, CreatorID, CreateTime, PartAccntedPeriod,
AccntedPeriod
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample"
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 OutputVATInvoice
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List"/>
from OutputVATInvoice
where InvoiceID = #{invoiceID,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from OutputVATInvoice
where InvoiceID = #{invoiceID,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from OutputVATInvoice
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if> </if>
</foreach> </delete>
</where> <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoice">
</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. insert into OutputVATInvoice (InvoiceID, InvoiceType, ClassCode,
--> InvoiceNumber, BuyerName, BuyerTaxNumber,
InvoiceID, InvoiceType, ClassCode, InvoiceNumber, BuyerName, BuyerTaxNumber, BankAccount, BankAccount, PhoneNum, InvoiceDate,
PhoneNum, InvoiceDate, SeqNo, PeriodID, Status, CreatorID, CreateTime, PartAccntedPeriod, SeqNo, PeriodID, Status,
AccntedPeriod CreatorID, CreateTime, PartAccntedPeriod,
</sql> AccntedPeriod)
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample" resultMap="BaseResultMap"> values (#{invoiceID,jdbcType=VARCHAR}, #{invoiceType,jdbcType=INTEGER}, #{classCode,jdbcType=VARCHAR},
<!-- #{invoiceNumber,jdbcType=VARCHAR}, #{buyerName,jdbcType=VARCHAR}, #{buyerTaxNumber,jdbcType=VARCHAR},
WARNING - @mbg.generated #{bankAccount,jdbcType=VARCHAR}, #{phoneNum,jdbcType=VARCHAR}, #{invoiceDate,jdbcType=TIMESTAMP},
This element is automatically generated by MyBatis Generator, do not modify. #{seqNo,jdbcType=INTEGER}, #{periodID,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
--> #{creatorID,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{partAccntedPeriod,jdbcType=INTEGER},
select #{accntedPeriod,jdbcType=INTEGER})
<if test="distinct"> </insert>
distinct <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoice">
</if> <!--
<include refid="Base_Column_List" /> WARNING - @mbg.generated
from OutputVATInvoice This element is automatically generated by MyBatis Generator, do not modify.
<if test="_parameter != null"> -->
<include refid="Example_Where_Clause" /> insert into OutputVATInvoice
</if> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderByClause != null"> <if test="invoiceID != null">
order by ${orderByClause} InvoiceID,
</if> </if>
</select> <if test="invoiceType != null">
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> InvoiceType,
<!-- </if>
WARNING - @mbg.generated <if test="classCode != null">
This element is automatically generated by MyBatis Generator, do not modify. ClassCode,
--> </if>
select <if test="invoiceNumber != null">
<include refid="Base_Column_List" /> InvoiceNumber,
from OutputVATInvoice </if>
where InvoiceID = #{invoiceID,jdbcType=VARCHAR} <if test="buyerName != null">
</select> BuyerName,
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> </if>
<!-- <if test="buyerTaxNumber != null">
WARNING - @mbg.generated BuyerTaxNumber,
This element is automatically generated by MyBatis Generator, do not modify. </if>
--> <if test="bankAccount != null">
delete from OutputVATInvoice BankAccount,
where InvoiceID = #{invoiceID,jdbcType=VARCHAR} </if>
</delete> <if test="phoneNum != null">
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample"> PhoneNum,
<!-- </if>
WARNING - @mbg.generated <if test="invoiceDate != null">
This element is automatically generated by MyBatis Generator, do not modify. InvoiceDate,
--> </if>
delete from OutputVATInvoice <if test="seqNo != null">
<if test="_parameter != null"> SeqNo,
<include refid="Example_Where_Clause" /> </if>
</if> <if test="periodID != null">
</delete> PeriodID,
<insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoice"> </if>
<!-- <if test="status != null">
WARNING - @mbg.generated Status,
This element is automatically generated by MyBatis Generator, do not modify. </if>
--> <if test="creatorID != null">
insert into OutputVATInvoice (InvoiceID, InvoiceType, ClassCode, CreatorID,
InvoiceNumber, BuyerName, BuyerTaxNumber, </if>
BankAccount, PhoneNum, InvoiceDate, <if test="createTime != null">
SeqNo, PeriodID, Status, CreateTime,
CreatorID, CreateTime, PartAccntedPeriod, </if>
AccntedPeriod) <if test="partAccntedPeriod != null">
values (#{invoiceID,jdbcType=VARCHAR}, #{invoiceType,jdbcType=INTEGER}, #{classCode,jdbcType=VARCHAR}, PartAccntedPeriod,
#{invoiceNumber,jdbcType=VARCHAR}, #{buyerName,jdbcType=VARCHAR}, #{buyerTaxNumber,jdbcType=VARCHAR}, </if>
#{bankAccount,jdbcType=VARCHAR}, #{phoneNum,jdbcType=VARCHAR}, #{invoiceDate,jdbcType=TIMESTAMP}, <if test="accntedPeriod != null">
#{seqNo,jdbcType=INTEGER}, #{periodID,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, AccntedPeriod,
#{creatorID,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{partAccntedPeriod,jdbcType=INTEGER}, </if>
#{accntedPeriod,jdbcType=INTEGER}) </trim>
</insert> <trim prefix="values (" suffix=")" suffixOverrides=",">
<insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoice"> <if test="invoiceID != null">
<!-- #{invoiceID,jdbcType=VARCHAR},
WARNING - @mbg.generated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="invoiceType != null">
--> #{invoiceType,jdbcType=INTEGER},
insert into OutputVATInvoice </if>
<trim prefix="(" suffix=")" suffixOverrides=","> <if test="classCode != null">
<if test="invoiceID != null"> #{classCode,jdbcType=VARCHAR},
InvoiceID, </if>
</if> <if test="invoiceNumber != null">
<if test="invoiceType != null"> #{invoiceNumber,jdbcType=VARCHAR},
InvoiceType, </if>
</if> <if test="buyerName != null">
<if test="classCode != null"> #{buyerName,jdbcType=VARCHAR},
ClassCode, </if>
</if> <if test="buyerTaxNumber != null">
<if test="invoiceNumber != null"> #{buyerTaxNumber,jdbcType=VARCHAR},
InvoiceNumber, </if>
</if> <if test="bankAccount != null">
<if test="buyerName != null"> #{bankAccount,jdbcType=VARCHAR},
BuyerName, </if>
</if> <if test="phoneNum != null">
<if test="buyerTaxNumber != null"> #{phoneNum,jdbcType=VARCHAR},
BuyerTaxNumber, </if>
</if> <if test="invoiceDate != null">
<if test="bankAccount != null"> #{invoiceDate,jdbcType=TIMESTAMP},
BankAccount, </if>
</if> <if test="seqNo != null">
<if test="phoneNum != null"> #{seqNo,jdbcType=INTEGER},
PhoneNum, </if>
</if> <if test="periodID != null">
<if test="invoiceDate != null"> #{periodID,jdbcType=INTEGER},
InvoiceDate, </if>
</if> <if test="status != null">
<if test="seqNo != null"> #{status,jdbcType=INTEGER},
SeqNo, </if>
</if> <if test="creatorID != null">
<if test="periodID != null"> #{creatorID,jdbcType=VARCHAR},
PeriodID, </if>
</if> <if test="createTime != null">
<if test="status != null"> #{createTime,jdbcType=TIMESTAMP},
Status, </if>
</if> <if test="partAccntedPeriod != null">
<if test="creatorID != null"> #{partAccntedPeriod,jdbcType=INTEGER},
CreatorID, </if>
</if> <if test="accntedPeriod != null">
<if test="createTime != null"> #{accntedPeriod,jdbcType=INTEGER},
CreateTime, </if>
</if> </trim>
<if test="partAccntedPeriod != null"> </insert>
PartAccntedPeriod, <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample"
</if> resultType="java.lang.Long">
<if test="accntedPeriod != null"> <!--
AccntedPeriod, WARNING - @mbg.generated
</if> This element is automatically generated by MyBatis Generator, do not modify.
</trim> -->
<trim prefix="values (" suffix=")" suffixOverrides=","> select count(*) from OutputVATInvoice
<if test="invoiceID != null"> <if test="_parameter != null">
#{invoiceID,jdbcType=VARCHAR}, <include refid="Example_Where_Clause"/>
</if> </if>
<if test="invoiceType != null"> </select>
#{invoiceType,jdbcType=INTEGER}, <update id="updateByExampleSelective" parameterType="map">
</if> <!--
<if test="classCode != null"> WARNING - @mbg.generated
#{classCode,jdbcType=VARCHAR}, This element is automatically generated by MyBatis Generator, do not modify.
</if> -->
<if test="invoiceNumber != null"> update OutputVATInvoice
#{invoiceNumber,jdbcType=VARCHAR}, <set>
</if> <if test="record.invoiceID != null">
<if test="buyerName != null"> InvoiceID = #{record.invoiceID,jdbcType=VARCHAR},
#{buyerName,jdbcType=VARCHAR}, </if>
</if> <if test="record.invoiceType != null">
<if test="buyerTaxNumber != null"> InvoiceType = #{record.invoiceType,jdbcType=INTEGER},
#{buyerTaxNumber,jdbcType=VARCHAR}, </if>
</if> <if test="record.classCode != null">
<if test="bankAccount != null"> ClassCode = #{record.classCode,jdbcType=VARCHAR},
#{bankAccount,jdbcType=VARCHAR}, </if>
</if> <if test="record.invoiceNumber != null">
<if test="phoneNum != null"> InvoiceNumber = #{record.invoiceNumber,jdbcType=VARCHAR},
#{phoneNum,jdbcType=VARCHAR}, </if>
</if> <if test="record.buyerName != null">
<if test="invoiceDate != null"> BuyerName = #{record.buyerName,jdbcType=VARCHAR},
#{invoiceDate,jdbcType=TIMESTAMP}, </if>
</if> <if test="record.buyerTaxNumber != null">
<if test="seqNo != null"> BuyerTaxNumber = #{record.buyerTaxNumber,jdbcType=VARCHAR},
#{seqNo,jdbcType=INTEGER}, </if>
</if> <if test="record.bankAccount != null">
<if test="periodID != null"> BankAccount = #{record.bankAccount,jdbcType=VARCHAR},
#{periodID,jdbcType=INTEGER}, </if>
</if> <if test="record.phoneNum != null">
<if test="status != null"> PhoneNum = #{record.phoneNum,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, </if>
</if> <if test="record.invoiceDate != null">
<if test="creatorID != null"> InvoiceDate = #{record.invoiceDate,jdbcType=TIMESTAMP},
#{creatorID,jdbcType=VARCHAR}, </if>
</if> <if test="record.seqNo != null">
<if test="createTime != null"> SeqNo = #{record.seqNo,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, </if>
</if> <if test="record.periodID != null">
<if test="partAccntedPeriod != null"> PeriodID = #{record.periodID,jdbcType=INTEGER},
#{partAccntedPeriod,jdbcType=INTEGER}, </if>
</if> <if test="record.status != null">
<if test="accntedPeriod != null"> Status = #{record.status,jdbcType=INTEGER},
#{accntedPeriod,jdbcType=INTEGER}, </if>
</if> <if test="record.creatorID != null">
</trim> CreatorID = #{record.creatorID,jdbcType=VARCHAR},
</insert> </if>
<select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample" resultType="java.lang.Long"> <if test="record.createTime != null">
<!-- CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
WARNING - @mbg.generated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="record.partAccntedPeriod != null">
--> PartAccntedPeriod = #{record.partAccntedPeriod,jdbcType=INTEGER},
select count(*) from OutputVATInvoice </if>
<if test="_parameter != null"> <if test="record.accntedPeriod != null">
<include refid="Example_Where_Clause" /> AccntedPeriod = #{record.accntedPeriod,jdbcType=INTEGER},
</if> </if>
</select> </set>
<update id="updateByExampleSelective" parameterType="map"> <if test="_parameter != null">
<!-- <include refid="Update_By_Example_Where_Clause"/>
WARNING - @mbg.generated </if>
This element is automatically generated by MyBatis Generator, do not modify. </update>
--> <update id="updateByExample" parameterType="map">
update OutputVATInvoice <!--
<set> WARNING - @mbg.generated
<if test="record.invoiceID != null"> This element is automatically generated by MyBatis Generator, do not modify.
InvoiceID = #{record.invoiceID,jdbcType=VARCHAR}, -->
</if> update OutputVATInvoice
<if test="record.invoiceType != null"> set InvoiceID = #{record.invoiceID,jdbcType=VARCHAR},
InvoiceType = #{record.invoiceType,jdbcType=INTEGER}, InvoiceType = #{record.invoiceType,jdbcType=INTEGER},
</if>
<if test="record.classCode != null">
ClassCode = #{record.classCode,jdbcType=VARCHAR}, ClassCode = #{record.classCode,jdbcType=VARCHAR},
</if>
<if test="record.invoiceNumber != null">
InvoiceNumber = #{record.invoiceNumber,jdbcType=VARCHAR}, InvoiceNumber = #{record.invoiceNumber,jdbcType=VARCHAR},
</if>
<if test="record.buyerName != null">
BuyerName = #{record.buyerName,jdbcType=VARCHAR}, BuyerName = #{record.buyerName,jdbcType=VARCHAR},
</if>
<if test="record.buyerTaxNumber != null">
BuyerTaxNumber = #{record.buyerTaxNumber,jdbcType=VARCHAR}, BuyerTaxNumber = #{record.buyerTaxNumber,jdbcType=VARCHAR},
</if>
<if test="record.bankAccount != null">
BankAccount = #{record.bankAccount,jdbcType=VARCHAR}, BankAccount = #{record.bankAccount,jdbcType=VARCHAR},
</if>
<if test="record.phoneNum != null">
PhoneNum = #{record.phoneNum,jdbcType=VARCHAR}, PhoneNum = #{record.phoneNum,jdbcType=VARCHAR},
</if>
<if test="record.invoiceDate != null">
InvoiceDate = #{record.invoiceDate,jdbcType=TIMESTAMP}, InvoiceDate = #{record.invoiceDate,jdbcType=TIMESTAMP},
</if>
<if test="record.seqNo != null">
SeqNo = #{record.seqNo,jdbcType=INTEGER}, SeqNo = #{record.seqNo,jdbcType=INTEGER},
</if>
<if test="record.periodID != null">
PeriodID = #{record.periodID,jdbcType=INTEGER}, PeriodID = #{record.periodID,jdbcType=INTEGER},
</if>
<if test="record.status != null">
Status = #{record.status,jdbcType=INTEGER}, Status = #{record.status,jdbcType=INTEGER},
</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.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.OutputVATInvoice">
<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 OutputVATInvoice
WARNING - @mbg.generated <set>
This element is automatically generated by MyBatis Generator, do not modify. <if test="invoiceType != null">
--> InvoiceType = #{invoiceType,jdbcType=INTEGER},
update OutputVATInvoice </if>
set InvoiceID = #{record.invoiceID,jdbcType=VARCHAR}, <if test="classCode != null">
InvoiceType = #{record.invoiceType,jdbcType=INTEGER}, ClassCode = #{classCode,jdbcType=VARCHAR},
ClassCode = #{record.classCode,jdbcType=VARCHAR}, </if>
InvoiceNumber = #{record.invoiceNumber,jdbcType=VARCHAR}, <if test="invoiceNumber != null">
BuyerName = #{record.buyerName,jdbcType=VARCHAR}, InvoiceNumber = #{invoiceNumber,jdbcType=VARCHAR},
BuyerTaxNumber = #{record.buyerTaxNumber,jdbcType=VARCHAR}, </if>
BankAccount = #{record.bankAccount,jdbcType=VARCHAR}, <if test="buyerName != null">
PhoneNum = #{record.phoneNum,jdbcType=VARCHAR}, BuyerName = #{buyerName,jdbcType=VARCHAR},
InvoiceDate = #{record.invoiceDate,jdbcType=TIMESTAMP}, </if>
SeqNo = #{record.seqNo,jdbcType=INTEGER}, <if test="buyerTaxNumber != null">
PeriodID = #{record.periodID,jdbcType=INTEGER}, BuyerTaxNumber = #{buyerTaxNumber,jdbcType=VARCHAR},
Status = #{record.status,jdbcType=INTEGER}, </if>
CreatorID = #{record.creatorID,jdbcType=VARCHAR}, <if test="bankAccount != null">
CreateTime = #{record.createTime,jdbcType=TIMESTAMP}, BankAccount = #{bankAccount,jdbcType=VARCHAR},
PartAccntedPeriod = #{record.partAccntedPeriod,jdbcType=INTEGER}, </if>
AccntedPeriod = #{record.accntedPeriod,jdbcType=INTEGER} <if test="phoneNum != null">
<if test="_parameter != null"> PhoneNum = #{phoneNum,jdbcType=VARCHAR},
<include refid="Update_By_Example_Where_Clause" /> </if>
</if> <if test="invoiceDate != null">
</update> InvoiceDate = #{invoiceDate,jdbcType=TIMESTAMP},
<update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoice"> </if>
<!-- <if test="seqNo != null">
WARNING - @mbg.generated SeqNo = #{seqNo,jdbcType=INTEGER},
This element is automatically generated by MyBatis Generator, do not modify. </if>
--> <if test="periodID != null">
update OutputVATInvoice PeriodID = #{periodID,jdbcType=INTEGER},
<set> </if>
<if test="invoiceType != null"> <if test="status != null">
InvoiceType = #{invoiceType,jdbcType=INTEGER}, Status = #{status,jdbcType=INTEGER},
</if> </if>
<if test="classCode != null"> <if test="creatorID != null">
CreatorID = #{creatorID,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
CreateTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="partAccntedPeriod != null">
PartAccntedPeriod = #{partAccntedPeriod,jdbcType=INTEGER},
</if>
<if test="accntedPeriod != null">
AccntedPeriod = #{accntedPeriod,jdbcType=INTEGER},
</if>
</set>
where InvoiceID = #{invoiceID,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoice">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update OutputVATInvoice
set InvoiceType = #{invoiceType,jdbcType=INTEGER},
ClassCode = #{classCode,jdbcType=VARCHAR}, ClassCode = #{classCode,jdbcType=VARCHAR},
</if>
<if test="invoiceNumber != null">
InvoiceNumber = #{invoiceNumber,jdbcType=VARCHAR}, InvoiceNumber = #{invoiceNumber,jdbcType=VARCHAR},
</if>
<if test="buyerName != null">
BuyerName = #{buyerName,jdbcType=VARCHAR}, BuyerName = #{buyerName,jdbcType=VARCHAR},
</if>
<if test="buyerTaxNumber != null">
BuyerTaxNumber = #{buyerTaxNumber,jdbcType=VARCHAR}, BuyerTaxNumber = #{buyerTaxNumber,jdbcType=VARCHAR},
</if>
<if test="bankAccount != null">
BankAccount = #{bankAccount,jdbcType=VARCHAR}, BankAccount = #{bankAccount,jdbcType=VARCHAR},
</if>
<if test="phoneNum != null">
PhoneNum = #{phoneNum,jdbcType=VARCHAR}, PhoneNum = #{phoneNum,jdbcType=VARCHAR},
</if>
<if test="invoiceDate != null">
InvoiceDate = #{invoiceDate,jdbcType=TIMESTAMP}, InvoiceDate = #{invoiceDate,jdbcType=TIMESTAMP},
</if>
<if test="seqNo != null">
SeqNo = #{seqNo,jdbcType=INTEGER}, SeqNo = #{seqNo,jdbcType=INTEGER},
</if>
<if test="periodID != null">
PeriodID = #{periodID,jdbcType=INTEGER}, PeriodID = #{periodID,jdbcType=INTEGER},
</if>
<if test="status != null">
Status = #{status,jdbcType=INTEGER}, Status = #{status,jdbcType=INTEGER},
</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="partAccntedPeriod != null">
PartAccntedPeriod = #{partAccntedPeriod,jdbcType=INTEGER}, PartAccntedPeriod = #{partAccntedPeriod,jdbcType=INTEGER},
</if> AccntedPeriod = #{accntedPeriod,jdbcType=INTEGER}
<if test="accntedPeriod != null"> where InvoiceID = #{invoiceID,jdbcType=VARCHAR}
AccntedPeriod = #{accntedPeriod,jdbcType=INTEGER}, </update>
</if> <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample"
</set> resultMap="BaseResultMap">
where InvoiceID = #{invoiceID,jdbcType=VARCHAR} <!--
</update> WARNING - @mbg.generated
<update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoice"> 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 OutputVATInvoice </if>
set InvoiceType = #{invoiceType,jdbcType=INTEGER}, <include refid="Base_Column_List"/>
ClassCode = #{classCode,jdbcType=VARCHAR}, from OutputVATInvoice
InvoiceNumber = #{invoiceNumber,jdbcType=VARCHAR}, <if test="_parameter != null">
BuyerName = #{buyerName,jdbcType=VARCHAR}, <include refid="Example_Where_Clause"/>
BuyerTaxNumber = #{buyerTaxNumber,jdbcType=VARCHAR}, </if>
BankAccount = #{bankAccount,jdbcType=VARCHAR}, <if test="orderByClause != null">
PhoneNum = #{phoneNum,jdbcType=VARCHAR}, order by ${orderByClause}
InvoiceDate = #{invoiceDate,jdbcType=TIMESTAMP}, </if>
SeqNo = #{seqNo,jdbcType=INTEGER}, </select>
PeriodID = #{periodID,jdbcType=INTEGER}, <resultMap id="OutputVATInvoiceInfoDto" type="pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto">
Status = #{status,jdbcType=INTEGER}, <id column="InvoiceID" jdbcType="VARCHAR" property="invoiceID"/>
CreatorID = #{creatorID,jdbcType=VARCHAR}, <result column="InvoiceType" jdbcType="INTEGER" property="invoiceType"/>
CreateTime = #{createTime,jdbcType=TIMESTAMP}, <result column="InvoiceType" jdbcType="INTEGER" property="invoiceType"/>
PartAccntedPeriod = #{partAccntedPeriod,jdbcType=INTEGER}, <result column="InvoiceTypeName" jdbcType="VARCHAR" property="invoiceTypeName"/>
AccntedPeriod = #{accntedPeriod,jdbcType=INTEGER} <result column="ClassCode" jdbcType="VARCHAR" property="classCode"/>
where InvoiceID = #{invoiceID,jdbcType=VARCHAR} <result column="InvoiceNumber" jdbcType="VARCHAR" property="invoiceNumber"/>
</update> <result column="BuyerName" jdbcType="VARCHAR" property="buyerName"/>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceExample" resultMap="BaseResultMap"> <result column="BuyerTaxNumber" jdbcType="VARCHAR" property="buyerTaxNumber"/>
<!-- <result column="BankAccount" jdbcType="VARCHAR" property="bankAccount"/>
WARNING - @mbg.generated <result column="PhoneNum" jdbcType="VARCHAR" property="phoneNum"/>
This element is automatically generated by MyBatis Generator, do not modify. <result column="InvoiceDate" jdbcType="TIMESTAMP" property="invoiceDate"/>
--> <result column="CodeVersion" jdbcType="VARCHAR" property="codeVersion"/>
select <result column="ProductName" jdbcType="VARCHAR" property="productName"/>
<if test="distinct"> <result column="DocumentNum" jdbcType="VARCHAR" property="documentNum"/>
distinct <result column="ProductStandard" jdbcType="VARCHAR" property="productStandard"/>
</if> <result column="Unit" jdbcType="VARCHAR" property="unit"/>
<include refid="Base_Column_List" /> <result column="Quantity" jdbcType="INTEGER" property="quantity"/>
from OutputVATInvoice <result column="UnitPrice" jdbcType="DOUBLE" property="unitPrice"/>
<if test="_parameter != null"> <result column="Amount" jdbcType="DECIMAL" property="amount"/>
<include refid="Example_Where_Clause" /> <result column="TaxRate" jdbcType="DECIMAL" property="taxRate"/>
</if> <result column="TaxAmount" jdbcType="DECIMAL" property="taxAmount"/>
<if test="orderByClause != null"> <result column="TaxClassCode" jdbcType="VARCHAR" property="taxClassCode"/>
order by ${orderByClause} <result column="PeriodID" jdbcType="INTEGER" property="periodID"/>
</if> <result column="IsDuplicate" jdbcType="INTEGER" property="isDuplicate"/>
</select> <result column="AmountDifference" jdbcType="DECIMAL" property="amountDifference"/>
</resultMap>
<select id="selectOutputVATInvoiceInfoLeftJoinItem" resultMap="OutputVATInvoiceInfoDto"
parameterType="pwc.taxtech.atms.dto.vatdto.QueryOutputDto">
SELECT
o.InvoiceID,
o.InvoiceType,
o.ClassCode,
o.InvoiceNumber,
o.BuyerName,
o.BuyerTaxNumber,
o.BankAccount,
o.PhoneNum,
o.InvoiceDate,
IFNULL( oi.CodeVersion,'') AS CodeVersion,
IFNULL(oi.ProductName,'') AS ProductName,
IFNULL(oi.DocumentNum,'') AS DocumentNum,
IFNULL(oi.ProductStandard,'') AS ProductStandard,
IFNULL(oi.Unit,'') AS Unit,
IFNULL(oi.Quantity,'') AS Quantity,
IFNULL(oi.UnitPrice,'') AS UnitPrice,
IFNULL(oi.Amount,'') AS Amount,
IFNULL(oi.TaxAmount,'') AS TaxAmount,
IFNULL(oi.TaxClassCode,'') AS TaxClassCode,
o.PeriodID
FROM OutputVATInvoice o
LEFT JOIN OutputVATInvoiceItem oi
ON o.InvoiceID = oi.InvoiceID
WHERE 1=1
<if test="queryDto.PeriodStart">
AND o.Period&gt;=#{queryDto.PeriodStart,jdbcType=VARCHAR}
</if>
<if test="queryDto.PeriodEnd">
AND o.Period&lt;=#{queryDto.PeriodEnd,jdbcType=VARCHAR}
</if>
<if test="queryDto.ProductName!=null and queryDto.ProductName!=''">
AND ProductName LIKE concat('%',#{query.ProductName,jdbcType=VARCHAR,'%'})
</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