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.
428 lines
17 KiB
428 lines
17 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.ExtQstjbDao">
|
|
|
|
<resultMap id="QstjbResultMap" type="com.dxhy.extend.model.ExtQstjbRespVO">
|
|
<result column="id" property="id"/>
|
|
<result column="uuid" property="uuid"/>
|
|
<result column="qsrq" property="qsrq"/>
|
|
<result column="qszt" property="qszt"/>
|
|
<result column="qsfs" property="qsfs"/>
|
|
<result column="qsr" property="qsr"/>
|
|
<result column="fpdm" property="fpdm"/>
|
|
<result column="fphm" property="fphm"/>
|
|
<result column="kprq" property="kprq"/>
|
|
<result column="gfsh" property="gfsh"/>
|
|
<result column="gfmc" property="gfmc"/>
|
|
<result column="xfsh" property="xfsh"/>
|
|
<result column="je" property="je"/>
|
|
<result column="se" property="se"/>
|
|
<result column="deptName" property="businessName"/>
|
|
<result column="invoiceType" property="invoiceType"/>
|
|
<result column="scanId" property="scanId"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="HjxxMap" type="com.dxhy.extend.model.ExtTjbbHjxxVO">
|
|
<result column="hjsl" property="hjsl"/>
|
|
<result column="hjje" property="hjje"/>
|
|
<result column="hjse" property="hjse"/>
|
|
</resultMap>
|
|
|
|
<select id="qstjbHjxxByCxtj" 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_invoice t
|
|
where
|
|
t.qs_date between #{qsrqq} and #{qsrqz}
|
|
and t.valid = '1'
|
|
and t.company = #{company}
|
|
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="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.user_name =#{qsr}
|
|
</if>
|
|
|
|
<if test="fphm != null and fphm != '' and fphm != 'null' ">
|
|
and t.invoice_no = #{fphm}
|
|
</if>
|
|
<if
|
|
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
|
|
and t.dept_id = #{businessCode}
|
|
</if>
|
|
<if test="businessCode==''">
|
|
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
|
|
</if>
|
|
<if test='businessCode == "99" and business!=null and business.size()>0'>
|
|
and (t.dept_id in
|
|
<foreach collection="business" index="index" item="item" open="(" separator="," close="">
|
|
#{item.businessCode}
|
|
</foreach>
|
|
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
|
|
</if>
|
|
</select>
|
|
|
|
<select id="qstjbHjxxByCxtj" parameterType="java.util.Map"
|
|
resultMap="HjxxMap" databaseId="oracle">
|
|
select COUNT(1)hjsl, SUM(t.invoice_amount)hjje, SUM(t.tax_amount)hjse
|
|
from t_dx_invoice t
|
|
where
|
|
t.qs_date between to_date(#{qsrqq},'yyyy-mm-dd hh24:mi:ss') and to_date(#{qsrqz},'yyyy-mm-dd
|
|
hh24:mi:ss')
|
|
and t.valid = '1'
|
|
and t.company = #{company}
|
|
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="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.user_name =#{qsr}
|
|
</if>
|
|
|
|
<if test="fphm != null and fphm != '' and fphm != 'null' ">
|
|
and t.invoice_no = #{fphm}
|
|
</if>
|
|
<if
|
|
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
|
|
and t.dept_id = #{businessCode}
|
|
</if>
|
|
<if test="businessCode==''">
|
|
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
|
|
</if>
|
|
<if test='businessCode == "99" and business!=null and business.size()>0'>
|
|
and (t.dept_id in
|
|
<foreach collection="business" index="index" item="item" open="(" separator="," close="">
|
|
#{item.businessCode}
|
|
</foreach>
|
|
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectQstjbByCxtj" parameterType="java.util.Map"
|
|
resultMap="QstjbResultMap" databaseId="mysql">
|
|
select t.id id,t.uuid uuid, DATE_FORMAT(t.qs_date,'%Y-%m-%d') qsrq,t.qs_status qszt,t.qs_type
|
|
qsfs,
|
|
t.invoice_code fpdm,t.invoice_no fphm,DATE_FORMAT(t.invoice_date,'%Y-%m-%d') kprq,t.gf_tax_no
|
|
gfsh,t.gf_name
|
|
gfmc,
|
|
t.xf_tax_no xfsh,t.xf_name xfmc,t.invoice_amount je,t.tax_amount se,t.invoice_type
|
|
invoiceType,t.user_name
|
|
qsr,t.dept_name deptName,img.scan_id scanId
|
|
from t_dx_invoice t left join t_dx_invoice_img img on t.scan_id = img.scan_id
|
|
where
|
|
t.qs_date between #{qsrqq} and #{qsrqz}
|
|
and t.valid = '1'
|
|
and t.company = #{company}
|
|
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="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.user_name =#{qsr}
|
|
</if>
|
|
<if test="fphm != null and fphm != '' and fphm != 'null' ">
|
|
and t.invoice_no = #{fphm}
|
|
</if>
|
|
<if
|
|
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
|
|
and t.dept_id = #{businessCode}
|
|
</if>
|
|
<if test="businessCode==''">
|
|
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
|
|
</if>
|
|
<if test='businessCode == "99" and business!=null and business.size()>0'>
|
|
and (t.dept_id in
|
|
<foreach collection="business" index="index" item="item" open="(" separator="," close="">
|
|
#{item.businessCode}
|
|
</foreach>
|
|
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
|
|
</if>
|
|
order by t.qs_date desc
|
|
</select>
|
|
|
|
<select id="selectQstjbByCxtj" parameterType="java.util.Map"
|
|
resultMap="QstjbResultMap" databaseId="oracle">
|
|
select t.id id,t.uuid uuid,to_char(t.qs_date,'yyyy-MM-dd') qsrq,t.qs_status qszt,t.qs_type qsfs,
|
|
t.invoice_code fpdm,t.invoice_no fphm,to_char(t.invoice_date,'yyyy-MM-dd') kprq,t.gf_tax_no
|
|
gfsh,t.gf_name gfmc,
|
|
t.xf_tax_no xfsh,t.xf_name xfmc,t.invoice_amount je,t.tax_amount se,t.invoice_type
|
|
invoiceType,t.user_name
|
|
qsr,t.dept_name deptName,img.scan_id scanId
|
|
from t_dx_invoice t left join t_dx_invoice_img img on t.scan_id = img.scan_id
|
|
where t.qs_date between to_date(#{qsrqq},'yyyy-mm-dd hh24:mi:ss') and
|
|
to_date(#{qsrqz},'yyyy-mm-dd hh24:mi:ss')
|
|
and t.valid = '1'
|
|
and t.company = #{company}
|
|
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="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.user_name =#{qsr}
|
|
</if>
|
|
|
|
<if test="fphm != null and fphm != '' and fphm != 'null' ">
|
|
and t.invoice_no = #{fphm}
|
|
</if>
|
|
<if
|
|
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
|
|
and t.dept_id = #{businessCode}
|
|
</if>
|
|
<if test="businessCode==''">
|
|
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
|
|
</if>
|
|
<if test='businessCode == "99" and business!=null and business.size()>0'>
|
|
and (t.dept_id in
|
|
<foreach collection="business" index="index" item="item" open="(" separator="," close="">
|
|
#{item.businessCode}
|
|
</foreach>
|
|
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
|
|
</if>
|
|
order by t.qs_date desc
|
|
</select>
|
|
|
|
<select id="yqswrzHjxxByCxtj" 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.qs_status = '1'
|
|
and t.rzh_yesorno = '0'
|
|
and t.invoice_type in ('01','03','08','14')
|
|
and t.company = #{company}
|
|
and t.qs_date between #{qsrqq} and #{qsrqz}
|
|
and t.gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
|
|
<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="fphm != null and fphm != '' and fphm != 'null' ">
|
|
and t.invoice_no = #{fphm}
|
|
</if>
|
|
<if
|
|
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
|
|
and t.dept_id = #{businessCode}
|
|
</if>
|
|
<if test="businessCode==''">
|
|
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
|
|
</if>
|
|
<if test='businessCode == "99" and business!=null and business.size()>0'>
|
|
and (t.dept_id in
|
|
<foreach collection="business" index="index" item="item" open="(" separator="," close="">
|
|
#{item.businessCode}
|
|
</foreach>
|
|
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
|
|
</if>
|
|
</select>
|
|
|
|
<select id="yqswrzHjxxByCxtj" parameterType="java.util.Map"
|
|
resultMap="HjxxMap" databaseId="oracle">
|
|
select COUNT(1)hjsl, SUM(t.invoice_amount)hjje, SUM(t.tax_amount)hjse
|
|
from t_dx_record_invoice t
|
|
where t.qs_status = '1'
|
|
and t.rzh_yesorno = '0'
|
|
and t.invoice_type in ('01','03','08','14')
|
|
and t.company = #{company}
|
|
and t.qs_date between to_date(#{qsrqq},'yyyy-mm-dd hh24:mi:ss') and to_date(#{qsrqz},'yyyy-mm-dd
|
|
hh24:mi:ss')
|
|
and t.gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
|
|
<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="fphm != null and fphm != '' and fphm != 'null' ">
|
|
and t.invoice_no = #{fphm}
|
|
</if>
|
|
<if
|
|
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
|
|
and t.dept_id = #{businessCode}
|
|
</if>
|
|
<if test="businessCode==''">
|
|
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
|
|
</if>
|
|
<if test='businessCode == "99" and business!=null and business.size()>0'>
|
|
and (t.dept_id in
|
|
<foreach collection="business" index="index" item="item" open="(" separator="," close="">
|
|
#{item.businessCode}
|
|
</foreach>
|
|
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectYqswrzByCxtj" parameterType="java.util.Map"
|
|
resultMap="QstjbResultMap" databaseId="mysql">
|
|
select t.id id,t.uuid uuid,date_format(t.qs_date,'%Y-%m-%d') qsrq,t.qs_status qszt,t.qs_type
|
|
qsfs,t.qs_name qsr,
|
|
t.invoice_code fpdm,t.invoice_no fphm,date_format(t.invoice_date,'%Y-%m-%d') kprq,t.gf_tax_no
|
|
gfsh,t.gf_name
|
|
gfmc,
|
|
t.xf_tax_no xfsh,t.xf_name xfmc,t.invoice_amount je,t.tax_amount se,t.invoice_type
|
|
invoiceType,t.dept_name
|
|
deptName
|
|
from t_dx_record_invoice t
|
|
where t.qs_status = '1'
|
|
and t.rzh_yesorno = '0'
|
|
and t.invoice_type in ('01','03','08','14')
|
|
and t.company = #{company}
|
|
and t.qs_date between #{qsrqq} and #{qsrqz}
|
|
|
|
and t.gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
|
|
<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="fphm != null and fphm != '' and fphm != 'null' ">
|
|
and t.invoice_no = #{fphm}
|
|
</if>
|
|
<if
|
|
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
|
|
and t.dept_id = #{businessCode}
|
|
</if>
|
|
<if test="businessCode==''">
|
|
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
|
|
</if>
|
|
<if test='businessCode == "99" and business!=null and business.size()>0'>
|
|
and (t.dept_id in
|
|
<foreach collection="business" index="index" item="item" open="(" separator="," close="">
|
|
#{item.businessCode}
|
|
</foreach>
|
|
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
|
|
</if>
|
|
order by t.qs_date desc
|
|
</select>
|
|
|
|
<select id="selectYqswrzByCxtj" parameterType="java.util.Map"
|
|
resultMap="QstjbResultMap" databaseId="oracle">
|
|
select t.id id,t.uuid uuid,to_char(t.qs_date,'yyyy-MM-dd') qsrq,t.qs_status qszt,t.qs_type
|
|
qsfs,t.qs_name qsr,
|
|
t.invoice_code fpdm,t.invoice_no fphm,to_char(t.invoice_date,'yyyy-MM-dd') kprq,t.gf_tax_no
|
|
gfsh,t.gf_name gfmc,
|
|
t.xf_tax_no xfsh,t.xf_name xfmc,t.invoice_amount je,t.tax_amount se,t.invoice_type
|
|
invoiceType,t.dept_name
|
|
deptName
|
|
from t_dx_record_invoice t
|
|
where t.qs_status = '1'
|
|
and t.rzh_yesorno = '0'
|
|
and t.invoice_type in ('01','03','08','14')
|
|
and t.company = #{company}
|
|
and t.qs_date between to_date(#{qsrqq},'yyyy-mm-dd hh24:mi:ss') and to_date(#{qsrqz},'yyyy-mm-dd
|
|
hh24:mi:ss')
|
|
and t.gf_tax_no in
|
|
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
|
|
<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="fphm != null and fphm != '' and fphm != 'null' ">
|
|
and t.invoice_no = #{fphm}
|
|
</if>
|
|
<if
|
|
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
|
|
and t.dept_id = #{businessCode}
|
|
</if>
|
|
<if test="businessCode==''">
|
|
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
|
|
</if>
|
|
<if test='businessCode == "99" and business!=null and business.size()>0'>
|
|
and (t.dept_id in
|
|
<foreach collection="business" index="index" item="item" open="(" separator="," close="">
|
|
#{item.businessCode}
|
|
</foreach>
|
|
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
|
|
</if>
|
|
order by t.qs_date desc
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
|