Commit 6010c9e9 by fengshuonan

修复一个查询性别的bug

parent 54c70573
...@@ -47,6 +47,7 @@ public class ConstantFactory implements IConstantFactory { ...@@ -47,6 +47,7 @@ public class ConstantFactory implements IConstantFactory {
private RoleMapper roleMapper = SpringContextHolder.getBean(RoleMapper.class); private RoleMapper roleMapper = SpringContextHolder.getBean(RoleMapper.class);
private DeptMapper deptMapper = SpringContextHolder.getBean(DeptMapper.class); private DeptMapper deptMapper = SpringContextHolder.getBean(DeptMapper.class);
private DictMapper dictMapper = SpringContextHolder.getBean(DictMapper.class); private DictMapper dictMapper = SpringContextHolder.getBean(DictMapper.class);
private DictTypeMapper dictTypeMapper = SpringContextHolder.getBean(DictTypeMapper.class);
private UserMapper userMapper = SpringContextHolder.getBean(UserMapper.class); private UserMapper userMapper = SpringContextHolder.getBean(UserMapper.class);
private MenuMapper menuMapper = SpringContextHolder.getBean(MenuMapper.class); private MenuMapper menuMapper = SpringContextHolder.getBean(MenuMapper.class);
private NoticeMapper noticeMapper = SpringContextHolder.getBean(NoticeMapper.class); private NoticeMapper noticeMapper = SpringContextHolder.getBean(NoticeMapper.class);
...@@ -244,15 +245,15 @@ public class ConstantFactory implements IConstantFactory { ...@@ -244,15 +245,15 @@ public class ConstantFactory implements IConstantFactory {
@Override @Override
public String getDictsByName(String name, String code) { public String getDictsByName(String name, String code) {
Dict temp = new Dict(); DictType temp = new DictType();
temp.setName(name); temp.setName(name);
QueryWrapper<Dict> queryWrapper = new QueryWrapper<>(temp); QueryWrapper<DictType> queryWrapper = new QueryWrapper<>(temp);
Dict dict = dictMapper.selectOne(queryWrapper); DictType dictType = dictTypeMapper.selectOne(queryWrapper);
if (dict == null) { if (dictType == null) {
return ""; return "";
} else { } else {
QueryWrapper<Dict> wrapper = new QueryWrapper<>(); QueryWrapper<Dict> wrapper = new QueryWrapper<>();
wrapper = wrapper.eq("PID", dict.getDictId()); wrapper = wrapper.eq("dict_type_id", dictType.getDictTypeId());
List<Dict> dicts = dictMapper.selectList(wrapper); List<Dict> dicts = dictMapper.selectList(wrapper);
for (Dict item : dicts) { for (Dict item : dicts) {
if (item.getCode() != null && item.getCode().equals(code)) { if (item.getCode() != null && item.getCode().equals(code)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment