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/RzjgqdMapper.xml

89 lines
3.8 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.RzjgqdDao">
<resultMap id="RzjgqdResultMap" type="com.dxhy.core.model.RzjgqdRespVO">
<result column="id" property="id"/>
<result column="uuid" property="uuid"/>
<result column="fpdm" property="fpdm"/>
<result column="fphm" property="fphm"/>
<result column="fplx" property="fplx"/>
<result column="kprq" property="kprq"/>
<result column="xfsh" property="xfsh"/>
<result column="xfmc" property="xfmc"/>
<result column="je" property="je"/>
<result column="se" property="se"/>
<result column="dkse" property="dkse"/>
<result column="rzrq" property="rzrq"/>
<result column="dklx" property="dklx"/>
</resultMap>
<select id="rzjgByGfshAndSkssq" parameterType="java.util.Map"
resultMap="RzjgqdResultMap" databaseId="mysql">
select t.id id,t.uuid uuid,t.invoice_code fpdm,t.invoice_no fphm,t.invoice_type fplx,
date_format(t.invoice_date,'%Y-%m-%d') kprq,
t.xf_tax_no xfsh,t.xf_name xfmc,t.invoice_amount je,t.tax_amount se,t.dk_tax_amount
dkse,date_format(t.rzh_date,'%Y-%m-%d') rzrq,
t.invoice_type,t.rzh_yesorno dklx,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.invoice_type in ('01','03','08','14','31') and t.auth_status = '4' <!--and rzh_yesorno='1'-->
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<if test="skssq != null and skssq != '' and skssq != 'null' ">
and t.rzh_belong_date = #{skssq}
</if>
<if test="company !=null and company !=''">
and t.company = #{company}
</if>
<if test="dklx != null and dklx!=''">
<choose>
<when test="dklx =='99'">
and t.rzh_yesorno in ('1','2')
</when>
<otherwise>
and t.rzh_yesorno =#{dklx}
</otherwise>
</choose>
</if>
</select>
<select id="rzjgByGfshAndSkssq" parameterType="java.util.Map"
resultMap="RzjgqdResultMap" databaseId="oracle">
select t.id id,t.uuid uuid,t.invoice_code fpdm,t.invoice_no fphm,t.invoice_type fplx,
to_char(t.invoice_date,'yyyy-MM-dd') kprq,
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,to_char(t.dk_tax_amount,'99999999999990.99') dkse,
to_char(t.rzh_date,'yyyy-MM-dd') rzrq,t.invoice_type,t.rzh_yesorno dklx
from t_dx_record_invoice t
where t.invoice_type in ('01','03','08','14','31') and t.auth_status = '4' <!--and t.rzh_yesorno = '1'-->
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="skssq != null and skssq != '' and skssq != 'null' ">
and t.rzh_belong_date = #{skssq}
</if>
<if test="company !=null and company !=''">
and t.company = #{company}
</if>
<if test="dklx!=null and dklx!=''">
<choose>
<when test="dklx=='99'">
and t.rzh_yesorno in ('1','2')
</when>
<otherwise>
and t.rzh_yesorno =#{dklx}
</otherwise>
</choose>
</if>
</select>
</mapper>