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.
241 lines
10 KiB
241 lines
10 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.QstjbDao">
|
|
|
|
<resultMap id="QstjbResultMap" type="com.dxhy.core.model.QstjbRespVO">
|
|
<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="invoiceType" property="invoiceType"/>
|
|
<result column="kprq" property="kprq"/>
|
|
<result column="gfsh" property="gfsh"/>
|
|
<result column="gfmc" property="gfmc"/>
|
|
<result column="xfsh" property="xfsh"/>
|
|
<result column="xfmc" property="xfmc"/>
|
|
<result column="je" property="je"/>
|
|
<result column="se" property="se"/>
|
|
<result column="deptName" property="businessName"/>
|
|
</resultMap>
|
|
|
|
<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,t.invoice_type invoiceType,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.user_name qsr,t.dept_name deptName
|
|
,r.sn_voucher_number,r.posting_time,r.image_id,r.account_period,r.bzdh,bzr,r.inaccount_status,r.comp_code
|
|
from t_dx_invoice t inner join t_dx_record_invoice r on t.uuid = r.uuid
|
|
where
|
|
t.qs_date between #{qsrqq} and #{qsrqz}
|
|
and t.valid = '1'
|
|
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 qszt != '99' ">
|
|
and t.qs_status = #{qszt}
|
|
</if>
|
|
|
|
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99' ">
|
|
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>
|
|
<if test="company !=null and company !=''">
|
|
and t.company = #{company}
|
|
</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,t.invoice_type invoiceType,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.user_name qsr,t.dept_name deptName
|
|
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.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 qszt != '99' ">
|
|
and t.qs_status = #{qszt}
|
|
</if>
|
|
|
|
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99' ">
|
|
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>
|
|
<if test="company !=null and company !=''">
|
|
and t.company = #{company}
|
|
</if>
|
|
order by t.qs_date desc
|
|
</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,t.invoice_type invoiceType,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.dept_name deptName,t.sn_voucher_number as snVoucherNumber,
|
|
t.posting_time as postingTime,
|
|
t.image_id as imageId,
|
|
t.account_period as account_period,
|
|
t.bzdh,
|
|
t.bzr,
|
|
t.inaccount_status as inaccountStatus,
|
|
t.comp_code as compCode
|
|
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.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>
|
|
<if test="company!=null and company !=''">
|
|
and t.company = #{company}
|
|
</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,t.invoice_type invoiceType,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,to_char(t.invoice_amount,'99999999999990.99')
|
|
je,to_char(t.tax_amount,'99999999999990.99') se,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.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>
|
|
<if test="company!=null and company !=''">
|
|
and t.company = #{company}
|
|
</if>
|
|
order by t.qs_date desc
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
|