|
|
|
@ -232,119 +232,119 @@ |
|
|
|
|
<!-- <if test="qsksrq==null or qsksrq=='' or qsjsrq==null or qsjsrq==''">--> |
|
|
|
|
<!-- order by t.invoice_date desc--> |
|
|
|
|
<!-- </if>--> |
|
|
|
|
order by t.bzdh desc |
|
|
|
|
</select> |
|
|
|
|
<select id="selectDksh" parameterType="java.util.Map" |
|
|
|
|
resultType="com.dxhy.base.entity.BaseTDxDkCount" |
|
|
|
|
databaseId="oracle"> |
|
|
|
|
select t.current_tax_period skssq,t.taxno taxno,d.tj_status tjStatus,tj_date tjDate from |
|
|
|
|
t_dx_tax_current |
|
|
|
|
t,t_dx_dk_count d |
|
|
|
|
where t.taxno=d.taxno |
|
|
|
|
and t.current_tax_period=d.skssq |
|
|
|
|
and t.taxno in |
|
|
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="selectSggxcx" parameterType="java.util.Map" |
|
|
|
|
resultMap="SggxcxResultMap" databaseId="oracle"> |
|
|
|
|
select t.invoice_type,t.dept_id |
|
|
|
|
,t.id,t.invoice_code,t.invoice_no,t.gf_name,t.gf_tax_no,t.xf_name, |
|
|
|
|
to_char(t.invoice_date,'yyyy-MM-dd')invoice_date,t.invoice_amount,t.tax_amount,t.invoice_status,to_char(t.qs_date,'yyyy-MM-dd')qs_date |
|
|
|
|
,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.voucher_number, |
|
|
|
|
case to_char(t.invoice_date,'yyyy-MM-dd') between c.select_start_date and c.select_end_date when |
|
|
|
|
true then 1 |
|
|
|
|
else 2 end authStatus, |
|
|
|
|
t.in_account_status,t.payment_status,to_char(t.payment_date,'yyyy-MM-dd')payment_date,t.settlement_no,t.ele_invoice_no |
|
|
|
|
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno |
|
|
|
|
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq |
|
|
|
|
WHERE to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq} |
|
|
|
|
and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08') |
|
|
|
|
and t.rzh_yesorno = '0' |
|
|
|
|
and t.auth_status in('0','5','6') |
|
|
|
|
and t.export_mark = '0' |
|
|
|
|
and t.company = #{company} |
|
|
|
|
<if |
|
|
|
|
test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '1'.toString()"> |
|
|
|
|
and t.invoice_status = '0' |
|
|
|
|
and t.invoice_amount>0 |
|
|
|
|
and t.tax_amount>=0 |
|
|
|
|
and to_char(t.invoice_date,'yyyyMMdd') between c.select_start_date and c.select_end_date |
|
|
|
|
and d.tj_status in('0','3') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if |
|
|
|
|
test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '0'.toString()"> |
|
|
|
|
and (t.invoice_status <> '0' or t.invoice_amount <0 or t.tax_amount <0 or |
|
|
|
|
to_char(t.invoice_date,'yyyyMMdd') <= c.select_start_date or |
|
|
|
|
to_char(t.invoice_date,'yyyyMMdd') >= |
|
|
|
|
c.select_end_date or d.tj_status in ('1','2')) |
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
and t.gf_tax_no in |
|
|
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
<if test="qszt != null and qszt != '' and qszt != 'null' "> |
|
|
|
|
and t.qs_status = #{qszt} |
|
|
|
|
</if> |
|
|
|
|
<if |
|
|
|
|
test="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'"> |
|
|
|
|
and to_char(t.qs_date,'yyyy-MM-dd') between #{qsksrq} and #{qsjsrq} |
|
|
|
|
</if> |
|
|
|
|
<if test="voucherNumber != null and voucherNumber != ''"> |
|
|
|
|
and t.voucher_number like concat('%',concat(#{voucherNumber},'%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentDateStart != null and paymentDateStart != '' and paymentDateStart != 'null' "> |
|
|
|
|
<![CDATA[ AND to_char(t.payment_date,'yyyy-MM-dd') >= #{paymentDateStart} ]]> |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentDateEnd != null and paymentDateEnd != '' and paymentDateEnd != 'null' "> |
|
|
|
|
<![CDATA[ AND to_char(t.payment_date,'yyyy-MM-dd') <= #{paymentDateEnd} ]]> |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentStatus != null and paymentStatus != '' and paymentStatus != '99'"> |
|
|
|
|
and t.payment_status = #{paymentStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' "> |
|
|
|
|
and t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') |
|
|
|
|
</if> |
|
|
|
|
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' "> |
|
|
|
|
and t.invoice_type = #{invoiceType} |
|
|
|
|
</if> |
|
|
|
|
<if test="invoiceSource!=null and invoiceSource!='99' and invoiceSource!='null' and invoiceSource!=''"> |
|
|
|
|
and t.invoice_source =#{invoiceSource} |
|
|
|
|
</if> |
|
|
|
|
<if test="fpzt != null and fpzt != '' and fpzt != 'null'"> |
|
|
|
|
and t.invoice_status = #{fpzt} |
|
|
|
|
</if> |
|
|
|
|
<if |
|
|
|
|
test="qsfs != null and qsfs != '' and qsfs != 'null' "> |
|
|
|
|
and t.qs_type = #{qsfs} |
|
|
|
|
</if> |
|
|
|
|
<if test="xfmc != null and xfmc != '' and xfmc != 'null' "> |
|
|
|
|
and t.xf_name like concat(#{xfmc},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="qsr != null and qsr != '' and qsr != 'null' "> |
|
|
|
|
and t.qs_name = #{qsr} |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentDateStart != null and paymentDateStart != '' and paymentDateStart != 'null' "> |
|
|
|
|
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') >= #{paymentDateStart} ]]> |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentDateEnd != null and paymentDateEnd != '' and paymentDateEnd != 'null' "> |
|
|
|
|
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') <= #{paymentDateEnd} ]]> |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentStatus != null and paymentStatus != '' and paymentStatus != '99'"> |
|
|
|
|
and t.payment_status = #{paymentStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="settlementNo != null and settlementNo != ''"> |
|
|
|
|
and t.settlement_no like concat(#{settlementNo},'%') |
|
|
|
|
</if> |
|
|
|
|
<if |
|
|
|
|
test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' "> |
|
|
|
|
and t.invoice_no = #{invoiceNo} |
|
|
|
|
</if> |
|
|
|
|
<!-- 按签收人查询 --> |
|
|
|
|
<!-- order by t.bzdh desc--> |
|
|
|
|
</select> |
|
|
|
|
<select id="selectDksh" parameterType="java.util.Map" |
|
|
|
|
resultType="com.dxhy.base.entity.BaseTDxDkCount" |
|
|
|
|
databaseId="oracle"> |
|
|
|
|
select t.current_tax_period skssq,t.taxno taxno,d.tj_status tjStatus,tj_date tjDate from |
|
|
|
|
t_dx_tax_current |
|
|
|
|
t,t_dx_dk_count d |
|
|
|
|
where t.taxno=d.taxno |
|
|
|
|
and t.current_tax_period=d.skssq |
|
|
|
|
and t.taxno in |
|
|
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="selectSggxcx" parameterType="java.util.Map" |
|
|
|
|
resultMap="SggxcxResultMap" databaseId="oracle"> |
|
|
|
|
select t.invoice_type,t.dept_id |
|
|
|
|
,t.id,t.invoice_code,t.invoice_no,t.gf_name,t.gf_tax_no,t.xf_name, |
|
|
|
|
to_char(t.invoice_date,'yyyy-MM-dd')invoice_date,t.invoice_amount,t.tax_amount,t.invoice_status,to_char(t.qs_date,'yyyy-MM-dd')qs_date |
|
|
|
|
,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.voucher_number, |
|
|
|
|
case to_char(t.invoice_date,'yyyy-MM-dd') between c.select_start_date and c.select_end_date when |
|
|
|
|
true then 1 |
|
|
|
|
else 2 end authStatus, |
|
|
|
|
t.in_account_status,t.payment_status,to_char(t.payment_date,'yyyy-MM-dd')payment_date,t.settlement_no,t.ele_invoice_no |
|
|
|
|
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno |
|
|
|
|
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq |
|
|
|
|
WHERE to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq} |
|
|
|
|
and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08') |
|
|
|
|
and t.rzh_yesorno = '0' |
|
|
|
|
and t.auth_status in('0','5','6') |
|
|
|
|
and t.export_mark = '0' |
|
|
|
|
and t.company = #{company} |
|
|
|
|
<if |
|
|
|
|
test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '1'.toString()"> |
|
|
|
|
and t.invoice_status = '0' |
|
|
|
|
and t.invoice_amount>0 |
|
|
|
|
and t.tax_amount>=0 |
|
|
|
|
and to_char(t.invoice_date,'yyyyMMdd') between c.select_start_date and c.select_end_date |
|
|
|
|
and d.tj_status in('0','3') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if |
|
|
|
|
test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '0'.toString()"> |
|
|
|
|
and (t.invoice_status <> '0' or t.invoice_amount <0 or t.tax_amount <0 or |
|
|
|
|
to_char(t.invoice_date,'yyyyMMdd') <= c.select_start_date or |
|
|
|
|
to_char(t.invoice_date,'yyyyMMdd') >= |
|
|
|
|
c.select_end_date or d.tj_status in ('1','2')) |
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
and t.gf_tax_no in |
|
|
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
<if test="qszt != null and qszt != '' and qszt != 'null' "> |
|
|
|
|
and t.qs_status = #{qszt} |
|
|
|
|
</if> |
|
|
|
|
<if |
|
|
|
|
test="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'"> |
|
|
|
|
and to_char(t.qs_date,'yyyy-MM-dd') between #{qsksrq} and #{qsjsrq} |
|
|
|
|
</if> |
|
|
|
|
<if test="voucherNumber != null and voucherNumber != ''"> |
|
|
|
|
and t.voucher_number like concat('%',concat(#{voucherNumber},'%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentDateStart != null and paymentDateStart != '' and paymentDateStart != 'null' "> |
|
|
|
|
<![CDATA[ AND to_char(t.payment_date,'yyyy-MM-dd') >= #{paymentDateStart} ]]> |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentDateEnd != null and paymentDateEnd != '' and paymentDateEnd != 'null' "> |
|
|
|
|
<![CDATA[ AND to_char(t.payment_date,'yyyy-MM-dd') <= #{paymentDateEnd} ]]> |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentStatus != null and paymentStatus != '' and paymentStatus != '99'"> |
|
|
|
|
and t.payment_status = #{paymentStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' "> |
|
|
|
|
and t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') |
|
|
|
|
</if> |
|
|
|
|
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' "> |
|
|
|
|
and t.invoice_type = #{invoiceType} |
|
|
|
|
</if> |
|
|
|
|
<if test="invoiceSource!=null and invoiceSource!='99' and invoiceSource!='null' and invoiceSource!=''"> |
|
|
|
|
and t.invoice_source =#{invoiceSource} |
|
|
|
|
</if> |
|
|
|
|
<if test="fpzt != null and fpzt != '' and fpzt != 'null'"> |
|
|
|
|
and t.invoice_status = #{fpzt} |
|
|
|
|
</if> |
|
|
|
|
<if |
|
|
|
|
test="qsfs != null and qsfs != '' and qsfs != 'null' "> |
|
|
|
|
and t.qs_type = #{qsfs} |
|
|
|
|
</if> |
|
|
|
|
<if test="xfmc != null and xfmc != '' and xfmc != 'null' "> |
|
|
|
|
and t.xf_name like concat(#{xfmc},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="qsr != null and qsr != '' and qsr != 'null' "> |
|
|
|
|
and t.qs_name = #{qsr} |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentDateStart != null and paymentDateStart != '' and paymentDateStart != 'null' "> |
|
|
|
|
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') >= #{paymentDateStart} ]]> |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentDateEnd != null and paymentDateEnd != '' and paymentDateEnd != 'null' "> |
|
|
|
|
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') <= #{paymentDateEnd} ]]> |
|
|
|
|
</if> |
|
|
|
|
<if test="paymentStatus != null and paymentStatus != '' and paymentStatus != '99'"> |
|
|
|
|
and t.payment_status = #{paymentStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="settlementNo != null and settlementNo != ''"> |
|
|
|
|
and t.settlement_no like concat(#{settlementNo},'%') |
|
|
|
|
</if> |
|
|
|
|
<if |
|
|
|
|
test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' "> |
|
|
|
|
and t.invoice_no = #{invoiceNo} |
|
|
|
|
</if> |
|
|
|
|
<!-- 按签收人查询 --> |
|
|
|
|
<if |
|
|
|
|
test="position != null and position != '' and position != 'null' and position == '1'.toString()"> |
|
|
|
|
and t.qs_name = #{username} |
|
|
|
@ -562,7 +562,7 @@ |
|
|
|
|
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'"> |
|
|
|
|
and t.account_period = #{accountPeriod} |
|
|
|
|
</if> |
|
|
|
|
order by t.bzdh desc |
|
|
|
|
<!-- order by t.bzdh desc --> |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="selectHj" parameterType="java.util.Map" |
|
|
|
|