2024-07-21 13:34:34 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
< !DOCTYPE mapper
2024-07-21 14:35:04 +00:00
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2024-07-21 13:34:34 +00:00
<mapper namespace= "com.xdadan.erp.emis.mapper.EmisSettleInvoiceRecordMapper" >
2024-07-21 14:35:04 +00:00
2024-07-24 23:29:26 +00:00
<resultMap type= "EmisSettleInvoiceRecord" id= "EmisSettleInvoiceRecordResult" extends= "com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult" >
2024-07-21 13:34:34 +00:00
<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= "companyName" column= "company_name" />
<result property= "companyTaxNo" column= "company_tax_no" />
<result property= "companyTel" column= "company_tel" />
<result property= "companyAddress" column= "company_address" />
2024-07-21 14:35:04 +00:00
<result property= "bankName" column= "bank_name" />
<result property= "bankAccNo" column= "bank_acc_no" />
2024-07-21 13:34:34 +00:00
<result property= "contact" column= "contact" />
<result property= "phone" column= "phone" />
<result property= "realTaxType" column= "real_tax_type" />
<result property= "openMoneyMax" column= "open_money_max" />
<result property= "openMoney" column= "open_money" />
2024-08-10 05:51:59 +00:00
2024-07-21 13:34:34 +00:00
<result property= "invoiceStatus" column= "invoice_status" />
<result property= "invoiceStatusDesc" column= "invoice_status_desc" />
<result property= "recieveAddress" column= "recieve_address" />
<result property= "email" column= "email" />
2024-08-10 05:51:59 +00:00
2024-07-21 13:34:34 +00:00
<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" />
2024-08-05 10:53:44 +00:00
<result property= "auditNote" column= "audit_note" />
2024-07-21 13:34:34 +00:00
<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" />
2024-07-24 23:29:26 +00:00
2024-08-10 05:51:59 +00:00
<result property= "filePath" column= "file_path" />
<result property= "invoiceNo" column= "invoice_no" />
2024-07-24 23:29:26 +00:00
<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" />
2024-07-21 13:34:34 +00:00
</resultMap>
<sql id= "selectEmisSettleInvoiceRecordVo" >
2024-08-05 10:53:44 +00:00
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, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_settle_invoice_record
2024-07-21 13:34:34 +00:00
</sql>
<select id= "selectEmisSettleInvoiceRecordList" parameterType= "EmisSettleInvoiceRecord" resultMap= "EmisSettleInvoiceRecordResult" >
<include refid= "selectEmisSettleInvoiceRecordVo" />
2024-07-21 14:35:04 +00:00
<where >
del_flag='0'
2024-07-21 13:34:34 +00:00
<if test= "id != null " > and id = #{id}</if>
<if test= "applySeqNo != null and applySeqNo != ''" > and apply_seq_no = #{applySeqNo}</if>
<if test= "applyDate != null " > and apply_date = #{applyDate}</if>
<if test= "applyManCode != null and applyManCode != ''" > and apply_man_code = #{applyManCode}</if>
<if test= "applySiteCode != null and applySiteCode != ''" > and apply_site_code = #{applySiteCode}</if>
<if test= "customerCode != null and customerCode != ''" > and customer_code = #{customerCode}</if>
<if test= "customerName != null and customerName != ''" > and customer_name like concat('%', #{customerName}, '%')</if>
2024-08-09 05:04:03 +00:00
<if test= "settleBillNo != null and settleBillNo != ''" > and FIND_IN_SET(#{settleBillNo},settle_bill_no) </if>
2024-07-21 13:34:34 +00:00
<if test= "settleBillName != null and settleBillName != ''" > and settle_bill_name like concat('%', #{settleBillName}, '%')</if>
<if test= "applyMoney != null " > and apply_money = #{applyMoney}</if>
<if test= "invoiceType != null and invoiceType != ''" > and invoice_type = #{invoiceType}</if>
<if test= "companyName != null and companyName != ''" > and company_name like concat('%', #{companyName}, '%')</if>
<if test= "companyTaxNo != null and companyTaxNo != ''" > and company_tax_no = #{companyTaxNo}</if>
<if test= "companyTel != null and companyTel != ''" > and company_tel like concat('%', #{companyTel}, '%')</if>
<if test= "companyAddress != null and companyAddress != ''" > and company_address like concat('%', #{companyAddress}, '%')</if>
2024-07-21 14:35:04 +00:00
<if test= "bankName != null and bankName != ''" > and bank_name like concat('%', #{bankName}, '%')</if>
<if test= "bankAccNo != null and bankAccNo != ''" > and bank_acc_no like concat('%', #{bankAccNo}, '%')</if>
2024-07-21 13:34:34 +00:00
<if test= "contact != null and contact != ''" > and contact like concat('%', #{contact}, '%')</if>
<if test= "phone != null and phone != ''" > and phone like concat('%', #{phone}, '%')</if>
<if test= "realTaxType != null and realTaxType != ''" > and real_tax_type = #{realTaxType}</if>
<if test= "openMoneyMax != null " > and open_money_max = #{openMoneyMax}</if>
<if test= "openMoney != null " > and open_money = #{openMoney}</if>
<if test= "invoiceNo != null and invoiceNo != ''" > and invoice_no = #{invoiceNo}</if>
<if test= "invoiceStatus != null and invoiceStatus != ''" > and invoice_status = #{invoiceStatus}</if>
<if test= "invoiceStatusDesc != null and invoiceStatusDesc != ''" > and invoice_status_desc like concat('%', #{invoiceStatusDesc}, '%')</if>
<if test= "recieveAddress != null and recieveAddress != ''" > and recieve_address like concat('%', #{recieveAddress}, '%')</if>
<if test= "email != null and email != ''" > and email like concat('%', #{email}, '%')</if>
<if test= "filePath != null and filePath != ''" > and file_path like concat('%', #{filePath}, '%')</if>
<if test= "remark != null and remark != ''" > and remark like concat('%', #{remark}, '%')</if>
<if test= "blAudit != null and blAudit != ''" > and bl_audit = #{blAudit}</if>
<if test= "auditDate != null " > and audit_date = #{auditDate}</if>
<if test= "auditManCode != null and auditManCode != ''" > and audit_man_code like concat('%', #{auditManCode}, '%')</if>
<if test= "auditSiteCode != null and auditSiteCode != ''" > and audit_site_code like concat('%', #{auditSiteCode}, '%')</if>
<if test= "opManCode != null and opManCode != ''" > and op_man_code like concat('%', #{opManCode}, '%')</if>
<if test= "opDate != null " > and op_date = #{opDate}</if>
<if test= "opSiteCode != null and opSiteCode != ''" > and op_site_code = #{opSiteCode}</if>
<if test= "openChId != null and openChId != ''" > and open_ch_id = #{openChId}</if>
<if test= "openChStatus != null and openChStatus != ''" > and open_ch_status = #{openChStatus}</if>
<if test= "openChStatusDesc != null and openChStatusDesc != ''" > and open_ch_status_desc = #{openChStatusDesc}</if>
<if test= "openComCode != null and openComCode != ''" > and open_com_code = #{openComCode}</if>
<if test= "delFlag != null and delFlag != ''" > and del_flag like concat('%', #{delFlag}, '%')</if>
<if test= "createBy != null and createBy != ''" > and create_by like concat('%', #{createBy}, '%')</if>
<if test= "createTime != null " > and create_time = #{createTime}</if>
<if test= "updateBy != null and updateBy != ''" > and update_by like concat('%', #{updateBy}, '%')</if>
<if test= "updateTime != null " > and update_time = #{updateTime}</if>
<if test= "createSite != null and createSite != ''" > and create_site like concat('%', #{createSite}, '%')</if>
<if test= "updateSite != null and updateSite != ''" > and update_site like concat('%', #{updateSite}, '%')</if>
2024-08-07 14:04:09 +00:00
2024-08-09 05:04:03 +00:00
<if test= "params.billCode != null and params.billCode != ''" >
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}) or b.bill_code like concat('%', #{params.billCode}, '%') )
)
)
</if>
2024-08-07 14:04:09 +00:00
<if test= "params.privSiteCode != null and params.privSiteCode != '88888'" >
2024-08-09 04:25:39 +00:00
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 ( x2.salesmen = #{params.privEmpName} OR x2.payee = #{params.privEmpName} OR x2.salesmen IN ( SELECT salesmen FROM emis_salesmen_rel WHERE sales_ass = #{params.privEmpName} ) )
2024-08-07 14:04:09 +00:00
)
</if>
2024-07-21 13:34:34 +00:00
</where>
order by create_time desc
</select>
2024-07-24 23:29:26 +00:00
<select id= "selectInvoiceRecordListBySettleBillNo" parameterType= "String" resultMap= "EmisSettleInvoiceRecordResult" >
2024-08-05 10:53:44 +00:00
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, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
2024-07-24 23:29:26 +00:00
from emis_settle_invoice_record a
where a.settle_bill_no = #{settleBillNo}
</select>
2024-08-05 03:31:05 +00:00
<select id= "selectInvoiceRecordByApplySeqNo" parameterType= "String" resultMap= "EmisSettleInvoiceRecordResult" >
2024-08-05 10:53:44 +00:00
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, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
2024-08-05 03:31:05 +00:00
from emis_settle_invoice_record a
where a.apply_seq_no = #{applySeqNo}
</select>
2024-07-21 13:34:34 +00:00
<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}
2024-07-21 14:35:04 +00:00
and bank_name = #{bankName}
and bank_acc_no = #{bankAccNo}
2024-07-21 13:34:34 +00:00
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>
2024-07-21 14:35:04 +00:00
2024-07-21 13:34:34 +00:00
<select id= "selectEmisSettleInvoiceRecordById" parameterType= "Long" resultMap= "EmisSettleInvoiceRecordResult" >
2024-08-05 10:53:44 +00:00
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, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
2024-07-21 13:34:34 +00:00
from emis_settle_invoice_record a
where a.id = #{id}
</select>
2024-07-21 14:35:04 +00:00
2024-07-21 13:34:34 +00:00
<insert id= "insertEmisSettleInvoiceRecord" parameterType= "EmisSettleInvoiceRecord" useGeneratedKeys= "true" keyProperty= "id" >
insert into emis_settle_invoice_record
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "id != null" > id,</if>
<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= "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>
2024-07-21 14:35:04 +00:00
<if test= "bankName != null and bankName != ''" > bank_name,</if>
<if test= "bankAccNo != null and bankAccNo != ''" > bank_acc_no,</if>
2024-07-21 13:34:34 +00:00
<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= "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>
2024-08-05 10:53:44 +00:00
<if test= "auditNote != null and auditNote != ''" > audit_note,</if>
2024-07-21 13:34:34 +00:00
<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= "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>
2024-07-21 14:35:04 +00:00
</trim>
2024-07-21 13:34:34 +00:00
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "id != null" > #{id},</if>
<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= "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>
2024-07-21 14:35:04 +00:00
<if test= "bankName != null and bankName != ''" > #{bankName},</if>
<if test= "bankAccNo != null and bankAccNo != ''" > #{bankAccNo},</if>
2024-07-21 13:34:34 +00:00
<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= "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>
2024-08-05 10:53:44 +00:00
<if test= "auditNote != null and auditNote != ''" > #{auditNote},</if>
2024-07-21 13:34:34 +00:00
<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= "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>
2024-07-21 14:35:04 +00:00
</trim>
2024-07-21 13:34:34 +00:00
</insert>
<update id= "updateEmisSettleInvoiceRecord" parameterType= "EmisSettleInvoiceRecord" >
update emis_settle_invoice_record
<trim prefix= "SET" suffixOverrides= "," >
<if test= "applySeqNo != null and applySeqNo != ''" > apply_seq_no = #{applySeqNo},</if>
<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= "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>
2024-07-21 14:35:04 +00:00
<if test= "bankName != null and bankName != ''" > bank_name = #{bankName},</if>
<if test= "bankAccNo != null and bankAccNo != ''" > bank_acc_no = #{bankAccNo},</if>
2024-07-21 13:34:34 +00:00
<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= "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= "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>
2024-08-05 10:53:44 +00:00
<if test= "auditNote != null and auditNote != ''" > audit_note = #{auditNote},</if>
2024-07-21 13:34:34 +00:00
<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= "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>
2024-08-05 10:53:44 +00:00
<update id= "auditCenterNoPass" parameterType= "EmisSettleInvoiceRecord" >
update emis_settle_invoice_record
set bl_audit='2',audit_note = #{auditNote},audit_date=now(),
audit_man_code = #{auditManCode},
audit_site_code = #{auditSiteCode}
where id = #{id}
</update>
2024-07-21 13:34:34 +00:00
<delete id= "deleteEmisSettleInvoiceRecordById" parameterType= "Long" >
2024-08-05 10:53:44 +00:00
update emis_settle_invoice_record where id = #{id}
2024-07-21 13:34:34 +00:00
</delete>
<delete id= "deleteEmisSettleInvoiceRecordByIds" parameterType= "String" >
2024-07-21 14:35:04 +00:00
delete from emis_settle_invoice_record where id in
2024-07-21 13:34:34 +00:00
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
</mapper>