<?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.customs.dao.CustomsJkszhcxDao" >
<resultMap id= "BaseResultMap"
type="com.dxhy.customs.model.JkszhcxRespVO">
<result column= "customs_code" property= "customsCode" />
<result column= "fill_in_date" property= "fillInDate" />
<result column= "gf_tax_no" property= "gfTaxNo" />
<result column= "gf_name" property= "gfName" />
<result column= "tax_amount" property= "taxAmount" />
<result column= "yx_tax_amount" property= "yxTaxAmount" />
<result column= "audit_status" property= "auditStatus" />
<result column= "apply_check" property= "applyCheck" />
<result column= "check_status" property= "checkStatus" />
<result column= "qs_status" property= "qsStatus" />
<result column= "qs_date" property= "qsDate" />
<result column= "qs_type" property= "qsType" />
<result column= "qs_user" property= "qsUser" />
<result column= "rzh_date" property= "rzhDate" />
<result column= "rzh_yesorno" property= "rzhYesorno" />
<result column= "auth_status" property= "authStatus" />
<result column= "bdk_status" property= "bdkStatus" />
<result column= "confirm_user" property= "confirmUser" />
<result column= "rzh_belong_date" property= "rzhBelongDate" />
<result column= "glzt" property= "glzt" />
<result column= "customs_scan_id" property= "customsScanId" />
<result column= "businessName" property= "businessName" />
<result column= "sn_voucher_number" property= "snVoucherNumber" />
<result column= "posting_time" property= "postingTime" />
<result column= "image_id" property= "imageNumber" />
<result column= "account_period" property= "accountPeriod" />
<result column= "bzdh" property= "bzdh" />
<result column= "bzr" property= "bzr" />
<result column= "inaccount_status" property= "inAccountStatus" />
<result column= "comp_code" property= "compCode" />
</resultMap>
<resultMap id= "HjResultMap" type= "java.util.Map" >
<result column= "hjsl" property= "hjsl" javaType= "Long" />
<result column= "hjse" property= "hjse" />
</resultMap>
<select databaseId= "mysql" id= "selectByPramsMap"
parameterType="java.util.Map" resultMap="BaseResultMap">
select
t.id,t.customs_code,DATE_FORMAT(t.fill_in_date,'%Y-%m-%d')
fill_in_date,t.gf_tax_no,t.gf_name,t.tax_amount,t.yx_tax_amount,t.audit_status,t.apply_check,t.check_status,t.qs_status,
DATE_FORMAT(t.qs_date,'%Y-%m-%d') qs_date,t.qs_type,t.qs_user,DATE_FORMAT(t.rzh_date,'%Y-%m-%d')
rzh_date, t.rzh_yesorno,t.auth_status,t.bdk_status,t.confirm_user,t.rzh_belong_date,t.glzt,
t.customs_scan_id,t.dept_name businessName
,t.sn_voucher_number,t.posting_time,t.image_id,t.account_period,t.bzdh,t.bzr,t.inaccount_status,t.comp_code
from t_dx_customs_record t
where export_mark = '0'
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<if test= "bzdh != null and bzdh != '' and bzdh != 'null'" >
and t.bzdh = #{bzdh}
</if>
<if test= "inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' " >
and (t.inaccount_status != '1' or t.inaccount_status is null)
</if>
<if test= "customsCode != null and customsCode != '' and customsCode != 'null'" >
and t.customs_code = #{customsCode}
</if>
<if
test="fillInStartDate != null and fillInEndDate != null and fillInStartDate != '' and fillInEndDate != ''">
and t.fill_in_date between #{fillInStartDate} and #{fillInEndDate}
</if>
<if test= "taxAmount != null and taxAmount != '' and taxAmount != 'null'" >
and t.tax_amount = #{taxAmount}+0
</if>
<if test= "qsStatus != null and qsStatus != '' and qsStatus != 'null' and qsStatus != '99'" >
and t.qs_status = #{qsStatus}
</if>
<if
test="rzhYesorno != null and rzhYesorno != '' and rzhYesorno != 'null' and rzhYesorno != '99'">
and t.rzh_yesorno = #{rzhYesorno}
</if>
<if test= "bdkStatus != null and bdkStatus != '' and bdkStatus != 'null' and bdkStatus != '99'" >
and t.bdk_status = #{bdkStatus}
</if>
<if test= "confirmUser != null and confirmUser != '' and confirmUser != 'null' and confirmUser != 'admin'" >
and t.confirm_user like CONCAT(#{confirmUser},'%')
</if>
<if test= "confirmUser == 'admin'" >
and (t.confirm_user = #{confirmUser} or t.confirm_user is null or t.confirm_user = '') and t.auth_status = '4'
</if>
<if test= "glzt != null and glzt != '' and glzt != 'null' and glzt != '99'" >
and t.glzt = #{glzt}
</if>
<if
test="auditStatus != null and auditStatus != '' and auditStatus != 'null' and auditStatus != '99'">
and t.audit_status = #{auditStatus}
</if>
<if
test="applyCheck != null and applyCheck != '' and applyCheck != 'null' and applyCheck != '99'">
and t.apply_check = #{applyCheck}
</if>
<if
test="checkStatus != null and checkStatus != '' and checkStatus != 'null' and checkStatus != '99'">
and t.check_status = #{checkStatus}
</if>
<if
test="qsDateStartDate != null and qsDateEndDate != null and qsDateStartDate != '' and qsDateEndDate != ''">
and t.qs_date between #{qsDateStartDate} and #{qsDateEndDate}
</if>
<if
test="rzhStartDate != null and rzhEndDate != null and rzhStartDate != '' and rzhEndDate != ''">
and t.rzh_date between #{rzhStartDate} and #{rzhEndDate}
</if>
<if test= "rzhBelongDate != null and rzhBelongDate != '' and rzhBelongDate != 'null' " >
and t.rzh_belong_date = #{rzhBelongDate}
</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 close= "" collection= "business" index= "index" item= "item" open= "(" separator= "," >
#{item.businessCode}
</foreach>
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
</if>
order by t.fill_in_date desc
</select>
<select databaseId= "oracle" id= "selectByPramsMap"
parameterType="java.util.Map" resultMap="BaseResultMap">
select
t.id,t.customs_code,to_char(t.fill_in_date,'yyyy-mm-dd')
fill_in_date,t.gf_tax_no,t.gf_name,t.tax_amount,t.yx_tax_amount,t.audit_status,t.apply_check,t.check_status,t.qs_status,
to_char(t.qs_date,'yyyy-mm-dd') qs_date,t.qs_type,t.qs_user,to_char(t.rzh_date,'yyyy-mm-dd')
rzh_date,
t.rzh_yesorno,t.auth_status,t.bdk_status,t.confirm_user,t.rzh_belong_date,t.glzt,t.customs_scan_id,t.dept_name
businessName
from t_dx_customs_record t
where export_mark = '0' and t.gf_tax_no in
<foreach close= ")" collection= "gfsh" index= "index" item= "item" open= "(" separator= "," >
#{item}
</foreach>
<if test= "customsCode != null and customsCode != '' and customsCode != 'null'" >
and t.customs_code = #{customsCode}
</if>
<if
test="fillInStartDate != null and fillInEndDate != null and fillInStartDate != '' and fillInEndDate != ''">
and t.fill_in_date between to_date(#{fillInStartDate},'yyyy-mm-dd hh24:mi:ss') and
to_date(#{fillInEndDate},'yyyy-mm-dd hh24:mi:ss')
</if>
<if test= "taxAmount != null and taxAmount != '' and taxAmount != 'null'" >
and t.tax_amount = #{taxAmount}+0
</if>
<if test= "qsStatus != null and qsStatus != '' and qsStatus != 'null' and qsStatus != '99'" >
and t.qs_status = #{qsStatus}
</if>
<if
test="rzhYesorno != null and rzhYesorno != '' and rzhYesorno != 'null' and rzhYesorno != '99'">
and t.rzh_yesorno = #{rzhYesorno}
</if>
<if test= "rzlx != null and rzlx != '' and rzlx != 'null' and rzlx != '99'" >
and t.bdk_status = #{bdkStatus}
</if>
<if test= "confirmUser != null and confirmUser != '' and confirmUser != 'null' " >
and t.confirm_user like CONCAT(#{confirmUser},'%')
</if>
<if test= "glzt != null and glzt != '' and glzt != 'null' and glzt != '99'" >
and t.glzt = #{glzt}
</if>
<if
test="auditStatus != null and auditStatus != '' and auditStatus != 'null' and auditStatus != '99'">
and t.audit_status = #{auditStatus}
</if>
<if
test="applyCheck != null and applyCheck != '' and applyCheck != 'null' and applyCheck != '99'">
and t.apply_check = #{applyCheck}
</if>
<if
test="checkStatus != null and checkStatus != '' and checkStatus != 'null' and checkStatus != '99'">
and t.check_status = #{checkStatus}
</if>
<if
test="qsDateStartDate != null and qsDateEndDate != null and qsDateStartDate != '' and qsDateEndDate != ''">
and t.qs_date between to_date(#{qsDateStartDate},'yyyy-mm-dd hh24:mi:ss') and
to_date(#{qsDateEndDate},'yyyy-mm-dd hh24:mi:ss')
</if>
<if
test="rzhStartDate != null and rzhEndDate != null and rzhStartDate != '' and rzhEndDate != ''">
and t.rzh_date between to_date(#{rzhStartDate},'yyyy-mm-dd hh24:mi:ss') and
to_date(#{rzhEndDate},'yyyy-mm-dd hh24:mi:ss')
</if>
<if test= "rzhBelongDate != null and rzhBelongDate != '' and rzhBelongDate != 'null' " >
and t.rzh_belong_date = #{rzhBelongDate}
</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 close= "" collection= "business" index= "index" item= "item" open= "(" separator= "," >
#{item.businessCode}
</foreach>
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
</if>
order by t.fill_in_date desc
</select>
<select databaseId= "mysql" id= "selectHjxx"
parameterType="java.util.Map" resultMap="HjResultMap">
select
count(1) hjsl,
sum(t.tax_amount) hjse
from t_dx_customs_record t
where export_mark = '0'
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<if test= "customsCode != null and customsCode != '' and customsCode != 'null'" >
and t.customs_code = #{customsCode}
</if>
<if test= "bzdh != null and bzdh != '' and bzdh != 'null'" >
and t.bzdh = #{bzdh}
</if>
<if test= "inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()" >
and t.inaccount_status = #{inAccountStatus}
</if>
<if test= "inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()" >
and (t.inaccount_status != '1' or t.inaccount_status = '' or t.inaccount_status is null)
</if>
<if
test="fillInStartDate != null and fillInEndDate != null and fillInStartDate != '' and fillInEndDate != ''">
and t.fill_in_date between #{fillInStartDate} and #{fillInEndDate}
</if>
<if test= "taxAmount != null and taxAmount != '' and taxAmount != 'null'" >
and t.tax_amount = #{taxAmount}+0
</if>
<if test= "qsStatus != null and qsStatus != '' and qsStatus != 'null' and qsStatus != '99'" >
and t.qs_status = #{qsStatus}
</if>
<if
test="rzhYesorno != null and rzhYesorno != '' and rzhYesorno != 'null' and rzhYesorno != '99'">
and t.rzh_yesorno = #{rzhYesorno}
</if>
<if test= "bdkStatus != null and bdkStatus != '' and bdkStatus != 'null' and bdkStatus != '99'" >
and t.bdk_status = #{bdkStatus}
</if>
<if test= "confirmUser != null and confirmUser != '' and confirmUser != 'null' and confirmUser != 'admin'" >
and t.confirm_user like CONCAT(#{confirmUser},'%')
</if>
<if test= "confirmUser == 'admin'" >
and (t.confirm_user = #{confirmUser} or t.confirm_user is null or t.confirm_user = '') and t.auth_status = '4'
</if>
<if test= "glzt != null and glzt != '' and glzt != 'null' and glzt != '99'" >
and t.glzt = #{glzt}
</if>
<if
test="auditStatus != null and auditStatus != '' and auditStatus != 'null' and auditStatus != '99'">
and t.audit_status = #{auditStatus}
</if>
<if
test="applyCheck != null and applyCheck != '' and applyCheck != 'null' and applyCheck != '99'">
and t.apply_check = #{applyCheck}
</if>
<if
test="checkStatus != null and checkStatus != '' and checkStatus != 'null' and checkStatus != '99'">
and t.check_status = #{checkStatus}
</if>
<if
test="qsDateStartDate != null and qsDateEndDate != null and qsDateStartDate != '' and qsDateEndDate != ''">
and t.qs_date between #{qsDateStartDate} and #{qsDateEndDate}
</if>
<if
test="rzhStartDate != null and rzhEndDate != null and rzhStartDate != '' and rzhEndDate != ''">
and t.rzh_date between #{rzhStartDate} and #{rzhEndDate}
</if>
<if test= "rzhBelongDate != null and rzhBelongDate != '' and rzhBelongDate != 'null' " >
and t.rzh_belong_date = #{rzhBelongDate}
</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 close= "" collection= "business" index= "index" item= "item" open= "(" separator= "," >
#{item.businessCode}
</foreach>
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
</if>
</select>
<select databaseId= "oracle" id= "selectHjxx"
parameterType="java.util.Map" resultMap="HjResultMap">
select
count(1) hjsl,
sum(t.tax_amount) hjse
from t_dx_customs_record t
where export_mark = '0' and t.gf_tax_no in
<foreach close= ")" collection= "gfsh" index= "index" item= "item" open= "(" separator= "," >
#{item}
</foreach>
<if test= "customsCode != null and customsCode != '' and invoiceStatus != 'null'" >
and t.customs_code = #{customsCode}
</if>
<if
test="fillInStartDate != null and fillInEndDate != null and fillInStartDate != '' and fillInEndDate != ''">
and t.fill_in_date between to_date(#{fillInStartDate},'yyyy-mm-dd hh24:mi:ss') and
to_date(#{fillInEndDate},'yyyy-mm-dd hh24:mi:ss')
</if>
<if test= "taxAmount != null and taxAmount != '' and taxAmount != 'null'" >
and t.tax_amount = #{taxAmount}+0
</if>
<if test= "qsStatus != null and qsStatus != '' and qsStatus != 'null' and qsStatus != '99'" >
and t.qs_status = #{qsStatus}
</if>
<if
test="rzhYesorno != null and rzhYesorno != '' and rzhYesorno != 'null' and rzhYesorno != '99'">
and t.rzh_yesorno = #{rzhYesorno}
</if>
<if test= "rzlx != null and rzlx != '' and rzlx != 'null' and rzlx != '99'" >
and t.bdk_status = #{bdkStatus}
</if>
<if test= "confirmUser != null and confirmUser != '' and confirmUser != 'null' " >
and t.confirm_user like CONCAT(#{confirmUser},'%')
</if>
<if test= "glzt != null and glzt != '' and glzt != 'null' and glzt != '99'" >
and t.glzt = #{glzt}
</if>
<if
test="auditStatus != null and auditStatus != '' and auditStatus != 'null' and auditStatus != '99'">
and t.audit_status = #{auditStatus}
</if>
<if
test="applyCheck != null and applyCheck != '' and applyCheck != 'null' and applyCheck != '99'">
and t.apply_check = #{applyCheck}
</if>
<if
test="checkStatus != null and checkStatus != '' and checkStatus != 'null' and checkStatus != '99'">
and t.check_status = #{checkStatus}
</if>
<if
test="qsDateStartDate != null and qsDateEndDate != null and qsDateStartDate != '' and qsDateEndDate != ''">
and t.qs_date between to_date(#{qsDateStartDate},'yyyy-mm-dd hh24:mi:ss') and
to_date(#{qsDateEndDate},'yyyy-mm-dd hh24:mi:ss')
</if>
<if
test="rzhStartDate != null and rzhEndDate != null and rzhStartDate != '' and rzhEndDate != ''">
and t.rzh_date between to_date(#{rzhStartDate},'yyyy-mm-dd hh24:mi:ss') and
to_date(#{rzhEndDate},'yyyy-mm-dd hh24:mi:ss')
</if>
<if test= "rzhBelongDate != null and rzhBelongDate != '' and rzhBelongDate != 'null' " >
and t.rzh_belong_date = #{rzhBelongDate}
</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 close= "" collection= "business" index= "index" item= "item" open= "(" separator= "," >
#{item.businessCode}
</foreach>
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
</if>
</select>
</mapper>