This commit is contained in:
linfso 2024-06-12 14:10:16 +08:00
parent 7b30d977e6
commit d5d0d5c349
5 changed files with 0 additions and 788 deletions

View File

@ -1,160 +0,0 @@
/**
* @Project: emis
* @Title: EmisCustomerUser.java
* @author linfso
* @date 2024-04-30 06:55:09
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 快递客户用户 实体类 </p>
*/
package com.xdadan.erp.oms2c.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xdadan.erp.oms.common.core.domain.BaseEntity;
import java.util.Date;
import lombok.Data;
/**
* @ClassName EmisCustomerUser
* @Description 快递客户用户
* @author linfso
* @date 2024-04-30 06:55:09
*/
@Data
public class EmisCustomerUser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/* id */
private Long id;
/* 客户编码 */
private String customerCode;
/* 客户名称 */
private String customerName;
/* 英文简称 */
private String customerNameEn;
/* 客户简称 */
private String simpleName;
/* 业务联系人 */
private String contact;
/* 电话包含手机 */
private String phone;
/* 手机号 */
private String mobile;
/* 客户类型 1-普通客户 2-月结客户 */
private String customerType;
/* 结算类型 : 1-现金 2-月结 3-月结到付,可多选 */
private String settledType;
/* 用户类型 1-个人 2-公司 */
private String userType;
/* 所属公司 */
private String company;
/* 营业执照号,纳税人识别号 */
private String licNo;
/* 部门id */
private String deptId;
/* 头像url地址 */
private String avatar;
/* 性别 */
private String sex;
/* 邀请人 */
private String invitationInfo;
/* 最后登录ip */
private String loginIp;
/* 最后登录日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date loginDate;
/* 称呼 */
private String nickName;
/* union_id */
private String unionId;
/* wxopenid */
private String openid;
/* 月结卡号 */
private String monthlyPayCode;
/* 登录账号 */
private String userName;
/* 登录密码 */
private String password;
/* 归属站点 */
private String ownerSite;
/* 业务网点 */
private String bizSite;
/* 业务网点名称,逗号隔开 */
private String bizSiteName;
/* 国家 */
private String country;
/* 省份 */
private String province;
/* 城市 */
private String city;
/* 区县 */
private String county;
/* 镇 */
private String town;
/* 地址 */
private String address;
/* email */
private String email;
/* 邮编 */
private String postCode;
/* 真实姓名 */
private String realName;
/* 身份证号 */
private String idNo;
/* 回款联系人 */
private String payee;
/* 销售联系人 */
private String salesmen;
/* 数据来源 */
private String dataFrom;
/* 是否开通oms */
private String blOpenOms;
/* 是否短信 */
private String blSms;
/* 专属业务员 */
private String opEmpCode;
/* 首次签约 */
private String firstSigningDay;
/* 启用状态 1-启用 0-未启用 */
private String status;
/* 排序 */
private String orderNum;
//---------
// 月结卡号别名
private String custNo;
// 客户别名
private String custName;
/* 国家 */
private String countryName;
/* 省份 */
private String provinceName;
/* 城市 */
private String cityName;
/* 区县 */
private String countyName;
/* 归属站点 */
private String ownerSiteName;
/* 回款联系人 */
private String payeeName;
/* 销售联系人 */
private String salesmenName;
/* 专属业务员 */
private String opEmpName;
// 最近下单时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lastOrderTime;
}

View File

@ -1,84 +0,0 @@
/**
* @Project: emis
* @Title: EmisCustomerUserMapper.java
* @author linfso
* @date 2024-03-01 03:51:54
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
* @version v1.0
* @Description: <p> 快递客户用户 Mapper 接口 </p>
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
*/
package com.xdadan.erp.oms2c.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdadan.erp.oms2c.domain.EmisCustomerUser;
/**
* @ClassName EmisCustomerUserMapper
* @Description <p> 快递客户用户 Mapper 接口 </p>
* @author linfso
* @date 2024-03-01 03:51:54
*/
public interface EmisCustomerUserMapper extends BaseMapper<EmisCustomerUser>
{
/**
* 主键查询
* @param id
* @return
*/
public EmisCustomerUser selectEmisCustomerUserById(Long id);
/**
* 查询列表
*
* @param emisCustomerUser
* @return 集合
*/
public List<EmisCustomerUser> selectEmisCustomerUserList(EmisCustomerUser emisCustomerUser);
/**
* 新增
*
* @param emisCustomerUser
* @return
*/
public int insertEmisCustomerUser(EmisCustomerUser emisCustomerUser);
/**
* 修改
*
* @param emisCustomerUser
* @return
*/
public int updateEmisCustomerUser(EmisCustomerUser emisCustomerUser);
/**
* 删除
*
* @param id 主键
* @return 结果
*/
public int deleteEmisCustomerUserById(Long id);
/**
* 批量删除
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteEmisCustomerUserByIds(Long[] ids);
/**
* 根据站点获取到最大编码
* @param ownSiteCode
* @return
*/
public Long selectMaxCustomerCodeBySite(String ownSiteCode);
public EmisCustomerUser selectEmisCustomerUserByPhone(String phone);
}

