This commit is contained in:
linfso 2024-05-06 14:54:08 +08:00
parent c7086c8598
commit 697120dc85
3 changed files with 81 additions and 3 deletions

View File

@ -41,6 +41,8 @@ public class EmisCustomerUser extends BaseEntity
private String customerName;
/* 英文简称 */
private String customerNameEn;
/* 客户简称 */
private String simpleName;
/* 电话包含手机 */
private String phone;
/* 手机号 */
@ -116,6 +118,8 @@ public class EmisCustomerUser extends BaseEntity
private String payee;
/* 销售联系人 */
private String salesmen;
/* 数据来源 */
private String dataFrom;
/* 是否开通oms */
private String blOpenOms;
/* 是否短信 */
@ -129,4 +133,26 @@ public class EmisCustomerUser extends BaseEntity
/* 修改站点代码 */
private String updateSite;
/* 国家 */
private String countryName;
/* 省份 */
private String provinceName;
/* 城市 */
private String cityName;
/* 区县 */
private String countyName;
/* 归属站点 */
private String ownerSiteName;
/* 回款联系人 */
private String payeeName;
/* 销售联系人 */
private String salesmenName;
/* 专属业务员 */
private String opEmpName;
}

View File

@ -4,11 +4,13 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xdadan.erp.emis.mapper.EmisCustomerUserMapper">
<resultMap type="EmisCustomerUser" id="EmisCustomerUserResult">
<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="phone" column="phone" />
<result property="mobile" column="mobile" />
<result property="customerType" column="customer_type" />
@ -46,6 +48,7 @@
<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" />
@ -58,19 +61,52 @@
<result property="updateTime" column="update_time" />
<result property="createSite" column="create_site" />
<result property="updateSite" column="update_site" />
<association property="countryName" column="country_code" select="selectCountryNameByCode"/>
<association property="provinceName" column="province" select="selectRegionNameByCode"/>
<association property="cityName" column="city" select="selectRegionNameByCode"/>
<association property="countyName" column="county" select="selectRegionNameByCode"/>
<association property="ownerSiteName" column="owner_site" select="selectSiteNameByCode"/>
<association property="payeeName" column="payee" select="selectEmpNameByCode"/>
<association property="salesmenName" column="salesmen" select="selectEmpNameByCode"/>
<association property="opEmpName" column="op_emp_code" select="selectEmpNameByCode"/>
</resultMap>
<sql id="selectEmisCustomerUserVo">
select id, customer_code, customer_name, customer_name_en, phone, mobile, customer_type, settled_type, user_type, company, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, country, province, city, county, town, address, email, send_country, send_province, send_city, send_county, send_town, post_code, status, real_name, id_no, payee, salesmen, bl_open_oms, bl_sms, op_emp_code, order_num, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_customer_user
select id, customer_code, customer_name, customer_name_en, simple_name, phone, mobile, customer_type, settled_type, user_type, company, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, country, province, city, county, town, address, email, send_country, send_province, send_city, send_county, send_town, post_code, status, real_name, id_no, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, order_num, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_customer_user
</sql>
<select id="selectCountryNameByCode" parameterType="String" resultType="string">
select a.name from emis_country a where a.code = #{code} limit 1
</select>
<select id="selectRegionNameByCode" parameterType="String" resultType="string">
select a.region_name from emis_region a where a.region_code = #{code} limit 1
</select>
<select id="selectSiteNameByCode" parameterType="String" resultType="string">
select a.site_name from emis_site a where a.site_code = #{code} limit 1
</select>
<select id="selectEmpNameByCode" parameterType="String" resultType="string">
select a.emp_name from sys_user a where a.emp_code = #{code} limit 1
</select>
<select id="selectEmisCustomerUserList" parameterType="EmisCustomerUser" resultMap="EmisCustomerUserResult">
<include refid="selectEmisCustomerUserVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="customerCode != null and customerCode != ''"> and customer_code like concat('%', #{customerCode}, '%')</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="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 like concat('%', #{customerType}, '%')</if>
@ -108,6 +144,7 @@
<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 like concat('%', #{blOpenOms}, '%')</if>
<if test="blSms != null and blSms != ''"> and bl_sms like concat('%', #{blSms}, '%')</if>
<if test="opEmpCode != null and opEmpCode != ''"> and op_emp_code like concat('%', #{opEmpCode}, '%')</if>
@ -125,7 +162,7 @@
</select>
<select id="selectEmisCustomerUserById" parameterType="Long" resultMap="EmisCustomerUserResult">
select id, customer_code, customer_name, customer_name_en, phone, mobile, customer_type, settled_type, user_type, company, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, country, province, city, county, town, address, email, send_country, send_province, send_city, send_county, send_town, post_code, status, real_name, id_no, payee, salesmen, bl_open_oms, bl_sms, op_emp_code, order_num, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, customer_code, customer_name, customer_name_en, simple_name, phone, mobile, customer_type, settled_type, user_type, company, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, country, province, city, county, town, address, email, send_country, send_province, send_city, send_county, send_town, post_code, status, real_name, id_no, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, 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>
@ -133,9 +170,11 @@
<insert id="insertEmisCustomerUser" parameterType="EmisCustomerUser" useGeneratedKeys="true" keyProperty="id">
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="phone != null and phone != ''">phone,</if>
<if test="mobile != null and mobile != ''">mobile,</if>
<if test="customerType != null and customerType != ''">customer_type,</if>
@ -173,6 +212,7 @@
<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>
@ -187,9 +227,11 @@
<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="phone != null and phone != ''">#{phone},</if>
<if test="mobile != null and mobile != ''">#{mobile},</if>
<if test="customerType != null and customerType != ''">#{customerType},</if>
@ -227,6 +269,7 @@
<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>
@ -248,6 +291,7 @@
<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="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>
@ -285,6 +329,7 @@
<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>
@ -301,6 +346,9 @@
where id = #{id}
</update>
<delete id="deleteEmisCustomerUserById" parameterType="Long">
update emis_customer_user set del_flag='1' where id = #{id}
</delete>

View File

@ -164,6 +164,10 @@
select a.name from emis_brand a where a.code = #{code} limit 1
</select>
<select id="selectEmpNameByCode" parameterType="String" resultType="string">
select a.emp_name from sys_user a where a.emp_code = #{code} limit 1
</select>
<select id="selectEmisSiteList" parameterType="EmisSite" resultMap="EmisSiteResult">
<include refid="selectEmisSiteVo"/>