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.
sdny-jxpt/dxhy-extend/src/main/resources/mapper/ExtRzInfoByXfMapper.xml

84 lines
3.2 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.extend.dao.ExtRzInfoByXfDao">
<resultMap id="FprzhrResultMap" type="com.dxhy.extend.model.ExtFprzhrRespVO">
<result column="xfName" property="xfName"/>
<result column="xfTaxNo" property="xfTaxNo"/>
<result column="fpsl" property="fpsl"/>
<result column="hjje" property="hjje"/>
<result column="hjse" property="hjse"/>
<result column="hjdk" property="hjdk"/>
<result column="rzDate" property="rzDate"/>
</resultMap>
<select id="rzInfoByXf" parameterType="java.util.Map"
resultMap="FprzhrResultMap" databaseId="mysql">
select
t.xf_name xfName,
t.xf_tax_no xfTaxNo,
COUNT(t.id ) as fpsl,
sum(invoice_amount) as hjje,
sum(tax_amount) as hjse ,
sum(dk_tax_amount) as hjdk
from t_dx_record_invoice t
where t.invoice_type in ('01','03','14')
and t.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 date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
</if>
<if test="rzksrq!=null and rzksrq!='' and rzjsrq!=null and rzjsrq!=''">
and date_format(t.rzh_date,'%Y-%m-%d') between #{rzksrq} and #{rzjsrq}
</if>
<if test="skssq!=null and skssq!=''">
and t.rzh_belong_date = #{skssq}
</if>
<if test="rzzt!=null and rzzt!=''">
and t.rzh_yesorno = #{rzzt}
</if>
<if test="xfmc!=null and xfmc!=''">
and t.xf_name like concat( #{xfmc},'%')
</if>
GROUP BY t.gf_tax_no ORDER by t.gf_tax_no
</select>
<select id="rzInfoByXf" parameterType="java.util.Map"
resultMap="FprzhrResultMap" databaseId="oracle">
select
t.xf_name xfName,
t.xf_tax_no xfTaxNo,
COUNT(t.id ) as fpsl,
sum(invoice_amount) as hjje,
sum(tax_amount) as hjse ,
sum(dk_tax_amount) as hjdk
from t_dx_record_invoice t
where t.invoice_type in ('01','03','14')
and t.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 TO_CHAR(t.invoice_date, 'yyyy-MM-dd HH24:mm:dd') between #{kpksrq} and #{kpjsrq}
</if>
<if test="rzksrq!=null and rzksrq!='' and rzjsrq!=null and rzjsrq!=''">
AND TO_CHAR(t.rzh_date, 'yyyy-MM-dd HH24:mm:dd') between #{rzksrq} and #{rzjsrq}
</if>
<if test="skssq!=null and skssq!=''">
and t.rzh_belong_date = #{skssq}
</if>
<if test="rzzt!=null and rzzt!=''">
and t.rzh_yesorno = #{rzzt}
</if>
<if test="xfmc!=null and xfmc!=''">
and t.xf_name like concat( #{xfmc},'%')
</if>
GROUP BY t.gf_tax_no ORDER by t.gf_tax_no
</select>
</mapper>