View File

@ -1,69 +0,0 @@
/**
* @Project: emis
* @Title: EmisCustomerUserService.java
* @author linfso
* @date 2024-03-01 03:51:54
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 快递客户用户 服务类接口 </p>
*/
package com.xdadan.erp.oms2c.service;
import java.util.List;
import com.xdadan.erp.oms2c.domain.EmisCustomerUser;
/**
* @ClassName EmisCustomerUserService
* @Description 快递客户用户
* @author linfso
* @date 2024-03-01 03:51:54
*/
public interface IEmisCustomerUserService
{
/**
* 主键查询
* @param id
* @return
*/
public EmisCustomerUser selectEmisCustomerUserById(Long id);
/**
* 查询快递客户用户列表
*
* @param emisCustomerUser 快递客户用户
* @return 快递客户用户集合
*/
public List<EmisCustomerUser> selectEmisCustomerUserList(EmisCustomerUser emisCustomerUser);
/**
* 新增快递客户用户
*
* @param emisCustomerUser 快递客户用户
* @return 结果
*/
public int insertEmisCustomerUser(EmisCustomerUser emisCustomerUser);
/**
* 修改快递客户用户
*
* @param emisCustomerUser 快递客户用户
* @return 结果
*/
public int updateEmisCustomerUser(EmisCustomerUser emisCustomerUser);
/**
* 批量删除快递客户用户
*
* @param ids 需要删除的快递客户用户主键集合
* @return 结果
*/
public int deleteEmisCustomerUserByIds(Long[] ids);
/**
* 删除快递客户用户信息
*
* @param id 快递客户用户主键
* @return 结果
*/
public int deleteEmisCustomerUserById(Long id);
}

View File

@ -1,110 +0,0 @@
/**
* @Project: emis
* @Title: EmisCustomerUserServiceImpl.java
* @author linfso
* @date 2024-03-01 03:51:54
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 快递客户用户 实体类 </p>
*/
package com.xdadan.erp.oms2c.service.impl;
import java.util.List;
import com.xdadan.erp.oms2c.service.EmisBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xdadan.erp.oms2c.domain.EmisCustomerUser;
import com.xdadan.erp.oms2c.mapper.EmisCustomerUserMapper;
import com.xdadan.erp.oms2c.service.IEmisCustomerUserService;
/**
* 快递客户用户Service业务层处理
*
* @author linfso
* @date 2024-03-01 03:51:54
*/
@Service
public class EmisCustomerUserServiceImpl extends EmisBaseService implements IEmisCustomerUserService
{
@Autowired
private EmisCustomerUserMapper emisCustomerUserMapper;
/**
* 查询快递客户用户
*
* @param id 快递客户用户主键
* @return 快递客户用户
*/
@Override
public EmisCustomerUser selectEmisCustomerUserById(Long id)
{
return emisCustomerUserMapper.selectEmisCustomerUserById(id);
}
/**
* 查询快递客户用户列表
*
* @param emisCustomerUser 快递客户用户
* @return 快递客户用户
*/
@Override
public List<EmisCustomerUser> selectEmisCustomerUserList(EmisCustomerUser emisCustomerUser)
{
return emisCustomerUserMapper.selectEmisCustomerUserList(emisCustomerUser);
}
/**
* 新增快递客户用户
*
* @param emisCustomerUser 快递客户用户
* @return 结果
*/
@Override
public int insertEmisCustomerUser(EmisCustomerUser emisCustomerUser)
{
EmisCustomerUser crtUser=createCustomerUser(emisCustomerUser);
// return emisCustomerUserMapper.insertEmisCustomerUser(emisCustomerUser);
return 1;
}
/**
* 修改快递客户用户
*
* @param emisCustomerUser 快递客户用户
* @return 结果
*/
@Override
public int updateEmisCustomerUser(EmisCustomerUser emisCustomerUser)
{
emisCustomerUser.preUpdate();
return emisCustomerUserMapper.updateEmisCustomerUser(emisCustomerUser);
}
/**
* 批量删除快递客户用户
*
* @param ids 需要删除的快递客户用户主键
* @return 结果
*/
@Override
public int deleteEmisCustomerUserByIds(Long[] ids)
{
return emisCustomerUserMapper.deleteEmisCustomerUserByIds(ids);
}
/**
* 删除快递客户用户信息
*
* @param id 快递客户用户主键
* @return 结果
*/
@Override
public int deleteEmisCustomerUserById(Long id)
{
return emisCustomerUserMapper.deleteEmisCustomerUserById(id);
}
}

