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

132 lines
6.1 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.ViolationMapper">
<select id="selectViolation" resultType="com.dxhy.core.model.ViolationRespVO">
select DISTINCT t.id,t.xf_tax_no,t.penalize_date,t.break_law_type,t.break_law_method,t.input_date,d.xf_name
from t_dx_violation_taxno d right join t_dx_violation_log t on d.xf_tax_no=t.xf_tax_no
where d.company=#{company}
<if test="xfName !=null and xfName!=''">
and d.xf_name like concat('%',concat(#{xfName},'%'))
</if>
</select>
<select id="selectRiskSupplier" resultType="com.dxhy.core.model.RiskSupplierVO">
select xf_tax_no taxNo,xf_name taxName,count(1) invoiceNum,sum(total_amount) invoiceAmount
from t_dx_record_invoice
where create_date BETWEEN '2000-01-01 00:00:00' and #{currentTime}
and illegal_supplier = '1'
and gf_tax_no in
<foreach collection="gfsh" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
<if test="taxNo!=null and taxNo!=''">
and (xf_tax_no like concat('%',concat(#{taxNo},'%')) or xf_name like concat('%',concat(#{taxNo},'%')))
</if>
group by xf_tax_no
</select>
<select id="selectRiskInvoice" resultType="com.dxhy.core.model.BbfpzhcxRespVO">
select invoice_type,invoice_code,invoice_no,invoice_status,glzt,date_format(invoice_date,'%Y-%m-%d')
invoiceDate,
xf_tax_no xfsh,xf_name xfmc,invoice_amount,tax_amount,total_amount,dk_tax_amount,remark,rzh_yesorno rzzt,
bdk_status,illegal_supplier,illegal_enterprise from t_dx_record_invoice
where (glzt in ('1','2') or invoice_status !='0' or illegal_supplier='1' or illegal_enterprise='1')
and gf_tax_no in
<foreach collection="gfsh" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
<if test="searchKey!=null and searchKey!=''">
and (invoice_no like concat('%',concat(#{searchKey},'%'))
or invoice_code like concat('%',concat(#{searchKey},'%')) or xf_name like
concat('%',concat(#{searchKey},'%')))
</if>
<if test="invoiceDateStart!=null and invoiceDateStart!='' and invoiceDateEnd !=null and invoiceDateEnd !=''">
and invoice_date between #{invoiceDateStart} and #{invoiceDateEnd}
</if>
<if test="invoiceType !=null and invoiceType !=''">
and invoice_type = #{invoiceType}
</if>
<if test="invoiceStatus !=null and invoiceStatus !=''">
and invoice_status = #{invoiceStatus}
</if>
<if test="glzt!=null and glzt !='' and glzt!='0'.toString()">
and glzt = #{glzt}
</if>
<if test="glzt!=null and glzt !='' and glzt=='0'.toString()">
and (glzt ='0' or glzt is null or glzt = '')
</if>
<if test="rzzt!=null and rzzt!=''">
and rzh_yesorno = #{rzzt}
</if>
<if test="rzlx!=null and rzlx!=''">
and bdk_status = #{rzlx}
</if>
<if test="fxlx!=null and fxlx!='' and fxlx=='1'.toString()">
and illegal_supplier = '1'
</if>
<if test="fxlx!=null and fxlx!='' and fxlx=='2'.toString()">
and invoice_status != '0'
</if>
<if test="fxlx!=null and fxlx!='' and fxlx=='3'.toString()">
and glzt in ('1','2')
</if>
<if test="fxlx!=null and fxlx!='' and fxlx=='4'.toString()">
and illegal_enterprise = '1'
</if>
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
and invoice_source = #{invoiceSource}
</if>
order by invoice_date desc
</select>
<select id="selectRiskEnterpriseInvoice" resultType="com.dxhy.core.model.EnterpriseInfoVO">
select rule.*
from t_dx_enterprise_control_rules rule left join t_dx_record_invoice t
on t.uuid = rule.uuid
where (t.glzt in ('1','2') or t.invoice_status !='0' or t.illegal_supplier='1' or t.illegal_enterprise='1')
and t.gf_tax_no in
<foreach collection="gfsh" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
<if test="searchKey!=null and searchKey!=''">
and (t.invoice_no like concat('%',concat(#{searchKey},'%'))
or t.invoice_code like concat('%',concat(#{searchKey},'%')) or t.xf_name like
concat('%',concat(#{searchKey},'%')))
</if>
<if test="invoiceDateStart!=null and invoiceDateStart!='' and invoiceDateEnd !=null and invoiceDateEnd !=''">
and t.invoice_date between #{invoiceDateStart} and #{invoiceDateEnd}
</if>
<if test="invoiceType !=null and invoiceType !=''">
and t.invoice_type = #{invoiceType}
</if>
<if test="invoiceStatus !=null and invoiceStatus !=''">
and t.invoice_status = #{invoiceStatus}
</if>
<if test="glzt!=null and glzt !='' and glzt!='0'.toString()">
and t.glzt = #{glzt}
</if>
<if test="glzt!=null and glzt !='' and glzt=='0'.toString()">
and (t.glzt ='0' or t.glzt is null or t.glzt = '')
</if>
<if test="rzzt!=null and rzzt!=''">
and t.rzh_yesorno = #{rzzt}
</if>
<if test="rzlx!=null and rzlx!=''">
and t.bdk_status = #{rzlx}
</if>
<if test="fxlx!=null and fxlx!='' and fxlx=='1'.toString()">
and t.illegal_supplier = '1'
</if>
<if test="fxlx!=null and fxlx!='' and fxlx=='2'.toString()">
and t.invoice_status != '0'
</if>
<if test="fxlx!=null and fxlx!='' and fxlx=='3'.toString()">
and t.glzt in ('1','2')
</if>
<if test="fxlx!=null and fxlx!='' and fxlx=='4'.toString()">
and t.illegal_enterprise = '1'
</if>
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
and t.invoice_source = #{invoiceSource}
</if>
</select>
</mapper>