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.
476 lines
21 KiB
476 lines
21 KiB
2 years ago
|
<?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.extend.dao.ExtInvoicePoolDao">
|
||
|
<sql id="sql_fields_added">
|
||
|
t.invoice_code invoiceCode,
|
||
|
t.invoice_no invoiceNo,
|
||
|
t.invoice_status invoiceStatus,
|
||
|
t.invoice_type invoiceType,
|
||
|
DATE_FORMAT(t.invoice_date,'%Y-%m-%d') invoiceDate,
|
||
|
t.xf_tax_no xfsh,
|
||
|
t.xf_name xfmc,
|
||
|
t.total_amount totalAmount,
|
||
|
t.gf_tax_no gfsh,
|
||
|
t.gf_name gfmc,
|
||
|
t.invoice_amount invoiceAmount,
|
||
|
t.tax_amount taxAmount,
|
||
|
t.dk_tax_amount yxse,
|
||
|
t.rzh_yesorno rzzt,
|
||
|
t.rzlx rzlx,
|
||
|
DATE_FORMAT(t.rzh_date,'%Y-%m-%d') rzrq,
|
||
|
t.rzh_type rzfs,
|
||
|
t.gx_user_name rzr,
|
||
|
DATE_FORMAT(t.create_date,'%Y-%m-%d') createDate,
|
||
|
t.collect_status collectStatus,
|
||
|
t.qs_type qsfs,
|
||
|
t.qs_status qszt,
|
||
|
DATE_FORMAT(t.qs_date,'%Y-%m-%d') qsrq,
|
||
|
t.qs_name qsr,
|
||
|
DATE_FORMAT(t.payment_date,'%Y-%m') inAccountMonth,
|
||
|
t.payment_status inAccountStatus,
|
||
|
t.voucher_number voucherNo,
|
||
|
t.amortize_status amortizeStatus,
|
||
|
t.amortize_amount amortizeAmount,
|
||
|
t.remain_amortize_amount remainAmortizeAmount,
|
||
|
t.amortize_document_number amortizeDocumentNumber,
|
||
|
t.source_system sourceSystem,
|
||
|
t.list_status listStatus,
|
||
|
t.scan_id scanId,
|
||
|
t.remark,
|
||
|
t.document_number documentNumber,
|
||
|
DATE_FORMAT(t.collect_date,'%Y-%m-%d') collectDate,
|
||
|
t.collect_from collectFrom
|
||
|
</sql>
|
||
|
<resultMap id="InvoicePoolHjResultMap"
|
||
|
type="com.dxhy.extend.entity.ExtAddTaxInvoice">
|
||
|
<result column="hjsl" property="id"/>
|
||
|
<result column="hjje" property="invoiceAmount"/>
|
||
|
<result column="hjse" property="taxAmount"/>
|
||
|
</resultMap>
|
||
|
<resultMap id="OtherPoolHjResultMap"
|
||
|
type="com.dxhy.extend.entity.ExtOtherInvoice">
|
||
|
<result column="hjsl" property="id"/>
|
||
|
<result column="hjje" property="invoiceAmount"/>
|
||
|
<result column="hjse" property="taxAmount"/>
|
||
|
</resultMap>
|
||
|
<select id="selectAddTaxHj" parameterType="java.util.Map"
|
||
|
resultMap="InvoicePoolHjResultMap" databaseId="mysql">
|
||
|
select count(1) hjsl,sum(t.invoice_amount)hjje,sum(t.tax_amount)hjse
|
||
|
from t_dx_record_invoice t
|
||
|
where 1=1
|
||
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">
|
||
|
AND t.create_date BETWEEN #{cjksyf} and #{cjjsyf}
|
||
|
</if>
|
||
|
<if test="kpksrq != null and kpksrq!= '' and kpjsrq != null and kpjsrq != ''">
|
||
|
AND t.invoice_date between #{kpksrq} and #{kpjsrq}
|
||
|
</if>
|
||
|
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
|
||
|
and CONCAT(IFNULL(t.invoice_code,''),IFNULL(t.invoice_no,''),IFNULL(t.xf_name,''),IFNULL(t.xf_tax_no,''))
|
||
|
like
|
||
|
CONCAT('%',#{keyWord},'%')
|
||
|
</if>
|
||
|
and t.gf_tax_no in
|
||
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<if
|
||
|
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
|
||
|
and t.invoice_type = #{invoiceType}
|
||
|
</if>
|
||
|
<if
|
||
|
test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
|
||
|
and t.invoice_status = #{invoiceStatus}
|
||
|
</if>
|
||
|
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
|
||
|
and t.qs_status = #{qszt}
|
||
|
</if>
|
||
|
<if test="rzzt != null and rzzt != '' and rzzt != 'null' and rzzt != '99'">
|
||
|
and t.rzh_yesorno = #{rzzt}
|
||
|
</if>
|
||
|
<if test="rzlx != null and rzlx != '' and rzlx != 'null' and rzlx != '99'">
|
||
|
and t.rzlx = #{rzlx}
|
||
|
</if>
|
||
|
<if test='rzzt == "99"'>
|
||
|
and t.rzh_yesorno in ('1','2','0')
|
||
|
</if>
|
||
|
<if test="skssq != null and skssq != '' and skssq != 'null' ">
|
||
|
and t.rzh_belong_date = #{skssq}
|
||
|
</if>
|
||
|
<if test="qsyf != null and qsyf != null and qsyf != '' and qsyf != ''">
|
||
|
and DATE_FORMAT(t.qs_date,'%Y-%m') = #{qsyf}
|
||
|
</if>
|
||
|
<if test="qsr != null and qsr != '' and qsr != 'null' ">
|
||
|
and t.qs_name like CONCAT(#{qsr},'%')
|
||
|
</if>
|
||
|
<if test="rzr != null and rzr != '' and rzr != 'null' ">
|
||
|
and t.gx_user_name like CONCAT(#{rzr},'%')
|
||
|
</if>
|
||
|
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
|
||
|
and t.qs_type = #{qsfs}
|
||
|
</if>
|
||
|
<if
|
||
|
test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99'">
|
||
|
and t.payment_status = #{inAccountStatus}
|
||
|
</if>
|
||
|
<if
|
||
|
test="inAccountMonth != null and inAccountMonth != null and inAccountMonth != '' and inAccountMonth != ''">
|
||
|
and DATE_FORMAT(t.payment_date,'%Y-%m') = #{inAccountMonth}
|
||
|
</if>
|
||
|
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
|
||
|
and t.invoice_source = #{invoiceSource}
|
||
|
</if>
|
||
|
</select>
|
||
|
<select id="listAddTaxInvoice" parameterType="java.util.Map"
|
||
|
resultType="com.dxhy.extend.entity.ExtAddTaxInvoice" databaseId="mysql">
|
||
|
select
|
||
|
t.invoice_code invoiceCode,
|
||
|
t.invoice_no invoiceNo,
|
||
|
t.invoice_status invoiceStatus,
|
||
|
t.invoice_type invoiceType,
|
||
|
DATE_FORMAT(t.invoice_date,'%Y-%m-%d') invoiceDate,
|
||
|
t.xf_tax_no xfsh,
|
||
|
t.xf_name xfmc,
|
||
|
t.total_amount totalAmount,
|
||
|
t.gf_tax_no gfsh,
|
||
|
t.gf_name gfmc,
|
||
|
t.invoice_amount invoiceAmount,
|
||
|
t.tax_amount taxAmount,
|
||
|
t.dk_tax_amount yxse,
|
||
|
t.rzh_yesorno rzzt,
|
||
|
t.rzlx rzlx,
|
||
|
DATE_FORMAT(t.rzh_date,'%Y-%m-%d') rzrq,
|
||
|
t.rzh_type rzfs,
|
||
|
t.gx_user_name rzr,
|
||
|
DATE_FORMAT(t.create_date,'%Y-%m-%d') createDate,
|
||
|
t.collect_status collectStatus,
|
||
|
t.qs_type qsfs,
|
||
|
t.qs_status qszt,
|
||
|
DATE_FORMAT(t.qs_date,'%Y-%m-%d') qsrq,
|
||
|
t.qs_name qsr,
|
||
|
DATE_FORMAT(t.payment_date,'%Y-%m') inAccountMonth,
|
||
|
t.payment_status inAccountStatus,
|
||
|
t.voucher_number voucherNo,
|
||
|
t.amortize_status amortizeStatus,
|
||
|
t.amortize_amount amortizeAmount,
|
||
|
t.remain_amortize_amount remainAmortizeAmount,
|
||
|
t.amortize_document_number amortizeDocumentNumber,
|
||
|
t.source_system sourceSystem,
|
||
|
t.is_sale_list listStatus,
|
||
|
t.scan_id scanId,
|
||
|
t.remark,
|
||
|
t.document_number documentNumber,
|
||
|
DATE_FORMAT(t.collect_date,'%Y-%m-%d') collectDate,
|
||
|
t.collect_from collectFrom
|
||
|
from t_dx_record_invoice t
|
||
|
where 1 = 1
|
||
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">
|
||
|
AND t.create_date BETWEEN #{cjksyf} and #{cjjsyf}
|
||
|
</if>
|
||
|
<if test="kpksrq != null and kpksrq!= '' and kpjsrq != null and kpjsrq != ''">
|
||
|
AND t.invoice_date between #{kpksrq} and #{kpjsrq}
|
||
|
</if>
|
||
|
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
|
||
|
and CONCAT(IFNULL(t.invoice_code,''),IFNULL(t.invoice_no,''),IFNULL(t.xf_name,''),IFNULL(t.xf_tax_no,''))
|
||
|
like
|
||
|
CONCAT('%',#{keyWord},'%')
|
||
|
</if>
|
||
|
and t.gf_tax_no in
|
||
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<if
|
||
|
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
|
||
|
and t.invoice_type = #{invoiceType}
|
||
|
</if>
|
||
|
<if
|
||
|
test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
|
||
|
and t.invoice_status = #{invoiceStatus}
|
||
|
</if>
|
||
|
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
|
||
|
and t.qs_status = #{qszt}
|
||
|
</if>
|
||
|
<if test="rzzt != null and rzzt != '' and rzzt != 'null' and rzzt != '99'">
|
||
|
and t.rzh_yesorno = #{rzzt}
|
||
|
</if>
|
||
|
<if test="rzlx != null and rzlx != '' and rzlx != 'null' and rzlx != '99'">
|
||
|
and t.rzlx = #{rzlx}
|
||
|
</if>
|
||
|
<if test='rzzt == "99"'>
|
||
|
and t.rzh_yesorno in ('1','2','0')
|
||
|
</if>
|
||
|
<if test="skssq != null and skssq != '' and skssq != 'null' ">
|
||
|
and t.rzh_belong_date = #{skssq}
|
||
|
</if>
|
||
|
<if test="qsyf != null and qsyf != null and qsyf != '' and qsyf != ''">
|
||
|
and DATE_FORMAT(t.qs_date,'%Y-%m') = #{qsyf}
|
||
|
</if>
|
||
|
<if test="qsr != null and qsr != '' and qsr != 'null' ">
|
||
|
and t.qs_name like CONCAT(#{qsr},'%')
|
||
|
</if>
|
||
|
<if test="rzr != null and rzr != '' and rzr != 'null' ">
|
||
|
and t.gx_user_name like CONCAT(#{rzr},'%')
|
||
|
</if>
|
||
|
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
|
||
|
and t.qs_type = #{qsfs}
|
||
|
</if>
|
||
|
<if
|
||
|
test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99'">
|
||
|
and t.payment_status = #{inAccountStatus}
|
||
|
</if>
|
||
|
<if
|
||
|
test="inAccountMonth != null and inAccountMonth != null and inAccountMonth != '' and inAccountMonth != ''">
|
||
|
and DATE_FORMAT(t.payment_date,'%Y-%m') = #{inAccountMonth}
|
||
|
</if>
|
||
|
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
|
||
|
and t.invoice_source = #{invoiceSource}
|
||
|
</if>
|
||
|
</select>
|
||
|
<!--其他发票汇总-->
|
||
|
<select id="selectOtherHj" parameterType="java.util.Map"
|
||
|
resultMap="OtherPoolHjResultMap" databaseId="mysql">
|
||
|
SELECT
|
||
|
count(1) hjsl,
|
||
|
sum(t.total_amount) hjje,
|
||
|
sum(t.tax_amount) hjse
|
||
|
FROM (select * from
|
||
|
t_dx_invoice_reimburse
|
||
|
where invoice_type in
|
||
|
('91','94','95','00','97','98','101','102','103','99')
|
||
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">
|
||
|
AND create_date between #{cjksyf} and #{cjjsyf}
|
||
|
</if>
|
||
|
<if test="kpksrq != null and kpksrq!= '' and kpjsrq != null and kpjsrq != ''">
|
||
|
AND invoice_date between #{kpksrq} and #{kpjsrq}
|
||
|
</if>
|
||
|
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
|
||
|
AND CONCAT(IFNULL(invoice_code,''),IFNULL(invoice_no,'')) like CONCAT('%',#{keyWord},'%')
|
||
|
</if>
|
||
|
AND gf_tax_no in
|
||
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<if
|
||
|
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '999' ">
|
||
|
AND invoice_type = #{invoiceType}
|
||
|
</if>
|
||
|
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
|
||
|
AND qs_status = #{qszt}
|
||
|
</if>
|
||
|
<if test="qsyf != null and qsyf != null and qsyf != '' and qsyf != ''">
|
||
|
AND DATE_FORMAT(qs_date,'%Y-%m') = #{qsyf}
|
||
|
</if>
|
||
|
<if test="qsr != null and qsr != '' and qsr != 'null' ">
|
||
|
AND qs_name like CONCAT('%',#{qsr},'%')
|
||
|
</if>
|
||
|
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
|
||
|
AND qs_type = #{qsfs}
|
||
|
</if>
|
||
|
GROUP BY uuid having min(create_date) ) t
|
||
|
</select>
|
||
|
<select id="listOtherInvoice" parameterType="java.util.Map"
|
||
|
resultType="com.dxhy.extend.entity.ExtOtherInvoice" databaseId="mysql">
|
||
|
SELECT
|
||
|
invoice_type invoiceType,
|
||
|
invoice_code invoiceCode,
|
||
|
invoice_no invoiceNo,
|
||
|
DATE_FORMAT(invoice_date,'%Y-%m-%d') invoiceDate,
|
||
|
DATE_FORMAT(create_date,'%Y-%m-%d') createDate,
|
||
|
total_amount invoiceAmount,
|
||
|
qs_status qszt,
|
||
|
DATE_FORMAT(qs_date,'%Y-%m-%d') qsrq,
|
||
|
qs_type qsfs,
|
||
|
qs_name qsr,
|
||
|
source_system sourceSystem,
|
||
|
uuid,
|
||
|
select_id selectId,
|
||
|
scan_id scanId,
|
||
|
business_document_number businessDocumentNumber
|
||
|
FROM
|
||
|
t_dx_invoice_reimburse
|
||
|
where invoice_type in
|
||
|
('91','94','95','00','97','98','101','102','103','99')
|
||
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">
|
||
|
AND create_date between #{cjksyf} and #{cjjsyf}
|
||
|
</if>
|
||
|
<if test="kpksrq != null and kpksrq!= '' and kpjsrq != null and kpjsrq != ''">
|
||
|
AND invoice_date between #{kpksrq} and #{kpjsrq}
|
||
|
</if>
|
||
|
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
|
||
|
AND CONCAT(IFNULL(invoice_code,''),IFNULL(invoice_no,'')) like CONCAT('%',#{keyWord},'%')
|
||
|
</if>
|
||
|
AND gf_tax_no in
|
||
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<if
|
||
|
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '999' ">
|
||
|
AND invoice_type = #{invoiceType}
|
||
|
</if>
|
||
|
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
|
||
|
AND qs_status = #{qszt}
|
||
|
</if>
|
||
|
<if test="qsyf != null and qsyf != null and qsyf != '' and qsyf != ''">
|
||
|
AND DATE_FORMAT(qs_date,'%Y-%m') = #{qsyf}
|
||
|
</if>
|
||
|
<if test="qsr != null and qsr != '' and qsr != 'null' ">
|
||
|
AND qs_name like CONCAT(#{qsr},'%')
|
||
|
</if>
|
||
|
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
|
||
|
AND qs_type = #{qsfs}
|
||
|
</if>
|
||
|
GROUP BY uuid having min(create_date)
|
||
|
ORDER BY create_date DESC
|
||
|
</select>
|
||
|
<!--销项票池汇总-->
|
||
|
<select id="selectSaleHj" parameterType="java.util.Map"
|
||
|
resultMap="InvoicePoolHjResultMap" databaseId="mysql">
|
||
|
select count(1) hjsl,sum(t.invoice_amount)hjje,sum(t.tax_amount)hjse
|
||
|
from t_dx_sale_record_invoice t
|
||
|
where 1 = 1
|
||
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">
|
||
|
AND t.create_date between #{cjksyf} and #{cjjsyf}
|
||
|
</if>
|
||
|
<if test="kpksrq != null and kpksrq!= '' and kpjsrq != null and kpjsrq != ''">
|
||
|
AND t.invoice_date between #{kpksrq} and #{kpjsrq}
|
||
|
</if>
|
||
|
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
|
||
|
and CONCAT(IFNULL(t.invoice_code,''),IFNULL(t.invoice_no,''),IFNULL(t.gf_name,''),IFNULL(t.gf_tax_no,''))
|
||
|
like
|
||
|
CONCAT('%',#{keyWord},'%')
|
||
|
</if>
|
||
|
and t.xf_tax_no in
|
||
|
<foreach collection="taxno" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<if
|
||
|
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
|
||
|
and t.invoice_type = #{invoiceType}
|
||
|
</if>
|
||
|
<if
|
||
|
test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
|
||
|
and t.invoice_status = #{invoiceStatus}
|
||
|
</if>
|
||
|
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
|
||
|
and t.qs_status = #{qszt}
|
||
|
</if>
|
||
|
<if test="qsyf != null and qsyf != null and qsyf != '' and qsyf != ''">
|
||
|
and DATE_FORMAT(t.qs_date,'%Y-%m') = #{qsyf}
|
||
|
</if>
|
||
|
<if test="qsr != null and qsr != '' and qsr != 'null' ">
|
||
|
and t.qs_name like CONCAT(#{qsr},'%')
|
||
|
</if>
|
||
|
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
|
||
|
and t.qs_type = #{qsfs}
|
||
|
</if>
|
||
|
<if test="remark != null and remark != '' and remark != 'null' ">
|
||
|
and t.remark like CONCAT(#{remark},'%')
|
||
|
</if>
|
||
|
<if test="listMark != null and listMark != '' and listMark != 'null' and listMark != '99'">
|
||
|
and t.list_status = #{listMark}
|
||
|
</if>
|
||
|
<if
|
||
|
test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99'">
|
||
|
and t.payment_status = #{inAccountStatus}
|
||
|
</if>
|
||
|
<if
|
||
|
test="inAccountMonth != null and inAccountMonth != null and inAccountMonth != '' and inAccountMonth != ''">
|
||
|
and DATE_FORMAT(t.payment_date,'%Y-%m') = #{inAccountMonth}
|
||
|
</if>
|
||
|
<if test="incentiveFlag !=null and incentiveFlag !='' and incentiveFlag!= '99'">
|
||
|
and t.incentive_flag like CONCAT('%',#{incentiveFlag},'%')
|
||
|
</if>
|
||
|
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
|
||
|
and t.invoice_source = #{invoiceSource}
|
||
|
</if>
|
||
|
</select>
|
||
|
<!--销项票池查询-->
|
||
|
<select id="listSaleInvoice" parameterType="java.util.Map"
|
||
|
resultType="com.dxhy.extend.entity.ExtAddTaxInvoice" databaseId="mysql">
|
||
|
select
|
||
|
<include refid="sql_fields_added"/>
|
||
|
,t.incentive_flag incentiveFlag
|
||
|
,t.system_name systemName
|
||
|
from t_dx_sale_record_invoice t
|
||
|
where 1 = 1
|
||
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">
|
||
|
AND t.create_date between #{cjksyf} and #{cjjsyf}
|
||
|
</if>
|
||
|
<if test="kpksrq != null and kpksrq!= '' and kpjsrq != null and kpjsrq != ''">
|
||
|
AND t.invoice_date between #{kpksrq} and #{kpjsrq}
|
||
|
</if>
|
||
|
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
|
||
|
and CONCAT(IFNULL(t.invoice_code,''),IFNULL(t.invoice_no,''),IFNULL(t.gf_name,''),IFNULL(t.gf_tax_no,''))
|
||
|
like
|
||
|
CONCAT('%',#{keyWord},'%')
|
||
|
</if>
|
||
|
and t.xf_tax_no in
|
||
|
<foreach collection="taxno" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<if
|
||
|
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
|
||
|
and t.invoice_type = #{invoiceType}
|
||
|
</if>
|
||
|
<if
|
||
|
test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
|
||
|
and t.invoice_status = #{invoiceStatus}
|
||
|
</if>
|
||
|
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
|
||
|
and t.qs_status = #{qszt}
|
||
|
</if>
|
||
|
<if test="qsyf != null and qsyf != null and qsyf != '' and qsyf != ''">
|
||
|
and DATE_FORMAT(t.qs_date,'%Y-%m') = #{qsyf}
|
||
|
</if>
|
||
|
<if test="qsr != null and qsr != '' and qsr != 'null' ">
|
||
|
and t.qs_name like CONCAT(#{qsr},'%')
|
||
|
</if>
|
||
|
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
|
||
|
and t.qs_type = #{qsfs}
|
||
|
</if>
|
||
|
<if test="remark != null and remark != '' and remark != 'null' ">
|
||
|
and t.remark like CONCAT(#{remark},'%')
|
||
|
</if>
|
||
|
<if test="listMark != null and listMark != '' and listMark != 'null' and listMark != '99'">
|
||
|
and t.list_status = #{listMark}
|
||
|
</if>
|
||
|
<if
|
||
|
test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99'">
|
||
|
and t.payment_status = #{inAccountStatus}
|
||
|
</if>
|
||
|
<if
|
||
|
test="inAccountMonth != null and inAccountMonth != null and inAccountMonth != '' and inAccountMonth != ''">
|
||
|
and DATE_FORMAT(t.payment_date,'%Y-%m') = #{inAccountMonth}
|
||
|
</if>
|
||
|
<if test="incentiveFlag !=null and incentiveFlag !='' and incentiveFlag!= '99'">
|
||
|
and t.incentive_flag like CONCAT('%',#{incentiveFlag},'%')
|
||
|
</if>
|
||
|
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
|
||
|
and t.invoice_source = #{invoiceSource}
|
||
|
</if>
|
||
|
GROUP BY t.uuid
|
||
|
ORDER BY t.create_date DESC
|
||
|
</select>
|
||
|
<!--摊销记录查询-->
|
||
|
<select id="listAmortizeRecord" parameterType="java.util.Map"
|
||
|
resultType="com.dxhy.extend.entity.AmortizeRecordEntity" databaseId="mysql">
|
||
|
SELECT amortize_document_number amortizeDocumentNumber,
|
||
|
amortize_amount amortizeAmount,
|
||
|
remain_amortize_amount remainAmortizeAmount,
|
||
|
amortize_user bxr
|
||
|
FROM t_dx_amortize_batch
|
||
|
WHERE invoice_code = #{invoiceCode}
|
||
|
AND invoice_no = #{invoiceNo}
|
||
|
AND status = '0'
|
||
|
ORDER BY create_date DESC
|
||
|
</select>
|
||
|
|
||
|
<!--销项票池优惠政策查询-->
|
||
|
<select id="listIncentiveFlag" resultType="java.lang.String">
|
||
|
SELECT incentive_flag
|
||
|
FROM t_dx_record_invoice_detail_sales
|
||
|
WHERE incentive_flag != ''
|
||
|
GROUP BY incentive_flag
|
||
|
</select>
|
||
|
</mapper>
|