大调整

This commit is contained in:
zhangchenbiao
2023-06-08 15:57:28 +08:00
parent 8e866554a1
commit 071725fb3d
44 changed files with 740 additions and 2352 deletions

View File

@@ -12,10 +12,10 @@
<result column="main_admin" jdbcType="BIT" property="mainAdmin"/>
<result column="is_admin" jdbcType="BIT" property="isAdmin"/>
<result column="unionid" jdbcType="VARCHAR" property="unionid"/>
<result column="position" jdbcType="VARCHAR" property="position"/>
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
<result column="jobnumber" jdbcType="VARCHAR" property="jobnumber"/>
<result column="is_leader" jdbcType="BIT" property="isLeader"/>
<result column="leader_dept_ids" jdbcType="VARCHAR" property="leaderDeptIds"/>
<result column="face_url" jdbcType="VARCHAR" property="faceUrl"/>
<result column="user_status" jdbcType="TINYINT" property="userStatus"/>
<result column="deleted" jdbcType="BIT" property="deleted"/>
@@ -27,132 +27,143 @@
</resultMap>
<sql id="Base_Column_List">
id, user_id, name, remark, mobile, email, org_email, main_admin, is_admin, unionid,
position, avatar, jobnumber, is_leader, face_url, user_status, deleted, create_time,
avatar, jobnumber, is_leader, leader_dept_ids, face_url, user_status, deleted, create_time,
update_time
</sql>
<sql id="Blob_Column_List">
user_region_ids
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="name != null">
name,
</if>
<if test="remark != null">
remark,
</if>
<if test="mobile != null">
mobile,
</if>
<if test="email != null">
email,
</if>
<if test="orgEmail != null">
org_email,
</if>
<if test="mainAdmin != null">
main_admin,
</if>
<if test="isAdmin != null">
is_admin,
</if>
<if test="unionid != null">
unionid,
</if>
<if test="position != null">
position,
</if>
<if test="avatar != null">
avatar,
</if>
<if test="jobnumber != null">
jobnumber,
</if>
<if test="isLeader != null">
is_leader,
</if>
<if test="faceUrl != null">
face_url,
</if>
<if test="userStatus != null">
user_status,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="userRegionIds != null">
user_region_ids,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId},
</if>
<if test="name != null">
#{name},
</if>
<if test="remark != null">
#{remark},
</if>
<if test="mobile != null">
#{mobile},
</if>
<if test="email != null">
#{email},
</if>
<if test="orgEmail != null">
#{orgEmail},
</if>
<if test="mainAdmin != null">
#{mainAdmin},
</if>
<if test="isAdmin != null">
#{isAdmin},
</if>
<if test="unionid != null">
#{unionid},
</if>
<if test="position != null">
#{position},
</if>
<if test="avatar != null">
#{avatar},
</if>
<if test="jobnumber != null">
#{jobnumber},
</if>
<if test="isLeader != null">
#{isLeader},
</if>
<if test="faceUrl != null">
#{faceUrl},
</if>
<if test="userStatus != null">
#{userStatus},
</if>
<if test="deleted != null">
#{deleted},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="userRegionIds != null">
#{userRegionIds},
</if>
</trim>
<insert id="batchInsertOrUpdate">
<foreach collection="recordList" item="record" separator=";">
insert into enterprise_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.id != null">
id,
</if>
<if test="record.userId != null">
user_id,
</if>
<if test="record.name != null">
name,
</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.mainAdmin != null">
main_admin,
</if>
<if test="record.isAdmin != null">
is_admin,
</if>
<if test="record.unionid != null">
unionid,
</if>
<if test="record.avatar != null">
avatar,
</if>
<if test="record.jobnumber != null">
jobnumber,
</if>
<if test="record.isLeader != null">
is_leader,
</if>
<if test="record.leaderDeptIds != null">
leader_dept_ids,
</if>
<if test="record.faceUrl != null">
face_url,
</if>
<if test="record.userStatus != null">
user_status,
</if>
<if test="record.deleted != null">
deleted,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.userRegionIds != null">
user_region_ids,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.id != null">
#{record.id},
</if>
<if test="record.userId != null">
#{record.userId},
</if>
<if test="record.name != null">
#{record.name},
</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.mainAdmin != null">
#{record.mainAdmin},
</if>
<if test="record.isAdmin != null">
#{record.isAdmin},
</if>
<if test="record.unionid != null">
#{record.unionid},
</if>
<if test="record.avatar != null">
#{record.avatar},
</if>
<if test="record.jobnumber != null">
#{record.jobnumber},
</if>
<if test="record.isLeader != null">
#{record.isLeader},
</if>
<if test="record.leaderDeptIds != null">
#{record.leaderDeptIds},
</if>
<if test="record.faceUrl != null">
#{record.faceUrl},
</if>
<if test="record.userStatus != null">
#{record.userStatus},
</if>
<if test="record.deleted != null">
#{record.deleted},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.userRegionIds != null">
#{record.userRegionIds},
</if>
</trim>
ON DUPLICATE KEY UPDATE user_id = values(user_id), name = values(name), remark = values(remark), mobile = values(mobile), email = values(email), org_email = values(org_email)
, main_admin = values(main_admin), is_admin = values(is_admin), unionid = values(unionid), avatar = values(avatar), jobnumber = values(jobnumber), is_leader = values(is_leader)
, leader_dept_ids = values(leader_dept_ids), face_url = values(face_url), user_status = values(user_status), user_region_ids = values(user_region_ids)
</foreach>
</insert>
<update id="updateByPrimaryKeySelective">
update enterprise_user
@@ -184,9 +195,6 @@
<if test="unionid != null">
unionid = #{unionid},
</if>
<if test="position != null">
position = #{position},
</if>
<if test="avatar != null">
avatar = #{avatar},
</if>
@@ -196,6 +204,9 @@
<if test="isLeader != null">
is_leader = #{isLeader},
</if>
<if test="record.leaderDeptIds != null">
leader_dept_ids = #{record.leaderDeptIds},
</if>
<if test="faceUrl != null">
face_url = #{faceUrl},
</if>
@@ -220,10 +231,15 @@
<select id="getUserInfoById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>, <include refid="Blob_Column_List"/>
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from
enterprise_user
where
user_id = #{userId}
</select>
<update id="deleteUser">
update enterprise_user set deleted = 1 where id in <foreach collection="excludeUserIds" open="(" close=")" separator="," item="userId">#{userId}</foreach>
</update>
</mapper>