yonge 3 年之前
父节点
当前提交
4033aaa8c4

+ 99 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/EmployeeDao.java

@@ -0,0 +1,99 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.yonge.cooleshow.auth.api.entity.SysRole;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.entity.Employee;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+
+public interface EmployeeDao extends BaseDAO<Integer, Employee> {
+
+    /**
+     * 修改密码
+     *
+     * @param userID
+     * @param password
+     */
+    void updatePassword(@Param("userID") Integer userID, @Param("password") String password);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 修改用户账户锁定状态
+     */
+    int updateUserLockStatus(@Param("userID") Integer userID);
+
+
+    void updateUserLock(@Param("userID") Integer userID, @Param("status") int status);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 修改用户离职日期
+     */
+    int updateUserDemissionDate(@Param("userID") Integer userID);
+
+    /**
+     * 根据手机号查询对象
+     *
+     * @param phone
+     * @return
+     */
+    SysUser queryByPhone(String phone);
+
+    /**
+     * 删除用户角色
+     *
+     * @param userId
+     */
+    void delEmployeeRole(Integer userId);
+
+    /**
+     * 批量新增用户角色
+     *
+     * @param id
+     * @param roleIds
+     */
+    void batchAddEmployeeRole(@Param("userId") Integer id, @Param("roleIds") List<Integer> roleIds, @Param("tenantId") Integer tenantId);
+
+    /**
+     * 获取用户权限列表
+     *
+     * @param userId
+     * @return
+     */
+    List<Integer> queryUserRole(Integer userId);
+
+    /**
+     * 获取用户信息
+     *
+     * @param userIds
+     * @return
+     */
+    List<SysUser> getUsers(@Param("userIds") List<Integer> userIds);
+
+    /**
+     * 批量添加角色和菜单关系
+     *
+     * @param roleId  角色id
+     * @param menuIds 菜单集合
+     */
+    int batchInsertRoleMenu(@Param("roleId") Integer roleId, @Param("menuIds") List<Integer> menuIds);
+
+    /**
+     * 根据机构id,和菜单id删除
+     */
+    int delRoleMenu(@Param("menuIds") List<Integer> menuIds);
+
+    /**
+     * 添加角色信息
+     *
+     * @param sysRole
+     * @return
+     */
+    int insertSysRole(SysRole sysRole);
+
+}

+ 317 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Employee.java

