Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
cfd6bc9e69
|
|
@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
|
||||
import com.bonus.common.annotation.SysLog;
|
||||
import com.bonus.common.enums.OperaType;
|
||||
import com.bonus.common.utils.encryption.Sm4Utils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
|
@ -143,6 +144,7 @@ public class SysUserController extends BaseController
|
|||
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setCreateBy(getUsername());
|
||||
user.setPhonenumber(Sm4Utils.encrypt(user.getPhonenumber()));
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,117 @@
|
|||
package com.bonus.web.controller.tool;
|
||||
|
||||
import com.bonus.common.annotation.Log;
|
||||
import com.bonus.common.annotation.SysLog;
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.domain.entity.SysUser;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.enums.BusinessType;
|
||||
import com.bonus.common.enums.OperaType;
|
||||
import com.bonus.common.utils.DateUtils;
|
||||
import com.bonus.common.utils.SecurityUtils;
|
||||
import com.bonus.common.utils.StringUtils;
|
||||
import com.bonus.system.domain.KyDataClassify;
|
||||
import com.bonus.system.service.KyDataClassifyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据分类管理
|
||||
* @author 马三炮
|
||||
* @date 2025/9/1
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/data/classify")
|
||||
@Slf4j
|
||||
public class KyDataClassifyController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private KyDataClassifyService kyDataClassifyService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取数据分类管理列表
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
@SysLog(title = "数据集成", businessType = OperaType.QUERY, logType = 0, module = "数据集成->数据分类管理", details = "查询数据分类列表")
|
||||
@PreAuthorize("@ss.hasPermi('data:classify:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(KyDataClassify kyDataClassify)
|
||||
{
|
||||
startPage();
|
||||
List<KyDataClassify> list = kyDataClassifyService.selectKyDataClassifyList(kyDataClassify);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('data:classify:add')")
|
||||
@SysLog(title = "数据集成", businessType = OperaType.QUERY, logType = 0, module = "数据集成->数据分类管理", details = "新增数据分类")
|
||||
@PostMapping("/addKyDataClassify")
|
||||
public AjaxResult addKyDataClassify(@Validated @RequestBody KyDataClassify kyDataClassify)
|
||||
{
|
||||
|
||||
kyDataClassify.setCreateUserId(getUserId());
|
||||
kyDataClassify.setCreateUserName(getUsername());
|
||||
kyDataClassify.setCreateTime(DateUtils.getNowDate());
|
||||
kyDataClassify.setUpdateUserId(getUserId());
|
||||
kyDataClassify.setUpdateUserName(getUsername());
|
||||
kyDataClassify.setUpdateTime(DateUtils.getNowDate());
|
||||
return toAjax(kyDataClassifyService.addKyDataClassify(kyDataClassify));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('data:classify:update')")
|
||||
@SysLog(title = "数据集成", businessType = OperaType.QUERY, logType = 0, module = "数据集成->数据分类管理", details = "修改数据分类")
|
||||
@PostMapping("/updateKyDataClassify")
|
||||
public AjaxResult updateKyDataClassify(@Validated @RequestBody KyDataClassify kyDataClassify)
|
||||
{
|
||||
|
||||
kyDataClassify.setUpdateUserId(getUserId());
|
||||
kyDataClassify.setUpdateUserName(getUsername());
|
||||
kyDataClassify.setUpdateTime(DateUtils.getNowDate());
|
||||
return toAjax(kyDataClassifyService.updateKyDataClassify(kyDataClassify));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('data:classify:del')")
|
||||
@SysLog(title = "数据集成", businessType = OperaType.QUERY, logType = 0, module = "数据集成->数据分类管理", details = "删除数据分类")
|
||||
@PostMapping("/delKyDataClassify")
|
||||
public AjaxResult delKyDataClassify(@Validated @RequestBody KyDataClassify kyDataClassify)
|
||||
{
|
||||
|
||||
return toAjax(kyDataClassifyService.delKyDataClassify(kyDataClassify));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据分类管理下拉框
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
/*@PreAuthorize("@ss.hasPermi('data:classify:list')")*/
|
||||
@GetMapping("/listAll")
|
||||
public TableDataInfo listAll(KyDataClassify kyDataClassify)
|
||||
{
|
||||
List<KyDataClassify> list = kyDataClassifyService.listAll(kyDataClassify);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
|
@ -52,6 +52,9 @@ public class SysDept extends BaseEntity
|
|||
/** 父部门名称 */
|
||||
private String parentName;
|
||||
|
||||
/** 部门描述 */
|
||||
private String remark;
|
||||
|
||||
/** 子部门 */
|
||||
private List<SysDept> children = new ArrayList<SysDept>();
|
||||
|
||||
|
|
@ -97,7 +100,7 @@ public class SysDept extends BaseEntity
|
|||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
/*@NotNull(message = "显示顺序不能为空")*/
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
|
|
@ -181,6 +184,16 @@ public class SysDept extends BaseEntity
|
|||
this.children = children;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@ public class SysUser extends BaseEntity
|
|||
/**用户密钥*/
|
||||
private String secret;
|
||||
|
||||
/** 角色名称 */
|
||||
private String roleName;
|
||||
|
||||
public SysUser()
|
||||
{
|
||||
|
||||
|
|
@ -321,6 +324,14 @@ public class SysUser extends BaseEntity
|
|||
this.secret = secret;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.util.Base64;
|
|||
*/
|
||||
public class GenerateUtil {
|
||||
|
||||
private static String generateRandomSecret(int length) {
|
||||
public static String generateRandomSecret(int length) {
|
||||
SecureRandom random = new SecureRandom();
|
||||
byte[] bytes = new byte[length];
|
||||
random.nextBytes(bytes);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import com.bonus.common.constant.Constants;
|
||||
import com.bonus.common.core.text.StrFormatter;
|
||||
|
|
@ -719,4 +721,104 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
}
|
||||
return sb.toString();
|
||||
}
|
||||
// 手机号正则表达式
|
||||
// 规则:11位数字,以1开头,第二位为3-9
|
||||
private static final String PHONE_REGEX = "^1[3-9]\\d{9}$";
|
||||
|
||||
// 编译正则表达式为Pattern对象,提高效率
|
||||
private static final Pattern PHONE_PATTERN = Pattern.compile(PHONE_REGEX);
|
||||
/**
|
||||
* 校验手机号是否合法
|
||||
* @param phoneNumber 待校验的手机号
|
||||
* @return 合法返回true,否则返回false
|
||||
*/
|
||||
public static boolean phoneNumberIsValid(String phoneNumber) {
|
||||
// 先判断是否为空
|
||||
if (phoneNumber == null || phoneNumber.trim().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
// 使用正则匹配
|
||||
return PHONE_PATTERN.matcher(phoneNumber).matches();
|
||||
}
|
||||
|
||||
// 身份证号正则表达式(18位)
|
||||
private static final String ID_CARD_REGEX = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$";
|
||||
|
||||
// 编译正则表达式
|
||||
private static final Pattern ID_CARD_PATTERN = Pattern.compile(ID_CARD_REGEX);
|
||||
|
||||
// 加权因子
|
||||
private static final int[] WEIGHT_FACTOR = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
|
||||
|
||||
// 校验码对应值
|
||||
private static final char[] CHECK_CODE = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'};
|
||||
|
||||
/**
|
||||
* 校验身份证号是否合法
|
||||
* @param idCard 待校验的身份证号
|
||||
* @return 合法返回true,否则返回false
|
||||
*/
|
||||
public static boolean idCardIsValid(String idCard) {
|
||||
// 校验空值
|
||||
if (idCard == null || idCard.trim().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 移除空格并转为大写
|
||||
String trimmedId = idCard.trim().toUpperCase();
|
||||
|
||||
// 校验格式
|
||||
if (!ID_CARD_PATTERN.matcher(trimmedId).matches()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 校验出生日期(这里简化处理,完整实现需要验证月份天数合法性)
|
||||
if (!isValidBirthDate(trimmedId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 校验校验码
|
||||
return isValidCheckCode(trimmedId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验出生日期格式
|
||||
*/
|
||||
private static boolean isValidBirthDate(String idCard) {
|
||||
try {
|
||||
// 从身份证号中提取出生年月日(第7-14位)
|
||||
int year = Integer.parseInt(idCard.substring(6, 10));
|
||||
int month = Integer.parseInt(idCard.substring(10, 12));
|
||||
int day = Integer.parseInt(idCard.substring(12, 14));
|
||||
|
||||
// 简单校验范围
|
||||
if (year < 1900 || year > 2100) return false;
|
||||
if (month < 1 || month > 12) return false;
|
||||
if (day < 1 || day > 31) return false;
|
||||
|
||||
// 更详细的日期校验可以在这里添加
|
||||
|
||||
return true;
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验身份证号的校验码
|
||||
*/
|
||||
private static boolean isValidCheckCode(String idCard) {
|
||||
// 计算前17位与对应加权因子乘积的和
|
||||
int sum = 0;
|
||||
for (int i = 0; i < 17; i++) {
|
||||
sum += Character.getNumericValue(idCard.charAt(i)) * WEIGHT_FACTOR[i];
|
||||
}
|
||||
|
||||
// 计算校验码
|
||||
int remainder = sum % 11;
|
||||
char checkCode = CHECK_CODE[remainder];
|
||||
|
||||
// 比较校验码
|
||||
return idCard.charAt(17) == checkCode;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/9/1
|
||||
*/
|
||||
@Data
|
||||
public class KyDataClassify {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数据类型名称
|
||||
*/
|
||||
private String dataTypeName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateUserName;
|
||||
|
||||
/**
|
||||
* 是否删除 0. 删除 1.未删除
|
||||
*/
|
||||
private String delFlag;
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import com.bonus.system.domain.KyDataClassify;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface KyDataClassifyMapper {
|
||||
|
||||
/**
|
||||
* 获取数据分类管理列表
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
List<KyDataClassify> selectKyDataClassifyList(KyDataClassify kyDataClassify);
|
||||
|
||||
/**
|
||||
* 新增数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
int addKyDataClassify(KyDataClassify kyDataClassify);
|
||||
|
||||
/**
|
||||
* 修改数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
int updateKyDataClassify(KyDataClassify kyDataClassify);
|
||||
|
||||
/**
|
||||
* 删除数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
int delKyDataClassify(KyDataClassify kyDataClassify);
|
||||
|
||||
/**
|
||||
* 获取数据分类管理下拉框
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
List<KyDataClassify> listAll(KyDataClassify kyDataClassify);
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.bonus.system.service;
|
||||
|
||||
import com.bonus.system.domain.KyDataClassify;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface KyDataClassifyService {
|
||||
|
||||
/**
|
||||
* 获取数据分类管理列表
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
List<KyDataClassify> selectKyDataClassifyList(KyDataClassify kyDataClassify);
|
||||
|
||||
/**
|
||||
* 新增数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
int addKyDataClassify(KyDataClassify kyDataClassify);
|
||||
|
||||
/**
|
||||
* 修改数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
int updateKyDataClassify(KyDataClassify kyDataClassify);
|
||||
|
||||
/**
|
||||
* 删除数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
int delKyDataClassify(KyDataClassify kyDataClassify);
|
||||
|
||||
/**
|
||||
* 获取数据分类管理下拉框
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
List<KyDataClassify> listAll(KyDataClassify kyDataClassify);
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package com.bonus.system.service.impl;
|
||||
|
||||
import com.bonus.common.core.domain.entity.SysUser;
|
||||
import com.bonus.common.utils.DateUtils;
|
||||
import com.bonus.common.utils.SecurityUtils;
|
||||
import com.bonus.system.domain.KyDataClassify;
|
||||
import com.bonus.system.mapper.KyDataClassifyMapper;
|
||||
import com.bonus.system.service.KyDataClassifyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/9/1
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class KyDataClassifyServiceImpl implements KyDataClassifyService {
|
||||
|
||||
@Resource
|
||||
private KyDataClassifyMapper kyDataClassifyMapper;
|
||||
|
||||
/**
|
||||
* 获取数据分类管理列表
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<KyDataClassify> selectKyDataClassifyList(KyDataClassify kyDataClassify) {
|
||||
return kyDataClassifyMapper.selectKyDataClassifyList(kyDataClassify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int addKyDataClassify(KyDataClassify kyDataClassify) {
|
||||
return kyDataClassifyMapper.addKyDataClassify(kyDataClassify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateKyDataClassify(KyDataClassify kyDataClassify) {
|
||||
return kyDataClassifyMapper.updateKyDataClassify(kyDataClassify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据分类
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int delKyDataClassify(KyDataClassify kyDataClassify) {
|
||||
return kyDataClassifyMapper.delKyDataClassify(kyDataClassify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据分类管理下拉框
|
||||
* @param kyDataClassify
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<KyDataClassify> listAll(KyDataClassify kyDataClassify) {
|
||||
return kyDataClassifyMapper.listAll(kyDataClassify);
|
||||
}
|
||||
}
|
||||
|
|
@ -211,13 +211,17 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
@Override
|
||||
public int insertDept(SysDept dept)
|
||||
{
|
||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||
// 如果父节点不为正常状态,则不允许新增子节点
|
||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
|
||||
{
|
||||
throw new ServiceException("部门停用,不允许新增");
|
||||
if (dept.getParentId()==0){
|
||||
dept.setAncestors("0");
|
||||
}else {
|
||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||
// 如果父节点不为正常状态,则不允许新增子节点
|
||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
|
||||
{
|
||||
throw new ServiceException("部门停用,不允许新增");
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
return deptMapper.insertDept(dept);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.validation.Validator;
|
||||
|
||||
import com.bonus.common.utils.GenerateUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -260,6 +262,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
@Transactional
|
||||
public int insertUser(SysUser user)
|
||||
{
|
||||
user.setSecret(GenerateUtil.generateRandomSecret(64));
|
||||
// 新增用户信息
|
||||
int rows = userMapper.insertUser(user);
|
||||
// 新增用户岗位关联
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
<?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.bonus.system.mapper.KyDataClassifyMapper">
|
||||
<insert id="addKyDataClassify">
|
||||
insert into da_ky_data_classify
|
||||
(data_type_name,remark,create_time,update_time,create_user_id,create_user_name,update_user_id,update_user_name)
|
||||
values (#{dataTypeName},#{remark},#{createTime},#{updateTime},#{createUserId},#{createUserName},#{updateUserId},#{updateUserName})
|
||||
</insert>
|
||||
<update id="updateKyDataClassify">
|
||||
update da_ky_data_classify
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="dataTypeName!=null">
|
||||
data_type_name =#{dataTypeName}
|
||||
</if>
|
||||
<if test="updateUserId!=null">
|
||||
update_user_id =#{updateUserId}
|
||||
</if>
|
||||
<if test="updateUserName!=null">
|
||||
update_user_name =#{updateUserName}
|
||||
</if>
|
||||
</trim>
|
||||
</update>
|
||||
<delete id="delKyDataClassify">
|
||||
update da_ky_data_classify set del_flag = '0' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="selectKyDataClassifyList" resultType="com.bonus.system.domain.KyDataClassify">
|
||||
select id,data_type_name,remark,update_time,update_user_id,update_user_name
|
||||
from da_ky_data_classify where del_flag='1'
|
||||
<if test="dataTypeName!=null">
|
||||
and data_type_name LIKE CONCAT('%', #{dataTypeName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="listAll" resultType="com.bonus.system.domain.KyDataClassify">
|
||||
select id,data_type_name
|
||||
from da_ky_data_classify where del_flag='1'
|
||||
<if test="dataTypeName!=null">
|
||||
and data_type_name LIKE CONCAT('%', #{dataTypeName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time, d.remark
|
||||
from da_ky_sys_dept d
|
||||
</sql>
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,d.remark,
|
||||
(select dept_name from da_ky_sys_dept where dept_id = d.parent_id) parent_name
|
||||
from da_ky_sys_dept d
|
||||
where d.dept_id = #{deptId}
|
||||
|
|
@ -99,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
|
|
@ -111,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
|
@ -127,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="email != null">email = #{email},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dept_id = #{deptId}
|
||||
|
|
|
|||
|
|
@ -59,8 +59,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from da_ky_sys_user u
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name,
|
||||
d.leader ,dksr.role_id,dksr.role_name
|
||||
from da_ky_sys_user u
|
||||
left join da_ky_sys_dept d on u.dept_id = d.dept_id
|
||||
left join da_ky_sys_user_role dksur on u.user_id = dksur.user_id
|
||||
left join da_ky_sys_role dksr on dksr.role_id = dksur.role_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
|
|
@ -159,6 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="pwdUpdateDate != null">pwd_update_date,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="secret != null and secret != ''">secret,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
|
|
@ -174,6 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="pwdUpdateDate != null">#{pwdUpdateDate},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="secret != null and secret != ''">#{secret},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
|
|
|||
Loading…
Reference in New Issue