parent
8adb116246
commit
ddce2cae6a
12 changed files with 369 additions and 18 deletions
@ -0,0 +1,48 @@ |
||||
package com.yipin.liuwanr; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy; |
||||
import com.baomidou.mybatisplus.core.config.GlobalConfig; |
||||
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; |
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
|
||||
import javax.sql.DataSource; |
||||
|
||||
@Configuration |
||||
public class MybatisPlusConfiguration { |
||||
|
||||
/** |
||||
* 将SqlSessionFactory配置为MybatisPlus的MybatisSqlSessionFactoryBean |
||||
* |
||||
* @param dataSource 默认配置文件中的数据源 |
||||
* @return MybatisSqlSessionFactoryBean |
||||
*/ |
||||
@Bean("mpSqlSessionFactory") |
||||
public MybatisSqlSessionFactoryBean setSqlSessionFactory(DataSource dataSource) { |
||||
MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean(); |
||||
// 设置数据源
|
||||
bean.setDataSource(dataSource); |
||||
// 简化PO的引用
|
||||
bean.setTypeAliasesPackage("com.yipin.liuwanr.entity."); |
||||
// 设置全局配置
|
||||
bean.setGlobalConfig(this.globalConfig()); |
||||
return bean; |
||||
} |
||||
|
||||
/** |
||||
* 设置全局配置 |
||||
* |
||||
* @return 全局配置 |
||||
*/ |
||||
public GlobalConfig globalConfig() { |
||||
GlobalConfig globalConfig = new GlobalConfig(); |
||||
GlobalConfig.DbConfig dbConfig = new GlobalConfig.DbConfig(); |
||||
// 设置逻辑删除字段
|
||||
dbConfig.setLogicDeleteField("deleted"); |
||||
// 设置更新策略
|
||||
dbConfig.setUpdateStrategy(FieldStrategy.NOT_EMPTY); |
||||
globalConfig.setDbConfig(dbConfig); |
||||
return globalConfig; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,67 @@ |
||||
package com.yipin.liuwanr.entity.response; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.yipin.liuwanr.entity.HrUserAccount; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 用户管理列表 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-03-17 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class UserAccountListRes implements Serializable { |
||||
|
||||
@TableId(value = "id", type = IdType.ID_WORKER) |
||||
private Integer id; |
||||
|
||||
/** |
||||
* 用户表id |
||||
*/ |
||||
private Integer userId; |
||||
|
||||
/** |
||||
* 账号 |
||||
*/ |
||||
private String account; |
||||
|
||||
/** |
||||
* 工号 |
||||
*/ |
||||
private String workNumber; |
||||
|
||||
/** |
||||
* 绑定的角色id |
||||
*/ |
||||
private String roleId; |
||||
|
||||
/** |
||||
* 绑定院校id |
||||
*/ |
||||
private Integer schoolId; |
||||
|
||||
private String schoolName; |
||||
|
||||
/** |
||||
* 所属平台:1->职站 2->数据平台 |
||||
*/ |
||||
private Integer platformId; |
||||
|
||||
private String platformName; |
||||
|
||||
/** |
||||
* 平台端区分:0->教师端 1->学生端 |
||||
*/ |
||||
private Integer type; |
||||
|
||||
} |
@ -0,0 +1,36 @@ |
||||
package com.yipin.liuwanr.entity.response; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.yipin.liuwanr.entity.HrUserAccount; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 用户管理列表 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-03-17 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class UserSchoolDetailRes implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 院校id |
||||
*/ |
||||
private Integer schoolId; |
||||
|
||||
/** |
||||
* 账号集合 |
||||
*/ |
||||
private List<HrUserAccount> accountList; |
||||
|
||||
} |
@ -0,0 +1,50 @@ |
||||
package com.yipin.liuwanr.entity.response; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.yipin.liuwanr.entity.HrUserAccount; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 用户管理列表 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-03-17 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class UserSysDetailRes implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 用户id |
||||
*/ |
||||
@TableId(value = "userId", type = IdType.AUTO) |
||||
private Integer userId; |
||||
|
||||
/** |
||||
* 所属平台 |
||||
*/ |
||||
private Integer platformId; |
||||
|
||||
/** |
||||
* 组织关系 |
||||
*/ |
||||
private Integer organizationalRelation; |
||||
|
||||
/** |
||||
* 集合层 |
||||
*/ |
||||
private List<UserSchoolDetailRes> bigList; |
||||
|
||||
private Map map; |
||||
|
||||
} |
Loading…
Reference in new issue