md
This commit is contained in:
parent
10afa65abd
commit
68ccca073f
@ -77,9 +77,6 @@
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmisCustomerUserVo">
|
||||
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
|
||||
@ -100,21 +97,40 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<sql id="selectEmisCustomerUserVo">
|
||||
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, biz_site, biz_site_name, 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="selectEmisCustomerUserList" parameterType="EmisCustomerUser" resultMap="EmisCustomerUserResult">
|
||||
<include refid="selectEmisCustomerUserVo"/>
|
||||
<where>
|
||||
del_flag='0'
|
||||
<if test="ownerSite != null and ownerSite != ''">
|
||||
<!-- 包含子网点 -->
|
||||
AND owner_site in (
|
||||
SELECT t3.site_code FROM(
|
||||
SELECT t1.site_code,t1.parent_site_code,t1.site_name,
|
||||
IF( FIND_IN_SET( parent_site_code, @parent_ids ) > 0, @parent_ids := CONCAT( @parent_ids, ',', site_code ), '0' ) AS cids
|
||||
FROM ( SELECT * FROM emis_site AS t WHERE t.del_flag = '0' ORDER BY t.site_code ASC ) t1,
|
||||
( SELECT @parent_ids := #{ownerSite} ) t2
|
||||
) t3
|
||||
WHERE cids != '0'
|
||||
UNION
|
||||
SELECT #{ownerSite} FROM dual
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="id != null "> and id = #{id}</if>
|
||||
<if test="customerCode != null and customerCode != ''"> and customer_code=#{customerCode}</if>
|
||||
<if test="customerCode != null and customerCode != ''"> and customer_code like concat('%', #{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=#{customerType}</if>
|
||||
<if test="customerType != null and customerType != ''"> and customer_type like concat('%', #{customerType}, '%')</if>
|
||||
<if test="settledType != null and settledType != ''"> and settled_type like concat('%', #{settledType}, '%')</if>
|
||||
<if test="userType != null and userType != ''"> and user_type=#{userType}</if>
|
||||
<if test="userType != null and userType != ''"> and user_type like concat('%', #{userType}, '%')</if>
|
||||
<if test="company != null and company != ''"> and company like concat('%', #{company}, '%')</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>
|
||||
@ -128,6 +144,9 @@
|
||||
<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="password != null and password != ''"> and password like concat('%', #{password}, '%')</if>
|
||||
<!-- <if test="ownerSite != null and ownerSite != ''"> and owner_site like concat('%', #{ownerSite}, '%')</if>-->
|
||||
<if test="bizSite != null and bizSite != ''"> and biz_site like concat('%', #{bizSite}, '%')</if>
|
||||
<if test="bizSiteName != null and bizSiteName != ''"> and biz_site_name like concat('%', #{bizSiteName}, '%')</if>
|
||||
<if test="country != null and country != ''"> and country like concat('%', #{country}, '%')</if>
|
||||
<if test="province != null and province != ''"> and province like concat('%', #{province}, '%')</if>
|
||||
<if test="city != null and city != ''"> and city like concat('%', #{city}, '%')</if>
|
||||
@ -159,33 +178,17 @@
|
||||
<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>
|
||||
|
||||
<if test="ownerSite != null and ownerSite != ''">
|
||||
<!-- 包含子网点 -->
|
||||
AND owner_site in (
|
||||
SELECT t3.site_code FROM(
|
||||
SELECT t1.site_code,t1.parent_site_code,t1.site_name,
|
||||
IF( FIND_IN_SET( parent_site_code, @parent_ids ) > 0, @parent_ids := CONCAT( @parent_ids, ',', site_code ), '0' ) AS cids
|
||||
FROM ( SELECT * FROM emis_site AS t WHERE t.del_flag = '0' ORDER BY t.site_code ASC ) t1,
|
||||
( SELECT @parent_ids := #{ownerSite} ) t2
|
||||
) t3
|
||||
WHERE cids != '0'
|
||||
UNION
|
||||
SELECT #{ownerSite} FROM dual
|
||||
)
|
||||
</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, 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
|
||||
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, biz_site, biz_site_name, 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>
|
||||
|
||||
<insert id="insertEmisCustomerUser" parameterType="EmisCustomerUser" useGeneratedKeys="true" keyProperty="id">
|
||||
<insert id="insertEmisCustomerUser" parameterType="EmisCustomerUser">
|
||||
insert into emis_customer_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
@ -212,6 +215,8 @@
|
||||
<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>
|
||||
@ -269,6 +274,8 @@
|
||||
<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>
|
||||
@ -327,7 +334,10 @@
|
||||
<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>
|
||||
@ -364,6 +374,9 @@
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<delete id="deleteEmisCustomerUserById" parameterType="Long">
|
||||
update emis_customer_user set del_flag='1' where id = #{id}
|
||||
</delete>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user