@@ -0,0 +1,317 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.enums.JobNatureEnum;
+import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
+
+/**
+ * 对应数据库表(employee):
+ */
+public class Employee extends SysUser {
+
+	/**  */
+	private Integer userId;
+
+	/**  */
+	@ApiModelProperty(value = "机构编号列表,逗号分隔",required = false)
+	private String organIdList;
+
+	/** 工作性质(兼职、全职、临时) */
+	@ApiModelProperty(value = "工作性质",required = false)
+	private JobNatureEnum jobNature;
+
+	/** 是否试用期(1-是 0-否) */
+	@ApiModelProperty(value = "是否试用期",required = false)
+	private YesOrNoEnum isProbationPeriod;
+
+	/** 学历 */
+	@ApiModelProperty(value = "学历",required = false)
+	private String educationBackground;
+
+	/** 毕业学校 */
+	@ApiModelProperty(value = "毕业学校",required = false)
+	private String graduateSchool;
+
+	/** 技术职称 */
+	@ApiModelProperty(value = "技术职称",required = false)
+	private String technicalTitles;
+
+	/** 入职时间 */
+	@ApiModelProperty(value = "入职时间",required = false)
+	private java.util.Date entryDate;
+
+	/** 证件类型 */
+	@ApiModelProperty(value = "证件类型",required = false)
+	private String certificateType;
+
+	/** 证件号码 */
+	@ApiModelProperty(value = "证件号码",required = false)
+	private String certificateNum;
+
+	@ApiModelProperty(value = "社保部门id",required = false)
+	private Integer deptId;
+
+	@ApiModelProperty(value = "部门ids",required = false)
+	private String depIds;
+
+	@ApiModelProperty(value = "岗位ids",required = false)
+	private String postIds;
+
+	@ApiModelProperty(value = "银行卡号",required = false)
+	private String bankCard;
+
+	@ApiModelProperty(value = "开户行",required = false)
+	private String openBankAddress;
+
+	@ApiModelProperty(value = "岗位管理部门",required = false)
+	private String postDeptIds;
+
+	/**  */
+	private java.util.Date updateTime;
+
+	/**  */
+	private java.util.Date createTime;
+
+	/** 介绍 */
+	@ApiModelProperty(value = "介绍",required = false)
+	private String introduction;
+
+	/** 离职日期 */
+	@ApiModelProperty(value = "离职日期",required = false)
+	private java.util.Date demissionDate;
+
+	@ApiModelProperty(value = "角色id列表",required = false)
+	private List<Integer> roleIds;
+
+	@ApiModelProperty(value = "职位id列表",required = false)
+	private List<Integer> positionIds;
+
+	@ApiModelProperty(value = "机构id列表")
+	private List<Integer> tenantIds;
+
+	@ApiModelProperty(value = "创建该机构的人")
+    private Integer createTenantUserId;
+
+	private String contactAddress;
+
+	private String postalCode;
+
+	public List<Integer> getPositionIds() {
+		return positionIds;
+	}
+
+	public void setPositionIds(List<Integer> positionIds) {
+		this.positionIds = positionIds;
+	}
+
+	public String getContactAddress() {
+		return contactAddress;
+	}
+
+	public void setContactAddress(String contactAddress) {
+		this.contactAddress = contactAddress;
+	}
+
+	public String getPostalCode() {
+		return postalCode;
+	}
+
+	public void setPostalCode(String postalCode) {
+		this.postalCode = postalCode;
+	}
+
+	public List<Integer> getRoleIds() {
+		return roleIds;
+	}
+
+	public void setRoleIds(List<Integer> roleIds) {
+		this.roleIds = roleIds;
+	}
+
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+
+	public Integer getUserId(){
+		return this.userId;
+	}
+
+	public String getOrganIdList() {
+		return organIdList;
+	}
+
+	public void setOrganIdList(String organIdList) {
+		this.organIdList = organIdList;
+	}
+
+	public void setEducationBackground(String educationBackground){
+		this.educationBackground = educationBackground;
+	}
+
+	public String getEducationBackground(){
+		return this.educationBackground;
+	}
+
+	public void setGraduateSchool(String graduateSchool){
+		this.graduateSchool = graduateSchool;
+	}
+
+	public String getGraduateSchool(){
+		return this.graduateSchool;
+	}
+
+	public void setTechnicalTitles(String technicalTitles){
+		this.technicalTitles = technicalTitles;
+	}
+
+	public String getTechnicalTitles(){
+		return this.technicalTitles;
+	}
+
+	public void setEntryDate(java.util.Date entryDate){
+		this.entryDate = entryDate;
+	}
+
+	public java.util.Date getEntryDate(){
+		return this.entryDate;
+	}
+
+	public void setCertificateType(String certificateType){
+		this.certificateType = certificateType;
+	}
+
+	public String getCertificateType(){
+		return this.certificateType;
+	}
+
+	public void setCertificateNum(String certificateNum){
+		this.certificateNum = certificateNum;
+	}
+
+	public String getCertificateNum(){
+		return this.certificateNum;
+	}
+
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+
+	public void setIntroduction(String introduction){
+		this.introduction = introduction;
+	}
+
+	public String getIntroduction(){
+		return this.introduction;
+	}
+
+	public void setDemissionDate(java.util.Date demissionDate){
+		this.demissionDate = demissionDate;
+	}
+
+	public java.util.Date getDemissionDate(){
+		return this.demissionDate;
+	}
+
+	public JobNatureEnum getJobNature() {
+		return jobNature;
+	}
+
+	public void setJobNature(JobNatureEnum jobNature) {
+		this.jobNature = jobNature;
+	}
+
+	public YesOrNoEnum getIsProbationPeriod() {
+		return isProbationPeriod;
+	}
+
+	public void setIsProbationPeriod(YesOrNoEnum isProbationPeriod) {
+		this.isProbationPeriod = isProbationPeriod;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+	public String getDeptIds() {
+		return depIds;
+	}
+
+	public void setDeptIds(String deptIds) {
+		this.depIds = deptIds;
+	}
+
+	public String getPostIds() {
+		return postIds;
+	}
+
+	public void setPostIds(String postIds) {
+		this.postIds = postIds;
+	}
+
+	public String getBankCard() {
+		return bankCard;
+	}
+
+	public void setBankCard(String bankCard) {
+		this.bankCard = bankCard;
+	}
+
+	public String getOpenBankAddress() {
+		return openBankAddress;
+	}
+
+	public void setOpenBankAddress(String openBankAddress) {
+		this.openBankAddress = openBankAddress;
+	}
+
+	public String getPostDeptIds() {
+		return postDeptIds;
+	}
+
+	public void setPostDeptIds(String postDeptIds) {
+		this.postDeptIds = postDeptIds;
+	}
+
+	public Integer getDeptId() {
+		return deptId;
+	}
+
+	public void setDeptId(Integer deptId) {
+		this.deptId = deptId;
+	}
+
+    public List<Integer> getTenantIds() {
+        return tenantIds;
+    }
+
+    public void setTenantIds(List<Integer> tenantIds) {
+        this.tenantIds = tenantIds;
+    }
+
+    public Integer getCreateTenantUserId() {
+        return createTenantUserId;
+    }
+
+    public void setCreateTenantUserId(Integer createTenantUserId) {
+        this.createTenantUserId = createTenantUserId;
+    }
+}

+ 36 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/JobNatureEnum.java

@@ -0,0 +1,36 @@
+package com.yonge.cooleshow.biz.dal.enums;
+
+import com.yonge.cooleshow.common.enums.BaseEnum;
+
+//工作性质(兼职、全职)
+public enum JobNatureEnum implements BaseEnum<String,JobNatureEnum> {
+    PART_TIME("PART_TIME","兼职"),
+    FULL_TIME("FULL_TIME","全职"),
+    LABOUR("LABOUR","劳务");
+
+    private String code;
+
+    private String msg;
+
+    JobNatureEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+}

+ 65 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/queryInfo/EmployeeQueryInfo.java

@@ -0,0 +1,65 @@
+package com.yonge.cooleshow.biz.dal.queryInfo;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import com.yonge.cooleshow.common.page.QueryInfo;
+
+public class EmployeeQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "工作类型",required = true)
+    private String jobNature;
+
+    @ApiModelProperty(value = "角色ID",required = false)
+    private Long roleId;
+
+    @ApiModelProperty(value = "用户名或电话",required = false)
+    private Long userNameOrPhone;
+
+    /** 是否离职 */
+    @ApiModelProperty(value = "是否离职",required = false)
+    private Boolean demissionflag;
+
+    /** 是否冻结 */
+    @ApiModelProperty(value = "是否冻结",required = false)
+    private Boolean lockFlag;
+
+    public Boolean getLockFlag() {
+        return lockFlag;
+    }
+
+    public void setLockFlag(Boolean lockFlag) {
+        this.lockFlag = lockFlag;
+    }
+
+    public Boolean getDemissionflag() {
+        return demissionflag;
+    }
+
+    public void setDemissionflag(Boolean demissionflag) {
+        this.demissionflag = demissionflag;
+    }
+
+    public String getJobNature() {
+        return jobNature;
+    }
+
+    public void setJobNature(String jobNature) {
+        this.jobNature = jobNature;
+    }
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
+    public Long getUserNameOrPhone() {
+        return userNameOrPhone;
+    }
+
+    public void setUserNameOrPhone(Long userNameOrPhone) {
+        this.userNameOrPhone = userNameOrPhone;
+    }
+}

