update 优化 增加删除标志位常量优化查询代码

This commit is contained in:
疯狂的狮子Li 2024-08-02 10:07:47 +08:00
parent b615a3b088
commit 2b0efd1f93
2 changed files with 11 additions and 1 deletions

View File

@ -67,6 +67,16 @@ public interface UserConstants {
*/
String DICT_NORMAL = "0";
/**
* 通用存在标志
*/
String DEL_FLAG_NORMAL = "0";
/**
* 通用删除标志
*/
String DEL_FLAG_REMOVED = "2";
/**
* 是否为系统默认
*/

View File

@ -78,7 +78,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
private LambdaQueryWrapper<SysDept> buildQueryWrapper(SysDeptBo bo) {
LambdaQueryWrapper<SysDept> lqw = Wrappers.lambdaQuery();
lqw.eq(SysDept::getDelFlag, "0");
lqw.eq(SysDept::getDelFlag, UserConstants.DEL_FLAG_NORMAL);
lqw.eq(ObjectUtil.isNotNull(bo.getDeptId()), SysDept::getDeptId, bo.getDeptId());
lqw.eq(ObjectUtil.isNotNull(bo.getParentId()), SysDept::getParentId, bo.getParentId());
lqw.like(StringUtils.isNotBlank(bo.getDeptName()), SysDept::getDeptName, bo.getDeptName());