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-core/src/main/resources/mapper/FpcjhzMapper.xml

123 lines
5.6 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.FpcjhzLbDao">
<resultMap id="BaseResultMap" type="com.dxhy.core.model.FpcjCjhzRespVO">
<result column="sl" property="sl"/>
<result column="je" property="je"/>
<result column="se" property="se"/>
<result column="cjrq" property="cjrq"/>
<result column="gfsh" property="gfsh"/>
<result column="gfmc" property="gfmc"/>
</resultMap>
<resultMap id="HjxxMap" type="com.dxhy.core.model.FpcjCjhzRespVO">
<result column="hjsl" property="sl"/>
<result column="hjje" property="je"/>
<result column="hjse" property="se"/>
</resultMap>
<resultMap id="GfxxMap" type="com.dxhy.core.model.FpcjCjhzRespVO">
<result column="gfsh" property="gfsh"/>
<result column="gfmc" property="gfmc"/>
</resultMap>
<select id="selectByGfshAndCjrq" parameterType="java.util.Map"
resultMap="BaseResultMap" databaseId="mysql">
select COUNT(1)sl, SUM(t.invoice_amount)je, SUM(t.tax_amount)se, DATE_FORMAT(t.create_date,'%Y-%m-%d')
cjrq,t.gf_tax_no gfsh
from t_dx_record_invoice t
WHERE t.create_date between #{cjksrq} and #{cjjsrq}
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and lq_tdyslxDm='08'))
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="ycpbz != null and ycpbz != '' and ycpbz != 'null' and ycpbz != '99' ">
and t.invoice_status in ('1','2','3','4','7','8','80')
</if>
<if test="company!=null and company !=''">
and t.company = #{company}
</if>
and t.source_system = '0'
group by cjrq,gfsh
order by cjrq desc
</select>
<select id="selectByGfshAndCjrq" parameterType="java.util.Map"
resultMap="BaseResultMap" databaseId="oracle">
select COUNT(1)sl, to_char(SUM(t.invoice_amount),'99999999999990.99') je,
to_char(SUM(t.tax_amount),'99999999999990.99') se, to_char(t.create_date,'YYYY-MM-DD')
cjrq,t.gf_tax_no gfsh
from t_dx_record_invoice t
WHERE t.create_date between to_date(#{cjksrq},'yyyy-mm-dd hh24:mi:ss') and to_date(#{cjjsrq},'yyyy-mm-dd
hh24:mi:ss')
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and lq_tdyslxDm='08'))
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="ycpbz != null and ycpbz != '' and ycpbz != 'null' and ycpbz != '99' ">
and t.invoice_status in selectByGfshAndCjrq
</if>
<if test="company!=null and company !=''">
and t.company = #{company}
</if>
and t.source_system = '0'
group by to_char(t.create_date,'YYYY-MM-DD'),gf_tax_no
order by to_char(t.create_date,'YYYY-MM-DD') desc
</select>
<select id="selectHjxxByGfshAndCjrq" 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.create_date between #{cjksrq} and #{cjjsrq}
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and lq_tdyslxDm='08'))
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="ycpbz != null and ycpbz != '' and ycpbz != 'null' and ycpbz != '99' ">
and t.invoice_status in ('1','2','3','4','7','8','80')
</if>
<if test="company!=null and company !=''">
and t.company = #{company}
</if>
and t.source_system = '0'
</select>
<select id="selectHjxxByGfshAndCjrq" parameterType="java.util.Map"
resultMap="HjxxMap" databaseId="oracle">
select COUNT(1)hjsl, to_char(SUM(t.invoice_amount),'99999999999990.99') hjje,
to_char(SUM(t.tax_amount),'99999999999990.99') hjse
from t_dx_record_invoice t
WHERE t.create_date between to_date(#{cjksrq},'yyyy-mm-dd hh24:mi:ss') and to_date(#{cjjsrq},'yyyy-mm-dd
hh24:mi:ss')
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and lq_tdyslxDm='08'))
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="ycpbz != null and ycpbz != '' and ycpbz != 'null' and ycpbz != '99' ">
and t.invoice_status in ('1','2','3','4','7','8','80')
</if>
<if test="company!=null and company !=''">
and t.company = #{company}
</if>
and t.source_system = '0'
</select>
<select id="selectGfxxList" parameterType="java.util.Map"
resultMap="GfxxMap">
select distinct t.gf_tax_no gfsh,t.gf_name gfmc
from t_dx_record_invoice t
WHERE t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and lq_tdyslxDm='08'))
and t.source_system = '0'
</select>
<!-- and t.detail_yesorno = '1'-->
</mapper>