表名修改
This commit is contained in:
+1
-2
@@ -7,8 +7,7 @@ import com.ruoyi.ar.domain.ArBill;
|
||||
/**
|
||||
* 应收账单余额核销 Service接口
|
||||
*
|
||||
* <p>资金来源为客户账户余额(customer_account.balance);核销时三方联动:账户余额扣减、已用额度释放、
|
||||
* 账单已核销/未核销金额及状态更新。</p>
|
||||
* <p>核销仅更新账单已核销/未核销金额及状态(2026-09-23 口径变更后不再变动 ctr_customer_account 余额与额度)。</p>
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-16
|
||||
|
||||
+4
-4
@@ -10,7 +10,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户主对象 bms_customer
|
||||
* 客户主对象 ctr_customer
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-08
|
||||
@@ -111,13 +111,13 @@ public class BmsCustomer extends BaseEntity
|
||||
@Excel(name = "绑定产品代码")
|
||||
private String productCodes;
|
||||
|
||||
/** 附件列表(子表 bms_customer_attachment) */
|
||||
/** 附件列表(子表 ctr_customer_attachment) */
|
||||
private List<BmsCustomerAttachment> attachmentList;
|
||||
|
||||
/** 公司主体列表(子表 bms_customer_company) */
|
||||
/** 公司主体列表(子表 ctr_customer_company) */
|
||||
private List<BmsCustomerCompany> companyList;
|
||||
|
||||
/** 联系人列表(子表 bms_customer_contact) */
|
||||
/** 联系人列表(子表 ctr_customer_contact) */
|
||||
private List<BmsCustomerContact> contactList;
|
||||
|
||||
/** 删除标记(0正常 2删除) */
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户附件对象 bms_customer_attachment
|
||||
* 客户附件对象 ctr_customer_attachment
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-08
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户公司主体对象 bms_customer_company
|
||||
* 客户公司主体对象 ctr_customer_company
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-09
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户联系人对象 bms_customer_contact
|
||||
* 客户联系人对象 ctr_customer_contact
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-09
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.ruoyi.customer.customermoney.vo.CustomerAccountStatusVO;
|
||||
* 客户资金公共服务:客户余额扣减/回补、授信额度占用/释放的统一入口。
|
||||
*
|
||||
* <p>客户余额、授信额度及其流水(客户模块资产)的所有变动都必须经过本接口,
|
||||
* 其他模块(应收账单、计费订单/计费变动等)不得直接更新 customer_account /
|
||||
* 其他模块(应收账单、计费订单/计费变动等)不得直接更新 ctr_customer_account /
|
||||
* 直接插入流水表。每个方法在同一事务内完成:行锁账户 -> 乐观锁变动 -> 写流水,
|
||||
* 调用方自身的事务会与本操作共享事务(默认 REQUIRED),任一失败整体回滚。</p>
|
||||
*
|
||||
|
||||
+1
-1
@@ -549,7 +549,7 @@ public class CustomerAccountApiImpl implements ICustomerAccountApi
|
||||
}
|
||||
}
|
||||
|
||||
/** Deadlock / duplicate key while inserting customer_account. */
|
||||
/** Deadlock / duplicate key while inserting ctr_customer_account. */
|
||||
private static boolean isAccountInitRace(Throwable e)
|
||||
{
|
||||
Throwable t = e;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 客户余额账户 customer_account
|
||||
* 客户余额账户 ctr_customer_account
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-11
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 客户余额流水 customer_balance_flow
|
||||
* 客户余额流水 ctr_customer_balance_flow
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-11
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 客户额度调整申请审批 customer_credit_apply
|
||||
* 客户额度调整申请审批 ctr_customer_credit_apply
|
||||
* 信用额度/额外额度(临时额度)调整先申请,审批通过后才真正调整账户额度
|
||||
*
|
||||
* @author ruoyi
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 客户额度流水 customer_credit_flow
|
||||
* 客户额度流水 ctr_customer_credit_flow
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-16
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 客户授信额度分配台账 customer_credit_grant
|
||||
* 客户授信额度分配台账 ctr_customer_credit_grant
|
||||
* 审批通过的净增额度占一行(占用角色额度池);调减/到期按 FIFO 核销行余额。
|
||||
* 角色池已用 = SUM(remaining WHERE role_id=? AND status='0')
|
||||
*
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 客户收款 customer_receipt
|
||||
* 客户收款 ctr_customer_receipt
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-11
|
||||
@@ -122,7 +122,7 @@ public class CustomerReceipt extends BaseEntity
|
||||
/** 删除标志(0存在 1删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 收款附件列表(存 bms_customer_attachment,attachment_type='3',biz_id 关联本单) */
|
||||
/** 收款附件列表(存 ctr_customer_attachment,attachment_type='3',biz_id 关联本单) */
|
||||
private List<BmsCustomerAttachment> attachmentList;
|
||||
|
||||
/** 收款附件数量(列表查询统计) */
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public class CustomerAccountStatusVO implements Serializable
|
||||
private String customerCode;
|
||||
/** 客户名称 */
|
||||
private String customerName;
|
||||
/** 启用状态(0正常 1停用)—— 来自 bms_customer.is_enable */
|
||||
/** 启用状态(0正常 1停用)—— 来自 ctr_customer.is_enable */
|
||||
private String isEnable;
|
||||
/** 启用状态文案(正常 / 停用) */
|
||||
private String isEnableLabel;
|
||||
|
||||
+4
-4
@@ -15,7 +15,7 @@ import com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany;
|
||||
import com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact;
|
||||
|
||||
/**
|
||||
* 供应商主对象 bms_supplier
|
||||
* 供应商主对象 sup_supplier
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-09
|
||||
@@ -124,13 +124,13 @@ public class BmsSupplier extends BaseEntity
|
||||
/** 绑定的渠道/服务ID */
|
||||
private String channelIds;
|
||||
|
||||
/** 附件列表(子表 bms_supplier_attachment) */
|
||||
/** 附件列表(子表 sup_supplier_attachment) */
|
||||
private List<BmsSupplierAttachment> attachmentList;
|
||||
|
||||
/** 公司主体列表(子表 bms_supplier_company) */
|
||||
/** 公司主体列表(子表 sup_supplier_company) */
|
||||
private List<BmsSupplierCompany> companyList;
|
||||
|
||||
/** 联系人列表(子表 bms_supplier_contact) */
|
||||
/** 联系人列表(子表 sup_supplier_contact) */
|
||||
private List<BmsSupplierContact> contactList;
|
||||
|
||||
/** 删除标记(0正常 2删除) */
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 供应商附件对象 bms_supplier_attachment
|
||||
* 供应商附件对象 sup_supplier_attachment
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-10
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 供应商公司主体(工商信息)对象 bms_supplier_company
|
||||
* 供应商公司主体(工商信息)对象 sup_supplier_company
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-10
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 供应商联系人对象 bms_supplier_contact
|
||||
* 供应商联系人对象 sup_supplier_contact
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-10
|
||||
|
||||
@@ -18,7 +18,7 @@ public class PrcQuote extends BaseEntity
|
||||
private String quoteId;
|
||||
private String quoteKey;
|
||||
private Long customerId;
|
||||
/** bms_customer.customer_code */
|
||||
/** ctr_customer.customer_code */
|
||||
private String customerCode;
|
||||
private String productCode;
|
||||
private String productName;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ public class TmsPriceQuoteRequest implements Serializable
|
||||
|
||||
private Long customerId;
|
||||
|
||||
/** Required. Maps to bms_customer.customer_code; used in quote unique key. */
|
||||
/** Required. Maps to ctr_customer.customer_code; used in quote unique key. */
|
||||
@NotBlank(message = "customerCode is required")
|
||||
private String customerCode;
|
||||
|
||||
|
||||
+1
-1
@@ -250,7 +250,7 @@ public class PrcBillingTaskServiceImpl implements IPrcBillingTaskService
|
||||
}
|
||||
|
||||
/**
|
||||
* Retry bill() on MySQL deadlock / lock wait (common when many tasks share one customer_account).
|
||||
* Retry bill() on MySQL deadlock / lock wait (common when many tasks share one ctr_customer_account).
|
||||
*/
|
||||
private TmsPriceQuoteResult billWithDbRetry(Long taskId, TmsPriceBillRequest billReq)
|
||||
{
|
||||
|
||||
+1
-1
@@ -335,7 +335,7 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
|
||||
}
|
||||
|
||||
/**
|
||||
* Require customerCode; resolve customer_id from bms_customer.
|
||||
* Require customerCode; resolve customer_id from ctr_customer.
|
||||
*/
|
||||
private void resolveCustomer(TmsPriceQuoteRequest request)
|
||||
{
|
||||
|
||||
@@ -36,24 +36,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 账户余额/外币余额统一取 customer_account 余额表(CNY 为本币,其余为外币),不取 bms_customer 冗余列 -->
|
||||
<!-- 账户余额/外币余额统一取 ctr_customer_account 余额表(CNY 为本币,其余为外币),不取 ctr_customer 冗余列 -->
|
||||
<!-- 信用额度=总额度+额外额度-已用额度-->
|
||||
<sql id="selectBmsCustomerVo">
|
||||
select c.customer_id, c.customer_code, c.customer_name, c.customer_code_dw, c.credit_code, c.customer_type,
|
||||
c.is_enable, c.sales_user_id, c.sales_user, c.ed, c.zq, c.settlement_user_id, c.settlement_user,
|
||||
c.service_user_id, c.service_user, c.settlement_type, c.temp_ed,
|
||||
(select coalesce(sum(ca.balance), 0) from customer_account ca
|
||||
(select coalesce(sum(ca.balance), 0) from ctr_customer_account ca
|
||||
where ca.customer_id = c.customer_id and ca.currency = 'CNY' and ca.del_flag = '0') as account_balance,
|
||||
(select coalesce(sum(ca.balance), 0) from customer_account ca
|
||||
(select coalesce(sum(ca.balance), 0) from ctr_customer_account ca
|
||||
where ca.customer_id = c.customer_id and ca.currency != 'CNY' and ca.del_flag = '0') as foreign_currency_balance,
|
||||
c.weight_threshold, c.throw_ratio,
|
||||
|
||||
(select coalesce(sum(ca.total_credit+ca.extra_credit-ca.used_credit), 0) from customer_account ca
|
||||
(select coalesce(sum(ca.total_credit+ca.extra_credit-ca.used_credit), 0) from ctr_customer_account ca
|
||||
where ca.customer_id = c.customer_id and ca.del_flag = '0') as credit_ed,
|
||||
|
||||
c.product_codes, c.remark,
|
||||
c.create_by, c.create_time, c.update_by, c.update_time, c.del_flag
|
||||
from bms_customer c
|
||||
from ctr_customer c
|
||||
<!-- 数据权限:销售(仅本人 c.sales_user_id)/销售经理(本部门 su.dept_id);
|
||||
历史迁移数据 sales_user_id 为非数字工号,+0 后不匹配任何 sys_user,仅管理员可见 -->
|
||||
left join sys_user su on su.user_id = c.sales_user_id + 0
|
||||
@@ -97,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!-- TMS 实时状态接口只读取客户ID和启用状态,避免加载客户完整资料和额度汇总。 -->
|
||||
<select id="selectCustomerStatusByCustomerId" parameterType="Long" resultMap="BmsCustomerResult">
|
||||
select customer_id, is_enable
|
||||
from bms_customer
|
||||
from ctr_customer
|
||||
where customer_id = #{customerId}
|
||||
and del_flag = '0'
|
||||
</select>
|
||||
@@ -124,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmsCustomerAttachmentVo">
|
||||
select attachment_id, customer_id, biz_type, file_name, file_path, file_size, file_type, file_extension, attachment_type, biz_id, is_logo, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from bms_customer_attachment
|
||||
select attachment_id, customer_id, biz_type, file_name, file_path, file_size, file_type, file_extension, attachment_type, biz_id, is_logo, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from ctr_customer_attachment
|
||||
</sql>
|
||||
|
||||
<select id="selectBmsCustomerAttachmentList" parameterType="com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment" resultMap="BmsCustomerAttachmentResult">
|
||||
@@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsCustomerAttachment" parameterType="com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment" useGeneratedKeys="true" keyProperty="attachmentId">
|
||||
insert into bms_customer_attachment
|
||||
insert into ctr_customer_attachment
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="bizType != null">biz_type,</if>
|
||||
@@ -180,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsCustomerAttachment" parameterType="com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment">
|
||||
update bms_customer_attachment
|
||||
update ctr_customer_attachment
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="bizType != null">biz_type = #{bizType},</if>
|
||||
@@ -201,19 +201,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsCustomerAttachmentByCustomerId" parameterType="Long">
|
||||
update bms_customer_attachment set del_flag = '2' where customer_id = #{customerId}
|
||||
update ctr_customer_attachment set del_flag = '2' where customer_id = #{customerId}
|
||||
</delete>
|
||||
|
||||
<!-- 仅逻辑删除客户档案模块的附件,保留收款水单等其他业务模块的附件 -->
|
||||
<update id="deleteBmsCustomerProfileAttachmentByCustomerId" parameterType="Long">
|
||||
update bms_customer_attachment set del_flag = '2'
|
||||
update ctr_customer_attachment set del_flag = '2'
|
||||
where customer_id = #{customerId}
|
||||
and (biz_type = 'customer' or biz_type is null or biz_type = '')
|
||||
</update>
|
||||
|
||||
<!-- 额度调整后回写客户档案额度字段(数据源为客户余额账户) -->
|
||||
<update id="updateCustomerCredit">
|
||||
update bms_customer
|
||||
update ctr_customer
|
||||
set credit_ed = #{creditEd},
|
||||
temp_ed = #{tempEd},
|
||||
update_by = #{updateBy},
|
||||
@@ -226,19 +226,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select customer_id as customerId,
|
||||
credit_ed as creditEd,
|
||||
temp_ed as tempEd
|
||||
from bms_customer
|
||||
from ctr_customer
|
||||
where customer_id = #{customerId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteBmsCustomerAttachmentByAttachmentIds" parameterType="String">
|
||||
update bms_customer_attachment set del_flag = '2' where attachment_id in
|
||||
update ctr_customer_attachment set del_flag = '2' where attachment_id in
|
||||
<foreach item="attachmentId" collection="attachmentIds" open="(" separator="," close=")">
|
||||
#{attachmentId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertBmsCustomer" parameterType="BmsCustomer" useGeneratedKeys="true" keyProperty="customerId">
|
||||
insert into bms_customer
|
||||
insert into ctr_customer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerCode != null and customerCode != ''">customer_code,</if>
|
||||
<if test="customerName != null and customerName != ''">customer_name,</if>
|
||||
@@ -302,7 +302,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsCustomer" parameterType="BmsCustomer">
|
||||
update bms_customer
|
||||
update ctr_customer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
|
||||
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
||||
@@ -335,17 +335,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsCustomerByCustomerId" parameterType="Long">
|
||||
update bms_customer set del_flag = '2' where customer_id = #{customerId}
|
||||
update ctr_customer set del_flag = '2' where customer_id = #{customerId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsCustomerByCustomerIds" parameterType="Long">
|
||||
update bms_customer set del_flag = '2' where customer_id in
|
||||
update ctr_customer set del_flag = '2' where customer_id in
|
||||
<foreach item="customerId" collection="customerIds" open="(" separator="," close=")">
|
||||
#{customerId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- ========== bms_customer_company 子表 ========== -->
|
||||
<!-- ========== ctr_customer_company 子表 ========== -->
|
||||
<resultMap type="com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany" id="BmsCustomerCompanyResult">
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
@@ -387,7 +387,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmsCustomerCompanyVo">
|
||||
select company_id, customer_id, company_name_full, english_name, credit_code, legal_person, legal_person_phone, legal_person_id_card, registered_capital, capital_currency, paid_in_capital, establish_date, business_term_start, business_term_end, business_term_permanent, registration_authority, registration_number, operating_status, business_scope, shareholders, employee_count, company_phone, company_fax, company_website, company_email, registered_province, registered_city, registered_district, registered_address_detail, business_license_url, attachment_ids, remark, create_by, create_time, update_by, update_time, del_flag from bms_customer_company
|
||||
select company_id, customer_id, company_name_full, english_name, credit_code, legal_person, legal_person_phone, legal_person_id_card, registered_capital, capital_currency, paid_in_capital, establish_date, business_term_start, business_term_end, business_term_permanent, registration_authority, registration_number, operating_status, business_scope, shareholders, employee_count, company_phone, company_fax, company_website, company_email, registered_province, registered_city, registered_district, registered_address_detail, business_license_url, attachment_ids, remark, create_by, create_time, update_by, update_time, del_flag from ctr_customer_company
|
||||
</sql>
|
||||
|
||||
<select id="selectBmsCustomerCompanyList" parameterType="com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany" resultMap="BmsCustomerCompanyResult">
|
||||
@@ -409,7 +409,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsCustomerCompany" parameterType="com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany" useGeneratedKeys="true" keyProperty="companyId">
|
||||
insert into bms_customer_company
|
||||
insert into ctr_customer_company
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="companyNameFull != null">company_name_full,</if>
|
||||
@@ -485,7 +485,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsCustomerCompany" parameterType="com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany">
|
||||
update bms_customer_company
|
||||
update ctr_customer_company
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="companyNameFull != null">company_name_full = #{companyNameFull},</if>
|
||||
@@ -525,14 +525,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsCustomerCompanyByCustomerId" parameterType="Long">
|
||||
update bms_customer_company set del_flag = '2' where customer_id = #{customerId}
|
||||
update ctr_customer_company set del_flag = '2' where customer_id = #{customerId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsCustomerCompanyByCompanyId" parameterType="Long">
|
||||
update bms_customer_company set del_flag = '2' where company_id = #{companyId}
|
||||
update ctr_customer_company set del_flag = '2' where company_id = #{companyId}
|
||||
</delete>
|
||||
|
||||
<!-- ========== bms_customer_contact 子表 ========== -->
|
||||
<!-- ========== ctr_customer_contact 子表 ========== -->
|
||||
<resultMap type="com.ruoyi.customer.customerinfo.domain.BmsCustomerContact" id="BmsCustomerContactResult">
|
||||
<result property="contactId" column="contact_id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
@@ -562,7 +562,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmsCustomerContactVo">
|
||||
select contact_id, customer_id, contact_name, position, department, phone, landline, email, wechat, qq, country, province, city, district, contact_address, postal_code, is_default, contact_type, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from bms_customer_contact
|
||||
select contact_id, customer_id, contact_name, position, department, phone, landline, email, wechat, qq, country, province, city, district, contact_address, postal_code, is_default, contact_type, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from ctr_customer_contact
|
||||
</sql>
|
||||
|
||||
<select id="selectBmsCustomerContactList" parameterType="com.ruoyi.customer.customerinfo.domain.BmsCustomerContact" resultMap="BmsCustomerContactResult">
|
||||
@@ -583,7 +583,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsCustomerContact" parameterType="com.ruoyi.customer.customerinfo.domain.BmsCustomerContact" useGeneratedKeys="true" keyProperty="contactId">
|
||||
insert into bms_customer_contact
|
||||
insert into ctr_customer_contact
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="contactName != null">contact_name,</if>
|
||||
@@ -635,7 +635,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsCustomerContact" parameterType="com.ruoyi.customer.customerinfo.domain.BmsCustomerContact">
|
||||
update bms_customer_contact
|
||||
update ctr_customer_contact
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="contactName != null">contact_name = #{contactName},</if>
|
||||
@@ -663,10 +663,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsCustomerContactByCustomerId" parameterType="Long">
|
||||
update bms_customer_contact set del_flag = '2' where customer_id = #{customerId}
|
||||
update ctr_customer_contact set del_flag = '2' where customer_id = #{customerId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsCustomerContactByContactId" parameterType="Long">
|
||||
update bms_customer_contact set del_flag = '2' where contact_id = #{contactId}
|
||||
update ctr_customer_contact set del_flag = '2' where contact_id = #{contactId}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
@@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
s.service_user_id, s.service_user, s.ed, s.zq, s.settlement_type, s.temp_ed, s.account_balance,
|
||||
s.foreign_currency_balance, s.credit_ed, s.weight_threshold, s.throw_ratio, s.cooperation_start_date,
|
||||
s.cooperation_status, s.channel_ids, s.remark, s.create_by, s.create_time, s.update_by, s.update_time, s.del_flag
|
||||
from bms_supplier s
|
||||
from sup_supplier s
|
||||
<!-- 数据权限:采购/销售(仅本人 s.purchaser_user_id)/部门经理(本部门 su.dept_id);
|
||||
非数字历史工号 +0 后不匹配任何 sys_user,仅管理员可见 -->
|
||||
left join sys_user su on su.user_id = s.purchaser_user_id + 0
|
||||
@@ -79,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsSupplier" parameterType="BmsSupplier" useGeneratedKeys="true" keyProperty="supplierId">
|
||||
insert into bms_supplier
|
||||
insert into sup_supplier
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="supplierCode != null and supplierCode != ''">supplier_code,</if>
|
||||
<if test="supplierName != null and supplierName != ''">supplier_name,</if>
|
||||
@@ -143,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsSupplier" parameterType="BmsSupplier">
|
||||
update bms_supplier
|
||||
update sup_supplier
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if>
|
||||
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
|
||||
@@ -178,17 +178,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsSupplierBySupplierId" parameterType="Long">
|
||||
delete from bms_supplier where supplier_id = #{supplierId}
|
||||
delete from sup_supplier where supplier_id = #{supplierId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsSupplierBySupplierIds" parameterType="Long">
|
||||
delete from bms_supplier where supplier_id in
|
||||
delete from sup_supplier where supplier_id in
|
||||
<foreach item="supplierId" collection="array" open="(" separator="," close=")">
|
||||
#{supplierId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- ========== bms_supplier_attachment 子表 ========== -->
|
||||
<!-- ========== sup_supplier_attachment 子表 ========== -->
|
||||
<resultMap type="com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment" id="BmsSupplierAttachmentResult">
|
||||
<result property="attachmentId" column="attachment_id" />
|
||||
<result property="supplierId" column="supplier_id" />
|
||||
@@ -209,7 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmsSupplierAttachmentVo">
|
||||
select attachment_id, supplier_id, file_name, file_path, file_size, file_type, file_extension, attachment_type, is_logo, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier_attachment
|
||||
select attachment_id, supplier_id, file_name, file_path, file_size, file_type, file_extension, attachment_type, is_logo, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from sup_supplier_attachment
|
||||
</sql>
|
||||
|
||||
<select id="selectBmsSupplierAttachmentList" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment" resultMap="BmsSupplierAttachmentResult">
|
||||
@@ -225,7 +225,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsSupplierAttachment" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment" useGeneratedKeys="true" keyProperty="attachmentId">
|
||||
insert into bms_supplier_attachment
|
||||
insert into sup_supplier_attachment
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
@@ -259,7 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsSupplierAttachment" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment">
|
||||
update bms_supplier_attachment
|
||||
update sup_supplier_attachment
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
||||
<if test="fileName != null">file_name = #{fileName},</if>
|
||||
@@ -278,14 +278,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsSupplierAttachmentBySupplierId" parameterType="Long">
|
||||
update bms_supplier_attachment set del_flag = '2' where supplier_id = #{supplierId}
|
||||
update sup_supplier_attachment set del_flag = '2' where supplier_id = #{supplierId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsSupplierAttachmentByAttachmentId" parameterType="Long">
|
||||
update bms_supplier_attachment set del_flag = '2' where attachment_id = #{attachmentId}
|
||||
update sup_supplier_attachment set del_flag = '2' where attachment_id = #{attachmentId}
|
||||
</delete>
|
||||
|
||||
<!-- ========== bms_supplier_company 子表 ========== -->
|
||||
<!-- ========== sup_supplier_company 子表 ========== -->
|
||||
<resultMap type="com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany" id="BmsSupplierCompanyResult">
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="supplierId" column="supplier_id" />
|
||||
@@ -327,7 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmsSupplierCompanyVo">
|
||||
select company_id, supplier_id, company_name_full, english_name, credit_code, legal_person, legal_person_phone, legal_person_id_card, registered_capital, capital_currency, paid_in_capital, establish_date, business_term_start, business_term_end, business_term_permanent, registration_authority, registration_number, operating_status, business_scope, shareholders, employee_count, company_phone, company_fax, company_website, company_email, registered_province, registered_city, registered_district, registered_address_detail, business_license_oss_id, attachment_ids, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier_company
|
||||
select company_id, supplier_id, company_name_full, english_name, credit_code, legal_person, legal_person_phone, legal_person_id_card, registered_capital, capital_currency, paid_in_capital, establish_date, business_term_start, business_term_end, business_term_permanent, registration_authority, registration_number, operating_status, business_scope, shareholders, employee_count, company_phone, company_fax, company_website, company_email, registered_province, registered_city, registered_district, registered_address_detail, business_license_oss_id, attachment_ids, remark, create_by, create_time, update_by, update_time, del_flag from sup_supplier_company
|
||||
</sql>
|
||||
|
||||
<select id="selectBmsSupplierCompanyList" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany" resultMap="BmsSupplierCompanyResult">
|
||||
@@ -349,7 +349,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsSupplierCompany" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany" useGeneratedKeys="true" keyProperty="companyId">
|
||||
insert into bms_supplier_company
|
||||
insert into sup_supplier_company
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
<if test="companyNameFull != null">company_name_full,</if>
|
||||
@@ -425,7 +425,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsSupplierCompany" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany">
|
||||
update bms_supplier_company
|
||||
update sup_supplier_company
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
||||
<if test="companyNameFull != null">company_name_full = #{companyNameFull},</if>
|
||||
@@ -465,14 +465,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsSupplierCompanyBySupplierId" parameterType="Long">
|
||||
update bms_supplier_company set del_flag = '2' where supplier_id = #{supplierId}
|
||||
update sup_supplier_company set del_flag = '2' where supplier_id = #{supplierId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsSupplierCompanyByCompanyId" parameterType="Long">
|
||||
update bms_supplier_company set del_flag = '2' where company_id = #{companyId}
|
||||
update sup_supplier_company set del_flag = '2' where company_id = #{companyId}
|
||||
</delete>
|
||||
|
||||
<!-- ========== bms_supplier_contact 子表 ========== -->
|
||||
<!-- ========== sup_supplier_contact 子表 ========== -->
|
||||
<resultMap type="com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact" id="BmsSupplierContactResult">
|
||||
<result property="contactId" column="contact_id" />
|
||||
<result property="supplierId" column="supplier_id" />
|
||||
@@ -502,7 +502,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmsSupplierContactVo">
|
||||
select contact_id, supplier_id, contact_name, position, department, phone, landline, email, wechat, qq, country, province, city, district, contact_address, postal_code, is_default, contact_type, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier_contact
|
||||
select contact_id, supplier_id, contact_name, position, department, phone, landline, email, wechat, qq, country, province, city, district, contact_address, postal_code, is_default, contact_type, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from sup_supplier_contact
|
||||
</sql>
|
||||
|
||||
<select id="selectBmsSupplierContactList" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact" resultMap="BmsSupplierContactResult">
|
||||
@@ -524,7 +524,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsSupplierContact" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact" useGeneratedKeys="true" keyProperty="contactId">
|
||||
insert into bms_supplier_contact
|
||||
insert into sup_supplier_contact
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
<if test="contactName != null">contact_name,</if>
|
||||
@@ -576,7 +576,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsSupplierContact" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact">
|
||||
update bms_supplier_contact
|
||||
update sup_supplier_contact
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
||||
<if test="contactName != null">contact_name = #{contactName},</if>
|
||||
@@ -604,11 +604,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsSupplierContactBySupplierId" parameterType="Long">
|
||||
update bms_supplier_contact set del_flag = '2' where supplier_id = #{supplierId}
|
||||
update sup_supplier_contact set del_flag = '2' where supplier_id = #{supplierId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsSupplierContactByContactId" parameterType="Long">
|
||||
update bms_supplier_contact set del_flag = '2' where contact_id = #{contactId}
|
||||
update sup_supplier_contact set del_flag = '2' where contact_id = #{contactId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
r.status as status,
|
||||
coalesce(q.total_quota, 0) as totalQuota,
|
||||
(select coalesce(sum(g.remaining), 0)
|
||||
from customer_credit_grant g
|
||||
from ctr_customer_credit_grant g
|
||||
where g.role_id = r.role_id and g.status = '0' and g.del_flag = '0') as usedQuota,
|
||||
q.remark as remark
|
||||
from sys_role r
|
||||
@@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
r.status as status,
|
||||
q.total_quota as totalQuota,
|
||||
(select coalesce(sum(g.remaining), 0)
|
||||
from customer_credit_grant g
|
||||
from ctr_customer_credit_grant g
|
||||
where g.role_id = r.role_id and g.status = '0' and g.del_flag = '0') as usedQuota,
|
||||
q.remark as remark
|
||||
from sys_user_role ur
|
||||
@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="sumActiveRemaining" resultType="java.math.BigDecimal">
|
||||
select coalesce(sum(remaining), 0)
|
||||
from customer_credit_grant
|
||||
from ctr_customer_credit_grant
|
||||
where role_id = #{roleId} and status = '0' and del_flag = '0'
|
||||
</select>
|
||||
|
||||
@@ -109,8 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
c.customer_code, c.customer_name,
|
||||
r.role_name,
|
||||
u.user_name as approve_by
|
||||
from customer_credit_grant g
|
||||
left join bms_customer c on c.customer_id = g.customer_id
|
||||
from ctr_customer_credit_grant g
|
||||
left join ctr_customer c on c.customer_id = g.customer_id
|
||||
left join sys_role r on r.role_id = g.role_id
|
||||
left join sys_user u on u.user_id = g.approve_user_id
|
||||
</sql>
|
||||
@@ -134,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select grant_id, customer_id, account_id, role_id, approve_user_id, apply_id, flow_id,
|
||||
credit_type, amount, remaining, effective_date, expire_date, status,
|
||||
create_by, create_time, update_by, update_time, del_flag
|
||||
from customer_credit_grant
|
||||
from ctr_customer_credit_grant
|
||||
where customer_id = #{customerId}
|
||||
and credit_type = #{creditType}
|
||||
and status = '0'
|
||||
@@ -145,7 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<insert id="insertGrant" parameterType="com.ruoyi.customer.customermoney.domain.CustomerCreditGrant"
|
||||
useGeneratedKeys="true" keyProperty="grantId">
|
||||
insert into customer_credit_grant (
|
||||
insert into ctr_customer_credit_grant (
|
||||
customer_id, account_id, role_id, approve_user_id, apply_id, flow_id,
|
||||
credit_type, amount, remaining, effective_date, expire_date, status,
|
||||
create_by, create_time, remark, del_flag
|
||||
@@ -158,7 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<update id="updateGrantRemaining"
|
||||
parameterType="com.ruoyi.customer.customermoney.domain.CustomerCreditGrant">
|
||||
update customer_credit_grant
|
||||
update ctr_customer_credit_grant
|
||||
set remaining = #{remaining},
|
||||
status = #{status},
|
||||
release_time = #{releaseTime},
|
||||
|
||||
+7
-7
@@ -44,8 +44,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.del_flag,
|
||||
c.customer_code, c.customer_name,
|
||||
r.role_name as approve_role_name
|
||||
from customer_credit_apply a
|
||||
left join bms_customer c on c.customer_id = a.customer_id
|
||||
from ctr_customer_credit_apply a
|
||||
left join ctr_customer c on a.customer_id = c.customer_id
|
||||
left join sys_role r on r.role_id = a.approve_role_id
|
||||
</sql>
|
||||
|
||||
@@ -75,13 +75,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectApplyByIdForUpdate" resultMap="CustomerCreditApplyResult">
|
||||
select * from customer_credit_apply where apply_id = #{applyId} and del_flag = '0' for update
|
||||
select * from ctr_customer_credit_apply where apply_id = #{applyId} and del_flag = '0' for update
|
||||
</select>
|
||||
|
||||
<insert id="insertApply"
|
||||
parameterType="com.ruoyi.customer.customermoney.domain.CustomerCreditApply"
|
||||
useGeneratedKeys="true" keyProperty="applyId">
|
||||
insert into customer_credit_apply (
|
||||
insert into ctr_customer_credit_apply (
|
||||
apply_no, customer_id, credit_type, adjust_mode, change_amount,
|
||||
effective_date, expire_date, reason, status,
|
||||
apply_by, apply_user_id, apply_time,
|
||||
@@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<update id="updateApproved"
|
||||
parameterType="com.ruoyi.customer.customermoney.domain.CustomerCreditApply">
|
||||
update customer_credit_apply
|
||||
update ctr_customer_credit_apply
|
||||
set status = 'APPROVED',
|
||||
account_id = #{accountId},
|
||||
flow_id = #{flowId},
|
||||
@@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<update id="updateRejected"
|
||||
parameterType="com.ruoyi.customer.customermoney.domain.CustomerCreditApply">
|
||||
update customer_credit_apply
|
||||
update ctr_customer_credit_apply
|
||||
set status = 'REJECTED',
|
||||
approve_by = #{approveBy},
|
||||
approve_user_id = #{approveUserId},
|
||||
@@ -124,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<update id="updateCancelled">
|
||||
update customer_credit_apply
|
||||
update ctr_customer_credit_apply
|
||||
set status = 'CANCELLED',
|
||||
update_by = #{updateBy},
|
||||
update_time = sysdate()
|
||||
|
||||
@@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
credit_effective_date, credit_expire_date, extra_credit,
|
||||
extra_effective_date, extra_expire_date, used_credit,
|
||||
tax, version, create_by, create_time, update_by, update_time, remark, del_flag
|
||||
from customer_account
|
||||
from ctr_customer_account
|
||||
</sql>
|
||||
|
||||
<select id="selectAccountByCustomerCurrency" resultMap="CustomerAccountResult">
|
||||
@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!-- 扫描已到期授信的CNY账户(信用或临时额度失效日早于今天;失效日当天仍有效,故严格小于今天) -->
|
||||
<select id="selectExpiredCreditCustomerIds" resultType="java.lang.Long">
|
||||
select distinct customer_id
|
||||
from customer_account
|
||||
from ctr_customer_account
|
||||
where del_flag = '0'
|
||||
and currency = 'CNY'
|
||||
and (
|
||||
@@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<insert id="insertAccount" parameterType="com.ruoyi.customer.customermoney.domain.CustomerAccount"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into customer_account
|
||||
insert into ctr_customer_account
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="currency != null">currency,</if>
|
||||
@@ -99,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="updateAccountBalance">
|
||||
update customer_account
|
||||
update ctr_customer_account
|
||||
set balance = #{balance},
|
||||
frozen_balance = #{frozenBalance},
|
||||
used_credit = #{usedCredit},
|
||||
@@ -111,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<!-- 乐观锁更新额度(信用/临时额度及各自有效期) -->
|
||||
<update id="updateAccountCredit">
|
||||
update customer_account
|
||||
update ctr_customer_account
|
||||
set total_credit = #{totalCredit},
|
||||
credit_effective_date = #{creditEffectiveDate},
|
||||
credit_expire_date = #{creditExpireDate},
|
||||
@@ -159,7 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
before_amount, change_amount, after_amount, used_credit,
|
||||
effective_date, expire_date, reason, adjust_mode, operator_id, role_id,
|
||||
create_by, create_time, update_by, update_time, remark, del_flag
|
||||
from customer_credit_flow
|
||||
from ctr_customer_credit_flow
|
||||
</sql>
|
||||
|
||||
<select id="selectCreditFlowList" parameterType="com.ruoyi.customer.customermoney.domain.CustomerCreditFlow"
|
||||
@@ -180,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<insert id="insertCreditFlow" parameterType="com.ruoyi.customer.customermoney.domain.CustomerCreditFlow"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into customer_credit_flow
|
||||
insert into ctr_customer_credit_flow
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="flowNo != null">flow_no,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
@@ -275,9 +275,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
r.received_at, r.status,
|
||||
r.confirmed_at, r.confirmed_by, r.invoice_status, r.version, r.create_by, r.create_time,
|
||||
r.update_by, r.update_time, r.remark, r.del_flag,
|
||||
(select count(1) from bms_customer_attachment a
|
||||
(select count(1) from ctr_customer_attachment a
|
||||
where a.biz_id = r.id and a.attachment_type = '3' and a.del_flag = '0') as attachment_count
|
||||
from customer_receipt r
|
||||
from ctr_customer_receipt r
|
||||
</sql>
|
||||
|
||||
<select id="selectReceiptList" parameterType="com.ruoyi.customer.customermoney.domain.CustomerReceipt"
|
||||
@@ -312,7 +312,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<insert id="insertReceipt" parameterType="com.ruoyi.customer.customermoney.domain.CustomerReceipt"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into customer_receipt
|
||||
insert into ctr_customer_receipt
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="receiptNo != null">receipt_no,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
@@ -374,7 +374,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<update id="confirmReceipt" parameterType="com.ruoyi.customer.customermoney.domain.CustomerReceipt">
|
||||
update customer_receipt
|
||||
update ctr_customer_receipt
|
||||
set status = 'CONFIRMED',
|
||||
confirmed_at = #{confirmedAt},
|
||||
confirmed_by = #{confirmedBy},
|
||||
@@ -385,7 +385,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<update id="cancelReceipt">
|
||||
update customer_receipt
|
||||
update ctr_customer_receipt
|
||||
set status = 'CANCELLED',
|
||||
update_by = #{updateBy},
|
||||
update_time = now()
|
||||
@@ -424,7 +424,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
direction, amount,
|
||||
before_balance, after_balance, before_frozen_balance, after_frozen_balance, operator_id,
|
||||
create_by, create_time, update_by, update_time, remark, del_flag
|
||||
from customer_balance_flow
|
||||
from ctr_customer_balance_flow
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowList" parameterType="com.ruoyi.customer.customermoney.domain.CustomerBalanceFlow"
|
||||
@@ -450,7 +450,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<insert id="insertFlow" parameterType="com.ruoyi.customer.customermoney.domain.CustomerBalanceFlow"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into customer_balance_flow
|
||||
insert into ctr_customer_balance_flow
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="flowNo != null">flow_no,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
|
||||
Reference in New Issue
Block a user