select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.area_id,u.dividend_proportion,u.dividend_item,u.app_user_id, u.cooperation_time,u.dividend_status,u.balance,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,a.area_name areaName
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
left join et_operating_area a on a.area_id = u.area_id
insert into sys_user(
user_id,
dept_id,
user_name,
nick_name,
user_type,
email,
avatar,
phonenumber,
sex,
password,
status,
create_by,
remark,
area_id,
dividend_proportion,
dividend_item,
app_user_id,
cooperation_time,
dividend_status,
create_time
)values(
#{userId},
#{deptId},
#{userName},
#{nickName},
#{userType},
#{email},
#{avatar},
#{phonenumber},
#{sex},
#{password},
#{status},
#{createBy},
#{remark},
#{areaId},
#{dividendProportion},
#{dividendItem},
#{appUserId},
#{cooperationTime},
#{dividendStatus},
sysdate()
)
update sys_user
dept_id = #{deptId},
user_name = #{userName},
nick_name = #{nickName},
user_type = #{userType},
email = #{email},
phonenumber = #{phonenumber},
sex = #{sex},
avatar = #{avatar},
password = #{password},
status = #{status},
login_ip = #{loginIp},
login_date = #{loginDate},
update_by = #{updateBy},
remark = #{remark},
area_id = #{areaId},
dividend_proportion = #{dividendProportion},
dividend_item = #{dividendItem},
app_user_id = #{appUserId},
cooperation_time = #{cooperationTime},
dividend_status = #{dividendStatus},
update_time = sysdate()
where user_id = #{userId}
update sys_user set status = #{status} where user_id = #{userId}
update sys_user set avatar = #{avatar} where user_name = #{userName}
update sys_user set password = #{password} where user_name = #{userName}
update sys_user set app_user_id = #{appUserId} where user_id = #{userId}
update sys_user set del_flag = '2' where user_id = #{userId}
update sys_user set del_flag = '2' where user_id in
#{userId}
update sys_user set balance = balance + #{amount} where user_id = #{userId}