+ 29 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/EmployeeService.java

@@ -0,0 +1,29 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import java.util.List;
+
+import com.yonge.cooleshow.auth.api.entity.SysRole;
+import com.yonge.cooleshow.biz.dal.entity.Employee;
+import com.yonge.cooleshow.common.service.BaseService;
+
+public interface EmployeeService extends BaseService<Integer, Employee> {
+
+    /**
+     * 新增员工
+     * @param employee
+     */
+    void add(Employee employee) throws Exception;
+
+    /**
+     * 修改员工信息
+     * @param employee
+     */
+    void updateEmployee(Employee employee);
+
+    List<Integer> queryUserRole(Integer sysUserId);
+
+    int batchInsertRoleMenu( Integer roleId, List<Integer> menuIds);
+
+    int insertSysRole(SysRole sysRole);
+
+}

+ 78 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/EmployeeServiceImpl.java

@@ -0,0 +1,78 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.LockedException;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysRole;
+import com.yonge.cooleshow.biz.dal.dao.EmployeeDao;
+import com.yonge.cooleshow.biz.dal.dao.TeacherDao;
+import com.yonge.cooleshow.biz.dal.entity.Employee;
+import com.yonge.cooleshow.biz.dal.service.EmployeeService;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+import com.yonge.cooleshow.common.service.impl.BaseServiceImpl;
+
+@Service
+public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> implements EmployeeService {
+
+    @Autowired
+    private EmployeeDao employeeDao;
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private TeacherDao teacherDao;
+
+    @Override
+    public BaseDAO<Integer, Employee> getDAO() {
+        return employeeDao;
+    }
+
+    public static void checkTenantId(Integer tenantId, Integer targetTenantId) {
+        //如果机构不一致,不允许跨机构注册
+        if (tenantId != null && tenantId != 0 && !tenantId.equals(targetTenantId)) {
+            throw new LockedException("用户已注册");
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void add(Employee employee) {
+
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateEmployee(Employee employee) {
+
+    }
+
+    @Override
+    public List<Integer> queryUserRole(Integer sysUserId) {
+        return employeeDao.queryUserRole(sysUserId);
+    }
+
+    /**
+     * 批量添加角色和菜单关系
+     *
+     * @param roleId  角色id
+     * @param menuIds 菜单集合
+     */
+    @Override
+    public int batchInsertRoleMenu(Integer roleId, List<Integer> menuIds) {
+        return employeeDao.batchInsertRoleMenu(roleId, menuIds);
+    }
+
+    /**
+     * 添加角色信息
+     *
+     * @param sysRole
+     */
+    @Override
+    public int insertSysRole(SysRole sysRole) {
+        return employeeDao.insertSysRole(sysRole);
+    }
+
+}

+ 217 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -0,0 +1,217 @@
+<?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.yonge.cooleshow.biz.dal.dao.EmployeeDao">
+
+    <resultMap type="com.yonge.cooleshow.biz.dal.entity.Employee" id="Employee">
+        <result column="user_id_" property="userId"/>
+        <result column="organ_id_list_" property="organIdList"/>
+        <result column="job_nature_" property="jobNature"/>
+        <result column="is_probation_period_" property="isProbationPeriod"/>
+        <result column="education_background_" property="educationBackground"/>
+        <result column="graduate_school_" property="graduateSchool"/>
+        <result column="technical_titles_" property="technicalTitles"/>
+        <result column="entry_date_" property="entryDate"/>
+        <result column="certificate_type_" property="certificateType"/>
+        <result column="certificate_num_" property="certificateNum"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="introduction_" property="introduction"/>
+        <result column="demission_date_" property="demissionDate"/>
+        <result column="contact_address_" property="contactAddress"/>
+        <result column="postal_code_" property="postalCode"/>
+        <result column="dept_id_" property="deptId"/>
+        <result column="dept_ids_" property="deptIds"/>
+        <result column="post_ids_" property="postIds"/>
+        <result column="post_dept_ids_" property="postDeptIds"/>
+        <result column="bank_card_" property="bankCard"/>
+        <result column="open_bank_address_" property="openBankAddress"/>
+		<result column="tenant_id_" property="tenantId" />
+    </resultMap>
+
+    <resultMap type="com.yonge.cooleshow.auth.api.entity.SysUser" id="SysUser">
+        <result column="id_" property="id"/>
+        <result column="username_" property="username"/>
+        <result column="password_" property="password"/>
+        <result column="salt_" property="salt"/>
+        <result column="phone_" property="phone"/>
+        <result column="avatar_" property="avatar"/>
+        <result column="organ_id_" property="organId"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="lock_flag_" property="lockFlag"/>
+        <result column="del_flag_" property="delFlag" typeHandler="com.yonge.cooleshow.common.dal.CustomEnumTypeHandler"/>
+        <result column="wx_openid_" property="wxOpenid"/>
+        <result column="qq_openid_" property="qqOpenid"/>
+        <result column="user_type_" property="userType"/>
+        <result column="gender_" property="gender"/>
+        <result column="nation_" property="nation"/>
+        <result column="birthdate_" property="birthdate"/>
+        <result column="email_" property="email"/>
+        <result column="im_token_" property="imToken"/>
+        <result column="real_name_" property="realName"/>
+        <result column="id_card_no_" property="idCardNo"/>
+        <result column="wechat_id_" property="wechatId"/>
+    </resultMap>
+
+    <!-- 根据主键查询一条记录 -->
+    <select id="get" resultMap="Employee">
+		SELECT * FROM employee WHERE user_id_ = #{userId}
+	</select>
+
+    <!-- 全查询 -->
+    <select id="findAll" resultMap="Employee">
+		SELECT * FROM employee ORDER BY user_id_
+	</select>
+
+    <!-- 向数据库增加一条记录 -->
+    <insert id="insert" parameterType="com.yonge.cooleshow.biz.dal.entity.Employee" useGeneratedKeys="true" keyColumn="id"
+            keyProperty="id">
+        INSERT INTO employee
+        (user_id_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,
+        entry_date_,update_time_,create_time_,introduction_,demission_date_,contact_address_)
+        VALUES(#{userId},#{jobNature},#{isProbationPeriod},#{educationBackground},#{graduateSchool},
+        #{technicalTitles},#{entryDate},now(),now(),#{introduction},#{demissionDate},#{contactAddress})
+    </insert>
+
+    <insert id="batchAddEmployeeRole">
+        INSERT INTO sys_user_role(user_id_,role_id_) values
+        <foreach collection="roleIds" item="item" index="index" separator=",">
+            (#{userId},#{item})
+        </foreach>
+    </insert>
+
+    <insert id="batchInsertRoleMenu">
+        INSERT INTO sys_role_menu (role_id_,menu_id_) VALUES
+        <foreach collection="menuIds" item="item" index="index" separator=",">
+            (#{roleId}, #{item})
+        </foreach>
+    </insert>
+
+    <delete id="delRoleMenu">
+        DELETE FROM `sys_role_menu`
+        WHERE  menu_id_ in
+        <foreach collection="menuIds" open="(" close=")" item="item" separator=",">
+            #{item}
+        </foreach>
+    </delete>
+
+    <insert id="insertSysRole" keyColumn="id_" keyProperty="id" parameterType="com.yonge.cooleshow.auth.api.entity.SysRole"
+            useGeneratedKeys="true">
+        INSERT INTO `sys_role` (`role_name_`, `role_code_`, `role_desc_`, `create_time_`,
+                                `update_time_`, `del_flag_`, `organ_id_`, `tenant_id_`)
+        VALUES (#{roleName}, #{roleCode}, #{roleDesc}, #{createTime},
+                #{updateTime}, #{delFlag}, #{organId}, #{tenantId});
+    </insert>
+
+    <select id="queryByPhone" resultMap="SysUser">
+		select * from sys_user where phone_ = #{phone} OR username_ = #{phone}
+	</select>
+
+    <!-- 根据主键查询一条记录 -->
+    <update id="update" parameterType="com.yonge.cooleshow.biz.dal.entity.Employee">
+        UPDATE employee
+        <set>
+            <if test="contactAddress != null">
+                contact_address_ = #{contactAddress},
+            </if>
+            <if test="postalCode != null">
+                postal_code_ = #{postalCode},
+            </if>
+            <if test="isProbationPeriod != null">
+                is_probation_period_ = #{isProbationPeriod},
+            </if>
+            <if test="graduateSchool != null">
+                graduate_school_ = #{graduateSchool},
+            </if>
+            <if test="organIdList != null">
+                organ_id_list_ = #{organIdList},
+            </if>
+            <if test="introduction != null">
+                introduction_ = #{introduction},
+            </if>
+            <if test="technicalTitles != null">
+                technical_titles_ = #{technicalTitles},
+            </if>
+            <if test="entryDate != null">
+                entry_date_ = #{entryDate},
+            </if>
+            <if test="jobNature != null">
+                job_nature_ = #{jobNature},
+            </if>
+            <if test="certificateType != null">
+                certificate_type_ = #{certificateType},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = NOW(),
+            </if>
+            <if test="educationBackground != null">
+                education_background_ = #{educationBackground},
+            </if>
+            <if test="certificateNum != null">
+                certificate_num_ = #{certificateNum},
+            </if>
+            <if test="demissionDate != null">
+                demission_date_ = #{demissionDate},
+            </if>
+                dept_id_ = #{deptId},
+            <if test="deptIds != null">
+                dept_ids_ = #{deptIds},
+            </if>
+            <if test="postIds != null">
+                post_ids_ = #{postIds},
+            </if>
+            <if test="postDeptIds != null">
+                post_dept_ids_ = #{postDeptIds},
+            </if>
+        </set>
+        WHERE user_id_ = #{userId} and tenant_id_ = #{tenantId}
+    </update>
+
+    <update id="updatePassword">
+        UPDATE sys_user SET password_ = #{password} WHERE id_ = #{userID}
+    </update>
+
+    <update id="updateUserLockStatus">
+		UPDATE sys_user SET lock_flag_ = IF(lock_flag_=0,1,0) WHERE id_=#{userID}
+	</update>
+    <update id="updateUserDemissionDate">
+        UPDATE employee SET demission_date_ = IF(demission_date_ IS NULL,now(),NULL) WHERE user_id_=#{userID}
+    </update>
+    <update id="updateUserLock">
+        UPDATE sys_user SET lock_flag_ = #{status} WHERE id_=#{userID}
+    </update>
+
+    <!-- 根据主键删除一条记录 -->
+    <delete id="delete">
+		DELETE FROM employee WHERE user_id_ = #{userId}
+	</delete>
+    <delete id="delEmployeeRole">
+        DELETE FROM sys_user_role WHERE user_id_ = #{userId}
+    </delete>
+
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="Employee" parameterType="map">
+        SELECT * FROM employee where tenant_id_ = #{tenantId} ORDER BY user_id_
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM employee where tenant_id_ = #{tenantId}
+	</select>
+
+    <select id="queryUserRole" resultType="java.lang.Integer">
+        SELECT sur.role_id_ FROM sys_user_role sur WHERE sur.user_id_ = #{userId}
+    </select>
+
+    <select id="getUsers" resultMap="SysUser">
+        select * from sys_user where id_ IN
+        <foreach collection="userIds" open="(" close=")" separator="," item="userId">
+            #{userId}
+        </foreach>
+    </select>
+</mapper>

+ 42 - 0
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/SubjectController.java

@@ -0,0 +1,42 @@
+package com.yonge.cooleshow.student.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.yonge.cooleshow.biz.dal.queryInfo.SubjectQueryInfo;
+import com.yonge.cooleshow.biz.dal.service.SubjectService;
+import com.yonge.cooleshow.common.controller.BaseController;
+
+@RequestMapping("subject")
+@Api(tags = "科目服务")
+@RestController
+public class SubjectController extends BaseController {
+
+	@Autowired
+	private SubjectService subjectService;
+
+	@ApiOperation(value = "根据科目编号查询科目")
+	@GetMapping("/get/{id}")
+	public Object get(@ApiParam(value = "科目编号", required = true) @PathVariable("id") Long id) {
+		return succeed(subjectService.get(id));
+	}
+
+	@ApiOperation(value = "分页查询科目列表")
+	@GetMapping("/queryPage")
+	public Object queryPage(SubjectQueryInfo queryInfo) {
+		return succeed(subjectService.queryPage(queryInfo));
+	}
+
+	@ApiOperation(value = "分页查询科目树状列表")
+	@GetMapping("/queryPageTree")
+	public Object queryPageTree(SubjectQueryInfo queryInfo) {
+		return succeed(subjectService.queryPageTree(queryInfo));
+	}
+}

+ 42 - 0
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/SubjectController.java

@@ -0,0 +1,42 @@
+package com.yonge.cooleshow.teacher.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.yonge.cooleshow.biz.dal.queryInfo.SubjectQueryInfo;
+import com.yonge.cooleshow.biz.dal.service.SubjectService;
+import com.yonge.cooleshow.common.controller.BaseController;
+
+@RequestMapping("subject")
+@Api(tags = "科目服务")
+@RestController
+public class SubjectController extends BaseController {
+
+	@Autowired
+	private SubjectService subjectService;
+
+	@ApiOperation(value = "根据科目编号查询科目")
+	@GetMapping("/get/{id}")
+	public Object get(@ApiParam(value = "科目编号", required = true) @PathVariable("id") Long id) {
+		return succeed(subjectService.get(id));
+	}
+
+	@ApiOperation(value = "分页查询科目列表")
+	@GetMapping("/queryPage")
+	public Object queryPage(SubjectQueryInfo queryInfo) {
+		return succeed(subjectService.queryPage(queryInfo));
+	}
+
+	@ApiOperation(value = "分页查询科目树状列表")
+	@GetMapping("/queryPageTree")
+	public Object queryPageTree(SubjectQueryInfo queryInfo) {
+		return succeed(subjectService.queryPageTree(queryInfo));
+	}
+}