|
|
|
@ -57,7 +57,8 @@ |
|
|
|
|
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 |
|
|
|
|
where t.gf_tax_no = #{gfsh} |
|
|
|
|
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null) |
|
|
|
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''"> |
|
|
|
|
AND t.create_date BETWEEN #{cjksyf} and #{cjjsyf} |
|
|
|
|
</if> |
|
|
|
@ -69,12 +70,6 @@ |
|
|
|
|
like |
|
|
|
|
CONCAT('%',#{keyWord},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != '88'"> |
|
|
|
|
and t.gf_tax_no in |
|
|
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' "> |
|
|
|
|
and t.invoice_type = #{invoiceType} |
|
|
|
@ -142,20 +137,6 @@ |
|
|
|
|
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'"> |
|
|
|
|
and t.invoice_source = #{invoiceSource} |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'"> |
|
|
|
|
and (t.comp_code in |
|
|
|
|
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")"> |
|
|
|
|
#{companyCode} |
|
|
|
|
</foreach> |
|
|
|
|
or t.comp_code is null or t.comp_code = '' |
|
|
|
|
) |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'"> |
|
|
|
|
and t.comp_code = #{companyCode} |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'"> |
|
|
|
|
and (t.comp_code = '' or t.comp_code is null) |
|
|
|
|
</if> |
|
|
|
|
</select> |
|
|
|
|
<select id="listAddTaxInvoice" parameterType="java.util.Map" |
|
|
|
|
resultType="com.dxhy.extend.entity.ExtAddTaxInvoice" databaseId="mysql"> |
|
|
|
@ -208,7 +189,8 @@ |
|
|
|
|
t.collect_from collectFrom, |
|
|
|
|
t.comp_code compCode |
|
|
|
|
from t_dx_record_invoice t |
|
|
|
|
where 1 = 1 |
|
|
|
|
where t.gf_tax_no = #{gfsh} |
|
|
|
|
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null) |
|
|
|
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''"> |
|
|
|
|
AND t.create_date BETWEEN #{cjksyf} and #{cjjsyf} |
|
|
|
|
</if> |
|
|
|
@ -220,12 +202,6 @@ |
|
|
|
|
like |
|
|
|
|
CONCAT('%',#{keyWord},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != '88'"> |
|
|
|
|
and t.gf_tax_no in |
|
|
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' "> |
|
|
|
|
and t.invoice_type = #{invoiceType} |
|
|
|
@ -293,23 +269,6 @@ |
|
|
|
|
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'"> |
|
|
|
|
and t.invoice_source = #{invoiceSource} |
|
|
|
|
</if> |
|
|
|
|
<!-- <if test="snVoucherNumber !=null and snVoucherNumber !='' and snVoucherNumber !='99'">--> |
|
|
|
|
<!-- and t.sn_voucher_number = #{snVoucherNumber}--> |
|
|
|
|
<!-- </if>--> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'"> |
|
|
|
|
and (t.comp_code in |
|
|
|
|
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")"> |
|
|
|
|
#{companyCode} |
|
|
|
|
</foreach> |
|
|
|
|
or t.comp_code is null or t.comp_code = '' |
|
|
|
|
) |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'"> |
|
|
|
|
and t.comp_code = #{companyCode} |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'"> |
|
|
|
|
and (t.comp_code = '' or t.comp_code is null) |
|
|
|
|
</if> |
|
|
|
|
</select> |
|
|
|
|
<!--其他发票汇总--> |
|
|
|
|
<select id="selectOtherHj" parameterType="java.util.Map" |
|
|
|
@ -322,6 +281,8 @@ |
|
|
|
|
t_dx_invoice_reimburse |
|
|
|
|
where invoice_type in |
|
|
|
|
('91','94','95','00','97','98','101','102','103','99') |
|
|
|
|
and gf_tax_no = #{gfsh} |
|
|
|
|
and (comp_code = #{companyCode} or comp_code = '' or comp_code is null) |
|
|
|
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''"> |
|
|
|
|
AND create_date between #{cjksyf} and #{cjjsyf} |
|
|
|
|
</if> |
|
|
|
@ -331,10 +292,6 @@ |
|
|
|
|
<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} |
|
|
|
@ -375,20 +332,6 @@ |
|
|
|
|
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'"> |
|
|
|
|
and sn_voucher_number = #{snVoucherNumber} |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'"> |
|
|
|
|
and (comp_code in |
|
|
|
|
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")"> |
|
|
|
|
#{companyCode} |
|
|
|
|
</foreach> |
|
|
|
|
or comp_code is null or comp_code = '' |
|
|
|
|
) |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'"> |
|
|
|
|
and comp_code = #{companyCode} |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'"> |
|
|
|
|
and (comp_code is null or comp_code = '') |
|
|
|
|
</if> |
|
|
|
|
GROUP BY uuid having min(create_date) ) t |
|
|
|
|
</select> |
|
|
|
|
<select id="listOtherInvoice" parameterType="java.util.Map" |
|
|
|
@ -420,13 +363,11 @@ |
|
|
|
|
t_dx_invoice_reimburse |
|
|
|
|
where invoice_type in |
|
|
|
|
('91','94','95','00','97','98','101','102','103','99') |
|
|
|
|
and gf_tax_no = #{gfsh} |
|
|
|
|
and (comp_code = #{companyCode} or comp_code = '' or comp_code is null) |
|
|
|
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''"> |
|
|
|
|
AND create_date between #{cjksyf} and #{cjjsyf} |
|
|
|
|
</if> |
|
|
|
|
<!-- AND gf_tax_no in--> |
|
|
|
|
<!-- <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">--> |
|
|
|
|
<!-- #{item}--> |
|
|
|
|
<!-- </foreach>--> |
|
|
|
|
<if test="kpksrq != null and kpksrq!= '' and kpjsrq != null and kpjsrq != ''"> |
|
|
|
|
AND invoice_date between #{kpksrq} and #{kpjsrq} |
|
|
|
|
</if> |
|
|
|
@ -476,20 +417,6 @@ |
|
|
|
|
<if test="bzr != null and bzr != '' and bzr != 'null'"> |
|
|
|
|
and bzr like concat('%',#{bzr},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'"> |
|
|
|
|
and (comp_code in |
|
|
|
|
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")"> |
|
|
|
|
#{companyCode} |
|
|
|
|
</foreach> |
|
|
|
|
or comp_code is null or comp_code = '' |
|
|
|
|
) |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'"> |
|
|
|
|
and comp_code = #{companyCode} |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'"> |
|
|
|
|
and (comp_code is null or comp_code = '') |
|
|
|
|
</if> |
|
|
|
|
GROUP BY uuid having min(create_date) |
|
|
|
|
ORDER BY create_date DESC |
|
|
|
|
</select> |
|
|
|
@ -498,7 +425,8 @@ |
|
|
|
|
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 |
|
|
|
|
where t.gf_tax_no = #{gfsh} |
|
|
|
|
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null) |
|
|
|
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''"> |
|
|
|
|
AND t.create_date between #{cjksyf} and #{cjjsyf} |
|
|
|
|
</if> |
|
|
|
@ -510,12 +438,6 @@ |
|
|
|
|
like |
|
|
|
|
CONCAT('%',#{keyWord},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="sign != '88'"> |
|
|
|
|
and t.xf_tax_no in |
|
|
|
|
<foreach collection="taxno" index="index" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if |
|
|
|
|
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' "> |
|
|
|
@ -581,20 +503,6 @@ |
|
|
|
|
<if test="bzr != null and bzr != '' and bzr != 'null'"> |
|
|
|
|
and t.bzr like concat('%',#{bzr},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'"> |
|
|
|
|
and (t.comp_code in |
|
|
|
|
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")"> |
|
|
|
|
#{companyCode} |
|
|
|
|
</foreach> |
|
|
|
|
or t.comp_code is null or t.comp_code = '' |
|
|
|
|
) |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'"> |
|
|
|
|
and t.comp_code = #{companyCode} |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'"> |
|
|
|
|
and (t.comp_code = '' or t.comp_code is null) |
|
|
|
|
</if> |
|
|
|
|
</select> |
|
|
|
|
<!--销项票池查询--> |
|
|
|
|
<select id="listSaleInvoice" parameterType="java.util.Map" |
|
|
|
@ -612,7 +520,8 @@ |
|
|
|
|
,t.bzr bzr |
|
|
|
|
,t.comp_code compCode |
|
|
|
|
from t_dx_sale_record_invoice t |
|
|
|
|
where 1 = 1 |
|
|
|
|
where t.gf_tax_no = #{gfsh} |
|
|
|
|
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null) |
|
|
|
|
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''"> |
|
|
|
|
AND t.create_date between #{cjksyf} and #{cjjsyf} |
|
|
|
|
</if> |
|
|
|
@ -624,12 +533,6 @@ |
|
|
|
|
like |
|
|
|
|
CONCAT('%',#{keyWord},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="sign != '88'"> |
|
|
|
|
and t.xf_tax_no in |
|
|
|
|
<foreach collection="taxno" index="index" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if |
|
|
|
|
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' "> |
|
|
|
@ -700,21 +603,6 @@ |
|
|
|
|
<if test="bzr != null and bzr != '' and bzr != 'null'"> |
|
|
|
|
and t.bzr like concat('%',#{bzr},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'"> |
|
|
|
|
and (t.comp_code in |
|
|
|
|
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")"> |
|
|
|
|
#{companyCode} |
|
|
|
|
</foreach> |
|
|
|
|
or t.comp_code is null or t.comp_code = '' |
|
|
|
|
) |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'"> |
|
|
|
|
and t.comp_code = #{companyCode} |
|
|
|
|
</if> |
|
|
|
|
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'"> |
|
|
|
|
and (t.comp_code = '' or t.comp_code is null) |
|
|
|
|
</if> |
|
|
|
|
GROUP BY t.uuid |
|
|
|
|
ORDER BY t.create_date DESC |
|
|
|
|
</select> |
|
|
|
|
<!--摊销记录查询--> |
|
|
|
|