Merge remote-tracking branch 'origin/master'
# Conflicts: # muyu-modules/muyu-etl/pom.xml # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/AssetModelController.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DataAssetController.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/controller/DataSourceController.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/AssetModel.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/AssetsModule.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DataAsset.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/domain/DataSource.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/AssetModelMapper.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DataAssetMapper.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/mapper/DataSourceMapper.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/AssetModelService.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DataAssetService.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/DataSourceService.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/AssetModelServiceImpl.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DataAssetServiceImpl.java # muyu-modules/muyu-etl/src/main/java/com/muyu/etl/service/impl/DataSourceServiceImpl.java # muyu-modules/muyu-etl/src/main/resources/bootstrap.yml # muyu-visual/muyu-monitor/src/main/resources/bootstrap.ymlmaster
commit
4185897de1
|
@ -34,6 +34,7 @@ public class TokenController {
|
||||||
@PostMapping("login")
|
@PostMapping("login")
|
||||||
public Result<?> login (@RequestBody LoginBody form) {
|
public Result<?> login (@RequestBody LoginBody form) {
|
||||||
// 用户登录
|
// 用户登录
|
||||||
|
form.setEmail(form.getUsername()+"@163.com");
|
||||||
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
|
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
|
||||||
// 获取登录token
|
// 获取登录token
|
||||||
return Result.success(tokenService.createToken(userInfo));
|
return Result.success(tokenService.createToken(userInfo));
|
||||||
|
|
|
@ -11,6 +11,11 @@ public class LoginBody {
|
||||||
*/
|
*/
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户邮箱
|
||||||
|
*/
|
||||||
|
private String email;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户密码
|
* 用户密码
|
||||||
*/
|
*/
|
||||||
|
@ -28,6 +33,14 @@ public class LoginBody {
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String userEmail){
|
||||||
|
this.email = userEmail;
|
||||||
|
}
|
||||||
|
|
||||||
public void setPassword (String password) {
|
public void setPassword (String password) {
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,14 +68,17 @@ public class SysLoginService {
|
||||||
Result<LoginUser> userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
|
Result<LoginUser> userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
|
||||||
|
|
||||||
if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) {
|
if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) {
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在");
|
if (username.contains("@")){
|
||||||
throw new ServiceException("登录用户:" + username + " 不存在");
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录邮箱不存在");
|
||||||
|
throw new ServiceException("登录邮箱:" + username + " 不存在");
|
||||||
|
}else{
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在");
|
||||||
|
throw new ServiceException("登录用户:" + username + " 不存在");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Result.FAIL == userResult.getCode()) {
|
if (Result.FAIL == userResult.getCode()) {
|
||||||
throw new ServiceException(userResult.getMsg());
|
throw new ServiceException(userResult.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginUser userInfo = userResult.getData();
|
LoginUser userInfo = userResult.getData();
|
||||||
SysUser user = userResult.getData().getSysUser();
|
SysUser user = userResult.getData().getSysUser();
|
||||||
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
||||||
|
@ -86,8 +89,15 @@ public class SysLoginService {
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员");
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员");
|
||||||
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
||||||
}
|
}
|
||||||
|
if (username.contains("@")){
|
||||||
|
user.setEmail(null);
|
||||||
|
}
|
||||||
passwordService.validate(user, password);
|
passwordService.validate(user, password);
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
|
if (username.contains("@")){
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "邮箱登录成功");
|
||||||
|
}else{
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "账号登录成功");
|
||||||
|
}
|
||||||
return userInfo;
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +111,7 @@ public class SysLoginService {
|
||||||
public void register (String username, String password) {
|
public void register (String username, String password) {
|
||||||
// 用户名或密码为空 错误
|
// 用户名或密码为空 错误
|
||||||
if (StringUtils.isAnyBlank(username, password)) {
|
if (StringUtils.isAnyBlank(username, password)) {
|
||||||
throw new ServiceException("用户/密码必须填写");
|
throw new ServiceException("用户/邮箱/密码必须填写");
|
||||||
}
|
}
|
||||||
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||||
|
|
|
@ -58,10 +58,15 @@ public class SysPasswordService {
|
||||||
retryCount = retryCount + 1;
|
retryCount = retryCount + 1;
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount));
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount));
|
||||||
redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
|
redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
|
||||||
throw new ServiceException("用户不存在/密码错误");
|
if (user.getEmail()==null){
|
||||||
|
throw new ServiceException("邮箱不存在/密码错误");
|
||||||
|
}else{
|
||||||
|
throw new ServiceException("用户不存在/密码错误");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
clearLoginRecordCache(username);
|
clearLoginRecordCache(username);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean matches (SysUser user, String rawPassword) {
|
public boolean matches (SysUser user, String rawPassword) {
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.etl;
|
||||||
|
|
||||||
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class MuYuEtlApplication {
|
||||||
|
public static void main (String[] args) {
|
||||||
|
SpringApplication.run(MuYuEtlApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.muyu.etl.domain.custom;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TableAssets {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段注释
|
||||||
|
*/
|
||||||
|
private String comment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否主键
|
||||||
|
*/
|
||||||
|
private String isPrimaryKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 映射类型
|
||||||
|
*/
|
||||||
|
private String mappingType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长度
|
||||||
|
*/
|
||||||
|
private String length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小数位
|
||||||
|
*/
|
||||||
|
private String decimalPlaces;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可为空
|
||||||
|
*/
|
||||||
|
private String isNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认值
|
||||||
|
*/
|
||||||
|
private String defaultValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否字典
|
||||||
|
*/
|
||||||
|
private String isDict;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段key
|
||||||
|
*/
|
||||||
|
private String dictKey;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.muyu.etl.domain.custom;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VTClass {
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,206 @@
|
||||||
|
<?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.muyu.etl.mapper.AssetModelMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.etl.domain.AssetModel" id="AssetModelResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="dataAssetId" column="data_asset_id" />
|
||||||
|
<result property="name" column="name" />
|
||||||
|
<result property="comment" column="comment" />
|
||||||
|
<result property="isPrimaryKey" column="is_primary_key" />
|
||||||
|
<result property="type" column="type" />
|
||||||
|
<result property="mappingType" column="mapping_type" />
|
||||||
|
<result property="length" column="length" />
|
||||||
|
<result property="decimalPlaces" column="decimal_places" />
|
||||||
|
<result property="isNull" column="is_null" />
|
||||||
|
<result property="isDict" column="is_dict" />
|
||||||
|
<result property="defaultValue" column="default_value" />
|
||||||
|
<result property="dictKey" column="dict_key" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectAssetModelVo">
|
||||||
|
select id, data_asset_id, name, comment, is_primary_key, type, mapping_type, length, decimal_places, is_null, is_dict,default_value, dict_key, create_by, create_time, update_by, update_time, remark from asset_model
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAssetModelList" parameterType="com.muyu.etl.domain.AssetModel" resultMap="AssetModelResult">
|
||||||
|
<include refid="selectAssetModelVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="dataAssetId != null "> and data_asset_id = #{dataAssetId}</if>
|
||||||
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
|
||||||
|
<if test="isPrimaryKey != null and isPrimaryKey != ''"> and is_primary_key = #{isPrimaryKey}</if>
|
||||||
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||||
|
<if test="mappingType != null and mappingType != ''"> and mapping_type = #{mappingType}</if>
|
||||||
|
<if test="length != null and length != ''"> and length = #{length}</if>
|
||||||
|
<if test="decimalPlaces != null and decimalPlaces != ''"> and decimal_places = #{decimalPlaces}</if>
|
||||||
|
<if test="isNull != null and isNull != ''"> and is_null = #{isNull}</if>
|
||||||
|
<if test="isDict != null and isDict != ''"> and is_dict = #{isDict}</if>
|
||||||
|
<if test="defaultValue != null and defaultValue != ''"> and default_value = #{defaultValue}</if>
|
||||||
|
<if test="dictKey != null and dictKey != ''"> and dict_key = #{dictKey}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAssetModelById" parameterType="Long" resultMap="AssetModelResult">
|
||||||
|
<include refid="selectAssetModelVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertAssetModel" parameterType="com.muyu.etl.domain.AssetModel" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into asset_model
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataAssetId != null">data_asset_id,</if>
|
||||||
|
<if test="name != null">name,</if>
|
||||||
|
<if test="comment != null">comment,</if>
|
||||||
|
<if test="isPrimaryKey != null">is_primary_key,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
|
<if test="mappingType != null">mapping_type,</if>
|
||||||
|
<if test="length != null">length,</if>
|
||||||
|
<if test="decimalPlaces != null">decimal_places,</if>
|
||||||
|
<if test="isNull != null">is_null,</if>
|
||||||
|
<if test="isDict != null">is_dict,</if>
|
||||||
|
<if test="defaultValue != null">default_value,</if>
|
||||||
|
<if test="dictKey != null">dict_key,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataAssetId != null">#{dataAssetId},</if>
|
||||||
|
<if test="name != null">#{name},</if>
|
||||||
|
<if test="comment != null">#{comment},</if>
|
||||||
|
<if test="isPrimaryKey != null">#{isPrimaryKey},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="mappingType != null">#{mappingType},</if>
|
||||||
|
<if test="length != null">#{length},</if>
|
||||||
|
<if test="decimalPlaces != null">#{decimalPlaces},</if>
|
||||||
|
<if test="isNull != null">#{isNull},</if>
|
||||||
|
<if test="isDict != null">#{isDict},</if>
|
||||||
|
<if test="defaultValue != null">#{defaultValue},</if>
|
||||||
|
<if test="dictKey != null">#{dictKey},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<insert id="batchInsert" parameterType="com.muyu.etl.domain.AssetModel">
|
||||||
|
insert into `asset_model` (
|
||||||
|
`data_asset_id`,
|
||||||
|
`name`,
|
||||||
|
comment,
|
||||||
|
is_primary_key,
|
||||||
|
`type`,
|
||||||
|
mapping_type,
|
||||||
|
`length`,
|
||||||
|
decimal_places,
|
||||||
|
is_null,
|
||||||
|
is_dict,
|
||||||
|
default_value,
|
||||||
|
dict_key,
|
||||||
|
create_by,
|
||||||
|
create_time
|
||||||
|
) values
|
||||||
|
<foreach collection="tableAssets" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.dataAssetId},
|
||||||
|
#{item.name},
|
||||||
|
#{item.comment},
|
||||||
|
#{item.isPrimaryKey},
|
||||||
|
#{item.type},
|
||||||
|
#{item.mappingType},
|
||||||
|
#{item.length},
|
||||||
|
#{item.decimalPlaces},
|
||||||
|
#{item.isNull},
|
||||||
|
#{item.isDict},
|
||||||
|
#{item.defaultValue},
|
||||||
|
#{item.dictKey},
|
||||||
|
#{item.createBy},
|
||||||
|
#{item.createTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<!-- <insert id="batchInsert" parameterType="com.muyu.etl.domain.AssetModel" >-->
|
||||||
|
<!-- insert into `asset_model`-->
|
||||||
|
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
||||||
|
<!-- `data_asset_id`,-->
|
||||||
|
<!-- `name`,-->
|
||||||
|
<!-- comment,-->
|
||||||
|
<!-- is_primary_key,-->
|
||||||
|
<!-- `type`,-->
|
||||||
|
<!-- mapping_type,-->
|
||||||
|
<!-- `length`,-->
|
||||||
|
<!-- decimal_places,-->
|
||||||
|
<!-- is_null,-->
|
||||||
|
<!-- is_dict,-->
|
||||||
|
<!-- default_value,-->
|
||||||
|
<!-- dict_key,-->
|
||||||
|
<!-- create_by,-->
|
||||||
|
<!-- create_time,-->
|
||||||
|
<!-- </trim>-->
|
||||||
|
<!-- values-->
|
||||||
|
<!-- <foreach collection="tableAssets" item="item" separator=",">-->
|
||||||
|
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
||||||
|
<!-- <if test="item.dataAssetId != null">#{item.dataAssetId},</if>-->
|
||||||
|
<!-- <if test="item.name != null">#{item.name},</if>-->
|
||||||
|
<!-- <if test="item.comment != null">#{item.comment},</if>-->
|
||||||
|
<!-- <if test="item.isPrimaryKey != null">#{item.isPrimaryKey},</if>-->
|
||||||
|
<!-- <if test="item.type != null">#{item.type},</if>-->
|
||||||
|
<!-- <if test="item.mappingType != null">#{item.mappingType},</if>-->
|
||||||
|
<!-- <if test="item.length != null">#{item.length},</if>-->
|
||||||
|
<!-- <if test="item.decimalPlaces != null">#{item.decimalPlaces},</if>-->
|
||||||
|
<!-- <if test="item.isNull != null">#{item.isNull},</if>-->
|
||||||
|
<!-- <if test="item.isDict != null">#{item.isDict},</if>-->
|
||||||
|
<!-- <if test="item.defaultValue != null">#{item.defaultValue},</if>-->
|
||||||
|
<!-- <if test="item.dictKey != null">#{item.dictKey},</if>-->
|
||||||
|
<!-- <if test="item.createBy != null and item.createBy != ''">#{item.createBy},</if>-->
|
||||||
|
<!-- <if test="item.createTime != null">#{item.createTime},</if>-->
|
||||||
|
<!-- </trim>-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
|
||||||
|
<!-- </insert>-->
|
||||||
|
|
||||||
|
<update id="updateAssetModel" parameterType="com.muyu.etl.domain.AssetModel">
|
||||||
|
update asset_model
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="dataAssetId != null">data_asset_id = #{dataAssetId},</if>
|
||||||
|
<if test="name != null">name = #{name},</if>
|
||||||
|
<if test="comment != null">comment = #{comment},</if>
|
||||||
|
<if test="isPrimaryKey != null">is_primary_key = #{isPrimaryKey},</if>
|
||||||
|
<if test="type != null">type = #{type},</if>
|
||||||
|
<if test="mappingType != null">mapping_type = #{mappingType},</if>
|
||||||
|
<if test="length != null">length = #{length},</if>
|
||||||
|
<if test="decimalPlaces != null">decimal_places = #{decimalPlaces},</if>
|
||||||
|
<if test="isNull != null">is_null = #{isNull},</if>
|
||||||
|
<if test="isDict != null">is_dict = #{isDict},</if>
|
||||||
|
<if test="defaultValue != null">default_value = #{defaultValue},</if>
|
||||||
|
<if test="dictKey != null">dict_key = #{dictKey},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteAssetModelById" parameterType="Long">
|
||||||
|
delete from asset_model where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAssetModelByIds" parameterType="String">
|
||||||
|
delete from asset_model where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,120 @@
|
||||||
|
<?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.muyu.etl.mapper.DataAssetMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.etl.domain.DataAsset" id="DataAssetResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="dataSourceId" column="data_source_id" />
|
||||||
|
<result property="tableName" column="table_name" />
|
||||||
|
<result property="tableComment" column="table_comment" />
|
||||||
|
<result property="tableCount" column="table_count" />
|
||||||
|
<result property="fields" column="fields" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDataAssetVo">
|
||||||
|
select id, data_source_id, table_name, table_comment, table_count, fields, create_by, create_time, update_by, update_time, remark from data_asset
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDataAssetList" parameterType="com.muyu.etl.domain.DataAsset" resultMap="DataAssetResult">
|
||||||
|
<include refid="selectDataAssetVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="dataSourceId != null "> and data_source_id = #{dataSourceId}</if>
|
||||||
|
<if test="tableName != null and tableName != ''"> and table_name like concat('%', #{tableName}, '%')</if>
|
||||||
|
<if test="tableComment != null and tableComment != ''"> and table_comment = #{tableComment}</if>
|
||||||
|
<if test="tableCount != null "> and table_count = #{tableCount}</if>
|
||||||
|
<if test="fields != null "> and fields = #{fields}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDataAssetById" parameterType="Long" resultMap="DataAssetResult">
|
||||||
|
<include refid="selectDataAssetVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDataAsset" parameterType="com.muyu.etl.domain.DataAsset" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into data_asset
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataSourceId != null">data_source_id,</if>
|
||||||
|
<if test="tableName != null">table_name,</if>
|
||||||
|
<if test="tableComment != null">table_comment,</if>
|
||||||
|
<if test="tableCount != null">table_count,</if>
|
||||||
|
<if test="fields != null">fields,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataSourceId != null">#{dataSourceId},</if>
|
||||||
|
<if test="tableName != null">#{tableName},</if>
|
||||||
|
<if test="tableComment != null">#{tableComment},</if>
|
||||||
|
<if test="tableCount != null">#{tableCount},</if>
|
||||||
|
<if test="fields != null">#{fields},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<insert id="batchInsert" parameterType="com.muyu.etl.domain.DataAsset" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into data_asset
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
data_source_id,
|
||||||
|
`table_name`,
|
||||||
|
table_comment,
|
||||||
|
table_count,
|
||||||
|
fields,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
</trim>
|
||||||
|
values
|
||||||
|
<foreach collection="dataAssets" item="item" separator=",">
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
#{item.dataSourceId},
|
||||||
|
#{item.tableName},
|
||||||
|
#{item.tableComment},
|
||||||
|
#{item.tableCount},
|
||||||
|
#{item.fields},
|
||||||
|
#{item.createBy},
|
||||||
|
#{item.createTime},
|
||||||
|
</trim>
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDataAsset" parameterType="com.muyu.etl.domain.DataAsset">
|
||||||
|
update data_asset
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="dataSourceId != null">data_source_id = #{dataSourceId},</if>
|
||||||
|
<if test="tableName != null">table_name = #{tableName},</if>
|
||||||
|
<if test="tableComment != null">table_comment = #{tableComment},</if>
|
||||||
|
<if test="tableCount != null">table_count = #{tableCount},</if>
|
||||||
|
<if test="fields != null">fields = #{fields},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteDataAssetById" parameterType="Long">
|
||||||
|
delete from data_asset where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDataAssetByIds" parameterType="String">
|
||||||
|
delete from data_asset where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,136 @@
|
||||||
|
<?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.muyu.etl.mapper.DataSourceMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.etl.domain.DataSource" id="DataSourceResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="dataSourceName" column="data_source_name" />
|
||||||
|
<result property="linkAddress" column="link_address" />
|
||||||
|
<result property="port" column="port" />
|
||||||
|
<result property="databaseName" column="database_name" />
|
||||||
|
<result property="username" column="username" />
|
||||||
|
<result property="password" column="password" />
|
||||||
|
<result property="connectionParam" column="connection_param" />
|
||||||
|
<result property="initNum" column="init_num" />
|
||||||
|
<result property="maxNum" column="max_num" />
|
||||||
|
<result property="maxWaitTime" column="max_wait_time" />
|
||||||
|
<result property="maxWaitSize" column="max_wait_size" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="type" column="type" />
|
||||||
|
<result property="systemName" column="system_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDataSourceVo">
|
||||||
|
select id, data_source_name, link_address, port, database_name, username, password, connection_param, init_num, max_num, max_wait_time, max_wait_size, create_by, create_time, update_by, update_time, remark, type, system_name from data_source
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDataSourceList" parameterType="com.muyu.etl.domain.DataSource" resultMap="DataSourceResult">
|
||||||
|
<include refid="selectDataSourceVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="dataSourceName != null and dataSourceName != ''"> and data_source_name like concat('%', #{dataSourceName}, '%')</if>
|
||||||
|
<if test="linkAddress != null and linkAddress != ''"> and link_address = #{linkAddress}</if>
|
||||||
|
<if test="port != null and port != ''"> and port = #{port}</if>
|
||||||
|
<if test="databaseName != null and databaseName != ''"> and database_name like concat('%', #{databaseName}, '%')</if>
|
||||||
|
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
||||||
|
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||||
|
<if test="connectionParam != null and connectionParam != ''"> and connection_param = #{connectionParam}</if>
|
||||||
|
<if test="initNum != null "> and init_num = #{initNum}</if>
|
||||||
|
<if test="maxNum != null "> and max_num = #{maxNum}</if>
|
||||||
|
<if test="maxWaitTime != null "> and max_wait_time = #{maxWaitTime}</if>
|
||||||
|
<if test="maxWaitSize != null "> and max_wait_size = #{maxWaitSize}</if>
|
||||||
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||||
|
<if test="systemName != null and systemName != ''"> and system_name like concat('%', #{systemName}, '%')</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDataSourceById" parameterType="Long" resultMap="DataSourceResult">
|
||||||
|
<include refid="selectDataSourceVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDataSource" parameterType="com.muyu.etl.domain.DataSource" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into data_source
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataSourceName != null">data_source_name,</if>
|
||||||
|
<if test="linkAddress != null">link_address,</if>
|
||||||
|
<if test="port != null">port,</if>
|
||||||
|
<if test="databaseName != null">database_name,</if>
|
||||||
|
<if test="username != null">username,</if>
|
||||||
|
<if test="password != null">password,</if>
|
||||||
|
<if test="connectionParam != null">connection_param,</if>
|
||||||
|
<if test="initNum != null">init_num,</if>
|
||||||
|
<if test="maxNum != null">max_num,</if>
|
||||||
|
<if test="maxWaitTime != null">max_wait_time,</if>
|
||||||
|
<if test="maxWaitSize != null">max_wait_size,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
|
<if test="systemName != null">system_name,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataSourceName != null">#{dataSourceName},</if>
|
||||||
|
<if test="linkAddress != null">#{linkAddress},</if>
|
||||||
|
<if test="port != null">#{port},</if>
|
||||||
|
<if test="databaseName != null">#{databaseName},</if>
|
||||||
|
<if test="username != null">#{username},</if>
|
||||||
|
<if test="password != null">#{password},</if>
|
||||||
|
<if test="connectionParam != null">#{connectionParam},</if>
|
||||||
|
<if test="initNum != null">#{initNum},</if>
|
||||||
|
<if test="maxNum != null">#{maxNum},</if>
|
||||||
|
<if test="maxWaitTime != null">#{maxWaitTime},</if>
|
||||||
|
<if test="maxWaitSize != null">#{maxWaitSize},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="systemName != null">#{systemName},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDataSource" parameterType="com.muyu.etl.domain.DataSource">
|
||||||
|
update data_source
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="dataSourceName != null">data_source_name = #{dataSourceName},</if>
|
||||||
|
<if test="linkAddress != null">link_address = #{linkAddress},</if>
|
||||||
|
<if test="port != null">port = #{port},</if>
|
||||||
|
<if test="databaseName != null">database_name = #{databaseName},</if>
|
||||||
|
<if test="username != null">username = #{username},</if>
|
||||||
|
<if test="password != null">password = #{password},</if>
|
||||||
|
<if test="connectionParam != null">connection_param = #{connectionParam},</if>
|
||||||
|
<if test="initNum != null">init_num = #{initNum},</if>
|
||||||
|
<if test="maxNum != null">max_num = #{maxNum},</if>
|
||||||
|
<if test="maxWaitTime != null">max_wait_time = #{maxWaitTime},</if>
|
||||||
|
<if test="maxWaitSize != null">max_wait_size = #{maxWaitSize},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="type != null">type = #{type},</if>
|
||||||
|
<if test="systemName != null">system_name = #{systemName},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteDataSourceById" parameterType="Long">
|
||||||
|
delete from data_source where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDataSourceByIds" parameterType="String">
|
||||||
|
delete from data_source where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -21,6 +21,16 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuList (SysMenu menu);
|
public List<SysMenu> selectMenuList (SysMenu menu);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据系统菜单ID列表返回对应的菜单项
|
||||||
|
*/
|
||||||
|
public List<SysMenu> selectSysMenuList (@Param("longs") List<Long> longs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询子菜单,根据父菜单ID列表返回对应的子菜单项
|
||||||
|
*/
|
||||||
|
public List<SysMenu> selectSysChdMenuList (@Param("longs") List<Long> longs);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户所有权限
|
* 根据用户所有权限
|
||||||
*
|
*
|
||||||
|
|
|
@ -51,6 +51,44 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||||
return selectMenuList(new SysMenu(), userId);
|
return selectMenuList(new SysMenu(), userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SysMenu> selectSysMenuList(List<SysMenu> menuList){
|
||||||
|
List<Long> longs = menuList.stream()
|
||||||
|
.map(menu -> menu.getParentId())
|
||||||
|
.filter(parentId -> parentId != 0)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
if (longs.size()==0){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<SysMenu> sysMenus = menuMapper.selectSysMenuList(longs);
|
||||||
|
List<SysMenu> sysMenus1 = selectSysMenuList(sysMenus);
|
||||||
|
if (sysMenus1 != null){
|
||||||
|
sysMenus.addAll(sysMenus1);
|
||||||
|
}
|
||||||
|
return sysMenus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SysMenu> selectSysChdMenuList(List<SysMenu> menuList){
|
||||||
|
//从输入的menuList中提取出每个菜单的ID,放入一个long类型的列表中
|
||||||
|
List<Long> longs = menuList.stream()
|
||||||
|
.map(menu -> menu.getMenuId())
|
||||||
|
.toList();
|
||||||
|
//根据提出的菜单ID列表来查询对应的子菜单,将查询结果放入sysMenus列表中
|
||||||
|
List<SysMenu> sysMenus = menuMapper.selectSysChdMenuList(longs);
|
||||||
|
//检查sysMenus是否为空,不为空将其添加到sysMenus列表中
|
||||||
|
if (sysMenus!=null && sysMenus.size()!=0){
|
||||||
|
List<SysMenu> sysMenus1 = selectSysMenuList(sysMenus);
|
||||||
|
if (sysMenus1 != null){
|
||||||
|
sysMenus.addAll(sysMenus1);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//sysMenus为空 直接返回null
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//展示sysMenus列表
|
||||||
|
return sysMenus;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统菜单列表
|
* 查询系统菜单列表
|
||||||
*
|
*
|
||||||
|
@ -64,10 +102,22 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||||
// 管理员显示所有菜单信息
|
// 管理员显示所有菜单信息
|
||||||
if (SysUser.isAdmin(userId)) {
|
if (SysUser.isAdmin(userId)) {
|
||||||
menuList = menuMapper.selectMenuList(menu);
|
menuList = menuMapper.selectMenuList(menu);
|
||||||
|
List<SysMenu> sysMenus1 = selectSysMenuList(menuList);
|
||||||
|
if (sysMenus1!=null && sysMenus1.size()!=0){
|
||||||
|
menuList.addAll(sysMenus1);
|
||||||
|
}
|
||||||
|
List<SysMenu> sysMenus = selectSysChdMenuList(menuMapper.selectMenuList(menu));
|
||||||
|
if (sysMenus!=null && sysMenus.size()!=0){
|
||||||
|
menuList.addAll(sysMenus);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
menu.getParams().put("userId", userId);
|
menu.getParams().put("userId", userId);
|
||||||
menuList = menuMapper.selectMenuListByUserId(menu);
|
menuList = menuMapper.selectMenuListByUserId(menu);
|
||||||
}
|
}
|
||||||
|
menuList = menuList.stream()
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -186,6 +186,30 @@
|
||||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysMenuList" resultType="com.muyu.system.domain.SysMenu">
|
||||||
|
<include refid="selectMenuVo"/>
|
||||||
|
<where>
|
||||||
|
menu_id in (
|
||||||
|
<foreach collection="longs" separator="," item="id">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</where>
|
||||||
|
order by parent_id,order_num
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysChdMenuList" resultType="com.muyu.system.domain.SysMenu">
|
||||||
|
<include refid="selectMenuVo"/>
|
||||||
|
<where>
|
||||||
|
parent_id in (
|
||||||
|
<foreach collection="longs" separator="," item="id">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</where>
|
||||||
|
order by parent_id,order_num
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateMenu" parameterType="com.muyu.system.domain.SysMenu">
|
<update id="updateMenu" parameterType="com.muyu.system.domain.SysMenu">
|
||||||
update sys_menu
|
update sys_menu
|
||||||
<set>
|
<set>
|
||||||
|
|
|
@ -152,7 +152,7 @@
|
||||||
|
|
||||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||||
<include refid="selectUserVo"/>
|
<include refid="selectUserVo"/>
|
||||||
where u.user_name = #{userName} and u.del_flag = '0'
|
where u.user_name = #{userName} or u.email = #{userName} and u.del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||||
|
@ -165,7 +165,7 @@
|
||||||
from sys_user
|
from sys_user
|
||||||
where user_name = #{userName}
|
where user_name = #{userName}
|
||||||
and del_flag = '0'
|
and del_flag = '0'
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||||
|
@ -173,7 +173,7 @@
|
||||||
from sys_user
|
from sys_user
|
||||||
where phonenumber = #{phonenumber}
|
where phonenumber = #{phonenumber}
|
||||||
and del_flag = '0'
|
and del_flag = '0'
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||||
|
@ -181,7 +181,7 @@
|
||||||
from sys_user
|
from sys_user
|
||||||
where email = #{email}
|
where email = #{email}
|
||||||
and del_flag = '0'
|
and del_flag = '0'
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertUser" parameterType="com.muyu.common.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
<insert id="insertUser" parameterType="com.muyu.common.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||||
|
|
Loading…
Reference in New Issue