查OA用户
This commit is contained in:
parent
fc740242a4
commit
64afeadd0e
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.seeyon.org.member.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.seeyon.org.member.entity.UserViewEntity;
|
||||
|
||||
/**
|
||||
* @Description OA人员视图
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/15 16:43
|
||||
**/
|
||||
public interface IUserViewDao extends IBaseDao<UserViewEntity,String> {
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.seeyon.org.member.dao.impl;
|
||||
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.seeyon.org.member.dao.IUserViewDao;
|
||||
import com.hzya.frame.seeyon.org.member.entity.UserViewEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description OA人员视图
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/15 16:47
|
||||
**/
|
||||
@Repository(value ="userViewDao")
|
||||
public class UserViewDaoImpl extends MybatisGenericDao<UserViewEntity,String> implements IUserViewDao {
|
||||
}
|
|
@ -0,0 +1,218 @@
|
|||
package com.hzya.frame.seeyon.org.member.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @Description OA人员视图
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/15 16:30
|
||||
**/
|
||||
public class UserViewEntity extends BaseEntity {
|
||||
|
||||
private String staffId;
|
||||
private String name;
|
||||
private String staffNumber;
|
||||
private String state;
|
||||
private String stateName;
|
||||
private String user_state;
|
||||
private String telephone;
|
||||
private String sexs;
|
||||
private String sexsName;
|
||||
private String id_card;
|
||||
private String level_id;
|
||||
private String level_name;
|
||||
private String update_time;
|
||||
private String departmentName;
|
||||
private String departmentId;
|
||||
private String departmentCode;
|
||||
private String postName;
|
||||
private String postID;
|
||||
private String loginName;
|
||||
private String mem_update_time;
|
||||
private String unit_updata_time;
|
||||
private String post_update_time;
|
||||
private String princ_update_time;
|
||||
|
||||
public String getStaffId() {
|
||||
return staffId;
|
||||
}
|
||||
|
||||
public void setStaffId(String staffId) {
|
||||
this.staffId = staffId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getStaffNumber() {
|
||||
return staffNumber;
|
||||
}
|
||||
|
||||
public void setStaffNumber(String staffNumber) {
|
||||
this.staffNumber = staffNumber;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getStateName() {
|
||||
return stateName;
|
||||
}
|
||||
|
||||
public void setStateName(String stateName) {
|
||||
this.stateName = stateName;
|
||||
}
|
||||
|
||||
public String getUser_state() {
|
||||
return user_state;
|
||||
}
|
||||
|
||||
public void setUser_state(String user_state) {
|
||||
this.user_state = user_state;
|
||||
}
|
||||
|
||||
public String getTelephone() {
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public void setTelephone(String telephone) {
|
||||
this.telephone = telephone;
|
||||
}
|
||||
|
||||
public String getSexs() {
|
||||
return sexs;
|
||||
}
|
||||
|
||||
public void setSexs(String sexs) {
|
||||
this.sexs = sexs;
|
||||
}
|
||||
|
||||
public String getSexsName() {
|
||||
return sexsName;
|
||||
}
|
||||
|
||||
public void setSexsName(String sexsName) {
|
||||
this.sexsName = sexsName;
|
||||
}
|
||||
|
||||
public String getId_card() {
|
||||
return id_card;
|
||||
}
|
||||
|
||||
public void setId_card(String id_card) {
|
||||
this.id_card = id_card;
|
||||
}
|
||||
|
||||
public String getLevel_id() {
|
||||
return level_id;
|
||||
}
|
||||
|
||||
public void setLevel_id(String level_id) {
|
||||
this.level_id = level_id;
|
||||
}
|
||||
|
||||
public String getLevel_name() {
|
||||
return level_name;
|
||||
}
|
||||
|
||||
public void setLevel_name(String level_name) {
|
||||
this.level_name = level_name;
|
||||
}
|
||||
public String getUpdate_time() {
|
||||
return update_time;
|
||||
}
|
||||
|
||||
public void setUpdate_time(String update_time) {
|
||||
this.update_time = update_time;
|
||||
}
|
||||
|
||||
public String getDepartmentName() {
|
||||
return departmentName;
|
||||
}
|
||||
|
||||
public void setDepartmentName(String departmentName) {
|
||||
this.departmentName = departmentName;
|
||||
}
|
||||
|
||||
public String getDepartmentId() {
|
||||
return departmentId;
|
||||
}
|
||||
|
||||
public void setDepartmentId(String departmentId) {
|
||||
this.departmentId = departmentId;
|
||||
}
|
||||
|
||||
public String getDepartmentCode() {
|
||||
return departmentCode;
|
||||
}
|
||||
|
||||
public void setDepartmentCode(String departmentCode) {
|
||||
this.departmentCode = departmentCode;
|
||||
}
|
||||
|
||||
public String getPostName() {
|
||||
return postName;
|
||||
}
|
||||
|
||||
public void setPostName(String postName) {
|
||||
this.postName = postName;
|
||||
}
|
||||
|
||||
public String getPostID() {
|
||||
return postID;
|
||||
}
|
||||
|
||||
public void setPostID(String postID) {
|
||||
this.postID = postID;
|
||||
}
|
||||
|
||||
public String getLoginName() {
|
||||
return loginName;
|
||||
}
|
||||
|
||||
public void setLoginName(String loginName) {
|
||||
this.loginName = loginName;
|
||||
}
|
||||
|
||||
public String getMem_update_time() {
|
||||
return mem_update_time;
|
||||
}
|
||||
|
||||
public void setMem_update_time(String mem_update_time) {
|
||||
this.mem_update_time = mem_update_time;
|
||||
}
|
||||
|
||||
public String getUnit_updata_time() {
|
||||
return unit_updata_time;
|
||||
}
|
||||
|
||||
public void setUnit_updata_time(String unit_updata_time) {
|
||||
this.unit_updata_time = unit_updata_time;
|
||||
}
|
||||
|
||||
public String getPost_update_time() {
|
||||
return post_update_time;
|
||||
}
|
||||
|
||||
public void setPost_update_time(String post_update_time) {
|
||||
this.post_update_time = post_update_time;
|
||||
}
|
||||
|
||||
public String getPrinc_update_time() {
|
||||
return princ_update_time;
|
||||
}
|
||||
|
||||
public void setPrinc_update_time(String princ_update_time) {
|
||||
this.princ_update_time = princ_update_time;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
<?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.hzya.frame.seeyon.org.member.dao.impl.UserViewDaoImpl">
|
||||
<resultMap id="get-UserViewEntity-result" type="com.hzya.frame.seeyon.org.member.entity.UserViewEntity">
|
||||
<result property="staffId" column="staffId" />
|
||||
<result property="name" column="name" />
|
||||
<result property="staffNumber" column="staffNumber" />
|
||||
<result property="state" column="state" />
|
||||
<result property="stateName" column="stateName" />
|
||||
<result property="user_state" column="user_state" />
|
||||
<result property="telephone" column="telephone" />
|
||||
<result property="sexs" column="sexs" />
|
||||
<result property="sexsName" column="sexsName" />
|
||||
<result property="id_card" column="id_card" />
|
||||
<result property="level_id" column="level_id" />
|
||||
<result property="level_name" column="level_name" />
|
||||
<result property="create_time" column="create_time" />
|
||||
<result property="update_time" column="update_time" />
|
||||
<result property="departmentName" column="departmentName" />
|
||||
<result property="departmentId" column="departmentId" />
|
||||
<result property="departmentCode" column="departmentCode" />
|
||||
<result property="postName" column="postName" />
|
||||
<result property="postID" column="postID" />
|
||||
<result property="loginName" column="loginName" />
|
||||
<result property="mem_update_time" column="mem_update_time" />
|
||||
<result property="unit_updata_time" column="unit_updata_time" />
|
||||
<result property="post_update_time" column="post_update_time" />
|
||||
<result property="princ_update_time" column="princ_update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="UserViewEntity_Base_Column_List">
|
||||
staffId,
|
||||
name,
|
||||
staffNumber,
|
||||
state,
|
||||
stateName,
|
||||
user_state,
|
||||
telephone,
|
||||
sexs,
|
||||
sexsName,
|
||||
id_card,
|
||||
level_id,
|
||||
level_name,
|
||||
create_time,
|
||||
update_time,
|
||||
departmentName,
|
||||
departmentId,
|
||||
departmentCode,
|
||||
postName,
|
||||
postID,
|
||||
loginName,
|
||||
mem_update_time,
|
||||
unit_updata_time,
|
||||
post_update_time,
|
||||
princ_update_time
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="UserViewEntity_list_base" resultMap="get-UserViewEntity-result" parameterType="com.hzya.frame.seeyon.org.member.entity.UserViewEntity">
|
||||
select
|
||||
<include refid="UserViewEntity_Base_Column_List" />
|
||||
from v_user_view_all
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="staffId != null and staffId !='' "> staffId = #{staffId}</if>
|
||||
<if test="staffNumber != null and staffNumber !='' "> and staffNumber = #{staffNumber} </if>
|
||||
<if test="state != null and state !='' "> and state = #{state} </if>
|
||||
<if test="loginName != null and loginName !='' "> and loginName = #{loginName} </if>
|
||||
</trim>
|
||||
order by update_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,35 @@
|
|||
package com.hzya.frame.seeyon.org.member.service;
|
||||
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.seeyon.org.member.entity.UserViewEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description OA 人员视图
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/15 16:36
|
||||
**/
|
||||
public interface IUserViewService extends IBaseService<UserViewEntity,String> {
|
||||
|
||||
/**
|
||||
* 查询全部 包含停用
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
List<UserViewEntity> queryAll(UserViewEntity entity);
|
||||
|
||||
/**
|
||||
* 只查启用的
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
List<UserViewEntity> queryEnableList(UserViewEntity entity);
|
||||
|
||||
/**
|
||||
* 根据人员编号查
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
UserViewEntity queryByStaffNumber(UserViewEntity entity);
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package com.hzya.frame.seeyon.org.member.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.seeyon.org.member.dao.IUserViewDao;
|
||||
import com.hzya.frame.seeyon.org.member.entity.UserViewEntity;
|
||||
import com.hzya.frame.seeyon.org.member.service.IUserViewService;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description OA人员视图
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/15 16:37
|
||||
**/
|
||||
@Service(value = "userViewService")
|
||||
public class UserViewServiceImpl extends BaseService<UserViewEntity,String> implements IUserViewService {
|
||||
|
||||
private IUserViewDao userViewDao;
|
||||
|
||||
@Autowired
|
||||
public void setUserViewDao(IUserViewDao dao) {
|
||||
this.userViewDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部 包含停用
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@DS(value = "#entity.dataSourceCode")
|
||||
@Override
|
||||
public List<UserViewEntity> queryAll(UserViewEntity entity) {
|
||||
List<UserViewEntity> queryList = userViewDao.query(entity);
|
||||
return queryList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 只查启用的
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@DS(value = "#entity.dataSourceCode")
|
||||
@Override
|
||||
public List<UserViewEntity> queryEnableList(UserViewEntity entity) {
|
||||
entity.setState("1");
|
||||
List<UserViewEntity> queryList = userViewDao.query(entity);
|
||||
return queryList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据人员编号查
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@DS(value = "#entity.dataSourceCode")
|
||||
@Override
|
||||
public UserViewEntity queryByStaffNumber(UserViewEntity entity) {
|
||||
if (null != entity && StrUtil.isNotEmpty(entity.getStaffNumber())){
|
||||
List<UserViewEntity> queryList = queryEnableList(entity);
|
||||
if (CollectionUtils.isNotEmpty(queryList)){
|
||||
if (queryList.size() > 1){
|
||||
throw new BaseSystemException("根据"+entity.getStaffNumber()+"查询到多个人员,请检查");
|
||||
}
|
||||
return queryList.get(0);
|
||||
}
|
||||
}else {
|
||||
throw new BaseSystemException("人员编号不能为空,请检查");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue