This commit is contained in:
zhangchenbiao
2023-06-06 17:32:47 +08:00
parent 7a78f59ad7
commit 2d0d896a58
46 changed files with 343 additions and 4400 deletions

View File

@@ -1,888 +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.cool.store.mapper.EnterpriseUserMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseUserDO">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="tel" jdbcType="VARCHAR" property="tel"/>
<result column="work_place" jdbcType="VARCHAR" property="workPlace"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="mobile" jdbcType="VARCHAR" property="mobile"/>
<result column="email" jdbcType="VARCHAR" property="email"/>
<result column="org_email" jdbcType="VARCHAR" property="orgEmail"/>
<result column="active" jdbcType="BIT" property="active"/>
<result column="order_in_depts" jdbcType="VARCHAR" property="orderInDepts"/>
<result column="main_admin" jdbcType="TINYINT" property="mainAdmin"/>
<result column="is_admin" jdbcType="BIT" property="isAdmin"/>
<result column="is_boss" jdbcType="BIT" property="isBoss"/>
<result column="dingId" jdbcType="VARCHAR" property="dingid"/>
<result column="unionid" jdbcType="VARCHAR" property="unionid"/>
<result column="is_hide" jdbcType="BIT" property="isHide"/>
<result column="position" jdbcType="VARCHAR" property="position"/>
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
<result column="extattr" jdbcType="VARCHAR" property="extattr"/>
<result column="is_enterprise" jdbcType="BIT" property="isEnterprise"/>
<result column="roles" jdbcType="VARCHAR" property="roles"/>
<result column="is_leader" jdbcType="BIT" property="isLeader"/>
<result column="face_url" jdbcType="VARCHAR" property="faceUrl"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="language" jdbcType="CHAR" property="language"/>
<result column="user_status" jdbcType="TINYINT" property="userStatus"/>
<result column="third_oa_unique_flag" jdbcType="VARCHAR" property="thirdOaUniqueFlag"/>
<result column="subordinate_change" jdbcType="TINYINT" property="subordinateChange"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="subordinate_range" jdbcType="VARCHAR" property="subordinateRange"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.EnterpriseUserDO">
<result column="is_leader_in_depts" jdbcType="LONGVARCHAR" property="isLeaderInDepts"/>
<result column="department" jdbcType="LONGVARCHAR" property="department"/>
<result column="jobnumber" jdbcType="LONGVARCHAR" property="jobnumber"/>
<result column="monitored_departments" jdbcType="LONGVARCHAR" property="monitoredDepartments"/>
<result column="departments" jdbcType="LONGVARCHAR" property="departments"/>
<result column="user_region_ids" jdbcType="LONGVARCHAR" property="userRegionIds"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, name, tel, work_place, remark, mobile, email, org_email, active, order_in_depts,
main_admin, is_admin, is_boss, dingId, unionid, is_hide, position, avatar, extattr,
is_enterprise, roles, is_leader, face_url, create_time, language, user_status, third_oa_unique_flag,
subordinate_change, update_time, subordinate_range
</sql>
<sql id="Blob_Column_List">
is_leader_in_depts, department, jobnumber, monitored_departments, departments, user_region_ids
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
user_id,
</if>
<if test="record.name != null">
name,
</if>
<if test="record.tel != null">
tel,
</if>
<if test="record.workPlace != null">
work_place,
</if>
<if test="record.remark != null">
remark,
</if>
<if test="record.mobile != null">
mobile,
</if>
<if test="record.email != null">
email,
</if>
<if test="record.orgEmail != null">
org_email,
</if>
<if test="record.active != null">
active,
</if>
<if test="record.orderInDepts != null">
order_in_depts,
</if>
<if test="record.mainAdmin != null">
main_admin,
</if>
<if test="record.isAdmin != null">
is_admin,
</if>
<if test="record.isBoss != null">
is_boss,
</if>
<if test="record.dingid != null">
dingId,
</if>
<if test="record.unionid != null">
unionid,
</if>
<if test="record.isHide != null">
is_hide,
</if>
<if test="record.position != null">
position,
</if>
<if test="record.avatar != null">
avatar,
</if>
<if test="record.extattr != null">
extattr,
</if>
<if test="record.isEnterprise != null">
is_enterprise,
</if>
<if test="record.roles != null">
roles,
</if>
<if test="record.isLeader != null">
is_leader,
</if>
<if test="record.faceUrl != null">
face_url,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.language != null">
language,
</if>
<if test="record.userStatus != null">
user_status,
</if>
<if test="record.thirdOaUniqueFlag != null">
third_oa_unique_flag,
</if>
<if test="record.subordinateChange != null">
subordinate_change,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.subordinateRange != null">
subordinate_range,
</if>
<if test="record.isLeaderInDepts != null">
is_leader_in_depts,
</if>
<if test="record.department != null">
department,
</if>
<if test="record.jobnumber != null">
jobnumber,
</if>
<if test="record.monitoredDepartments != null">
monitored_departments,
</if>
<if test="record.departments != null">
departments,
</if>
<if test="record.userRegionIds != null">
user_region_ids,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
#{record.userId},
</if>
<if test="record.name != null">
#{record.name},
</if>
<if test="record.tel != null">
#{record.tel},
</if>
<if test="record.workPlace != null">
#{record.workPlace},
</if>
<if test="record.remark != null">
#{record.remark},
</if>
<if test="record.mobile != null">
#{record.mobile},
</if>
<if test="record.email != null">
#{record.email},
</if>
<if test="record.orgEmail != null">
#{record.orgEmail},
</if>
<if test="record.active != null">
#{record.active},
</if>
<if test="record.orderInDepts != null">
#{record.orderInDepts},
</if>
<if test="record.mainAdmin != null">
#{record.mainAdmin},
</if>
<if test="record.isAdmin != null">
#{record.isAdmin},
</if>
<if test="record.isBoss != null">
#{record.isBoss},
</if>
<if test="record.dingid != null">
#{record.dingid},
</if>
<if test="record.unionid != null">
#{record.unionid},
</if>
<if test="record.isHide != null">
#{record.isHide},
</if>
<if test="record.position != null">
#{record.position},
</if>
<if test="record.avatar != null">
#{record.avatar},
</if>
<if test="record.extattr != null">
#{record.extattr},
</if>
<if test="record.isEnterprise != null">
#{record.isEnterprise},
</if>
<if test="record.roles != null">
#{record.roles},
</if>
<if test="record.isLeader != null">
#{record.isLeader},
</if>
<if test="record.faceUrl != null">
#{record.faceUrl},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.language != null">
#{record.language},
</if>
<if test="record.userStatus != null">
#{record.userStatus},
</if>
<if test="record.thirdOaUniqueFlag != null">
#{record.thirdOaUniqueFlag},
</if>
<if test="record.subordinateChange != null">
#{record.subordinateChange},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.subordinateRange != null">
#{record.subordinateRange},
</if>
<if test="record.isLeaderInDepts != null">
#{record.isLeaderInDepts},
</if>
<if test="record.department != null">
#{record.department},
</if>
<if test="record.jobnumber != null">
#{record.jobnumber},
</if>
<if test="record.monitoredDepartments != null">
#{record.monitoredDepartments},
</if>
<if test="record.departments != null">
#{record.departments},
</if>
<if test="record.userRegionIds != null">
#{record.userRegionIds},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update enterprise_user
<set>
<if test="record.userId != null">
user_id = #{record.userId},
</if>
<if test="record.name != null">
name = #{record.name},
</if>
<if test="record.tel != null">
tel = #{record.tel},
</if>
<if test="record.workPlace != null">
work_place = #{record.workPlace},
</if>
<if test="record.remark != null">
remark = #{record.remark},
</if>
<if test="record.mobile != null">
mobile = #{record.mobile},
</if>
<if test="record.email != null">
email = #{record.email},
</if>
<if test="record.orgEmail != null">
org_email = #{record.orgEmail},
</if>
<if test="record.active != null">
active = #{record.active},
</if>
<if test="record.orderInDepts != null">
order_in_depts = #{record.orderInDepts},
</if>
<if test="record.mainAdmin != null">
main_admin = #{record.mainAdmin},
</if>
<if test="record.isAdmin != null">
is_admin = #{record.isAdmin},
</if>
<if test="record.isBoss != null">
is_boss = #{record.isBoss},
</if>
<if test="record.dingid != null">
dingId = #{record.dingid},
</if>
<if test="record.unionid != null">
unionid = #{record.unionid},
</if>
<if test="record.isHide != null">
is_hide = #{record.isHide},
</if>
<if test="record.position != null">
position = #{record.position},
</if>
<if test="record.avatar != null">
avatar = #{record.avatar},
</if>
<if test="record.extattr != null">
extattr = #{record.extattr},
</if>
<if test="record.isEnterprise != null">
is_enterprise = #{record.isEnterprise},
</if>
<if test="record.roles != null">
roles = #{record.roles},
</if>
<if test="record.isLeader != null">
is_leader = #{record.isLeader},
</if>
<if test="record.faceUrl != null">
face_url = #{record.faceUrl},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.language != null">
language = #{record.language},
</if>
<if test="record.userStatus != null">
user_status = #{record.userStatus},
</if>
<if test="record.thirdOaUniqueFlag != null">
third_oa_unique_flag = #{record.thirdOaUniqueFlag},
</if>
<if test="record.subordinateChange != null">
subordinate_change = #{record.subordinateChange},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.subordinateRange != null">
subordinate_range = #{record.subordinateRange},
</if>
<if test="record.isLeaderInDepts != null">
is_leader_in_depts = #{record.isLeaderInDepts},
</if>
<if test="record.department != null">
department = #{record.department},
</if>
<if test="record.jobnumber != null">
jobnumber = #{record.jobnumber},
</if>
<if test="record.monitoredDepartments != null">
monitored_departments = #{record.monitoredDepartments},
</if>
<if test="record.departments != null">
departments = #{record.departments},
</if>
<if test="record.userRegionIds != null">
user_region_ids = #{record.userRegionIds},
</if>
</set>
where id = #{record.id}
</update>
<select id="getUserInfoById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from
enterprise_user
where
user_id = #{userId}
</select>
<insert id="batchInsertOrUpdate" parameterType="java.util.List">
insert into enterprise_user (
id,
user_id,
`name`,
mobile,
email,
active,
order_in_depts,
main_admin,
is_admin,
is_boss,
dingId,
unionid,
is_leader_in_depts,
is_hide,
departments,
`position`,
avatar,
jobnumber,
extattr,
roles,
is_leader,
create_time
) values
<foreach collection="list" item="it" separator=",">
(
#{it.id, jdbcType=VARCHAR},
#{it.userId, jdbcType=VARCHAR},
#{it.name, jdbcType=VARCHAR},
#{it.mobile, jdbcType=VARCHAR},
#{it.email, jdbcType=VARCHAR},
#{it.active, jdbcType=BOOLEAN},
#{it.orderInDepts, jdbcType=VARCHAR},
#{it.mainAdmin, jdbcType=BOOLEAN},
#{it.isAdmin, jdbcType=BOOLEAN},
#{it.isBoss, jdbcType=BOOLEAN},
#{it.dingid, jdbcType=VARCHAR},
#{it.unionid, jdbcType=VARCHAR},
#{it.isLeaderInDepts, jdbcType=VARCHAR},
#{it.isHide, jdbcType=BOOLEAN},
#{it.departments, jdbcType=VARCHAR},
#{it.position, jdbcType=VARCHAR},
#{it.avatar, jdbcType=VARCHAR},
#{it.jobnumber, jdbcType=VARCHAR},
#{it.extattr, jdbcType=VARCHAR},
#{it.roles, jdbcType=VARCHAR},
#{it.isLeader, jdbcType=BOOLEAN},
sysdate()
)
</foreach>
ON DUPLICATE KEY UPDATE
departments=values(departments),
`name`=values(name),
main_admin=values(main_admin),
is_admin=values(is_admin),
mobile = values(mobile),
order_in_depts=values(order_in_depts),
is_leader_in_depts=values(is_leader_in_depts),
avatar=values(avatar),
active=values(active),
`position`=values(position),
roles=values(roles),
jobnumber=values(jobnumber)
</insert>
<update id="batchUpdateDiffUserDiffRegionIds">
update enterprise_user
set user_region_ids =
<foreach collection="list" item="item" index="index" separator=" " open="case user_id" close="end">
when #{item.userId} then #{item.userRegionIds}
</foreach>
where user_id in
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
#{item.userId}
</foreach>
</update>
<select id="fuzzyUsersByDepartment" resultType="com.cool.store.entity.EnterpriseUserDO">
select
u.user_id as userId,
u.name as name,
u.roles as roles,
u.jobnumber as jobnumber,
u.remark as remark,
u.mobile as mobile,
u.email as email,
u.org_email as orgEmail,
u.avatar as avatar,
u.user_status as userStatus,
u.unionid as unionid
from enterprise_user u
left join enterprise_user_role ul on u.user_id=ul.user_id
left join sys_role r on ul.role_id=r.id
<where>
u.active = true and u.user_id != 'a100000001'
<if test="deptId !=null and deptId !=''">
and u.departments like concat('%/',#{deptId},'/%')
</if>
<if test="userName !=null and userName !=''">
and u.name like concat('%',#{userName},'%')
</if>
<if test="jobNumber !=null and jobNumber !=''">
and u.jobnumber = #{jobNumber}
</if>
<if test="roleId !=null ">
and r.id=#{roleId}
</if>
<if test="userStatus !=null ">
and u.user_status=#{userStatus}
</if>
<if test="regionId !=null and regionId !=''">
and user_region_ids like concat('%/',#{regionId},'/%')
</if>
<if test="userIdList != null and userIdList.size > 0">
and u.user_id in
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
#{userId}
</foreach>
</if>
</where>
GROUP BY u.user_id
<if test="orderBy != null and orderBy != '' ">
order by u.${orderBy} ${orderRule}
</if>
</select>
<select id="fuzzyUsersByNotRole" resultType="com.cool.store.entity.EnterpriseUserDO">
select
user_id as userId,
name as name,
jobnumber as jobnumber,
remark as remark,
mobile as mobile,
email as email,
org_email as orgEmail,
avatar as avatar,
roles as roles,
departments as departments,
user_status as userStatus,
unionid
from enterprise_user
<where>
active = true and user_id != 'a100000001'
<if test="deptId !=null and deptId !=''">
and departments like concat('%/',#{deptId},'/%')
</if>
<if test="userName !=null and userName !=''">
and name like concat('%',#{userName},'%')
</if>
<if test="jobNumber !=null and jobNumber !=''">
and jobnumber = #{jobNumber}
</if>
<if test="userStatus !=null">
and user_status = #{userStatus}
</if>
<if test="regionId !=null and regionId !=''">
and user_region_ids like concat('%/',#{regionId},'/%')
</if>
<if test="userIdList != null and userIdList.size > 0">
and user_id in
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
#{userId}
</foreach>
</if>
</where>
ORDER BY user_id
<if test="orderBy != null and orderBy != '' ">
, ${orderBy}
</if>
</select>
<select id="selectUsersByUserIds" resultType="com.cool.store.entity.EnterpriseUserDO">
select
id,
user_id as userId,
`name` as name,
avatar,
active,
mobile,
jobnumber,
`language`,
user_status as userStatus,
subordinate_range as subordinateRange
from enterprise_user
<where>
user_id != 'a100000001'
and
<if test="userIds.size()>0 and userIds!=null">or
user_id in
<foreach
collection="userIds" item="userId" separator="," open="(" close=")">
#{userId, jdbcType=VARCHAR}
</foreach>
</if>
</where>
</select>
<select id="listUserByGroupId" resultType="com.cool.store.entity.EnterpriseUserDO">
select
u.user_id as userId,
u.name as name,
u.roles as roles,
u.jobnumber as jobnumber,
u.mobile as mobile,
u.email as email,
u.org_email as orgEmail,
u.avatar as avatar,
u.departments as departments,
u.user_status as userStatus,
u.unionid as unionid
from enterprise_user u
left join enterprise_user_group_mapping ug on u.user_id=ug.user_id
<where>
ug.group_id = #{groupId} and u.active = true and u.user_id != 'a100000001'
<if test="userName !=null and userName !=''">
and u.name like concat('%',#{userName},'%')
</if>
<if test="userIdList != null and userIdList.size > 0">
and u.user_id in
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
#{userId}
</foreach>
</if>
</where>
GROUP BY u.user_id
</select>
<select id="listByRegionIdList" resultType="com.cool.store.entity.EnterpriseUserDO">
select
id as id,
user_id as userId,
`name` as name,
tel as tel,
work_place as workPlace,
remark as remark,
mobile as mobile,
email as email,
org_email as orgEmail,
active as active,
order_in_depts as orderInDepts,
is_admin as isAdmin,
is_boss as isBoss,
dingId as dingId,
unionid as unionid,
is_leader_in_depts as isLeaderInDepts,
is_hide as isHide,
`position` as position,
avatar as avatar,
jobnumber as jobnumber,
extattr as extattr,
is_enterprise as isEnterprise,
roles as roles,
monitored_departments as monitoredDepartments,
departments as departments,
is_leader as isLeader,
face_url as faceUrl,
create_time as createTime,
`language` as language
from enterprise_user where user_id != 'a100000001'
<foreach collection="regionIdList" item="regionId" separator=" or " open="and (" close=" )">
user_region_ids like concat('%/', #{regionId}, '/%')
</foreach>
order by id
</select>
<update id="updateEnterpriseUser">
update enterprise_user
<set>
<if test="enterpriseUserDO.name != null and enterpriseUserDO.name !=''">`name` = #{enterpriseUserDO.name},</if>
<if test="enterpriseUserDO.tel != null and enterpriseUserDO.tel !=''">`tel` = #{enterpriseUserDO.tel},</if>
<if test="enterpriseUserDO.workPlace != null and enterpriseUserDO.workPlace !=''">`work_place` =
#{enterpriseUserDO.workPlace},
</if>
<if test="enterpriseUserDO.mobile != null and enterpriseUserDO.mobile !=''">`mobile` =
#{enterpriseUserDO.mobile},
</if>
<if test="enterpriseUserDO.email != null and enterpriseUserDO.email !=''">`email` = #{enterpriseUserDO.email},
</if>
<if test="enterpriseUserDO.orgEmail != null and enterpriseUserDO.orgEmail !=''">`org_email` =
#{enterpriseUserDO.orgEmail},
</if>
<if test="enterpriseUserDO.active != null">`active` =
#{enterpriseUserDO.active},
</if>
<if test="enterpriseUserDO.orderInDepts != null and enterpriseUserDO.orderInDepts !=''">`order_in_depts` =
#{enterpriseUserDO.orderInDepts},
</if>
<if test="enterpriseUserDO.mainAdmin != null">`main_admin` = #{enterpriseUserDO.mainAdmin},</if>
<if test="enterpriseUserDO.isAdmin != null">`is_admin` = #{enterpriseUserDO.isAdmin},</if>
<if test="enterpriseUserDO.isBoss != null">`is_boss` = #{enterpriseUserDO.isBoss},</if>
<if test="enterpriseUserDO.dingid != null and enterpriseUserDO.dingid !=''">`dingId` =
#{enterpriseUserDO.dingid},
</if>
<if test="enterpriseUserDO.unionid != null and enterpriseUserDO.unionid !=''">`unionid` =
#{enterpriseUserDO.unionid},
</if>
<if test="enterpriseUserDO.isLeaderInDepts != null and enterpriseUserDO.isLeaderInDepts !=''">
`is_leader_in_depts` = #{enterpriseUserDO.isLeaderInDepts},
</if>
<if test="enterpriseUserDO.isHide != null">`is_hide` = #{enterpriseUserDO.isHide},</if>
<if test="enterpriseUserDO.position != null and enterpriseUserDO.position !=''">`position` =
#{enterpriseUserDO.position},
</if>
<if test="enterpriseUserDO.avatar != null and enterpriseUserDO.avatar !=''">`avatar` =
#{enterpriseUserDO.avatar},
</if>
<if test="enterpriseUserDO.jobnumber != null and enterpriseUserDO.jobnumber !=''">`jobnumber` =
#{enterpriseUserDO.jobnumber},
</if>
<if test="enterpriseUserDO.extattr != null and enterpriseUserDO.extattr !=''">`extattr` =
#{enterpriseUserDO.extattr},
</if>
<if test="enterpriseUserDO.isEnterprise != null">`is_enterprise` =
#{enterpriseUserDO.isEnterprise},
</if>
<if test="enterpriseUserDO.roles != null and enterpriseUserDO.roles !=''">`roles` = #{enterpriseUserDO.roles},
</if>
<if test="enterpriseUserDO.monitoredDepartments != null and enterpriseUserDO.monitoredDepartments !=''">`
monitored_departments` = #{enterpriseUserDO.monitoredDepartments},
</if>
<if test="enterpriseUserDO.departments != null and enterpriseUserDO.departments !=''">`departments` =
#{enterpriseUserDO.departments},
</if>
<if test="enterpriseUserDO.isLeader != null">`is_leader` = #{enterpriseUserDO.isLeader},</if>
<if test="enterpriseUserDO.faceUrl != null and enterpriseUserDO.faceUrl !=''">`face_url` =
#{enterpriseUserDO.faceUrl},
</if>
<if test="enterpriseUserDO.createTime != null">`create_time` = #{enterpriseUserDO.createTime},</if>
<if test="enterpriseUserDO.language != null and enterpriseUserDO.language !=''">`language` =
#{enterpriseUserDO.language},
</if>
<if test="enterpriseUserDO.userStatus != null">`user_status` =
#{enterpriseUserDO.userStatus},
</if>
<if test="enterpriseUserDO.thirdOaUniqueFlag != null and enterpriseUserDO.thirdOaUniqueFlag !=''">`third_oa_unique_flag` =
#{enterpriseUserDO.thirdOaUniqueFlag},
</if>
<if test="enterpriseUserDO.userRegionIds != null and enterpriseUserDO.userRegionIds !=''">
`user_region_ids` = #{enterpriseUserDO.userRegionIds},
</if>
<if test="enterpriseUserDO.subordinateChange != null and enterpriseUserDO.subordinateChange !=''">
`subordinate_change` = #{enterpriseUserDO.subordinateChange},
</if>
<if test="enterpriseUserDO.subordinateRange != null and enterpriseUserDO.subordinateRange !=''">
`subordinate_range` = #{enterpriseUserDO.subordinateRange},
</if>
<if test="enterpriseUserDO.remark != null and enterpriseUserDO.remark !=''">
`remark` = #{enterpriseUserDO.remark},
</if>
</set>
where user_id =#{enterpriseUserDO.userId}
</update>
<select id="getMainAdminUserIds" resultType="string">
select user_id from enterprise_user where main_admin = true and active = true
</select>
<select id="selectSpecifyNodeUserIds" resultType="string">
select
user_id
from
enterprise_user
where
departments like concat('%/',#{dingDeptId},'/%')
</select>
<select id="selectAllUserIds" resultType="java.lang.String">
select user_id as userId from enterprise_user
</select>
<select id="selectByUserIdIgnoreActive" resultType="com.cool.store.entity.EnterpriseUserDO">
select
id as id,
user_id as userId,
`name` as name,
tel as tel,
work_place as workPlace,
remark as remark,
mobile as mobile,
email as email,
org_email as orgEmail,
active as active,
order_in_depts as orderInDepts,
is_admin as isAdmin,
is_boss as isBoss,
dingId as dingId,
unionid as unionid,
is_leader_in_depts as isLeaderInDepts,
is_hide as isHide,
`position` as position,
avatar as avatar,
face_url as faceUrl,
jobnumber as jobnumber,
extattr as extattr,
is_enterprise as isEnterprise,
roles as roles,
monitored_departments as monitoredDepartments,
departments as departments,
is_leader as isLeader,
create_time as createTime,
`language` as language,
third_oa_unique_flag as thirdOaUniqueFlag,
subordinate_change as subordinateChange,
subordinate_range as subordinateRange
from enterprise_user where user_id = #{userId, jdbcType=VARCHAR}
</select>
<insert id="insertEnterpriseUser">
insert into enterprise_user
( `id`,
`user_id`,
`name`,
`tel`,
`work_place`,
`remark`,
`mobile`,
`email`,
`org_email`,
`active`,
`order_in_depts`,
`main_admin`,
`is_admin`,
`is_boss`,
`dingId`,
`unionid`,
`is_leader_in_depts`,
`is_hide`,
`position`,
`avatar`,
`jobnumber`,
`extattr`,
`is_enterprise`,
`roles`,
`monitored_departments`,
`departments`,
`is_leader`,
`face_url`,
`create_time`,
`user_status`,
`third_oa_unique_flag`,
`subordinate_range`
)
values
(
#{entity.id},
#{entity.userId},
#{entity.name},
#{entity.tel},
#{entity.workPlace},
#{entity.remark},
#{entity.mobile},
#{entity.email},
#{entity.orgEmail},
#{entity.active},
#{entity.orderInDepts},
#{entity.mainAdmin},
#{entity.isAdmin},
#{entity.isBoss},
#{entity.dingid},
#{entity.unionid},
#{entity.isLeaderInDepts},
#{entity.isHide},
#{entity.position},
#{entity.avatar},
#{entity.jobnumber},
#{entity.extattr},
#{entity.isEnterprise},
#{entity.roles},
#{entity.monitoredDepartments},
#{entity.departments},
#{entity.isLeader},
#{entity.faceUrl},
now(),
#{entity.userStatus},
#{entity.thirdOaUniqueFlag},
#{entity.subordinateRange}
)
</insert>
</mapper>