demand: TMS系统 - 客户管理 - 现金客户-增删改查接口

committer: heyu
This commit is contained in:
aike 2025-12-24 16:01:09 +08:00
parent a6f7c96d38
commit cc6663fb71
2 changed files with 35 additions and 9 deletions

View File

@ -10,11 +10,12 @@
*/
package com.xdadan.erp.emis.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdadan.erp.emis.domain.EmisCustomerUser;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @ClassName EmisCustomerUserMapper
* @Description <p> 快递客户用户 Mapper 接口 </p>
@ -98,6 +99,13 @@ public interface EmisCustomerUserMapper extends BaseMapper<EmisCustomerUser>
public EmisCustomerUser selectMonthCustomerByMonthlyPayCode(String monthlyPayCode);
/**
* 根据公司名称查询现金客户列表
* @param company 公司名称
* @return 现金客户列表
*/
public List<EmisCustomerUser> selectMoneyCustomerByCompany(String company);
public int insertSysOmsUserRole(Long omsUserId);

View File

@ -6,6 +6,8 @@
<resultMap type="EmisCustomerUser" id="EmisCustomerUserResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResultAll">
<result property="id" column="id" />
<result property="moneyUserId" column="money_user_id" />
<result property="moneyUserName" column="money_user_name" />
<result property="customerCode" column="customer_code" />
<result property="customerName" column="customer_name" />
<result property="customerNameEn" column="customer_name_en" />
@ -88,6 +90,8 @@
<sql id="selectEmisCustomerUserVo">
select /*+ INDEX(a idx_emis_customer_user_owner_site) */
a.id,
a.money_user_id,
mu.company as money_user_name,
a.customer_code,
a.customer_name,
a.customer_name_en,
@ -164,6 +168,7 @@
us.site_name as update_site_name,
lw.last_order_time
from emis_customer_user a
left join emis_money_user mu on mu.id = a.money_user_id
left join emis_country c on c.code = a.country
left join emis_region rp on rp.region_code = a.province
left join emis_region rc on rc.region_code = a.city
@ -252,6 +257,9 @@
<if test="settleDay != null "> and a.settle_day = #{settleDay}</if>
<if test="salesSupport != null and salesSupport != ''"> and a.sales_support = #{salesSupport}</if>
<if test="salesExecutive != null and salesExecutive != ''"> and a.sales_executive = #{salesExecutive}</if>
<if test="searchValue != null and searchValue != ''">
and ( a.customer_name like concat('%',#{searchValue}, '%') or a.customer_code like concat('%',#{searchValue}, '%') or a.company like concat('%',#{searchValue}, '%') or a.phone like concat('%',#{searchValue}, '%') )
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.salesmen=#{params.privEmpName}
@ -279,7 +287,7 @@
</select>
<select id="selectEmisCustomerUserById" parameterType="Long" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, money_user_id, (select company from emis_money_user where id=a.money_user_id) as money_user_name, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.id = #{id}
</select>
@ -287,6 +295,7 @@
<insert id="insertEmisCustomerUser" parameterType="EmisCustomerUser" useGeneratedKeys="true" keyProperty="id">
insert into emis_customer_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="moneyUserId != null">money_user_id,</if>
<if test="customerCode != null and customerCode != ''">customer_code,</if>
<if test="customerName != null and customerName != ''">customer_name,</if>
<if test="customerNameEn != null and customerNameEn != ''">customer_name_en,</if>
@ -354,6 +363,7 @@
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="moneyUserId != null">#{moneyUserId},</if>
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
<if test="customerName != null and customerName != ''">#{customerName},</if>
<if test="customerNameEn != null and customerNameEn != ''">#{customerNameEn},</if>
@ -425,6 +435,7 @@
<update id="updateEmisCustomerUser" parameterType="EmisCustomerUser">
update emis_customer_user
<trim prefix="SET" suffixOverrides=",">
<if test="moneyUserId != null">money_user_id = #{moneyUserId},</if>
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
<if test="customerNameEn != null and customerNameEn != ''">customer_name_en = #{customerNameEn},</if>
@ -529,29 +540,35 @@
<!-- </select>-->
<select id="selectEmisCustomerUserByPhone" parameterType="string" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, money_user_id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.del_flag='0' and a.phone = #{phone}
</select>
<select id="selectCustomerByCustomerCode" parameterType="string" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, money_user_id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.del_flag='0' and a.customer_code = #{customerCode}
</select>
<select id="selectMonthCustomerByName" parameterType="string" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, money_user_id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.del_flag='0' and a.customer_type='2' and a.customer_name = #{customerName}
</select>
<select id="selectMonthCustomerByMonthlyPayCode" parameterType="string" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, money_user_id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.del_flag='0' and a.customer_type='2' and a.monthly_pay_code= #{monthlyPayCode}
</select>
<select id="selectMoneyCustomerByCompany" parameterType="string" resultMap="EmisCustomerUserResult">
select id, money_user_id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.del_flag='0' and a.customer_type='1' and a.company = #{company}
</select>
<insert id="insertSysOmsUserRole" parameterType="Long">
insert into sys_oms_user_role(user_id,role_id)
@ -564,6 +581,7 @@
<update id="updateEnterpriseInfoByMonthlyPayCode" parameterType="EmisCustomerUser">
update emis_customer_user
<trim prefix="SET" suffixOverrides=",">
<if test="moneyUserId != null">money_user_id = #{moneyUserId},</if>
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
<if test="customerNameEn != null and customerNameEn != ''">customer_name_en = #{customerNameEn},</if>
@ -637,9 +655,9 @@
<update id="batchUpdateMoneyUserId">
UPDATE emis_customer_user
SET money_user_id = #{moneyUserId},
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
update_time = NOW()
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
update_time = NOW()
WHERE id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}