Commit 1730f6ac authored by sherlock's avatar sherlock

Merge branch 'dev_oracle_sherlock' into 'dev_oracle'

another dataSource

See merge request root/atms!137
parents 9e2a6a9a f4f918e1
......@@ -14,6 +14,15 @@
</parent>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.oracle/ojdbc6 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>pwc.taxtech.atms</groupId>
<artifactId>atms-dao</artifactId>
......
......@@ -9,6 +9,8 @@ import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.ProjectDao;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.ProjectServiceTypeMapper;
import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.vat.dao.*;
......@@ -30,19 +32,21 @@ public class SpringContextUtil implements ApplicationContextAware {
public static PeriodStandardAccountMapper periodStandardAccountMapper;
public static ProjectDao projectDao;
public static BalanceMapper balanceMapper;
public static DataSourceMapper dataSourceMapper;
// public static DataSourceMapper dataSourceMapper;
public static PeriodDataSourceMapper periodDataSourceMapper;
public static DataSourceDetailMapper dataSourceDetailMapper;
// public static DataSourceDetailMapper dataSourceDetailMapper;
public static PeriodDataSourceDetailMapper periodDataSourceDetailMapper;
public static PeriodFormulaBlockMapper periodFormulaBlockMapper;
public static VatEnterpriseAccountDao vatEnterpriseAccountDao;
public static VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
public static PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper;
public static BalanceStdManualMapper balanceStdManualMapper;
public static OutputVatInvoiceMapper outputVATInvoiceMapper;
// public static OutputVatInvoiceMapper outputVATInvoiceMapper;
public static OutputInvoiceMapper outputInvoiceMapper;
public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper;
public static InputVatInvoiceDao inputVatInvoiceDao;
public static InputVatInvoiceMapper inputVATInvoiceMapper;
public static InputInvoiceDao inputInvoiceDao;
// public static InputVatInvoiceMapper inputVATInvoiceMapper;
public static InputInvoiceMapper inputInvoiceMapper;
public static AssetsListMapper assetsListMapper;
public static ProjectMapper projectMapper;
public static CellDataSourceMapper cellDataSourceMapper;
......@@ -72,23 +76,23 @@ public class SpringContextUtil implements ApplicationContextAware {
periodCellTemplateMapper = webApplicationContext.getBean(PeriodCellTemplateMapper.class);
projectServiceTypeMapper = webApplicationContext.getBean(ProjectServiceTypeMapper.class);
periodTemplateMapper = webApplicationContext.getBean(PeriodTemplateMapper.class);
periodStandardAccountMapper = webApplicationContext.getBean(PeriodStandardAccountMapper.class);
// periodStandardAccountMapper = webApplicationContext.getBean(PeriodStandardAccountMapper.class);
periodStandardAccountMapper = webApplicationContext.getBean(PeriodStandardAccountMapper.class);
projectDao = webApplicationContext.getBean(ProjectDao.class);
balanceMapper = webApplicationContext.getBean(BalanceMapper.class);
dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class);
// dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class);
periodDataSourceMapper = webApplicationContext.getBean(PeriodDataSourceMapper.class);
dataSourceDetailMapper = webApplicationContext.getBean(DataSourceDetailMapper.class);
// dataSourceDetailMapper = webApplicationContext.getBean(DataSourceDetailMapper.class);
periodDataSourceDetailMapper = webApplicationContext.getBean(PeriodDataSourceDetailMapper.class);
periodFormulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class);
vatEnterpriseAccountDao = webApplicationContext.getBean(VatEnterpriseAccountDao.class);
vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class);
periodEnterpriseAccountMapper = webApplicationContext.getBean(PeriodEnterpriseAccountMapper.class);
balanceStdManualMapper = webApplicationContext.getBean(BalanceStdManualMapper.class);
outputVATInvoiceMapper = webApplicationContext.getBean(OutputVatInvoiceMapper.class);
outputInvoiceMapper = webApplicationContext.getBean(OutputInvoiceMapper.class);
periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class);
inputVatInvoiceDao = webApplicationContext.getBean(InputVatInvoiceDao.class);
inputVATInvoiceMapper = webApplicationContext.getBean(InputVatInvoiceMapper.class);
inputInvoiceDao = webApplicationContext.getBean(InputInvoiceDao.class);
inputInvoiceMapper = webApplicationContext.getBean(InputInvoiceMapper.class);
assetsListMapper = webApplicationContext.getBean(AssetsListMapper.class);
projectMapper = webApplicationContext.getBean(ProjectMapper.class);
cellDataSourceMapper = webApplicationContext.getBean(CellDataSourceMapper.class);
......
......@@ -3,17 +3,18 @@ package pwc.taxtech.atms.vat.dao;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample;
import java.util.List;
@Service
public class InputVatInvoiceDao {
public class InputInvoiceDao {
@Autowired
InputVatInvoiceMapper inputVATInvoiceMapper;
InputInvoiceMapper inputInvoiceMapper;
public List<InputVatInvoice> getInputVATInvoice(Integer period, Integer invoiceType, String checkPass, String scanPass, String notPass) {
public List<InputVatInvoice> getInputInvoice(Integer period, Integer invoiceType, String checkPass, String scanPass, String notPass) {
InputVatInvoiceExample example = new InputVatInvoiceExample();
InputVatInvoiceExample.Criteria criteria = example.createCriteria();
InputVatInvoiceExample.Criteria criteria1 = example.createCriteria();
......@@ -37,6 +38,6 @@ public class InputVatInvoiceDao {
example.or(criteria1);
}
return inputVATInvoiceMapper.selectByExample(example);
return inputInvoiceMapper.selectByExample(example);
}
}
......@@ -47,8 +47,8 @@ public class VatAbstractService {
public PeriodCellTemplateMapper periodCellTemplateMapper;
@Autowired
public PeriodCellTemplateConfigMapper periodCellTemplateConfigMapper;
@Autowired
public DataSourceMapper dataSourceMapper;
// @Autowired
// public DataSourceMapper dataSourceMapper;
@Autowired
public PeriodDataSourceMapper periodDataSourceMapper;
@Autowired
......
......@@ -81,22 +81,22 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
List<InputVatInvoice> inputVATInvoices;
if (authenticationType == 1 && formulaContext.getIsYear()) {
inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(null, invoiceType,
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null);
} else if (authenticationType == 1) {
inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(period, invoiceType,
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null);
}
// 认证未通过与未认证暂认为是同一个意思
else if ((authenticationType == 1 || authenticationType == 2) && formulaContext.getIsYear()) {
inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(null, invoiceType,
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType,
null, null, Constant.InputInvoiceCertificationResult.NotPass);
}
// 认证未通过与未认证暂认为是同一个意思
else if (authenticationType == 0 || authenticationType == 2) {
inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(period, invoiceType, null,
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType, null,
null, Constant.InputInvoiceCertificationResult.NotPass);
} else {
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
......
......@@ -84,7 +84,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
}
String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputVATInvoiceMapper.getInputVATInvoiceResultDto(dbName);
List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputInvoiceMapper.getInputVATInvoiceResultDto(dbName);
if (!goodsName.equals("99")) {
inputInvoice = inputInvoice.stream()
......
......@@ -71,7 +71,7 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
}
String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
List<OutputVATInvoiceDto> outputInvoice = SpringContextUtil.outputVATInvoiceMapper.getVatInvoiceWithItems(dbName);
List<OutputVATInvoiceDto> outputInvoice = SpringContextUtil.outputInvoiceMapper.getVatInvoiceWithItems(dbName);
if (invoiceType != 99) {
outputInvoice = outputInvoice.stream()
......
......@@ -26,6 +26,11 @@
</property>
</bean>
<bean id="datasource2" class="com.alibaba.druid.pool.DruidDataSource">
<property name="url" value="${jdbc2_url}" />
<property name="username" value="${jdbc2_username}" />
<property name="password" value="${jdbc2_password}" />
</bean>
<!-- **************************************************************** -->
<!-- 启用注解, 启用component-scan -->
<!-- **************************************************************** -->
......@@ -35,6 +40,12 @@
<import resource="applicationContext-datasource.xml" />
<bean id="sqlSessionFactory2" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="datasource2"/>
<property name="configLocation" value="classpath:sqlMapConfig.xml"/>
<property name="mapperLocations" value="classpath*:pwc/taxtech/atms/invoice/*Mapper.xml"/>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:sqlMapConfig.xml" />
......@@ -49,6 +60,13 @@
<constructor-arg ref="sqlSessionFactory" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="pwc.taxtech.atms.invoice" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory2"/>
</bean>
<bean id="transactionManager2" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="datasource2" />
</bean>
<!-- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="pwc.taxtech.atms" /> </bean> -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
......
......@@ -4,6 +4,12 @@ jdbc_password=taxadmin2018
#jdbc_password=111111
jdbc_admin_db=tax_admin
jdbc2_url=jdbc:oracle:thin:@10.158.230.144:11521:XE
jdbc2_user=pwc_invoice
jdbc2_password=pwc_invoice
#jdbc_password=111111
jdbc2_admin_db=pwc_invoice
jdbc_url_demo=jdbc:mysql://10.158.230.144:3306/demo_db_name?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
......
package pwc.taxtech.atms.vat.dao;
package pwc.taxtech.atms.invoice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.DataSourceCellDataDto;
import pwc.taxtech.atms.vat.dpo.DataSourceExtendDto;
import pwc.taxtech.atms.vat.entity.DataSource;
import pwc.taxtech.atms.vat.entity.DataSourceExample;
import pwc.taxtech.atms.vat.dpo.CellInvoiceDto;
import pwc.taxtech.atms.vat.dpo.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.vat.dpo.InputVATInvoiceItemExtendDto;
import pwc.taxtech.atms.vat.dpo.InputVATInvoiceResultDto;
import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample;
import java.util.List;
@Mapper
public interface DataSourceMapper extends MyVatMapper {
public interface InputInvoiceMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
long countByExample(DataSourceExample example);
long countByExample(InputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
int deleteByExample(DataSourceExample example);
int deleteByExample(InputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
int insert(DataSource record);
int insert(InputVatInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
int insertSelective(DataSource record);
int insertSelective(InputVatInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
List<DataSource> selectByExampleWithRowbounds(DataSourceExample example, RowBounds rowBounds);
List<InputVatInvoice> selectByExampleWithRowbounds(InputVatInvoiceExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
List<DataSource> selectByExample(DataSourceExample example);
List<InputVatInvoice> selectByExample(InputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
DataSource selectByPrimaryKey(Long id);
InputVatInvoice selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DataSource record, @Param("example") DataSourceExample example);
int updateByExampleSelective(@Param("record") InputVatInvoice record, @Param("example") InputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
int updateByExample(@Param("record") DataSource record, @Param("example") DataSourceExample example);
int updateByExample(@Param("record") InputVatInvoice record, @Param("example") InputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DataSource record);
int updateByPrimaryKeySelective(InputVatInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. DATA_SOURCE
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
*
* @mbg.generated
*/
int updateByPrimaryKey(DataSource record);
int updateByPrimaryKey(InputVatInvoice record);
void clearFormulaBlockWithPeriod(@Param("period") Integer period);
long getInputVATInvoiceCountByCondition(@Param("paras") InputInvoicePreviewQueryParam param);
void clearTaxRuleSettingWithPeriod(@Param("period") Integer period);
List<InputVatInvoice> getInputVATInvoiceCountByConditionWithPaging(@Param("paras") InputInvoicePreviewQueryParam param,
@Param("limitFrom") int limitFrom);
void clearCellTemplateWithPeriod(@Param("period") Integer period, @Param("exceptReportTemplateIDs") String exceptReportTemplateIDs);
List<InputVATInvoiceResultDto> getInputVATInvoiceResultDto(@Param("dbName") String dbName);
void clearCellTemplateConfigWithPeriod(@Param("period") Integer period, @Param("exceptReportTemplateIDs") String exceptReportTemplateIDs);
List<CellInvoiceDto> selectInputInvoiceWithItem();
void clearTemplateWithPeriod(@Param("period") Integer period, @Param("exceptReportTemplateIDs") String exceptReportTemplateIDs);
void clearTaxPayerReportWithPeriod(@Param("period") Integer period, @Param("projectId") String projectId);
void clearDataSourceWithPeriod(@Param("period") Integer period);
void clearDataSourceDetailWithPeriod(@Param("period") Integer period);
void clearCellDataSourceDataWithPeriod(@Param("period") Integer period);
void clearCellDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs, @Param("period") Integer period);
void clearReportWithPeriod(Integer period);
void clearDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs, @Param("period") Integer period,
@Param("projectId") String projectId);
List<DataSourceExtendDto> getFormulaDataSource(Long reportID);
List<DataSourceExtendDto> getManualDataSource(Long cellDataID);
DataSourceCellDataDto getManualDataSource2(Long dataSourceID);
InputVATInvoiceItemExtendDto selectInvoiceExtendDto(@Param("invoiceItemId") String invoiceItemId);
}
\ No newline at end of file
package pwc.taxtech.atms.invoice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.OutputInvoiceDataSourceDto;
import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceDto;
import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.vat.dpo.QueryOutputDto;
import pwc.taxtech.atms.vat.entity.OutputVatInvoice;
import pwc.taxtech.atms.vat.entity.OutputVatInvoiceExample;
import java.util.List;
@Mapper
public interface OutputInvoiceMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
long countByExample(OutputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
int deleteByExample(OutputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
int deleteByPrimaryKey(String invoiceId);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
int insert(OutputVatInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
int insertSelective(OutputVatInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
List<OutputVatInvoice> selectByExampleWithRowbounds(OutputVatInvoiceExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
List<OutputVatInvoice> selectByExample(OutputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
OutputVatInvoice selectByPrimaryKey(String invoiceId);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") OutputVatInvoice record, @Param("example") OutputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
int updateByExample(@Param("record") OutputVatInvoice record, @Param("example") OutputVatInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(OutputVatInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
*
* @mbg.generated
*/
int updateByPrimaryKey(OutputVatInvoice record);
List<OutputVATInvoiceInfoDto> selectOutputVATInvoiceInfoLeftJoinItem(@Param("queryDto") QueryOutputDto queryDto);
@Select("SELECT " +
" o.PERIOD_ID as periodId, " +
" o.INVOICE_TYPE as invoiceType, " +
" o.CLASS_CODE as classCode, " +
" o.INVOICE_NUMBER as invoiceNumber, " +
" o.BUYER_NAME as buyerName, " +
" o.BUYER_TAX_NUMBER as buyerTaxNumber, " +
" o.BANK_ACCOUNT as bankAccount, " +
" o.PHONE_NUM as phoneNum, " +
" o.INVOICE_DATE as invoiceDate, " +
" oi.CODE_VERSION as codeVersion, " +
" oi.PRODUCT_NAME as productName, " +
" oi.DOCUMENT_NUM as documentNum, " +
" oi.PRODUCT_STANDARD as productStandard, " +
" oi.UNIT as unit, " +
" oi.QUANTITY as quantity, " +
" oi.UNIT_PRICE as unitPrice, " +
" oi.AMOUNT as amount, " +
" oi.TAX_RATE as taxRate, " +
" oi.TAX_AMOUNT as taxAmount, " +
" oi.TAX_CLASS_CODE as taxClassCode " +
"FROM " +
" OUTPUT_VAT_INVOICE o, " +
" OUTPUT_VAT_INVOICE_ITEM oi, " +
" (SELECT " +
" INVOICE_ID, MIN(SeqNo) MIN_SEQ_NO " +
" FROM " +
" OUTPUT_VAT_INVOICE_ITEM " +
" GROUP BY InvoiceID) m " +
"WHERE " +
" o.INVOICE_ID = oi.INVOICE_ID " +
" AND o.INVOICE_ID = m.INVOICE_ID " +
" AND oi.SEQ_NO = m.MIN_SEQ_NO " +
" AND o.PERIOD_ID = #{period}" +
" UNION SELECT " +
" o2.periodID, " +
" NULL AS invoiceType, " +
" '' AS classCode, " +
" '' AS invoiceNumber, " +
" '' AS buyerName, " +
" '' AS buyerTaxNumber, " +
" '' AS bankAccount, " +
" '' AS phoneNum, " +
" NULL AS invoiceDate, " +
" oi2.codeVersion, " +
" oi2.productName, " +
" oi2.documentNum, " +
" oi2.productStandard, " +
" oi2.unit, " +
" oi2.quantity, " +
" oi2.unitPrice, " +
" oi2.amount, " +
" oi2.taxRate, " +
" oi2.taxAmount, " +
" oi2.taxClassCode " +
"FROM " +
" OUTPUT_VAT_INVOICE o2, " +
" OUTPUT_VAT_INVOICE_ITEM oi2, " +
" (SELECT " +
" INVOICE_ID, MIN(SEQ_NO) MIN_SEQ_NO " +
" FROM " +
" OUTPUT_VAT_INVOICE_ITEM " +
" GROUP BY INVOICE_ID) m2 " +
"WHERE " +
" o2.INVOICE_ID = oi2.INVOICE_ID " +
" AND o2.INVOICE_ID = m2.INVOICE_ID " +
" AND oi2.SEQ_NO != m2.MIN_SEQ_NO " +
" AND o2.PERIOD_ID = #{period}" +
" ")
List<OutputVATInvoiceInfoDto> queryOutputDetailWithItem(Integer period);
List<OutputVATInvoiceDto> getVatInvoiceWithItems(@Param("dbName") String dbName);
List<OutputInvoiceDataSourceDto> selectOutputInvoiceAndItem();
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dpo;
import pwc.taxtech.atms.CommonUtils;
import pwc.taxtech.atms.vat.entity.DataSource;
import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import java.util.List;
public class DataSourceExtendDto extends DataSource {
public class DataSourceExtendDto extends PeriodDataSource {
private Integer operationType;
private Long cellTemplateId;
private Long cellDataId;
......
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