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.
124 lines
4.8 KiB
124 lines
4.8 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.ExtBbycfpbbcxDao">
|
||
|
|
||
|
<resultMap id="BbycfpcxhjResultMap"
|
||
|
type="com.dxhy.extend.model.ExtBbycfpbbRespVO">
|
||
|
<result column="hjsl" property="hjsl"/>
|
||
|
<result column="hjje" property="hjje"/>
|
||
|
<result column="hjse" property="hjse"/>
|
||
|
<result column="gfsh" property="gfsh"/>
|
||
|
<result column="gfmc" property="gfmc"/>
|
||
|
<result column="yczt" property="yczt"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="hjxxMap"
|
||
|
type="com.dxhy.extend.model.ExtBbycfpbbRespVO">
|
||
|
<result column="hjsl" property="id"/>
|
||
|
<result column="hjje" property="hjje"/>
|
||
|
<result column="hjse" property="hjse"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<select id="selectBbycfpbbHj" parameterType="java.util.Map"
|
||
|
resultMap="BbycfpcxhjResultMap" databaseId="mysql">
|
||
|
|
||
|
select t.invoice_status yczt,t.gf_tax_no gfsh,t.gf_name gfmc,count(1)
|
||
|
hjsl,sum(t.invoice_amount)hjje,sum(t.tax_amount)hjse
|
||
|
from t_dx_record_invoice t
|
||
|
where t.invoice_status != '0'
|
||
|
and t.invoice_type in ('01','03','08','14')
|
||
|
and t.company = #{company}
|
||
|
and DATE_FORMAT(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
|
||
|
and t.gf_tax_no in
|
||
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<choose>
|
||
|
<when test="yczt != null and yczt != '' and yczt != 'null'">
|
||
|
and t.invoice_status = #{yczt}
|
||
|
</when>
|
||
|
<otherwise>
|
||
|
and t.invoice_status <![CDATA[ <> ]]> 0
|
||
|
</otherwise>
|
||
|
</choose>
|
||
|
|
||
|
group by t.invoice_status,t.gf_tax_no
|
||
|
</select>
|
||
|
<select id="selectBbycfpbbHj" parameterType="java.util.Map"
|
||
|
resultMap="BbycfpcxhjResultMap" databaseId="oracle">
|
||
|
|
||
|
select t.invoice_status yczt,o.taxno gfsh,o.taxname gfmc,count(1)
|
||
|
hjsl,sum(t.invoice_amount)hjje,sum(t.tax_amount)hjse
|
||
|
from ${dxhyTertiary}.t_dx_record_invoice t left join ${dxhyAdmin}.sys_dept o on t.gf_tax_no =
|
||
|
o.taxno
|
||
|
where t.invoice_status != '0'
|
||
|
and t.invoice_type in ('01','03','08','14')
|
||
|
and t.company = #{company}
|
||
|
and to_char(t.invoice_date,'yyyy-mm-dd') between #{kpksrq} and #{kpjsrq}
|
||
|
and t.gf_tax_no in
|
||
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<choose>
|
||
|
<when test="yczt != '0' and yczt != '' and yczt != null">
|
||
|
and t.invoice_status = #{yczt}
|
||
|
</when>
|
||
|
<otherwise>
|
||
|
and t.invoice_status <![CDATA[ <> ]]> 0
|
||
|
</otherwise>
|
||
|
</choose>
|
||
|
|
||
|
group by t.invoice_status,o.taxno,o.taxname
|
||
|
</select>
|
||
|
|
||
|
<select id="selectHjxx" parameterType="java.util.Map"
|
||
|
resultMap="hjxxMap" databaseId="mysql">
|
||
|
|
||
|
select count(1) hjsl,sum(t.invoice_amount)hjje,sum(t.tax_amount)hjse
|
||
|
from t_dx_record_invoice t
|
||
|
where t.invoice_status != '0'
|
||
|
and t.invoice_type in ('01','03','08','14')
|
||
|
and t.company = #{company}
|
||
|
and DATE_FORMAT(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
|
||
|
and t.gf_tax_no in
|
||
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<choose>
|
||
|
<when test="yczt != null and yczt != '' and yczt != '0'">
|
||
|
and t.invoice_status = #{yczt}
|
||
|
</when>
|
||
|
<otherwise>
|
||
|
and t.invoice_status <![CDATA[ <> ]]> 0
|
||
|
</otherwise>
|
||
|
</choose>
|
||
|
</select>
|
||
|
<select id="selectHjxx" parameterType="java.util.Map"
|
||
|
resultMap="hjxxMap" databaseId="oracle">
|
||
|
|
||
|
select count(1) hjsl,sum(t.invoice_amount)hjje,sum(t.tax_amount)hjse
|
||
|
from ${dxhyTertiary}.t_dx_record_invoice t left join ${dxhyAdmin}.sys_dept o on t.gf_tax_no =
|
||
|
o.taxno
|
||
|
where t.invoice_status != '0'
|
||
|
and t.invoice_type in ('01','03','08','14')
|
||
|
and t.company = #{company}
|
||
|
and t.invoice_date between to_date(#{kpksrq},'yyyy-mm-dd hh24:mi:ss') and
|
||
|
to_date(#{kpjsrq},'yyyy-mm-dd
|
||
|
hh24:mi:ss')
|
||
|
and t.gf_tax_no in
|
||
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
<choose>
|
||
|
<when test="yczt != null and yczt != '' and yczt != '0'">
|
||
|
and t.invoice_status = #{yczt}
|
||
|
</when>
|
||
|
<otherwise>
|
||
|
and t.invoice_status <![CDATA[ <> ]]> 0
|
||
|
</otherwise>
|
||
|
</choose>
|
||
|
</select>
|
||
|
|
||
|
</mapper>
|