add
This commit is contained in:
@@ -0,0 +1,32 @@
|
|||||||
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @date 2023-06-06 02:29
|
||||||
|
*/
|
||||||
|
public interface EnterpriseUserMapper {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认插入方法,只会给有值的字段赋值
|
||||||
|
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||||
|
* dateTime:2023-06-06 02:29
|
||||||
|
*/
|
||||||
|
int insertSelective(EnterpriseUserDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||||
|
* dateTime:2023-06-06 02:29
|
||||||
|
*/
|
||||||
|
int updateByPrimaryKeySelective(EnterpriseUserDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
EnterpriseUserDO getUserInfoById(@Param("userId") String userId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,229 @@
|
|||||||
|
<?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="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="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="face_url" jdbcType="VARCHAR" property="faceUrl"/>
|
||||||
|
<result column="user_status" jdbcType="TINYINT" property="userStatus"/>
|
||||||
|
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.EnterpriseUserDO">
|
||||||
|
<result column="user_region_ids" jdbcType="LONGVARCHAR" property="userRegionIds"/>
|
||||||
|
</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,
|
||||||
|
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>
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update enterprise_user
|
||||||
|
<set>
|
||||||
|
<if test="userId != null">
|
||||||
|
user_id = #{userId},
|
||||||
|
</if>
|
||||||
|
<if test="name != null">
|
||||||
|
name = #{name},
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
remark = #{remark},
|
||||||
|
</if>
|
||||||
|
<if test="mobile != null">
|
||||||
|
mobile = #{mobile},
|
||||||
|
</if>
|
||||||
|
<if test="email != null">
|
||||||
|
email = #{email},
|
||||||
|
</if>
|
||||||
|
<if test="orgEmail != null">
|
||||||
|
org_email = #{orgEmail},
|
||||||
|
</if>
|
||||||
|
<if test="mainAdmin != null">
|
||||||
|
main_admin = #{mainAdmin},
|
||||||
|
</if>
|
||||||
|
<if test="isAdmin != null">
|
||||||
|
is_admin = #{isAdmin},
|
||||||
|
</if>
|
||||||
|
<if test="unionid != null">
|
||||||
|
unionid = #{unionid},
|
||||||
|
</if>
|
||||||
|
<if test="position != null">
|
||||||
|
position = #{position},
|
||||||
|
</if>
|
||||||
|
<if test="avatar != null">
|
||||||
|
avatar = #{avatar},
|
||||||
|
</if>
|
||||||
|
<if test="jobnumber != null">
|
||||||
|
jobnumber = #{jobnumber},
|
||||||
|
</if>
|
||||||
|
<if test="isLeader != null">
|
||||||
|
is_leader = #{isLeader},
|
||||||
|
</if>
|
||||||
|
<if test="faceUrl != null">
|
||||||
|
face_url = #{faceUrl},
|
||||||
|
</if>
|
||||||
|
<if test="userStatus != null">
|
||||||
|
user_status = #{userStatus},
|
||||||
|
</if>
|
||||||
|
<if test="deleted != null">
|
||||||
|
deleted = #{deleted},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
<if test="userRegionIds != null">
|
||||||
|
user_region_ids = #{userRegionIds},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{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>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
package com.cool.store.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @date 2023-06-06 02:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EnterpriseUserDO implements Serializable {
|
||||||
|
@ApiModelProperty("用户主键id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("手机号码")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("员工的电子邮箱")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@ApiModelProperty("员工的企业邮箱")
|
||||||
|
private String orgEmail;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否是主管理员,0:否,1:是")
|
||||||
|
private Boolean mainAdmin;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否为企业的管理员, true表示是, false表示不是")
|
||||||
|
private Boolean isAdmin;
|
||||||
|
|
||||||
|
@ApiModelProperty("在当前isv全局范围内唯一标识一个用户的身份,用户无法修改")
|
||||||
|
private String unionid;
|
||||||
|
|
||||||
|
@ApiModelProperty("")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
@ApiModelProperty("头像url")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty("工号")
|
||||||
|
private String jobnumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否是部门的主管, true表示是, false表示不是")
|
||||||
|
private Boolean isLeader;
|
||||||
|
|
||||||
|
@ApiModelProperty("人脸照片url")
|
||||||
|
private String faceUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户状态 0待审核 1正常 2冻结")
|
||||||
|
private Integer userStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标识")
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("部门集合(region_ids)")
|
||||||
|
private String userRegionIds;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user