【dict】增加删除标识查询条件

Signed-off-by: liuhanqing <447067298@qq.com>
pull/65/head
liuhanqing 2021-01-16 23:43:45 +08:00
parent 9e99aac503
commit f7a1c55e72
3 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package cn.stylefeng.guns.core.beetl.tag;
import cn.hutool.core.util.StrUtil;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
@ -28,12 +29,14 @@ public class SysDictCheckBoxTag extends SysDictBaseTag {
// 根据字典类型编码去查询字典类型
LambdaQueryWrapper<SysDictType> dictTypeQueryWrapper = new LambdaQueryWrapper<>();
dictTypeQueryWrapper.eq(SysDictType::getDictTypeCode, this.getDictTypeCode());
dictTypeQueryWrapper.ne(SysDictType::getDelFlag, YesOrNotEnum.Y.getCode());
SysDictType dictType = dictTypeService.getOne(dictTypeQueryWrapper);
// 判断字典类型不为空
if (dictType != null) {
// 查询字典列表
LambdaQueryWrapper<SysDict> dictQueryWrapper = new LambdaQueryWrapper<>();
dictQueryWrapper.eq(SysDict::getDictTypeCode, dictType.getDictTypeCode());
dictQueryWrapper.ne(SysDict::getDelFlag, YesOrNotEnum.Y.getCode());
dictQueryWrapper.orderByAsc(SysDict::getDictSort);
List<SysDict> lst = dictService.list(dictQueryWrapper);
// 默认选中值

View File

@ -3,6 +3,7 @@ package cn.stylefeng.guns.core.beetl.tag;
import cn.hutool.core.util.StrUtil;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
@ -27,12 +28,14 @@ public class SysDictRadioTag extends SysDictBaseTag {
// 根据字典类型编码去查询字典类型
LambdaQueryWrapper<SysDictType> dictTypeQueryWrapper = new LambdaQueryWrapper<>();
dictTypeQueryWrapper.eq(SysDictType::getDictTypeCode, this.getDictTypeCode());
dictTypeQueryWrapper.ne(SysDictType::getDelFlag, YesOrNotEnum.Y.getCode());
SysDictType dictType = dictTypeService.getOne(dictTypeQueryWrapper);
// 判断字典类型不为空
if (dictType != null) {
// 查询字典列表
LambdaQueryWrapper<SysDict> dictQueryWrapper = new LambdaQueryWrapper<>();
dictQueryWrapper.eq(SysDict::getDictTypeCode, dictType.getDictTypeCode());
dictQueryWrapper.ne(SysDict::getDelFlag, YesOrNotEnum.Y.getCode());
dictQueryWrapper.orderByAsc(SysDict::getDictSort);
List<SysDict> lst = dictService.list(dictQueryWrapper);
// 默认选中值

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
import cn.stylefeng.guns.core.beetl.enums.SelectTagHeadTypeEnum;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
@ -65,11 +66,13 @@ public class SysDictSelectTag extends SysDictBaseTag {
// 根据字典类型编码去查询字典类型
LambdaQueryWrapper<SysDictType> dictTypeQueryWrapper = new LambdaQueryWrapper<>();
dictTypeQueryWrapper.eq(SysDictType::getDictTypeCode, this.getDictTypeCode());
dictTypeQueryWrapper.ne(SysDictType::getDelFlag, YesOrNotEnum.Y.getCode());
SysDictType dictType = dictTypeService.getOne(dictTypeQueryWrapper);
if (dictType != null) {
// 查询字典列表
LambdaQueryWrapper<SysDict> dictQueryWrapper = new LambdaQueryWrapper<>();
dictQueryWrapper.eq(SysDict::getDictTypeCode, dictType.getDictTypeCode());
dictQueryWrapper.ne(SysDict::getDelFlag, YesOrNotEnum.Y.getCode());
dictQueryWrapper.orderByAsc(SysDict::getDictSort);
List<SysDict> lst = dictService.list(dictQueryWrapper);
// 默认选中值