View File

@ -1,365 +0,0 @@
<?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.oms2c.mapper.EmisCustomerUserMapper">
<resultMap type="EmisCustomerUser" id="EmisCustomerUserResult" extends="com.xdadan.erp.oms2c.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="customerCode" column="customer_code" />
<result property="customerName" column="customer_name" />
<result property="customerNameEn" column="customer_name_en" />
<result property="simpleName" column="simple_name" />
<result property="contact" column="contact" />
<result property="phone" column="phone" />
<result property="mobile" column="mobile" />
<result property="customerType" column="customer_type" />
<result property="settledType" column="settled_type" />
<result property="userType" column="user_type" />
<result property="company" column="company" />
<result property="licNo" column="lic_no" />
<result property="deptId" column="dept_id" />
<result property="avatar" column="avatar" />
<result property="sex" column="sex" />
<result property="invitationInfo" column="invitation_info" />
<result property="loginIp" column="login_ip" />
<result property="loginDate" column="login_date" />
<result property="nickName" column="nick_name" />
<result property="unionId" column="union_id" />
<result property="openid" column="openid" />
<result property="monthlyPayCode" column="monthly_pay_code" />
<result property="userName" column="user_name" />
<result property="password" column="password" />
<result property="ownerSite" column="owner_site" />
<result property="bizSite" column="biz_site" />
<result property="bizSiteName" column="biz_site_name" />
<result property="country" column="country" />
<result property="province" column="province" />
<result property="city" column="city" />
<result property="county" column="county" />
<result property="town" column="town" />
<result property="address" column="address" />
<result property="email" column="email" />
<result property="postCode" column="post_code" />
<result property="realName" column="real_name" />
<result property="idNo" column="id_no" />
<result property="payee" column="payee" />
<result property="salesmen" column="salesmen" />
<result property="dataFrom" column="data_from" />
<result property="blOpenOms" column="bl_open_oms" />
<result property="blSms" column="bl_sms" />
<result property="opEmpCode" column="op_emp_code" />
<result property="firstSigningDay" column="first_signing_day" />
<result property="status" column="status" />
<result property="orderNum" column="order_num" />
<result property="custNo" column="monthly_pay_code" />
<result property="custName" column="customer_name" />
<association property="countryName" column="country" select="com.xdadan.erp.oms2c.mapper.EmisBaseMapper.selectCountryNameByCode"/>
<association property="provinceName" column="province" select="com.xdadan.erp.oms2c.mapper.EmisBaseMapper.selectRegionNameByCode"/>
<association property="cityName" column="city" select="com.xdadan.erp.oms2c.mapper.EmisBaseMapper.selectRegionNameByCode"/>
<association property="countyName" column="county" select="com.xdadan.erp.oms2c.mapper.EmisBaseMapper.selectRegionNameByCode"/>
<association property="ownerSiteName" column="owner_site" select="com.xdadan.erp.oms2c.mapper.EmisBaseMapper.selectSiteNameByCode"/>
<association property="payeeName" column="payee" select="com.xdadan.erp.oms2c.mapper.EmisBaseMapper.selectEmpNameByCode"/>
<association property="salesmenName" column="salesmen" select="com.xdadan.erp.oms2c.mapper.EmisBaseMapper.selectEmpNameByCode"/>
<!-- <association property="opEmpName" column="op_emp_code" select="selectEmpNameByCode"/>-->
<association property="lastOrderTime" column="customer_code" select="selectLastOrderTimeByCustomerCode"/>
</resultMap>
<select id="selectLastOrderTimeByCustomerCode" parameterType="String" resultType="date">
select send_date from emis_waybill where customer_code=#{code} order by send_date desc limit 1;
</select>
<sql id="selectEmisCustomerUserVo">
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, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, status, order_num, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_customer_user
</sql>
<!-- or FIND_IN_SET(#{ownerSite},biz_site)-->
<select id="selectEmisCustomerUserList" parameterType="EmisCustomerUser" resultMap="EmisCustomerUserResult">
<include refid="selectEmisCustomerUserVo"/>
<where>
del_flag='0'
<if test="ownerSite != null and ownerSite != ''">
and ( owner_site=#{ownerSite} )
</if>
<if test="custName != null and custName != ''"> and customer_name like concat('%', #{custName}, '%')</if>
<if test="id != null "> and id = #{id}</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>
<if test="customerNameEn != null and customerNameEn != ''"> and customer_name_en like concat('%', #{customerNameEn}, '%')</if>
<if test="simpleName != null and simpleName != ''"> and simple_name like concat('%', #{simpleName}, '%')</if>
<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="mobile != null and mobile != ''"> and mobile like concat('%', #{mobile}, '%')</if>
<if test="customerType != null and customerType != ''"> and customer_type=#{customerType}</if>
<if test="settledType != null and settledType != ''"> and settled_type=#{settledType}</if>
<if test="userType != null and userType != ''"> and user_type=#{userType}</if>
<if test="company != null and company != ''"> and company like concat('%', #{company}, '%')</if>
<if test="licNo != null and licNo != ''"> and lic_no like concat('%', #{licNo}, '%')</if>
<if test="deptId != null and deptId != ''"> and dept_id like concat('%', #{deptId}, '%')</if>
<if test="avatar != null and avatar != ''"> and avatar like concat('%', #{avatar}, '%')</if>
<if test="sex != null and sex != ''"> and sex= #{sex}</if>
<if test="invitationInfo != null and invitationInfo != ''"> and invitation_info like concat('%', #{invitationInfo}, '%')</if>
<if test="loginIp != null and loginIp != ''"> and login_ip like concat('%', #{loginIp}, '%')</if>
<if test="loginDate != null "> and login_date like concat('%', #{loginDate}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="unionId != null and unionId != ''"> and union_id like concat('%', #{unionId}, '%')</if>
<if test="openid != null and openid != ''"> and openid like concat('%', #{openid}, '%')</if>
<if test="monthlyPayCode != null and monthlyPayCode != ''"> and monthly_pay_code like concat('%', #{monthlyPayCode}, '%')</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="bizSite != null and bizSite != ''"> and FIND_IN_SET(#{bizSite},biz_site)</if>
<if test="bizSiteName != null and bizSiteName != ''"> and biz_site_name like concat('%', #{bizSiteName}, '%')</if>
<if test="country != null and country != ''"> and country=#{country}</if>
<if test="province != null and province != ''"> and province=#{province}</if>
<if test="city != null and city != ''"> and city=#{city}</if>
<if test="county != null and county != ''"> and county=#{county}</if>
<if test="town != null and town != ''"> and town=#{town}</if>
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
<if test="email != null and email != ''"> and email like concat('%', #{email}, '%')</if>
<if test="postCode != null and postCode != ''"> and post_code like concat('%', #{postCode}, '%')</if>
<if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
<if test="idNo != null and idNo != ''"> and id_no like concat('%', #{idNo}, '%')</if>
<if test="payee != null and payee != ''"> and payee like concat('%', #{payee}, '%')</if>
<if test="salesmen != null and salesmen != ''"> and salesmen like concat('%', #{salesmen}, '%')</if>
<if test="dataFrom != null and dataFrom != ''"> and data_from like concat('%', #{dataFrom}, '%')</if>
<if test="blOpenOms != null and blOpenOms != ''"> and bl_open_oms=#{blOpenOms}</if>
<if test="blSms != null and blSms != ''"> and bl_sms=#{blSms}</if>
<if test="opEmpCode != null and opEmpCode != ''"> and op_emp_code like concat('%', #{opEmpCode}, '%')</if>
<if test="firstSigningDay != null and firstSigningDay != ''"> and first_signing_day like concat('%', #{firstSigningDay}, '%')</if>
<if test="status != null and status != ''"> and status=#{status}</if>
<if test="orderNum != null and orderNum != ''"> and order_num like concat('%', #{orderNum}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</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>
</where>
order by create_time desc
</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, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, status, order_num, 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>
<insert id="insertEmisCustomerUser" parameterType="EmisCustomerUser">
insert into emis_customer_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">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>
<if test="simpleName != null and simpleName != ''">simple_name,</if>
<if test="contact != null and contact != ''">contact,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="mobile != null and mobile != ''">mobile,</if>
<if test="customerType != null and customerType != ''">customer_type,</if>
<if test="settledType != null and settledType != ''">settled_type,</if>
<if test="userType != null and userType != ''">user_type,</if>
<if test="company != null and company != ''">company,</if>
<if test="licNo != null and licNo != ''">lic_no,</if>
<if test="deptId != null and deptId != ''">dept_id,</if>
<if test="avatar != null and avatar != ''">avatar,</if>
<if test="sex != null and sex != ''">sex,</if>
<if test="invitationInfo != null and invitationInfo != ''">invitation_info,</if>
<if test="loginIp != null and loginIp != ''">login_ip,</if>
<if test="loginDate != null">login_date,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="unionId != null and unionId != ''">union_id,</if>
<if test="openid != null and openid != ''">openid,</if>
<if test="monthlyPayCode != null and monthlyPayCode != ''">monthly_pay_code,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="password != null and password != ''">password,</if>
<if test="ownerSite != null and ownerSite != ''">owner_site,</if>
<if test="bizSite != null and bizSite != ''">biz_site,</if>
<if test="bizSiteName != null and bizSiteName != ''">biz_site_name,</if>
<if test="country != null and country != ''">country,</if>
<if test="province != null and province != ''">province,</if>
<if test="city != null and city != ''">city,</if>
<if test="county != null and county != ''">county,</if>
<if test="town != null and town != ''">town,</if>
<if test="address != null and address != ''">address,</if>
<if test="email != null and email != ''">email,</if>
<if test="postCode != null and postCode != ''">post_code,</if>
<if test="realName != null and realName != ''">real_name,</if>
<if test="idNo != null and idNo != ''">id_no,</if>
<if test="payee != null and payee != ''">payee,</if>
<if test="salesmen != null and salesmen != ''">salesmen,</if>
<if test="dataFrom != null and dataFrom != ''">data_from,</if>
<if test="blOpenOms != null and blOpenOms != ''">bl_open_oms,</if>
<if test="blSms != null and blSms != ''">bl_sms,</if>
<if test="opEmpCode != null and opEmpCode != ''">op_emp_code,</if>
<if test="firstSigningDay != null and firstSigningDay != ''">first_signing_day,</if>
<if test="status != null and status != ''">status,</if>
<if test="orderNum != null and orderNum != ''">order_num,</if>
<if test="remark != null and remark != ''">remark,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</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>
<if test="simpleName != null and simpleName != ''">#{simpleName},</if>
<if test="contact != null and contact != ''">#{contact},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="mobile != null and mobile != ''">#{mobile},</if>
<if test="customerType != null and customerType != ''">#{customerType},</if>
<if test="settledType != null and settledType != ''">#{settledType},</if>
<if test="userType != null and userType != ''">#{userType},</if>
<if test="company != null and company != ''">#{company},</if>
<if test="licNo != null and licNo != ''">#{licNo},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if>
<if test="sex != null and sex != ''">#{sex},</if>
<if test="invitationInfo != null and invitationInfo != ''">#{invitationInfo},</if>
<if test="loginIp != null and loginIp != ''">#{loginIp},</if>
<if test="loginDate != null">#{loginDate},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="unionId != null and unionId != ''">#{unionId},</if>
<if test="openid != null and openid != ''">#{openid},</if>
<if test="monthlyPayCode != null and monthlyPayCode != ''">#{monthlyPayCode},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="password != null and password != ''">#{password},</if>
<if test="ownerSite != null and ownerSite != ''">#{ownerSite},</if>
<if test="bizSite != null and bizSite != ''">#{bizSite},</if>
<if test="bizSiteName != null and bizSiteName != ''">#{bizSiteName},</if>
<if test="country != null and country != ''">#{country},</if>
<if test="province != null and province != ''">#{province},</if>
<if test="city != null and city != ''">#{city},</if>
<if test="county != null and county != ''">#{county},</if>
<if test="town != null and town != ''">#{town},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="postCode != null and postCode != ''">#{postCode},</if>
<if test="realName != null and realName != ''">#{realName},</if>
<if test="idNo != null and idNo != ''">#{idNo},</if>
<if test="payee != null and payee != ''">#{payee},</if>
<if test="salesmen != null and salesmen != ''">#{salesmen},</if>
<if test="dataFrom != null and dataFrom != ''">#{dataFrom},</if>
<if test="blOpenOms != null and blOpenOms != ''">#{blOpenOms},</if>
<if test="blSms != null and blSms != ''">#{blSms},</if>
<if test="opEmpCode != null and opEmpCode != ''">#{opEmpCode},</if>
<if test="firstSigningDay != null and firstSigningDay != ''">#{firstSigningDay},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="remark != null and remark != ''">#{remark},</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>
</trim>
</insert>
<update id="updateEmisCustomerUser" parameterType="EmisCustomerUser">
update emis_customer_user
<trim prefix="SET" suffixOverrides=",">
<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>
<if test="simpleName != null and simpleName != ''">simple_name = #{simpleName},</if>
<if test="contact != null and contact != ''">contact = #{contact},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
<if test="customerType != null and customerType != ''">customer_type = #{customerType},</if>
<if test="settledType != null and settledType != ''">settled_type = #{settledType},</if>
<if test="userType != null and userType != ''">user_type = #{userType},</if>
<if test="company != null and company != ''">company = #{company},</if>
<if test="licNo != null and licNo != ''">lic_no = #{licNo},</if>
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="invitationInfo != null and invitationInfo != ''">invitation_info = #{invitationInfo},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="unionId != null and unionId != ''">union_id = #{unionId},</if>
<if test="openid != null and openid != ''">openid = #{openid},</if>
<if test="monthlyPayCode != null and monthlyPayCode != ''">monthly_pay_code = #{monthlyPayCode},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="ownerSite != null and ownerSite != ''">owner_site = #{ownerSite},</if>
<if test="bizSite != null and bizSite != ''">biz_site = #{bizSite},</if>
<if test="bizSiteName != null and bizSiteName != ''">biz_site_name = #{bizSiteName},</if>
<if test="country != null and country != ''">country = #{country},</if>
<if test="province != null and province != ''">province = #{province},</if>
<if test="city != null and city != ''">city = #{city},</if>
<if test="county != null and county != ''">county = #{county},</if>
<if test="town != null and town != ''">town = #{town},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
<if test="realName != null and realName != ''">real_name = #{realName},</if>
<if test="idNo != null and idNo != ''">id_no = #{idNo},</if>
<if test="payee != null and payee != ''">payee = #{payee},</if>
<if test="salesmen != null and salesmen != ''">salesmen = #{salesmen},</if>
<if test="dataFrom != null and dataFrom != ''">data_from = #{dataFrom},</if>
<if test="blOpenOms != null and blOpenOms != ''">bl_open_oms = #{blOpenOms},</if>
<if test="blSms != null and blSms != ''">bl_sms = #{blSms},</if>
<if test="opEmpCode != null and opEmpCode != ''">op_emp_code = #{opEmpCode},</if>
<if test="firstSigningDay != null and firstSigningDay != ''">first_signing_day = #{firstSigningDay},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="remark != null and remark != ''">remark = #{remark},</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>
<delete id="deleteEmisCustomerUserById" parameterType="Long">
update emis_customer_user set del_flag='1' where id = #{id}
</delete>
<delete id="deleteEmisCustomerUserByIds" parameterType="String">
update emis_customer_user set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectMaxCustomerCodeBySite" parameterType="String" resultType="Long">
select IF(max(customer_code) is NULL,CONCAT(#{ownSiteCode},LPAD('1',6,'0')),CONCAT(CONVERT(max(customer_code),SIGNED)+1,'')) as code
from emis_customer_user where owner_site = #{ownSiteCode}
</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, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, status, order_num, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_customer_user a
where a.phone = #{phone}
</select>
</mapper>