去掉多余的实体文件
添加组织机构相关的实体文件
This commit is contained in:
@@ -1,92 +0,0 @@
|
||||
package com.adc.da.sync.vo;
|
||||
|
||||
public class SyncVO {
|
||||
|
||||
private String account;
|
||||
|
||||
private String userCode; //工号
|
||||
|
||||
private String oldOrgName;
|
||||
|
||||
private String newOrgName;
|
||||
|
||||
private String newContactAddress;
|
||||
|
||||
/**
|
||||
* 办公电话
|
||||
*/
|
||||
private String officePhone;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String cellPhoneNumber;
|
||||
/**
|
||||
* 电子邮件
|
||||
*/
|
||||
private String email;
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getUserCode() {
|
||||
return userCode;
|
||||
}
|
||||
|
||||
public void setUserCode(String userCode) {
|
||||
this.userCode = userCode;
|
||||
}
|
||||
|
||||
public String getOldOrgName() {
|
||||
return oldOrgName;
|
||||
}
|
||||
|
||||
public void setOldOrgName(String oldOrgName) {
|
||||
this.oldOrgName = oldOrgName;
|
||||
}
|
||||
|
||||
public String getNewOrgName() {
|
||||
return newOrgName;
|
||||
}
|
||||
|
||||
public void setNewOrgName(String newOrgName) {
|
||||
this.newOrgName = newOrgName;
|
||||
}
|
||||
|
||||
public String getNewContactAddress() {
|
||||
return newContactAddress;
|
||||
}
|
||||
|
||||
public void setNewContactAddress(String newContactAddress) {
|
||||
this.newContactAddress = newContactAddress;
|
||||
}
|
||||
|
||||
public String getOfficePhone() {
|
||||
return officePhone;
|
||||
}
|
||||
|
||||
public void setOfficePhone(String officePhone) {
|
||||
this.officePhone = officePhone;
|
||||
}
|
||||
|
||||
public String getCellPhoneNumber() {
|
||||
return cellPhoneNumber;
|
||||
}
|
||||
|
||||
public void setCellPhoneNumber(String cellPhoneNumber) {
|
||||
this.cellPhoneNumber = cellPhoneNumber;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.adc.da.sys.dao.mysql;
|
||||
|
||||
import com.adc.da.base.dao.BaseDao;
|
||||
import com.adc.da.sys.entity.OrgEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface OrgEODao extends BaseDao<OrgEO> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.adc.da.sys.dao.mysql;
|
||||
|
||||
import com.adc.da.base.dao.BaseDao;
|
||||
import com.adc.da.sys.entity.RoleOrgEO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* <br>
|
||||
* <b>功能:</b>TR_ROLE_ORG RoleOrgEODao<br>
|
||||
* <b>作者:</b>Wei Jinjin<br>
|
||||
* <b>日期:</b> 2019-10-28 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
public interface RoleOrgEODao extends BaseDao<RoleOrgEO> {
|
||||
|
||||
/**
|
||||
* 删除角色组织机构关联
|
||||
*/
|
||||
void deleteRoleOrgByRoleId(String roleId);
|
||||
|
||||
/**
|
||||
* 根据角色ID,获取部门ID列表
|
||||
*/
|
||||
List<String> queryOrgIdList(String[] roleIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.sys.dao.mysql;
|
||||
|
||||
import com.adc.da.sys.entity.UserOrgEO;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <br>
|
||||
* <b>功能:</b>TR_USER_ROLE UserRoleEODao<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2017-11-07 <br>
|
||||
* <b>版权所有:<b>版权归天津卡达克数据技术中心所有。<br>
|
||||
*
|
||||
* @see mybatis.mapper.sys
|
||||
*/
|
||||
public interface UserOrgEODao extends BaseMapper<UserOrgEO> {
|
||||
|
||||
int insertBatch(@Param("userOrgEOList") List<UserOrgEO> userOrgEOList);
|
||||
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import java.util.List;
|
||||
* @see mybatis.mapper.sys
|
||||
*/
|
||||
public interface UserRoleEODao extends BaseMapper<UserRoleEO> {
|
||||
|
||||
public int insertBatch(@Param("userRoleEOList") List<UserRoleEO> userRoleEOList);
|
||||
int insertBatch(@Param("userRoleEOList") List<UserRoleEO> userRoleEOList);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.adc.da.sys.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 组织机构实体类
|
||||
*/
|
||||
@Data
|
||||
@TableName("TS_ORG")
|
||||
public class OrgEO extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2386892031753294731L;
|
||||
|
||||
@TableId(value = "FILE_ID",type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
@TableField("ORG_CODE")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@TableField("ORG_NAME")
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 部门级别
|
||||
*/
|
||||
@TableField("ORG_LEVEL")
|
||||
private Integer orgLevel;
|
||||
|
||||
/**
|
||||
* 父部门编码
|
||||
*/
|
||||
@TableField("SUP_ORG_CODE")
|
||||
private String supOrgCode;
|
||||
|
||||
/**
|
||||
* 部门简称
|
||||
*/
|
||||
@TableField("ORG_SHORT_NAME")
|
||||
private String orgShortName;
|
||||
|
||||
/**
|
||||
* 归属地
|
||||
*/
|
||||
@TableField("ATTRIBUTION")
|
||||
private String attribution;
|
||||
|
||||
/**
|
||||
* 部门14位码
|
||||
*/
|
||||
@TableField("BPMN_14")
|
||||
private String bmdm14;
|
||||
|
||||
/**
|
||||
* 状态,1正常,0停用,-1删除
|
||||
*/
|
||||
@TableField("STATUS")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 更新时间,格式:yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@TableField("UPDATE_TIME")
|
||||
private String updateTime;
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package com.adc.da.sys.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
|
||||
|
||||
/**
|
||||
* <b>功能:</b>TR_ROLE_ORG RoleOrgEOEntity<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2019-10-28 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
public class RoleOrgEO extends BaseEntity {
|
||||
|
||||
private String roleId;
|
||||
private String orgId;
|
||||
|
||||
/**
|
||||
* java字段名转换为原始数据库列名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>roleId -> role_id</li>
|
||||
* <li>orgId -> org_id</li>
|
||||
*/
|
||||
public static String fieldToColumn(String fieldName) {
|
||||
if (fieldName == null) { return null; }
|
||||
switch (fieldName) {
|
||||
case "roleId": return "role_id";
|
||||
case "orgId": return "org_id";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 原始数据库列名转换为java字段名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>role_id -> roleId</li>
|
||||
* <li>org_id -> orgId</li>
|
||||
*/
|
||||
public static String columnToField(String columnName) {
|
||||
if (columnName == null) { return null; }
|
||||
switch (columnName) {
|
||||
case "role_id": return "roleId";
|
||||
case "org_id": return "orgId";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** **/
|
||||
public String getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public String getOrgId() {
|
||||
return this.orgId;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setOrgId(String orgId) {
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.adc.da.sys.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>TR_USER_ROLE UserRoleEOEntity<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2017-11-07 <br>
|
||||
* <b>版权所有:<b>版权归天津卡达克数据技术中心所有。<br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>userId -> user_id</li>
|
||||
* <li>roleId -> role_id</li>
|
||||
* @author comments created by Lee Kwanho
|
||||
* date 2018-08-16
|
||||
*/
|
||||
@Data
|
||||
@TableName("TR_USER_ORG")
|
||||
public class UserOrgEO extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableField("USER_ID")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@TableField("ORG_ID")
|
||||
private String orgId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.adc.da.sys.service;
|
||||
|
||||
import com.adc.da.base.service.BaseService;
|
||||
import com.adc.da.sys.dao.mysql.*;
|
||||
import com.adc.da.sys.entity.OrgEO;
|
||||
import com.adc.da.sys.entity.RoleEO;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.adc.da.util.constant.DeleteFlagEnum;
|
||||
import com.adc.da.util.utils.BeanMapper;
|
||||
import com.adc.da.util.utils.CollectionUtils;
|
||||
import com.adc.da.util.utils.UUID;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service("orgEOService")
|
||||
@Transactional
|
||||
public class OrgEOService extends BaseService<OrgEO, String> {
|
||||
|
||||
@Resource
|
||||
private UserOrgEODao userOrgEODao;
|
||||
|
||||
@Resource
|
||||
private OrgEODao dao;
|
||||
|
||||
public OrgEODao getDao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.adc.da.sys.dao.mysql.OrgEODao">
|
||||
|
||||
</mapper>
|
||||
@@ -1,85 +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.adc.da.sys.dao.mysql.RoleOrgEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.RoleOrgEO" >
|
||||
<result column="role_id" property="roleId" />
|
||||
<result column="org_id" property="orgId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TR_ROLE_ORG table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
role_id, org_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="roleId != null" >
|
||||
and role_id ${roleIdOperator} #{roleId}
|
||||
</if>
|
||||
<if test="orgId != null" >
|
||||
and org_id ${orgIdOperator} #{orgId}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.sys.entity.RoleOrgEO" >
|
||||
insert into TR_ROLE_ORG(<include refid="Base_Column_List" />)
|
||||
values (#{roleId, jdbcType=VARCHAR}, #{orgId, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.sys.entity.RoleOrgEO" >
|
||||
insert into TR_ROLE_ORG
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="roleId != null" >role_id,</if>
|
||||
<if test="orgId != null" >org_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="roleId != null" >#{roleId, jdbcType=VARCHAR},</if>
|
||||
<if test="orgId != null" >#{orgId, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- TR_ROLE_ORG 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TR_ROLE_ORG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TR_ROLE_ORG列表 -->
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List" /> from
|
||||
(select tmp_tb.* , rownum rn from
|
||||
(select <include refid="Base_Column_List" /> from TR_ROLE_ORG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TR_ROLE_ORG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleOrgByRoleId" parameterType="java.lang.String">
|
||||
delete from TR_ROLE_ORG ro where ro.role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<select id="queryOrgIdList" resultType="java.lang.String" parameterType="java.lang.String">
|
||||
select org_id from TR_ROLE_ORG where role_id in
|
||||
<foreach item="roleId" collection="array" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?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.adc.da.sys.dao.mysql.UserOrgEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.UserOrgEO" >
|
||||
<id column="user_id" property="userId" />
|
||||
<result column="org_id" property="orgId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TR_USER_ORG table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
user_id, org_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="userId != null" >
|
||||
and `user_id` ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="orgId != null" >
|
||||
and `org_id` ${orgIdOperator} #{orgId}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.sys.entity.UserOrgEO" >
|
||||
insert into TR_USER_ORG(<include refid="Base_Column_List" />)
|
||||
values (#{userId}, #{orgId})
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.sys.entity.UserOrgEO" >
|
||||
update TR_USER_ORG
|
||||
set `org_id` = #{orgId}
|
||||
where `user_id` = #{userId}
|
||||
</update>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.sys.entity.UserOrgEO" >
|
||||
update TR_USER_ORG
|
||||
<set >
|
||||
<if test="orgId != null" >
|
||||
org_id = #{orgId},
|
||||
</if>
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 TR_USER_ORG -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from TR_USER_ORG
|
||||
where user_id = #{value}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from TR_USER_ORG
|
||||
where user_id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- TR_USER_ORG 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.String" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TR_USER_ORG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TR_USER_ORG列表 -->
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from (select t.*,rownum rownu from TR_USER_ORG t
|
||||
where rownum<=${pager.endIndex})tt
|
||||
where tt.rownu>=${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/>
|
||||
from TR_USER_ORG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
<if test="pager.mysqlQueryCondition != null and pager.mysqlQueryCondition != ''" >
|
||||
${pager.mysqlQueryCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insertBatch" parameterType="com.adc.da.sys.entity.UserOrgEO" >
|
||||
insert into TR_USER_ORG(<include refid="Base_Column_List" />)values
|
||||
<foreach collection="UserOrgEOList" item="ur" separator=",">
|
||||
(#{ur.userId}, #{ur.orgId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user