746 lines
52 KiB
XML
746 lines
52 KiB
XML
<?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.xdadan.erp.emis.mapper.EmisSettleInvoiceRecordMapper">
|
|
|
|
<resultMap type="EmisSettleInvoiceRecord" id="EmisSettleInvoiceRecordResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="applySeqNo" column="apply_seq_no" />
|
|
<result property="applyDate" column="apply_date" />
|
|
<result property="applyManCode" column="apply_man_code" />
|
|
<result property="applySiteCode" column="apply_site_code" />
|
|
<result property="customerCode" column="customer_code" />
|
|
<result property="customerName" column="customer_name" />
|
|
<result property="settleBillNo" column="settle_bill_no" />
|
|
<result property="settleBillName" column="settle_bill_name" />
|
|
<result property="applyMoney" column="apply_money" />
|
|
<result property="invoiceType" column="invoice_type" />
|
|
<result property="openbillScope" column="openbill_scope" />
|
|
<result property="companyName" column="company_name" />
|
|
<result property="companyTaxNo" column="company_tax_no" />
|
|
<result property="companyTel" column="company_tel" />
|
|
<result property="companyAddress" column="company_address" />
|
|
<result property="invioceRemark" column="invioce_remark" />
|
|
<result property="bankName" column="bank_name" />
|
|
<result property="bankAccNo" column="bank_acc_no" />
|
|
<result property="contact" column="contact" />
|
|
<result property="phone" column="phone" />
|
|
<result property="realTaxType" column="real_tax_type" />
|
|
<result property="origOpenMoney" column="orig_open_money" />
|
|
<result property="addTaxRate" column="add_tax_rate" />
|
|
<result property="addOpenMoney" column="add_open_money" />
|
|
<result property="openMoneyMax" column="open_money_max" />
|
|
<result property="openMoney" column="open_money" />
|
|
<result property="invoiceNo" column="invoice_no" />
|
|
<result property="recedMoney" column="reced_money" />
|
|
<result property="paymentStatus" column="payment_status" />
|
|
<result property="invoiceStatus" column="invoice_status" />
|
|
<result property="invoiceStatusDesc" column="invoice_status_desc" />
|
|
<result property="recieveAddress" column="recieve_address" />
|
|
<result property="email" column="email" />
|
|
<result property="filePath" column="file_path" />
|
|
<result property="blAudit" column="bl_audit" />
|
|
<result property="auditDate" column="audit_date" />
|
|
<result property="auditManCode" column="audit_man_code" />
|
|
<result property="auditSiteCode" column="audit_site_code" />
|
|
<result property="auditNote" column="audit_note" />
|
|
<result property="opManCode" column="op_man_code" />
|
|
<result property="opDate" column="op_date" />
|
|
<result property="opSiteCode" column="op_site_code" />
|
|
<result property="openChId" column="open_ch_id" />
|
|
<result property="openChStatus" column="open_ch_status" />
|
|
<result property="openChStatusDesc" column="open_ch_status_desc" />
|
|
<result property="openComCode" column="open_com_code" />
|
|
<result property="blDelay" column="bl_delay" />
|
|
<result property="delayOpManCode" column="delay_op_man_code" />
|
|
<result property="delayOpDate" column="delay_op_date" />
|
|
<result property="salerCompanyName" column="saler_company_name" />
|
|
|
|
<association property="applyManName" column="apply_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
|
|
<association property="applySiteName" column="apply_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
|
|
|
<association property="auditManName" column="audit_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
|
|
<association property="auditSiteName" column="audit_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
|
|
|
<association property="opManName" column="op_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
|
|
<association property="opSiteName" column="op_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
|
|
|
<association property="delayOpManName" column="delay_op_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
|
|
|
|
<association property="updateByName" column="update_by" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
|
|
|
|
</resultMap>
|
|
|
|
<!-- 简化版resultMap -->
|
|
<resultMap type="EmisSettleInvoiceRecord" id="EmisSettleInvoiceRecordSimpleResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="applySeqNo" column="apply_seq_no" />
|
|
<result property="applyDate" column="apply_date" />
|
|
<result property="applyManCode" column="apply_man_code" />
|
|
<result property="applyManName" column="apply_man_name" />
|
|
<result property="applyMoney" column="apply_money" />
|
|
<result property="opDate" column="op_date" />
|
|
<result property="opManCode" column="op_man_code" />
|
|
<result property="opManName" column="op_man_name" />
|
|
<result property="auditManCode" column="audit_man_code" />
|
|
<result property="auditManName" column="audit_man_name" />
|
|
<result property="companyName" column="company_name" />
|
|
<result property="invoiceNo" column="invoice_no" />
|
|
<result property="invoiceStatus" column="invoice_status" />
|
|
<result property="recedMoney" column="reced_money" />
|
|
<result property="paymentStatus" column="payment_status" />
|
|
<result property="settleBillNo" column="settle_bill_no" />
|
|
<result property="remark" column="remark" />
|
|
</resultMap>
|
|
|
|
<sql id="selectEmisSettleInvoiceRecordVo">
|
|
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, openbill_scope, company_name, company_tax_no, company_tel, company_address, invioce_remark, bank_name, bank_acc_no, contact, phone, real_tax_type, orig_open_money, add_tax_rate, add_open_money, open_money_max, open_money, invoice_no, reced_money, payment_status, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, audit_note, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, bl_delay, delay_op_man_code, delay_op_date, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_settle_invoice_record
|
|
</sql>
|
|
|
|
<select id="selectEmisSettleInvoiceRecordList" parameterType="EmisSettleInvoiceRecord" resultMap="EmisSettleInvoiceRecordResult">
|
|
|
|
select a.id, a.apply_seq_no, a.apply_date, a.apply_man_code, a.apply_site_code, a.customer_code, a.customer_name, a.settle_bill_no, a.settle_bill_name, a.apply_money, a.invoice_type, a.openbill_scope, a.company_name, a.company_tax_no, a.company_tel, a.company_address, a.invioce_remark, a.bank_name, a.bank_acc_no, a.contact, a.phone, a.real_tax_type, a.orig_open_money, a.add_tax_rate, a.add_open_money, a.open_money_max, a.open_money, ch.invoice_no, a.reced_money, a.payment_status, a.invoice_status, a.invoice_status_desc, a.recieve_address, a.email, a.file_path, a.remark, a.bl_audit, a.audit_date, a.audit_man_code, a.audit_site_code, a.audit_note, a.op_man_code, a.op_date, a.op_site_code, a.open_ch_id, a.open_ch_status, a.open_ch_status_desc, a.open_com_code, a.bl_delay, a.delay_op_man_code, a.delay_op_date, ch.saler_company_name, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.create_site, a.update_site
|
|
from emis_settle_invoice_record a
|
|
left join emis_settle_invoice_ch_record ch on a.apply_seq_no = ch.apply_seq_no and ch.del_flag = '0'
|
|
|
|
|
|
<where>
|
|
a.del_flag='0'
|
|
<if test="id != null "> and a.id = #{id}</if>
|
|
<if test="applySeqNo != null and applySeqNo != ''"> and a.apply_seq_no = #{applySeqNo}</if>
|
|
<if test="applyDate != null "> and a.apply_date = #{applyDate}</if>
|
|
<if test="applyManCode != null and applyManCode != ''"> and a.apply_man_code = #{applyManCode}</if>
|
|
<if test="applySiteCode != null and applySiteCode != ''"> and a.apply_site_code = #{applySiteCode}</if>
|
|
<if test="customerCode != null and customerCode != ''"> and a.customer_code = #{customerCode}</if>
|
|
<if test="customerName != null and customerName != ''"> and a.customer_name like concat('%', #{customerName}, '%')</if>
|
|
<if test="settleBillName != null and settleBillName != ''"> and a.settle_bill_name like concat('%', #{settleBillName}, '%')</if>
|
|
<if test="applyMoney != null "> and a.apply_money = #{applyMoney}</if>
|
|
<if test="paymentStatus != null and paymentStatus != ''"> and a.payment_status=#{paymentStatus}</if>
|
|
<if test="invoiceType != null and invoiceType != ''"> and a.invoice_type = #{invoiceType}</if>
|
|
<if test="companyName != null and companyName != ''"> and a.company_name like concat('%', #{companyName}, '%')</if>
|
|
<if test="companyTaxNo != null and companyTaxNo != ''"> and a.company_tax_no = #{companyTaxNo}</if>
|
|
<if test="companyTel != null and companyTel != ''"> and a.company_tel like concat('%', #{companyTel}, '%')</if>
|
|
<if test="companyAddress != null and companyAddress != ''"> and a.company_address like concat('%', #{companyAddress}, '%')</if>
|
|
<if test="bankName != null and bankName != ''"> and a.bank_name like concat('%', #{bankName}, '%')</if>
|
|
<if test="bankAccNo != null and bankAccNo != ''"> and a.bank_acc_no like concat('%', #{bankAccNo}, '%')</if>
|
|
<if test="contact != null and contact != ''"> and a.contact like concat('%', #{contact}, '%')</if>
|
|
<if test="phone != null and phone != ''"> and a.phone like concat('%', #{phone}, '%')</if>
|
|
<if test="realTaxType != null and realTaxType != ''"> and a.real_tax_type = #{realTaxType}</if>
|
|
<if test="openMoneyMax != null "> and a.open_money_max = #{openMoneyMax}</if>
|
|
<if test="openMoney != null "> and a.open_money = #{openMoney}</if>
|
|
<if test="invoiceNo != null and invoiceNo != ''"> and FIND_IN_SET(ch.invoice_no, REPLACE(#{invoiceNo}, '\n', ','))</if>
|
|
<if test="invoiceStatus != null and invoiceStatus != ''"> and a.invoice_status = #{invoiceStatus}</if>
|
|
<if test="invoiceStatusDesc != null and invoiceStatusDesc != ''"> and a.invoice_status_desc like concat('%', #{invoiceStatusDesc}, '%')</if>
|
|
<if test="recieveAddress != null and recieveAddress != ''"> and a.recieve_address like concat('%', #{recieveAddress}, '%')</if>
|
|
<if test="email != null and email != ''"> and a.email like concat('%', #{email}, '%')</if>
|
|
<if test="filePath != null and filePath != ''"> and a.file_path like concat('%', #{filePath}, '%')</if>
|
|
<if test="remark != null and remark != ''"> and a.remark like concat('%', #{remark}, '%')</if>
|
|
<if test="blAudit != null and blAudit != ''"> and a.bl_audit = #{blAudit}</if>
|
|
<if test="auditDate != null "> and a.audit_date = #{auditDate}</if>
|
|
<if test="auditManCode != null and auditManCode != ''"> and a.audit_man_code like concat('%', #{auditManCode}, '%')</if>
|
|
<if test="auditSiteCode != null and auditSiteCode != ''"> and a.audit_site_code like concat('%', #{auditSiteCode}, '%')</if>
|
|
<if test="opManCode != null and opManCode != ''"> and a.op_man_code like concat('%', #{opManCode}, '%')</if>
|
|
<if test="opDate != null "> and a.op_date = #{opDate}</if>
|
|
<if test="opSiteCode != null and opSiteCode != ''"> and a.op_site_code = #{opSiteCode}</if>
|
|
<if test="openChId != null and openChId != ''"> and a.open_ch_id = #{openChId}</if>
|
|
<if test="openChStatus != null and openChStatus != ''"> and a.open_ch_status = #{openChStatus}</if>
|
|
<if test="openChStatusDesc != null and openChStatusDesc != ''"> and a.open_ch_status_desc = #{openChStatusDesc}</if>
|
|
<if test="openComCode != null and openComCode != ''"> and a.open_com_code = #{openComCode}</if>
|
|
<if test="blDelay != null and blDelay != ''"> and a.bl_delay = #{blDelay}</if>
|
|
<if test="salerCompanyName != null and salerCompanyName != ''"> and ch.saler_company_name like concat('%', #{salerCompanyName}, '%')</if>
|
|
<if test="delFlag != null and delFlag != ''"> and a.del_flag like concat('%', #{delFlag}, '%')</if>
|
|
<if test="createBy != null and createBy != ''"> and a.create_by like concat('%', #{createBy}, '%')</if>
|
|
<if test="createTime != null "> and a.create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and a.update_by like concat('%', #{updateBy}, '%')</if>
|
|
<if test="updateTime != null "> and a.update_time = #{updateTime}</if>
|
|
<if test="createSite != null and createSite != ''"> and a.create_site like concat('%', #{createSite}, '%')</if>
|
|
<if test="updateSite != null and updateSite != ''"> and a.update_site like concat('%', #{updateSite}, '%')</if>
|
|
|
|
|
|
<if test="settleBillNo != null and settleBillNo != ''">
|
|
<!--
|
|
AND apply_seq_no IN (
|
|
SELECT x1.apply_seq_no FROM
|
|
emis_settle_invoice_record x1,
|
|
emis_settle_bill x2
|
|
WHERE
|
|
x1.del_flag = '0'
|
|
AND x2.del_flag = '0'
|
|
AND FIND_IN_SET( x2.settle_bill_no, x1.settle_bill_no )
|
|
AND FIND_IN_SET( x2.settle_bill_no, #{settleBillNo})
|
|
) -->
|
|
and EXISTS(
|
|
select 1 from emis_settle_invoice_bill_rel x3
|
|
where x3.del_flag = '0'
|
|
and a.apply_seq_no=x3.apply_seq_no
|
|
AND FIND_IN_SET(x3.settle_bill_no, #{settleBillNo})
|
|
)
|
|
</if>
|
|
|
|
|
|
<if test="params.billCode != null and params.billCode != ''">
|
|
|
|
and EXISTS(
|
|
select 1 from emis_settle_invoice_rel rel
|
|
where rel.del_flag = '0' and rel.bill_no=#{params.billCode}
|
|
and rel.apply_seq_no = a.apply_seq_no
|
|
)
|
|
|
|
|
|
<!--
|
|
AND apply_seq_no IN (
|
|
SELECT x1.apply_seq_no FROM
|
|
emis_settle_invoice_record x1,
|
|
emis_settle_bill x2
|
|
WHERE
|
|
x1.del_flag = '0'
|
|
AND x2.del_flag = '0'
|
|
AND FIND_IN_SET( x2.settle_bill_no, x1.settle_bill_no )
|
|
AND exists (
|
|
select 1 from emis_settle_sub_bill b
|
|
where x2.settle_bill_no=b.settle_bill_no
|
|
and ( FIND_IN_SET(b.`bill_code`,#{params.billCode}) )
|
|
)
|
|
)
|
|
-->
|
|
|
|
|
|
</if>
|
|
|
|
<if test="params.beginApplyDate != null and params.beginApplyDate != ''">
|
|
and a.apply_date <![CDATA[ >= ]]> #{params.beginCreateTime}
|
|
</if>
|
|
<if test="params.endApplyDate != null and params.endApplyDate != ''">
|
|
and a.apply_date <![CDATA[ <= ]]> #{params.endCreateTime}
|
|
</if>
|
|
|
|
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
|
|
and a.create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
|
|
</if>
|
|
<if test="params.endCreateTime != null and params.endCreateTime != ''">
|
|
and a.create_time <![CDATA[ <= ]]> #{params.endCreateTime}
|
|
</if>
|
|
|
|
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
|
|
|
and EXISTS(
|
|
select 1 from emis_settle_bill x2,emis_settle_invoice_bill_rel x3
|
|
where x2.del_flag = '0' and x3.del_flag = '0'
|
|
and a.apply_seq_no=x3.apply_seq_no and x2.settle_bill_no=x3.settle_bill_no
|
|
AND (
|
|
x2.salesmen = #{params.privEmpName}
|
|
OR x2.payee = #{params.privEmpName}
|
|
OR x2.salesmen IN (
|
|
SELECT salesmen
|
|
FROM emis_salesmen_rel esr
|
|
where esr.del_flag='0' and esr.bl_open='1'
|
|
and now() <![CDATA[ >= ]]> esr.start_date and now() <![CDATA[ <= ]]> esr.end_date
|
|
and esr.sales_ass = #{params.privEmpName}
|
|
)
|
|
)
|
|
)
|
|
|
|
</if>
|
|
|
|
</where>
|
|
order by a.create_time desc
|
|
</select>
|
|
|
|
<select id="selectSimpleInvoiceRecordList" parameterType="EmisSettleInvoiceRecord"
|
|
resultMap="EmisSettleInvoiceRecordSimpleResult">
|
|
select a.id, a.apply_seq_no, a.apply_date, a.apply_man_code, a.apply_site_code, a.customer_code,
|
|
a.customer_name, a.settle_bill_no, a.settle_bill_name, a.apply_money, a.invoice_type, a.openbill_scope,
|
|
a.company_name, a.company_tax_no, a.company_tel, a.company_address, a.invioce_remark, a.bank_name,
|
|
a.bank_acc_no, a.contact, a.phone, a.real_tax_type, a.orig_open_money, a.add_tax_rate, a.add_open_money,
|
|
a.open_money_max, a.open_money, ch.invoice_no, a.reced_money, a.payment_status, a.invoice_status,
|
|
a.invoice_status_desc, a.recieve_address, a.email, a.file_path, a.remark, a.bl_audit, a.audit_date,
|
|
a.audit_man_code, a.audit_site_code, a.audit_note, a.op_man_code, a.op_date, a.op_site_code, a.open_ch_id,
|
|
a.open_ch_status, a.open_ch_status_desc, a.open_com_code, a.bl_delay, a.delay_op_man_code, a.delay_op_date, ch.saler_company_name, a.del_flag, a.create_by, a.create_time, a.update_by,
|
|
a.update_time, a.create_site, a.update_site,
|
|
apply_user.emp_name as apply_man_name,
|
|
audit_user.emp_name as audit_man_name,
|
|
op_user.emp_name as op_man_name,
|
|
delay_op_user.emp_name as delay_op_man_name
|
|
from emis_settle_invoice_record a
|
|
left join emis_settle_invoice_ch_record ch on a.apply_seq_no = ch.apply_seq_no and ch.del_flag = '0'
|
|
left join sys_user apply_user on a.apply_man_code = apply_user.emp_code
|
|
left join sys_user audit_user on a.audit_man_code = audit_user.emp_code
|
|
left join sys_user op_user on a.op_man_code = op_user.emp_code
|
|
left join sys_user delay_op_user on a.delay_op_man_code = delay_op_user.emp_code
|
|
<where>
|
|
a.del_flag='0'
|
|
<if test="id != null "> and a.id = #{id}</if>
|
|
<if test="applySeqNo != null and applySeqNo != ''"> and a.apply_seq_no = #{applySeqNo}</if>
|
|
<if test="applyDate != null "> and a.apply_date = #{applyDate}</if>
|
|
<if test="applyManCode != null and applyManCode != ''"> and a.apply_man_code = #{applyManCode}</if>
|
|
<if test="applySiteCode != null and applySiteCode != ''"> and a.apply_site_code = #{applySiteCode}</if>
|
|
<if test="customerCode != null and customerCode != ''"> and a.customer_code = #{customerCode}</if>
|
|
<if test="customerName != null and customerName != ''"> and a.customer_name like concat('%', #{customerName}, '%')</if>
|
|
<if test="settleBillName != null and settleBillName != ''"> and a.settle_bill_name like concat('%', #{settleBillName}, '%')</if>
|
|
<if test="applyMoney != null "> and a.apply_money = #{applyMoney}</if>
|
|
<if test="paymentStatus != null and paymentStatus != ''"> and a.payment_status=#{paymentStatus}</if>
|
|
<if test="invoiceType != null and invoiceType != ''"> and a.invoice_type = #{invoiceType}</if>
|
|
<if test="companyName != null and companyName != ''"> and a.company_name like concat('%', #{companyName}, '%')</if>
|
|
<if test="companyTaxNo != null and companyTaxNo != ''"> and a.company_tax_no = #{companyTaxNo}</if>
|
|
<if test="companyTel != null and companyTel != ''"> and a.company_tel like concat('%', #{companyTel}, '%')</if>
|
|
<if test="companyAddress != null and companyAddress != ''"> and a.company_address like concat('%', #{companyAddress}, '%')</if>
|
|
<if test="bankName != null and bankName != ''"> and a.bank_name like concat('%', #{bankName}, '%')</if>
|
|
<if test="bankAccNo != null and bankAccNo != ''"> and a.bank_acc_no like concat('%', #{bankAccNo}, '%')</if>
|
|
<if test="contact != null and contact != ''"> and a.contact like concat('%', #{contact}, '%')</if>
|
|
<if test="phone != null and phone != ''"> and a.phone like concat('%', #{phone}, '%')</if>
|
|
<if test="realTaxType != null and realTaxType != ''"> and a.real_tax_type = #{realTaxType}</if>
|
|
<if test="openMoneyMax != null "> and a.open_money_max = #{openMoneyMax}</if>
|
|
<if test="openMoney != null "> and a.open_money = #{openMoney}</if>
|
|
<if test="invoiceNo != null and invoiceNo != ''"> and FIND_IN_SET(ch.invoice_no, REPLACE(#{invoiceNo}, '\n', ','))</if>
|
|
<if test="invoiceStatus != null and invoiceStatus != ''"> and a.invoice_status = #{invoiceStatus}</if>
|
|
<if test="invoiceStatusDesc != null and invoiceStatusDesc != ''"> and a.invoice_status_desc like concat('%', #{invoiceStatusDesc}, '%')</if>
|
|
<if test="recieveAddress != null and recieveAddress != ''"> and a.recieve_address like concat('%', #{recieveAddress}, '%')</if>
|
|
<if test="email != null and email != ''"> and a.email like concat('%', #{email}, '%')</if>
|
|
<if test="filePath != null and filePath != ''"> and a.file_path like concat('%', #{filePath}, '%')</if>
|
|
<if test="remark != null and remark != ''"> and a.remark like concat('%', #{remark}, '%')</if>
|
|
<if test="blAudit != null and blAudit != ''"> and a.bl_audit = #{blAudit}</if>
|
|
<if test="auditDate != null "> and a.audit_date = #{auditDate}</if>
|
|
<if test="auditManCode != null and auditManCode != ''"> and a.audit_man_code like concat('%', #{auditManCode}, '%')</if>
|
|
<if test="auditSiteCode != null and auditSiteCode != ''"> and a.audit_site_code like concat('%', #{auditSiteCode}, '%')</if>
|
|
<if test="opManCode != null and opManCode != ''"> and a.op_man_code like concat('%', #{opManCode}, '%')</if>
|
|
<if test="opDate != null "> and a.op_date = #{opDate}</if>
|
|
<if test="opSiteCode != null and opSiteCode != ''"> and a.op_site_code = #{opSiteCode}</if>
|
|
<if test="openChId != null and openChId != ''"> and a.open_ch_id = #{openChId}</if>
|
|
<if test="openChStatus != null and openChStatus != ''"> and a.open_ch_status = #{openChStatus}</if>
|
|
<if test="openChStatusDesc != null and openChStatusDesc != ''"> and a.open_ch_status_desc = #{openChStatusDesc}</if>
|
|
<if test="openComCode != null and openComCode != ''"> and a.open_com_code = #{openComCode}</if>
|
|
<if test="blDelay != null and blDelay != ''"> and a.bl_delay = #{blDelay}</if>
|
|
<if test="salerCompanyName != null and salerCompanyName != ''"> and ch.saler_company_name like concat('%', #{salerCompanyName}, '%')</if>
|
|
<if test="delFlag != null and delFlag != ''"> and a.del_flag like concat('%', #{delFlag}, '%')</if>
|
|
<if test="createBy != null and createBy != ''"> and a.create_by like concat('%', #{createBy}, '%')</if>
|
|
<if test="createTime != null "> and a.create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and a.update_by like concat('%', #{updateBy}, '%')</if>
|
|
<if test="updateTime != null "> and a.update_time = #{updateTime}</if>
|
|
<if test="createSite != null and createSite != ''"> and a.create_site like concat('%', #{createSite}, '%')</if>
|
|
<if test="updateSite != null and updateSite != ''"> and a.update_site like concat('%', #{updateSite}, '%')</if>
|
|
|
|
<if test="settleBillNo != null and settleBillNo != ''">
|
|
and EXISTS(
|
|
select 1 from emis_settle_invoice_bill_rel x3
|
|
where x3.del_flag = '0'
|
|
and a.apply_seq_no=x3.apply_seq_no
|
|
AND FIND_IN_SET(x3.settle_bill_no, #{settleBillNo})
|
|
)
|
|
</if>
|
|
|
|
<if test="params.billCode != null and params.billCode != ''">
|
|
and EXISTS(
|
|
select 1 from emis_settle_invoice_rel rel
|
|
where rel.del_flag = '0' and rel.bill_no=#{params.billCode}
|
|
and rel.apply_seq_no = a.apply_seq_no
|
|
)
|
|
</if>
|
|
|
|
<if test="params.beginApplyDate != null and params.beginApplyDate != ''">
|
|
and a.apply_date <![CDATA[ >= ]]> #{params.beginCreateTime}
|
|
</if>
|
|
<if test="params.endApplyDate != null and params.endApplyDate != ''">
|
|
and a.apply_date <![CDATA[ <= ]]> #{params.endCreateTime}
|
|
</if>
|
|
|
|
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
|
|
and a.create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
|
|
</if>
|
|
<if test="params.endCreateTime != null and params.endCreateTime != ''">
|
|
and a.create_time <![CDATA[ <= ]]> #{params.endCreateTime}
|
|
</if>
|
|
|
|
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
|
and EXISTS(
|
|
select 1 from emis_settle_bill x2,emis_settle_invoice_bill_rel x3
|
|
where x2.del_flag = '0' and x3.del_flag = '0'
|
|
and a.apply_seq_no=x3.apply_seq_no and x2.settle_bill_no=x3.settle_bill_no
|
|
AND (
|
|
x2.salesmen = #{params.privEmpName}
|
|
OR x2.payee = #{params.privEmpName}
|
|
OR x2.salesmen IN (
|
|
SELECT salesmen
|
|
FROM emis_salesmen_rel esr
|
|
where esr.del_flag='0' and esr.bl_open='1'
|
|
and now() <![CDATA[ >= ]]> esr.start_date and now() <![CDATA[ <= ]]> esr.end_date
|
|
and esr.sales_ass = #{params.privEmpName}
|
|
)
|
|
)
|
|
)
|
|
</if>
|
|
|
|
</where>
|
|
order by a.create_time desc
|
|
</select>
|
|
|
|
<select id="selectInvoiceRecordListBySettleBillNo" parameterType="String" resultMap="EmisSettleInvoiceRecordResult">
|
|
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, audit_note, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, bl_delay, delay_op_man_code, delay_op_date, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_settle_invoice_record a
|
|
where del_flag = '0' and FIND_IN_SET( a.settle_bill_no,#{settleBillNo} )
|
|
</select>
|
|
|
|
<select id="selectInvoiceRecordByApplySeqNo" parameterType="String" resultMap="EmisSettleInvoiceRecordResult">
|
|
select id, apply_seq_no, apply_date, apply_man_code, apply_site_code, customer_code, customer_name, settle_bill_no, settle_bill_name, apply_money, invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, real_tax_type, open_money_max, open_money,reced_money, invoice_no, invoice_status, invoice_status_desc, recieve_address, email, file_path, remark, bl_audit, audit_date, audit_man_code, audit_site_code, audit_note, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, bl_delay, delay_op_man_code, delay_op_date, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_settle_invoice_record a
|
|
where a.apply_seq_no = #{applySeqNo}
|
|
</select>
|
|
|
|
<select id="selectInvoiceRecordListByBillCodes" parameterType="java.util.List" resultMap="EmisSettleInvoiceRecordResult">
|
|
select distinct a.id, a.apply_seq_no, a.apply_date, a.apply_man_code, a.apply_site_code, a.customer_code, a.customer_name, a.settle_bill_no, a.settle_bill_name, a.apply_money, a.invoice_type, a.openbill_scope, a.company_name, a.company_tax_no, a.company_tel, a.company_address, a.invioce_remark, a.bank_name, a.bank_acc_no, a.contact, a.phone, a.real_tax_type, a.orig_open_money, a.add_tax_rate, a.add_open_money, a.open_money_max, a.open_money, ch.invoice_no, a.reced_money, a.payment_status, a.invoice_status, a.invoice_status_desc, a.recieve_address, a.email, a.file_path, a.remark, a.bl_audit, a.audit_date, a.audit_man_code, a.audit_site_code, a.audit_note, a.op_man_code, a.op_date, a.op_site_code, a.open_ch_id, a.open_ch_status, a.open_ch_status_desc, a.open_com_code, a.bl_delay, a.delay_op_man_code, a.delay_op_date, ch.saler_company_name, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.create_site, a.update_site
|
|
from emis_settle_invoice_record a
|
|
left join emis_settle_invoice_ch_record ch on a.apply_seq_no = ch.apply_seq_no and ch.del_flag = '0'
|
|
where a.del_flag = '0'
|
|
and exists (
|
|
select 1 from emis_settle_invoice_rel rel
|
|
where rel.del_flag = '0'
|
|
and rel.apply_seq_no = a.apply_seq_no
|
|
and rel.bill_no in
|
|
<foreach item="billCode" collection="billCodes" open="(" separator="," close=")">
|
|
#{billCode}
|
|
</foreach>
|
|
)
|
|
order by a.invoice_no, a.apply_seq_no
|
|
</select>
|
|
|
|
<!-- 检查是否有重复太抬头开票,未审核 -->
|
|
<select id="checkOpenBillRepeat" parameterType="EmisSettleInvoiceRecord" resultType="int">
|
|
select count(1) from emis_settle_invoice_record
|
|
where del_flag='0'
|
|
and settle_bill_no = #{settleBillNo}
|
|
and apply_money = #{applyMoney}
|
|
and invoice_type = #{invoiceType}
|
|
and company_tax_no = #{companyTaxNo}
|
|
<if test="remark != null and remark != ''">
|
|
and remark = #{remark}
|
|
</if>
|
|
and bl_audit = '0'
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="checkUnique" parameterType="EmisSettleInvoiceRecord" resultType="int">
|
|
select count(1) from emis_settle_invoice_record
|
|
where del_flag='0'
|
|
and id = #{id}
|
|
and apply_seq_no = #{applySeqNo}
|
|
and apply_date = #{applyDate}
|
|
and apply_man_code = #{applyManCode}
|
|
and apply_site_code = #{applySiteCode}
|
|
and customer_code = #{customerCode}
|
|
and customer_name = #{customerName}
|
|
and settle_bill_no = #{settleBillNo}
|
|
and settle_bill_name = #{settleBillName}
|
|
and apply_money = #{applyMoney}
|
|
and invoice_type = #{invoiceType}
|
|
and company_name = #{companyName}
|
|
and company_tax_no = #{companyTaxNo}
|
|
and company_tel = #{companyTel}
|
|
and company_address = #{companyAddress}
|
|
and bank_name = #{bankName}
|
|
and bank_acc_no = #{bankAccNo}
|
|
and contact = #{contact}
|
|
and phone = #{phone}
|
|
and real_tax_type = #{realTaxType}
|
|
and open_money_max = #{openMoneyMax}
|
|
and open_money = #{openMoney}
|
|
and invoice_no = #{invoiceNo}
|
|
and invoice_status = #{invoiceStatus}
|
|
and invoice_status_desc = #{invoiceStatusDesc}
|
|
and recieve_address = #{recieveAddress}
|
|
and email = #{email}
|
|
and file_path = #{filePath}
|
|
and remark = #{remark}
|
|
and bl_audit = #{blAudit}
|
|
and audit_date = #{auditDate}
|
|
and audit_man_code = #{auditManCode}
|
|
and audit_site_code = #{auditSiteCode}
|
|
and op_man_code = #{opManCode}
|
|
and op_date = #{opDate}
|
|
and op_site_code = #{opSiteCode}
|
|
and open_ch_id = #{openChId}
|
|
and open_ch_status = #{openChStatus}
|
|
and open_ch_status_desc = #{openChStatusDesc}
|
|
and open_com_code = #{openComCode}
|
|
and del_flag = #{delFlag}
|
|
and create_by = #{createBy}
|
|
and create_time = #{createTime}
|
|
and update_by = #{updateBy}
|
|
and update_time = #{updateTime}
|
|
and create_site = #{createSite}
|
|
and update_site = #{updateSite}
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="selectEmisSettleInvoiceRecordById" parameterType="Long" resultMap="EmisSettleInvoiceRecordResult">
|
|
select a.id, a.apply_seq_no, a.apply_date, a.apply_man_code, a.apply_site_code, a.customer_code, a.customer_name, a.settle_bill_no, a.settle_bill_name, a.apply_money, a.invoice_type, a.openbill_scope, a.company_name, a.company_tax_no, a.company_tel, a.company_address, a.invioce_remark, a.bank_name, a.bank_acc_no, a.contact, a.phone, a.real_tax_type, a.orig_open_money, a.add_tax_rate, a.add_open_money, a.open_money_max, a.open_money, a.invoice_no, a.invoice_status, a.invoice_status_desc, a.recieve_address, a.email, a.file_path, a.remark, a.bl_audit, a.audit_date, a.audit_man_code, a.audit_site_code, a.audit_note, a.op_man_code, a.op_date, a.op_site_code, a.open_ch_id, a.open_ch_status, a.open_ch_status_desc, a.open_com_code, a.bl_delay, a.delay_op_man_code, a.delay_op_date, ch.saler_company_name, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.create_site, a.update_site
|
|
from emis_settle_invoice_record a
|
|
left join emis_settle_invoice_ch_record ch on a.apply_seq_no = ch.apply_seq_no and ch.del_flag = '0'
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisSettleInvoiceRecord" parameterType="EmisSettleInvoiceRecord" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_settle_invoice_record
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="applySeqNo != null and applySeqNo != ''">apply_seq_no,</if>
|
|
<if test="applyDate != null">apply_date,</if>
|
|
<if test="applyManCode != null and applyManCode != ''">apply_man_code,</if>
|
|
<if test="applySiteCode != null and applySiteCode != ''">apply_site_code,</if>
|
|
<if test="customerCode != null and customerCode != ''">customer_code,</if>
|
|
<if test="customerName != null and customerName != ''">customer_name,</if>
|
|
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no,</if>
|
|
<if test="settleBillName != null and settleBillName != ''">settle_bill_name,</if>
|
|
<if test="applyMoney != null">apply_money,</if>
|
|
<if test="invoiceType != null and invoiceType != ''">invoice_type,</if>
|
|
<if test="openbillScope != null and openbillScope != ''">openbill_scope,</if>
|
|
<if test="companyName != null and companyName != ''">company_name,</if>
|
|
<if test="companyTaxNo != null and companyTaxNo != ''">company_tax_no,</if>
|
|
<if test="companyTel != null and companyTel != ''">company_tel,</if>
|
|
<if test="companyAddress != null and companyAddress != ''">company_address,</if>
|
|
<if test="invioceRemark != null and invioceRemark != ''">invioce_remark,</if>
|
|
<if test="bankName != null and bankName != ''">bank_name,</if>
|
|
<if test="bankAccNo != null and bankAccNo != ''">bank_acc_no,</if>
|
|
<if test="contact != null and contact != ''">contact,</if>
|
|
<if test="phone != null and phone != ''">phone,</if>
|
|
<if test="realTaxType != null and realTaxType != ''">real_tax_type,</if>
|
|
<if test="origOpenMoney != null">orig_open_money,</if>
|
|
<if test="addTaxRate != null">add_tax_rate,</if>
|
|
<if test="addOpenMoney != null">add_open_money,</if>
|
|
<if test="openMoneyMax != null">open_money_max,</if>
|
|
<if test="openMoney != null">open_money,</if>
|
|
<if test="invoiceNo != null and invoiceNo != ''">invoice_no,</if>
|
|
<if test="invoiceStatus != null and invoiceStatus != ''">invoice_status,</if>
|
|
<if test="invoiceStatusDesc != null and invoiceStatusDesc != ''">invoice_status_desc,</if>
|
|
<if test="recieveAddress != null and recieveAddress != ''">recieve_address,</if>
|
|
<if test="email != null and email != ''">email,</if>
|
|
<if test="filePath != null and filePath != ''">file_path,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="blAudit != null and blAudit != ''">bl_audit,</if>
|
|
<if test="auditDate != null">audit_date,</if>
|
|
<if test="auditManCode != null and auditManCode != ''">audit_man_code,</if>
|
|
<if test="auditSiteCode != null and auditSiteCode != ''">audit_site_code,</if>
|
|
<if test="auditNote != null and auditNote != ''">audit_note,</if>
|
|
<if test="opManCode != null and opManCode != ''">op_man_code,</if>
|
|
<if test="opDate != null">op_date,</if>
|
|
<if test="opSiteCode != null and opSiteCode != ''">op_site_code,</if>
|
|
<if test="openChId != null and openChId != ''">open_ch_id,</if>
|
|
<if test="openChStatus != null and openChStatus != ''">open_ch_status,</if>
|
|
<if test="openChStatusDesc != null and openChStatusDesc != ''">open_ch_status_desc,</if>
|
|
<if test="openComCode != null and openComCode != ''">open_com_code,</if>
|
|
<if test="blDelay != null and blDelay != ''">bl_delay,</if>
|
|
<if test="delayOpManCode != null and delayOpManCode != ''">delay_op_man_code,</if>
|
|
<if test="delayOpDate != null">delay_op_date,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
|
<if test="paymentStatus != null and paymentStatus != ''">payment_status,</if>
|
|
<if test="recedMoney != null">reced_money,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="applySeqNo != null and applySeqNo != ''">#{applySeqNo},</if>
|
|
<if test="applyDate != null">#{applyDate},</if>
|
|
<if test="applyManCode != null and applyManCode != ''">#{applyManCode},</if>
|
|
<if test="applySiteCode != null and applySiteCode != ''">#{applySiteCode},</if>
|
|
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
|
|
<if test="customerName != null and customerName != ''">#{customerName},</if>
|
|
<if test="settleBillNo != null and settleBillNo != ''">#{settleBillNo},</if>
|
|
<if test="settleBillName != null and settleBillName != ''">#{settleBillName},</if>
|
|
<if test="applyMoney != null">#{applyMoney},</if>
|
|
<if test="invoiceType != null and invoiceType != ''">#{invoiceType},</if>
|
|
<if test="openbillScope != null and openbillScope != ''">#{openbillScope},</if>
|
|
<if test="companyName != null and companyName != ''">#{companyName},</if>
|
|
<if test="companyTaxNo != null and companyTaxNo != ''">#{companyTaxNo},</if>
|
|
<if test="companyTel != null and companyTel != ''">#{companyTel},</if>
|
|
<if test="companyAddress != null and companyAddress != ''">#{companyAddress},</if>
|
|
<if test="invioceRemark != null and invioceRemark != ''">#{invioceRemark},</if>
|
|
<if test="bankName != null and bankName != ''">#{bankName},</if>
|
|
<if test="bankAccNo != null and bankAccNo != ''">#{bankAccNo},</if>
|
|
<if test="contact != null and contact != ''">#{contact},</if>
|
|
<if test="phone != null and phone != ''">#{phone},</if>
|
|
<if test="realTaxType != null and realTaxType != ''">#{realTaxType},</if>
|
|
<if test="origOpenMoney != null">#{origOpenMoney},</if>
|
|
<if test="addTaxRate != null">#{addTaxRate},</if>
|
|
<if test="addOpenMoney != null">#{addOpenMoney},</if>
|
|
<if test="openMoneyMax != null">#{openMoneyMax},</if>
|
|
<if test="openMoney != null">#{openMoney},</if>
|
|
<if test="invoiceNo != null and invoiceNo != ''">#{invoiceNo},</if>
|
|
<if test="invoiceStatus != null and invoiceStatus != ''">#{invoiceStatus},</if>
|
|
<if test="invoiceStatusDesc != null and invoiceStatusDesc != ''">#{invoiceStatusDesc},</if>
|
|
<if test="recieveAddress != null and recieveAddress != ''">#{recieveAddress},</if>
|
|
<if test="email != null and email != ''">#{email},</if>
|
|
<if test="filePath != null and filePath != ''">#{filePath},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="blAudit != null and blAudit != ''">#{blAudit},</if>
|
|
<if test="auditDate != null">#{auditDate},</if>
|
|
<if test="auditManCode != null and auditManCode != ''">#{auditManCode},</if>
|
|
<if test="auditSiteCode != null and auditSiteCode != ''">#{auditSiteCode},</if>
|
|
<if test="auditNote != null and auditNote != ''">#{auditNote},</if>
|
|
<if test="opManCode != null and opManCode != ''">#{opManCode},</if>
|
|
<if test="opDate != null">#{opDate},</if>
|
|
<if test="opSiteCode != null and opSiteCode != ''">#{opSiteCode},</if>
|
|
<if test="openChId != null and openChId != ''">#{openChId},</if>
|
|
<if test="openChStatus != null and openChStatus != ''">#{openChStatus},</if>
|
|
<if test="openChStatusDesc != null and openChStatusDesc != ''">#{openChStatusDesc},</if>
|
|
<if test="openComCode != null and openComCode != ''">#{openComCode},</if>
|
|
<if test="blDelay != null and blDelay != ''">#{blDelay},</if>
|
|
<if test="delayOpManCode != null and delayOpManCode != ''">#{delayOpManCode},</if>
|
|
<if test="delayOpDate != null">#{delayOpDate},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
|
<if test="paymentStatus != null and paymentStatus != ''">#{paymentStatus},</if>
|
|
<if test="recedMoney != null">#{recedMoney},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
|
|
<insert id="insertInvoiceRecordBillRel">
|
|
insert into emis_settle_invoice_bill_rel(apply_seq_no,settle_bill_no)
|
|
values(#{applySeqNo},#{settleBillNo})
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateEmisSettleInvoiceRecord" parameterType="EmisSettleInvoiceRecord">
|
|
update emis_settle_invoice_record
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="applyDate != null">apply_date = #{applyDate},</if>
|
|
<if test="applyManCode != null and applyManCode != ''">apply_man_code = #{applyManCode},</if>
|
|
<if test="applySiteCode != null and applySiteCode != ''">apply_site_code = #{applySiteCode},</if>
|
|
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
|
|
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
|
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no = #{settleBillNo},</if>
|
|
<if test="settleBillName != null and settleBillName != ''">settle_bill_name = #{settleBillName},</if>
|
|
<if test="applyMoney != null">apply_money = #{applyMoney},</if>
|
|
<if test="invoiceType != null and invoiceType != ''">invoice_type = #{invoiceType},</if>
|
|
<if test="openbillScope != null and openbillScope != ''">openbill_scope = #{openbillScope},</if>
|
|
<if test="companyName != null and companyName != ''">company_name = #{companyName},</if>
|
|
<if test="companyTaxNo != null and companyTaxNo != ''">company_tax_no = #{companyTaxNo},</if>
|
|
<if test="companyTel != null and companyTel != ''">company_tel = #{companyTel},</if>
|
|
<if test="companyAddress != null and companyAddress != ''">company_address = #{companyAddress},</if>
|
|
<if test="invioceRemark != null and invioceRemark != ''">invioce_remark = #{invioceRemark},</if>
|
|
<if test="bankName != null and bankName != ''">bank_name = #{bankName},</if>
|
|
<if test="bankAccNo != null and bankAccNo != ''">bank_acc_no = #{bankAccNo},</if>
|
|
<if test="contact != null and contact != ''">contact = #{contact},</if>
|
|
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
|
<if test="realTaxType != null and realTaxType != ''">real_tax_type = #{realTaxType},</if>
|
|
<if test="origOpenMoney != null">orig_open_money = #{origOpenMoney},</if>
|
|
<if test="addTaxRate != null">add_tax_rate = #{addTaxRate},</if>
|
|
<if test="addOpenMoney != null">add_open_money = #{addOpenMoney},</if>
|
|
<if test="openMoneyMax != null">open_money_max = #{openMoneyMax},</if>
|
|
<if test="openMoney != null">open_money = #{openMoney},</if>
|
|
<if test="invoiceNo != null and invoiceNo != ''">invoice_no = #{invoiceNo},</if>
|
|
<if test="recedMoney != null">reced_money = #{recedMoney},</if>
|
|
<if test="paymentStatus != null and paymentStatus != ''">payment_status = #{paymentStatus},</if>
|
|
<if test="invoiceStatus != null and invoiceStatus != ''">invoice_status = #{invoiceStatus},</if>
|
|
<if test="invoiceStatusDesc != null and invoiceStatusDesc != ''">invoice_status_desc = #{invoiceStatusDesc},</if>
|
|
<if test="recieveAddress != null and recieveAddress != ''">recieve_address = #{recieveAddress},</if>
|
|
<if test="email != null and email != ''">email = #{email},</if>
|
|
<if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="blAudit != null and blAudit != ''">bl_audit = #{blAudit},</if>
|
|
<if test="auditDate != null">audit_date = #{auditDate},</if>
|
|
<if test="auditManCode != null and auditManCode != ''">audit_man_code = #{auditManCode},</if>
|
|
<if test="auditSiteCode != null and auditSiteCode != ''">audit_site_code = #{auditSiteCode},</if>
|
|
<if test="auditNote != null and auditNote != ''">audit_note = #{auditNote},</if>
|
|
<if test="opManCode != null and opManCode != ''">op_man_code = #{opManCode},</if>
|
|
<if test="opDate != null">op_date = #{opDate},</if>
|
|
<if test="opSiteCode != null and opSiteCode != ''">op_site_code = #{opSiteCode},</if>
|
|
<if test="openChId != null and openChId != ''">open_ch_id = #{openChId},</if>
|
|
<if test="openChStatus != null and openChStatus != ''">open_ch_status = #{openChStatus},</if>
|
|
<if test="openChStatusDesc != null and openChStatusDesc != ''">open_ch_status_desc = #{openChStatusDesc},</if>
|
|
<if test="openComCode != null and openComCode != ''">open_com_code = #{openComCode},</if>
|
|
<if test="blDelay != null and blDelay != ''">bl_delay = #{blDelay},</if>
|
|
<if test="delayOpManCode != null and delayOpManCode != ''">delay_op_man_code = #{delayOpManCode},</if>
|
|
<if test="delayOpDate != null">delay_op_date = #{delayOpDate},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<update id="auditCenterPass" parameterType="EmisSettleInvoiceRecord">
|
|
update emis_settle_invoice_record
|
|
set bl_audit='1',
|
|
invoice_status='1',
|
|
audit_date=now(),
|
|
audit_man_code = #{auditManCode},
|
|
audit_site_code = #{auditSiteCode}
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<update id="updateHasPayByApplySeqNo" parameterType="string">
|
|
update emis_settle_invoice_record
|
|
set payment_status='1'
|
|
where apply_seq_no = #{applySeqNo}
|
|
</update>
|
|
|
|
<update id="auditCenterNoPass" parameterType="EmisSettleInvoiceRecord">
|
|
update emis_settle_invoice_record
|
|
set bl_audit='2',
|
|
invoice_status='3',
|
|
audit_note = #{auditNote},
|
|
audit_date=now(),
|
|
audit_man_code = #{auditManCode},
|
|
audit_site_code = #{auditSiteCode}
|
|
where id = #{id}
|
|
</update>
|
|
|
|
|
|
<delete id="deleteEmisSettleInvoiceRecordById" parameterType="Long">
|
|
update emis_settle_invoice_record where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisSettleInvoiceRecordByIds" parameterType="String">
|
|
delete from emis_settle_invoice_record where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<!-- 批量发票延期 -->
|
|
<update id="batchDelayInvoice" parameterType="map">
|
|
update emis_settle_invoice_record
|
|
set bl_delay = '1',
|
|
delay_op_man_code = #{delayOpManCode},
|
|
delay_op_date = now(),
|
|
update_by = #{delayOpManCode},
|
|
update_time = now(),
|
|
update_site = #{updateSite}
|
|
where id in
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
and invoice_status = '0'
|
|
and (bl_delay is null or bl_delay = '0')
|
|
</update>
|
|
|
|
<!-- 批量取消发票延期 -->
|
|
<update id="batchCancelDelayInvoice" parameterType="map">
|
|
update emis_settle_invoice_record
|
|
set bl_delay = '0',
|
|
delay_op_man_code = null,
|
|
delay_op_date = null,
|
|
update_by = #{cancelOpManCode},
|
|
update_time = now(),
|
|
update_site = #{updateSite}
|
|
where id in
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
and bl_delay = '1'
|
|
</update>
|
|
</mapper>
|