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.
146 lines
6.1 KiB
146 lines
6.1 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.core.dao.JxsebbDao">
|
|
|
|
<resultMap id="reportResultMap" type="com.dxhy.core.model.ReportStatisticsVo">
|
|
<result column="totalCount" property="totalCount"/>
|
|
<result column="totalAmount" property="totalAmount"/>
|
|
<result column="totalTax" property="totalTax"/>
|
|
</resultMap>
|
|
|
|
<select id="getResult" resultMap="reportResultMap" databaseId="mysql">
|
|
select count(1) totalCount, ifnull(sum(invoice_amount), 0) totalAmount, ifnull(sum(dk_tax_amount), 0) totalTax
|
|
FROM t_dx_record_invoice
|
|
WHERE valid='1' and invoice_type in ('01','03','08','14','31','283','161','183','185') AND invoice_status='0' AND rzh_yesorno='1'
|
|
<if test="skssq !=null and skssq != ''">
|
|
and rzh_belong_date = #{skssq}
|
|
</if>
|
|
and gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
<if test="company !=null and company !=''">
|
|
and company = #{company}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getResult" resultMap="reportResultMap" databaseId="oracle">
|
|
select count(1) totalCount, nvl(sum(invoice_amount), 0) totalAmount, nvl(sum(dk_tax_amount), 0) totalTax
|
|
FROM t_dx_record_invoice
|
|
WHERE valid='1' and invoice_type in ('01','03','08','14') AND invoice_status='0' AND rzh_yesorno='1'
|
|
<if test="skssq !=null and skssq != ''">
|
|
and rzh_belong_date = #{skssq}
|
|
</if>
|
|
and gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
<if test="company !=null and company !=''">
|
|
and company = #{company}
|
|
</if>
|
|
</select>
|
|
<select id="getTotal" resultType="com.dxhy.core.model.CustomsStatisticsVo" databaseId="mysql">
|
|
select count(1) customsCount, ifnull(sum(yx_tax_amount), 0) customsTax
|
|
FROM t_dx_customs_record
|
|
WHERE data_type = '17' AND glzt='0' AND rzh_yesorno='1'
|
|
<if test="skssq !=null and skssq != ''">
|
|
and rzh_belong_date = #{skssq}
|
|
</if>
|
|
and gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
<if test="company !=null and company !=''">
|
|
and company = #{company}
|
|
</if>
|
|
</select>
|
|
<select id="getTotal" resultType="com.dxhy.core.model.CustomsStatisticsVo" databaseId="oracle">
|
|
select count(1) customsCount, nvl(sum(yx_tax_amount), 0) customsTax
|
|
FROM t_dx_customs_record
|
|
WHERE data_type = '17' AND glzt='0' AND rzh_yesorno='1'
|
|
<if test="skssq !=null and skssq != ''">
|
|
and rzh_belong_date = #{skssq}
|
|
</if>
|
|
and gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
<if test="company !=null and company !=''">
|
|
and company = #{company}
|
|
</if>
|
|
</select>
|
|
<select id="getTotalOutTax" resultType="Double" databaseId="mysql">
|
|
SELECT ifnull(sum(out_tax_amount), 0) FROM t_dx_record_invoice
|
|
WHERE valid='1' and invoice_type in ('01','03','08','14','31','283','161','183','185') AND invoice_status='0' AND rzh_yesorno='1' AND
|
|
out_status in ('1','2')
|
|
<if test="skssq !=null and skssq != ''">
|
|
and out_belong_date = #{skssq}
|
|
</if>
|
|
and gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
<if test="company != null and company !=''">
|
|
and company = #{company}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getOutTaxDetail" resultType="com.dxhy.core.model.DailyReportVo" databaseId="mysql">
|
|
SELECT
|
|
out_reason rzhDate,
|
|
ifnull(sum(out_tax_amount), 0) tax
|
|
FROM t_dx_record_invoice
|
|
WHERE valid='1' and invoice_type in ('01','03','08','14','31','283','161','183','185') AND invoice_status='0' AND rzh_yesorno='1' AND
|
|
out_status in ('1','2')
|
|
<if test="skssq !=null and skssq != ''">
|
|
and out_belong_date = #{skssq}
|
|
</if>
|
|
and gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
<if test="company != null and company !=''">
|
|
and company = #{company}
|
|
</if>
|
|
GROUP BY out_reason
|
|
ORDER BY out_reason ASC
|
|
</select>
|
|
|
|
<select id="getTotalOutTax" resultType="Double" databaseId="oracle">
|
|
SELECT nvl(sum(out_tax_amount), 0) FROM t_dx_record_invoice
|
|
WHERE valid='1' and invoice_type in ('01','03','08','14') AND invoice_status='0' AND rzh_yesorno='1' AND
|
|
out_status in ('1','2')
|
|
<if test="skssq !=null and skssq != ''">
|
|
and out_belong_date = #{skssq}
|
|
</if>
|
|
and gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
<if test="company != null and company !=''">
|
|
and company = #{company}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getOutTaxDetail" resultType="com.dxhy.core.model.DailyReportVo" databaseId="oracle">
|
|
SELECT
|
|
out_reason rzhDate,
|
|
nvl(sum(out_tax_amount), 0) tax
|
|
FROM t_dx_record_invoice
|
|
WHERE valid='1' and invoice_type in ('01','03','08','14') AND invoice_status='0' AND rzh_yesorno='1' AND
|
|
out_status in ('1','2')
|
|
<if test="skssq !=null and skssq != ''">
|
|
and out_belong_date = #{skssq}
|
|
</if>
|
|
and gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
<if test="company != null and company !=''">
|
|
and company = #{company}
|
|
</if>
|
|
GROUP BY out_reason
|
|
ORDER BY out_reason ASC
|
|
</select>
|
|
</mapper>
|
|
|