You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1208 lines
49 KiB
1208 lines
49 KiB
<?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">
|
|
<mapper namespace="com.dxhy.domestic.dao.DomesticExportInvoiceDao">
|
|
<resultMap id="BaseResultMap" type="com.dxhy.domestic.entity.TdxExportInvoice">
|
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
|
<result column="export_no" jdbcType="VARCHAR" property="exportNo"/>
|
|
<result column="invoice_code" jdbcType="VARCHAR" property="invoiceCode"/>
|
|
<result column="invoice_no" jdbcType="VARCHAR" property="invoiceNo"/>
|
|
<result column="invoice_type" jdbcType="VARCHAR" property="invoiceType"/>
|
|
<result column="invoice_status" jdbcType="VARCHAR" property="invoiceStatus"/>
|
|
<result column="invoice_date" jdbcType="TIMESTAMP" property="invoiceDate"/>
|
|
<result column="gf_tax_no" jdbcType="VARCHAR" property="gfTaxNo"/>
|
|
<result column="gf_name" jdbcType="VARCHAR" property="gfName"/>
|
|
<result column="xf_tax_no" jdbcType="VARCHAR" property="xfTaxNo"/>
|
|
<result column="xf_name" jdbcType="VARCHAR" property="xfName"/>
|
|
<result column="export_amount" jdbcType="DECIMAL" property="exportAmount"/>
|
|
<result column="export_tax_amount" jdbcType="DECIMAL" property="exportTaxAmount"/>
|
|
<result column="export_yxse" jdbcType="DECIMAL" property="exportYxse"/>
|
|
<result column="rzh_date" jdbcType="TIMESTAMP" property="rzhDate"/>
|
|
<result column="rzh_belong_date" jdbcType="VARCHAR" property="rzhBelongDate"/>
|
|
<result column="confirm_date" jdbcType="TIMESTAMP" property="confirmDate"/>
|
|
<result column="rzh_yesorno" jdbcType="VARCHAR" property="rzhYesorno"/>
|
|
<result column="uuid" jdbcType="VARCHAR" property="uuid"/>
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
|
|
<result column="rzh_back_msg" jdbcType="VARCHAR" property="rzhBackMsg"/>
|
|
<result column="check_code" jdbcType="VARCHAR" property="checkCode"/>
|
|
<result column="txfbz" jdbcType="VARCHAR" property="txfbz"/>
|
|
<result column="lslbz" jdbcType="VARCHAR" property="lslbz"/>
|
|
<result column="confirm_user" jdbcType="VARCHAR" property="confirmUser"/>
|
|
<result column="glzt" jdbcType="VARCHAR" property="glzt"/>
|
|
<result column="xxly" jdbcType="VARCHAR" property="xxly"/>
|
|
<result column="yqkgxbz" jdbcType="VARCHAR" property="yqkgxbz"/>
|
|
<result column="company" jdbcType="VARCHAR" property="company"/>
|
|
<result column="cxrz_status" jdbcType="VARCHAR" property="cxrzStatus"/>
|
|
<result column="cxrz_date" jdbcType="TIMESTAMP" property="cxrzDate"/>
|
|
<result column="bdk_status" jdbcType="VARCHAR" property="bdkStatus"/>
|
|
<result column="cxrz_current_period" jdbcType="VARCHAR" property="cxrzCurrentPeriod"/>
|
|
<result column="bdk_current_period" jdbcType="VARCHAR" property="bdkCurrentPeriod"/>
|
|
<result column="cxbdk_status" jdbcType="VARCHAR" property="cxbdkStatus"/>
|
|
<result column="cxbdk_date" jdbcType="TIMESTAMP" property="cxbdkDate"/>
|
|
<result column="auth_status" jdbcType="VARCHAR" property="authStatus"/>
|
|
<result column="rzlx" jdbcType="VARCHAR" property="rzlx"/>
|
|
</resultMap>
|
|
<select databaseId="mysql" id="queryVatSgrzSum"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
count(1) as hjsl,
|
|
sum(p.export_amount) as hjje,
|
|
sum(p.export_tax_amount) as hjse
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where
|
|
p.rzh_yesorno = '0'
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
|
|
and p.auth_status in('0','5','6')
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and p.invoice_date >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and p.invoice_date <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select databaseId="mysql" id="queryVatSgrz"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
p.id as id,
|
|
p.export_no as exportNo,
|
|
p.invoice_code as invoiceCode,
|
|
p.invoice_no as invoiceNo,
|
|
p.invoice_status as invoiceStatus,
|
|
DATE_FORMAT(p.invoice_date ,'%Y-%m-%d') as invoiceDate,
|
|
p.invoice_type as invoiceType,
|
|
p.gf_name as gfName,
|
|
p.xf_name as xfName,
|
|
p.export_amount as exportAmount,
|
|
p.export_tax_amount as exportTaxAmount,
|
|
p.export_yxse as exportYxse,
|
|
p.gf_tax_no as gfTaxNo,
|
|
p.inaccount_status as inAccountStatus,
|
|
p.bzdh as bzdh,
|
|
p.image_id as imageNumber,
|
|
p.account_period as accountPeriod,
|
|
p.posting_time as postingTime,
|
|
p.sn_voucher_number as snVoucherNumber,
|
|
p.bzr as bzr,
|
|
p.comp_code as compCode
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where
|
|
p.rzh_yesorno = '0'
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
|
|
and p.auth_status in('0','5','6')
|
|
and p.company = #{queryParams.company}
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and p.invoice_date >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and p.invoice_date <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
order by p.create_date desc
|
|
|
|
</select>
|
|
|
|
<select databaseId="mysql" id="queryVatBdk"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
p.id as id,
|
|
p.export_no as exportNo,
|
|
p.invoice_code as invoiceCode,
|
|
p.invoice_no as invoiceNo,
|
|
p.invoice_status as invoiceStatus,
|
|
DATE_FORMAT(p.invoice_date ,'%Y-%m-%d') as invoiceDate,
|
|
p.invoice_type as invoiceType,
|
|
p.gf_name as gfName,
|
|
p.xf_name as xfName,
|
|
p.export_amount as exportAmount,
|
|
p.export_tax_amount as exportTaxAmount,
|
|
p.export_yxse as exportYxse,
|
|
p.auth_status as authStatus,
|
|
p.cxbdk_status as cxbdkStatus,
|
|
p.bdk_status as bdkStatus,
|
|
p.gf_tax_no as gfTaxNo,
|
|
p.inaccount_status as inAccountStatus,
|
|
p.bzdh as bzdh,
|
|
p.image_id as imageNumber,
|
|
p.account_period as accountPeriod,
|
|
p.posting_time as postingTime,
|
|
p.sn_voucher_number as snVoucherNumber,
|
|
p.bzr as bzr,
|
|
p.comp_code as compCode
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where p.gf_tax_no = #{queryParams.gfsh}
|
|
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
|
|
and company = #{queryParams.company}
|
|
|
|
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
|
|
and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
|
|
</if>
|
|
|
|
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '4'.toString()">
|
|
and p.bdk_status = '2' and p.auth_status='4'
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and p.invoice_date >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and p.invoice_date <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
order by p.invoice_date desc
|
|
|
|
</select>
|
|
|
|
<select databaseId="mysql" id="queryVatBdkSum"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
count(1) as hjsl,
|
|
sum(p.export_amount) as hjje,
|
|
sum(p.export_tax_amount) as hjse
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where p.gf_tax_no = #{queryParams.gfsh}
|
|
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
|
|
and p.company = #{queryParams.company}
|
|
|
|
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
|
|
and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
|
|
</if>
|
|
|
|
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '4'.toString()">
|
|
and p.bdk_status = '2' and p.auth_status='4'
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and p.invoice_date >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and p.invoice_date <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select databaseId="mysql" id="queryVatRzcx"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
p.id as id,
|
|
p.export_no as exportNo,
|
|
p.invoice_code as invoiceCode,
|
|
p.invoice_no as invoiceNo,
|
|
p.invoice_status as invoiceStatus,
|
|
DATE_FORMAT(p.invoice_date ,'%Y-%m-%d') as invoiceDate,
|
|
p.invoice_type as invoiceType,
|
|
p.gf_name as gfName,
|
|
p.xf_name as xfName,
|
|
p.export_amount as exportAmount,
|
|
p.export_tax_amount as exportTaxAmount,
|
|
p.export_yxse as exportYxse,
|
|
p.gf_tax_no as gfTaxNo,
|
|
p.xf_tax_no as xfTaxNo,
|
|
DATE_FORMAT(p.rzh_date,'%Y-%m-%d') as rzhDate,
|
|
p.rzh_yesorno as rzhYesorno,
|
|
p.auth_status as authStatus,
|
|
p.bdk_status as bdkStatus,
|
|
p.confirm_user as confirmUser,
|
|
p.rzh_belong_date as rzhBelongDate,
|
|
p.cxbdk_status as cxbdkStatus,
|
|
p.cxrz_status as cxrzStatus,
|
|
p.inaccount_status as inAccountStatus,
|
|
p.bzdh as bzdh,
|
|
p.image_id as imageNumber,
|
|
p.account_period as accountPeriod,
|
|
p.posting_time as postingTime,
|
|
p.sn_voucher_number as snVoucherNumber,
|
|
p.bzr as bzr,
|
|
p.comp_code as compCode
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where
|
|
p.auth_status != '0'
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
|
|
and p.company = #{queryParams.company}
|
|
|
|
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno != 3 ">
|
|
and p.rzh_yesorno = #{queryParams.rzhYesorno}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno == 3 ">
|
|
and (p.rzh_yesorno = '1' or p.rzh_yesorno = '2')
|
|
</if>
|
|
|
|
<if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
|
|
and p.bdk_status = #{queryParams.bdkStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
|
|
and p.auth_status = #{queryParams.authStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
|
|
and p.rzh_belong_date = #{queryParams.rzhBelongDate}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and p.invoice_date >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and p.invoice_date <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
|
|
and p.rzh_date >= #{queryParams.rzhDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
|
|
and p.rzh_date <= #{queryParams.rzhDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
|
|
and p.confirm_user = #{queryParams.confirmUser}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
order by p.confirm_date desc
|
|
</select>
|
|
|
|
<select databaseId="mysql" id="queryVatRzcxSum"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
count(1) as hjsl,
|
|
sum(p.export_amount) as hjje,
|
|
sum(p.export_tax_amount) as hjse
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where
|
|
p.auth_status != '0'
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
|
|
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno != 3 ">
|
|
and p.rzh_yesorno = #{queryParams.rzhYesorno}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno == 3 ">
|
|
and (p.rzh_yesorno = '1' or p.rzh_yesorno = '2')
|
|
</if>
|
|
|
|
<if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
|
|
and p.bdk_status = #{queryParams.bdkStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
|
|
and p.auth_status = #{queryParams.authStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
|
|
and p.rzh_belong_date = #{queryParams.rzhBelongDate}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and p.invoice_date >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and p.invoice_date <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
|
|
and p.rzh_date >= #{queryParams.rzhDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
|
|
and p.rzh_date <= #{queryParams.rzhDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
|
|
and p.confirm_user = #{queryParams.confirmUser}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select databaseId="mysql"
|
|
id="queryExportInvoiceList" parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO"
|
|
resultType="java.util.Map">
|
|
SELECT
|
|
p.id as id,
|
|
p.export_no as exportNo,
|
|
p.invoice_code as invoiceCode,
|
|
p.invoice_no as invoiceNo,
|
|
p.invoice_status as invoiceStatus,
|
|
DATE_FORMAT(p.invoice_date ,'%Y-%m-%d') as invoiceDate,
|
|
p.invoice_type as invoiceType,
|
|
p.gf_name as gfName,
|
|
p.xf_name as xfName,
|
|
p.export_amount as exportAmount,
|
|
p.export_tax_amount as exportTaxAmount,
|
|
p.export_yxse as exportYxse,
|
|
p.gf_tax_no as gfTaxNo,
|
|
p.xf_tax_no as xfTaxNo,
|
|
DATE_FORMAT(p.rzh_date ,'%Y-%m-%d') as rzhDate,
|
|
p.rzh_yesorno as rzhYesorno,
|
|
p.auth_status as authStatus,
|
|
p.bdk_status as bdkStatus,
|
|
p.confirm_user as confirmUser,
|
|
p.rzh_belong_date as rzhBelongDate,
|
|
p.cxbdk_status as cxbdkStatus,
|
|
p.sn_voucher_number as snVoucherNumber,
|
|
p.posting_time as postingTime,
|
|
p.image_id as imageNumber,
|
|
p.account_period as accountPeriod,
|
|
p.bzdh,
|
|
p.bzr,
|
|
p.inaccount_status as inAccountStatus,
|
|
p.comp_code as compCode
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where p.company = #{queryParams.company}
|
|
<include refid="queryExportInvoice_sql"/>
|
|
order by p.invoice_date desc
|
|
</select>
|
|
|
|
|
|
<select databaseId="mysql"
|
|
id="queryExportInvoiceSum" parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO"
|
|
resultType="java.util.Map">
|
|
SELECT
|
|
count(1) as hjsl,
|
|
sum(p.export_amount) as hjje,
|
|
sum(p.export_tax_amount) as hjse
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where p.company = #{queryParams.company}
|
|
<include refid="queryExportInvoice_sql"/>
|
|
</select>
|
|
<select databaseId="mysql" id="selectDkse"
|
|
parameterType="java.util.Map" resultType="com.dxhy.domestic.entity.TdxExportInvoice">
|
|
select sum(t.export_yxse) exportYxse
|
|
from t_dx_export_invoice t
|
|
WHERE (t.rzh_yesorno = '1' or t.auth_status in ('2', '3', '4'))
|
|
and t.gf_tax_no = #{gfsh}
|
|
and t.rzh_belong_date = #{skssq}
|
|
|
|
</select>
|
|
<select databaseId="oracle" id="queryVatSgrzSum"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
count(1) as "hjsl",
|
|
sum(p.export_amount) as "hjje",
|
|
sum(p.export_tax_amount) as "hjse"
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where
|
|
p.rzh_yesorno = '0'
|
|
and p.auth_status in('0','5','6')
|
|
|
|
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
|
|
and p.gf_tax_no in
|
|
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
|
|
separator=",">
|
|
#{item,jdbcType=VARCHAR}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select databaseId="oracle" id="queryVatSgrz"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
to_char(p.id) as "id",
|
|
p.export_no as "exportNo",
|
|
p.invoice_code as "invoiceCode",
|
|
p.invoice_no as "invoiceNo",
|
|
p.invoice_status as "invoiceStatus",
|
|
to_date(p.invoice_date, 'yyyy-MM-dd') as "invoiceDate",
|
|
p.invoice_type as "invoiceType",
|
|
p.gf_name as "gfName",
|
|
p.xf_name as "xfName",
|
|
p.export_amount as "exportAmount",
|
|
p.export_tax_amount as "exportTaxAmount",
|
|
p.export_yxse as "exportYxse",
|
|
p.gf_tax_no as "gfTaxNo"
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where
|
|
p.rzh_yesorno = '0'
|
|
and company = #{queryParams.company}
|
|
and p.auth_status in('0','5','6')
|
|
|
|
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
|
|
and p.gf_tax_no in
|
|
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
|
|
separator=",">
|
|
#{item,jdbcType=VARCHAR}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
order by p.create_date desc
|
|
|
|
</select>
|
|
|
|
<!-- ====================================== ↓↓↓↓↓↓ oracle ↓↓↓↓↓↓ ====================================== -->
|
|
|
|
<select databaseId="oracle" id="queryVatBdk"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
to_char(p.id) as "id",
|
|
p.export_no as "exportNo",
|
|
p.invoice_code as "invoiceCode",
|
|
p.invoice_no as "invoiceNo",
|
|
p.invoice_status as "invoiceStatus",
|
|
to_date(p.invoice_date , 'yyyy-MM-dd') as "invoiceDate",
|
|
p.invoice_type as "invoiceType",
|
|
p.gf_name as "gfName",
|
|
p.xf_name as "xfName",
|
|
p.export_amount as "exportAmount",
|
|
p.export_tax_amount as "exportTaxAmount",
|
|
p.export_yxse as "exportYxse",
|
|
p.auth_status as "authStatus",
|
|
p.cxbdk_status as "cxbdkStatus",
|
|
p.bdk_status as "bdkStatus",
|
|
p.gf_tax_no as "gfTaxNo"
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where company = #{queryParams.company}
|
|
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
|
|
and p.gf_tax_no in
|
|
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
|
|
separator=",">
|
|
#{item,jdbcType=VARCHAR}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
</if>
|
|
|
|
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
|
|
and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
|
|
</if>
|
|
|
|
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '4'.toString()">
|
|
and p.bdk_status = '2' and p.auth_status='4'
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
order by p.invoice_date desc
|
|
|
|
</select>
|
|
|
|
<select databaseId="oracle" id="queryVatBdkSum"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
count(1) as "hjsl",
|
|
sum(p.export_amount) as "hjje",
|
|
sum(p.export_tax_amount) as "hjse"
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where
|
|
p.company = #{queryParams.company}
|
|
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
|
|
and p.gf_tax_no in
|
|
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
|
|
separator=",">
|
|
#{item,jdbcType=VARCHAR}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
</if>
|
|
|
|
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
|
|
and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
|
|
</if>
|
|
|
|
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '4'.toString()">
|
|
and p.bdk_status = '2' and p.auth_status='4'
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select databaseId="oracle" id="queryVatRzcx"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
to_char(p.id) as "id",
|
|
p.export_no as "exportNo",
|
|
p.invoice_code as "invoiceCode",
|
|
p.invoice_no as "invoiceNo",
|
|
p.invoice_status as "invoiceStatus",
|
|
to_date(p.invoice_date , 'yyyy-MM-dd') as "invoiceDate",
|
|
p.invoice_type as "invoiceType",
|
|
p.gf_name as "gfName",
|
|
p.xf_name as "xfName",
|
|
p.export_amount as "exportAmount",
|
|
p.export_tax_amount as "exportTaxAmount",
|
|
p.export_yxse as "exportYxse",
|
|
p.gf_tax_no as "gfTaxNo",
|
|
p.xf_tax_no as "xfTaxNo",
|
|
to_date(p.rzh_date, 'yyyy-MM-dd') as "rzhDate",
|
|
p.rzh_yesorno as "rzhYesorno",
|
|
p.auth_status as "authStatus",
|
|
p.bdk_status as "bdkStatus",
|
|
p.confirm_user as "confirmUser",
|
|
p.rzh_belong_date as "rzhBelongDate",
|
|
p.cxbdk_status as "cxbdkStatus",
|
|
p.cxrz_status as "cxrzStatus"
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where
|
|
p.auth_status != '0'
|
|
and p.company = #{queryParams.company}
|
|
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
|
|
and p.gf_tax_no in
|
|
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
|
|
separator=",">
|
|
#{item,jdbcType=VARCHAR}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!=''">
|
|
and p.rzh_yesorno = #{queryParams.rzhYesorno}
|
|
</if>
|
|
|
|
<if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
|
|
and p.bdk_status = #{queryParams.bdkStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
|
|
and p.auth_status = #{queryParams.authStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
|
|
and p.rzh_belong_date = #{queryParams.rzhBelongDate}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
|
|
and to_char(p.rzh_date,'yyyy-mm-dd hh24:mi:ss') >= #{queryParams.rzhDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
|
|
and to_char(p.rzh_date,'yyyy-mm-dd hh24:mi:ss') <= #{queryParams.rzhDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
|
|
and p.confirm_user = #{queryParams.confirmUser}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
order by p.confirm_date desc
|
|
</select>
|
|
|
|
<select databaseId="oracle" id="queryVatRzcxSum"
|
|
parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO" resultType="java.util.Map">
|
|
SELECT
|
|
count(1) as "hjsl",
|
|
sum(p.export_amount) as "hjje",
|
|
sum(p.export_tax_amount) as "hjse"
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where
|
|
p.auth_status != '0'
|
|
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
|
|
and p.gf_tax_no in
|
|
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
|
|
separator=",">
|
|
#{item,jdbcType=VARCHAR}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!=''">
|
|
and p.rzh_yesorno = #{queryParams.rzhYesorno}
|
|
</if>
|
|
|
|
<if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
|
|
and p.bdk_status = #{queryParams.bdkStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
|
|
and p.auth_status = #{queryParams.authStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
|
|
and p.rzh_belong_date = #{queryParams.rzhBelongDate}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
|
|
and to_char(p.rzh_date,'yyyy-mm-dd hh24:mi:ss') >= #{queryParams.rzhDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
|
|
and to_char(p.rzh_date,'yyyy-mm-dd hh24:mi:ss') <= #{queryParams.rzhDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
|
|
and p.confirm_user = #{queryParams.confirmUser}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceSource != null and queryParams.invoiceSource != '' and queryParams.invoiceSource != 'null' ">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select databaseId="oracle"
|
|
id="queryExportInvoiceList" parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO"
|
|
resultType="java.util.Map">
|
|
SELECT
|
|
p.id as "id",
|
|
p.export_no as "exportNo",
|
|
p.invoice_code as "invoiceCode",
|
|
p.invoice_no as "invoiceNo",
|
|
p.invoice_status as "invoiceStatus",
|
|
to_date(p.invoice_date , 'yyyy-MM-dd') as "invoiceDate",
|
|
p.invoice_type as "invoiceType",
|
|
p.gf_name as "gfName",
|
|
p.xf_name as "xfName",
|
|
p.export_amount as "exportAmount",
|
|
p.export_tax_amount as "exportTaxAmount",
|
|
p.export_yxse as "exportYxse",
|
|
p.gf_tax_no as "gfTaxNo",
|
|
p.xf_tax_no as "xfTaxNo",
|
|
to_date( p.rzh_date , 'yyyy-MM-dd') as "rzhDate",
|
|
p.rzh_yesorno as "rzhYesorno",
|
|
p.auth_status as "authStatus",
|
|
p.bdk_status as "bdkStatus",
|
|
p.confirm_user as "confirmUser",
|
|
p.rzh_belong_date as "rzhBelongDate",
|
|
p.cxbdk_status as "cxbdkStatus"
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where p.company = #{queryParams.company}
|
|
<include refid="queryExportInvoice_oracle"/>
|
|
order by p.invoice_date desc
|
|
</select>
|
|
|
|
<select databaseId="oracle"
|
|
id="queryExportInvoiceSum" parameterType="com.dxhy.domestic.model.dto.TdxExportInvoiceModelDTO"
|
|
resultType="java.util.Map">
|
|
SELECT
|
|
count(1) as "hjsl",
|
|
sum(p.export_amount) as "hjje",
|
|
sum(p.export_tax_amount) as "hjse"
|
|
FROM
|
|
t_dx_export_invoice p
|
|
where p.company = #{queryParams.company}
|
|
<include refid="queryExportInvoice_oracle"/>
|
|
</select>
|
|
|
|
|
|
<select databaseId="oracle" id="selectDkse"
|
|
parameterType="java.util.Map" resultType="com.dxhy.domestic.entity.TdxExportInvoice">
|
|
select sum(t.export_yxse) exportYxse
|
|
from t_dx_export_invoice t
|
|
WHERE (t.rzh_yesorno = '1' or t.auth_status in ('2', '3', '4'))
|
|
and t.gf_tax_no = #{gfsh}
|
|
and t.rzh_belong_date = #{skssq}
|
|
|
|
</select>
|
|
<sql id="Base_Column_List">
|
|
id, export_no, invoice_code, invoice_no, invoice_type, invoice_status, invoice_date,
|
|
gf_tax_no, gf_name, xf_tax_no, xf_name, export_amount, export_tax_amount, export_yxse,
|
|
rzh_date, rzh_belong_date, confirm_date, rzh_yesorno, uuid, create_date, update_date,
|
|
rzh_back_msg, check_code, txfbz, lslbz, confirm_user, glzt, xxly, yqkgxbz, company,
|
|
cxrz_status, cxrz_date, bdk_status, cxrz_current_period, bdk_current_period, cxbdk_status,
|
|
cxbdk_date, auth_status,rzlx
|
|
</sql>
|
|
|
|
<sql id="queryExportInvoice_sql">
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
|
|
|
|
<if test="queryParams.rzhYesorno != null and queryParams.rzhYesorno != '' and queryParams.rzhYesorno != '3'.toString()">
|
|
and p.rzh_yesorno = #{queryParams.rzhYesorno}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhYesorno != null and queryParams.rzhYesorno != '' and queryParams.rzhYesorno == '3'.toString()">
|
|
and (p.rzh_yesorno = '1' or p.rzh_yesorno = '2')
|
|
</if>
|
|
|
|
<if test="queryParams.rzlx!=null and queryParams.rzlx!=''">
|
|
and p.bdk_status = #{queryParams.rzlx}
|
|
</if>
|
|
|
|
<if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
|
|
and p.auth_status = #{queryParams.authStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
|
|
and p.rzh_belong_date = #{queryParams.rzhBelongDate}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and p.invoice_date >= #{queryParams.invoiceDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and p.invoice_date <= #{queryParams.invoiceDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
|
|
and p.rzh_date >= #{queryParams.rzhDateStart}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
|
|
and p.rzh_date <= #{queryParams.rzhDateEnd}
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.confirmUser!=null and queryParams.confirmUser!='' and queryParams.confirmUser != 'admin'">
|
|
and p.confirm_user = #{queryParams.confirmUser}
|
|
</if>
|
|
|
|
<if test="queryParams.confirmUser == 'admin'">
|
|
and (p.confirm_user = #{queryParams.confirmUser} or p.confirm_user is null or p.confirm_user = '') and p.auth_status = '4'
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
<if test="queryParams.invoiceSource!=null and queryParams.invoiceSource!=''">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
</sql>
|
|
<sql id="queryExportInvoice_oracle">
|
|
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
|
|
and p.gf_tax_no in
|
|
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
|
|
separator=",">
|
|
#{item,jdbcType=VARCHAR}
|
|
</foreach>
|
|
</if>
|
|
|
|
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
|
|
and p.gf_tax_no = #{queryParams.gfsh}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!=''">
|
|
and p.rzh_yesorno = #{queryParams.rzhYesorno}
|
|
</if>
|
|
|
|
<if test="queryParams.rzlx!=null and queryParams.rzlx!=''">
|
|
and p.bdk_status = #{queryParams.rzlx}
|
|
</if>
|
|
|
|
<if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
|
|
and p.auth_status = #{queryParams.authStatus}
|
|
</if>
|
|
|
|
<if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
|
|
and p.rzh_belong_date = #{queryParams.rzhBelongDate}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceNo!=null and queryParams.invoiceNo!=''">
|
|
and p.invoice_no = #{queryParams.invoiceNo}
|
|
</if>
|
|
|
|
<if test="queryParams.xfName!=null and queryParams.xfName!=''">
|
|
and p.xf_name = #{queryParams.xfName}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateStart!=null and queryParams.invoiceDateStart!=''">
|
|
and p.invoice_date >= to_date(#{queryParams.invoiceDateStart}, 'yyyy-MM-dd hh24:mi:ss')
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
|
|
and p.invoice_date <= to_date(substr(#{queryParams.invoiceDateEnd},1,10) || ' 23:59:59',
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
|
|
and p.rzh_date >= to_date(#{queryParams.rzhDateStart}, 'yyyy-MM-dd hh24:mi:ss')
|
|
</if>
|
|
|
|
<if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
|
|
and p.rzh_date <= to_date(substr(#{queryParams.rzhDateEnd},1,10) || ' 23:59:59',
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
</if>
|
|
|
|
<if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
|
|
and p.export_no = #{queryParams.exportNo}
|
|
</if>
|
|
|
|
<if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
|
|
and p.confirm_user = #{queryParams.confirmUser}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceSource!=null and queryParams.invoiceSource!=''">
|
|
and p.invoice_source = #{queryParams.invoiceSource}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceType!=null and queryParams.invoiceType!=''">
|
|
and p.invoice_type = #{queryParams.invoiceType}
|
|
</if>
|
|
|
|
<if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
|
|
and p.invoice_status = #{queryParams.invoiceStatus}
|
|
</if>
|
|
</sql>
|
|
|
|
</mapper>
|
|
|