diff --git a/nursing-unit-config/nu-config-biz/src/main/java/com/nu/modules/utils/PinyinUtils.java b/nursing-unit-config/nu-config-biz/src/main/java/com/nu/modules/utils/PinyinUtils.java index c371526..ac8fd96 100644 --- a/nursing-unit-config/nu-config-biz/src/main/java/com/nu/modules/utils/PinyinUtils.java +++ b/nursing-unit-config/nu-config-biz/src/main/java/com/nu/modules/utils/PinyinUtils.java @@ -1,11 +1,11 @@ package com.nu.modules.utils; + import lombok.extern.slf4j.Slf4j; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; -import org.springframework.stereotype.Component; @Slf4j public class PinyinUtils { diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java index c526d89..9f99029 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java @@ -214,4 +214,6 @@ public interface SysDictMapper extends BaseMapper { * @return */ int removeLogicDeleted(@Param("ids")List ids); + + int existColumn(@Param("tableName") String tableName, @Param("columnName") String columnName); } diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml index a5d935d..92734ad 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml @@ -2,248 +2,268 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - - SELECT COUNT(1) FROM ${tableName} WHERE ${fieldName} = #{fieldVal} - - - + + + SELECT COUNT(1) + FROM ${tableName} + WHERE ${fieldName} = #{fieldVal} + + + - - + + - - + + - - - select ${text} as "text", ${code} as "value" - - ,iz_enabled as status - - from ${table} - - where ${filterSql} - - - - - - + + + select ${text} as "text", ${code} as "value" + + ,iz_enabled as status + + from ${table} + + where ${filterSql} + + + + + + - - + + - + - - + + + - - - UPDATE - sys_dict - SET - del_flag = 0 - WHERE - del_flag = 1 - AND id IN - - #{dictId} - - + + + UPDATE + sys_dict + SET + del_flag = 0 + WHERE + del_flag = 1 + AND id IN + + #{dictId} + + - - - DELETE FROM sys_dict - WHERE - del_flag = 1 - AND id IN - - #{dictId} - - + + + DELETE FROM sys_dict + WHERE + del_flag = 1 + AND id IN + + #{dictId} + + diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java index d4f9a9a..15b09d0 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java @@ -268,9 +268,10 @@ public class SysDictServiceImpl extends ServiceImpl impl text = SqlInjectionUtil.getSqlInjectField(text); code = SqlInjectionUtil.getSqlInjectField(code); List dictModels = Lists.newArrayList(); - try { + int existIzEnabled = sysDictMapper.existColumn(table, "iz_enabled"); + if(existIzEnabled>0){ dictModels = sysDictMapper.queryTableDictWithFilter(table, text, code, filterSql, "1"); - } catch (Exception e) { + }else{ dictModels = sysDictMapper.queryTableDictWithFilter(table, text, code, filterSql, null); } return dictModels; @@ -299,9 +300,10 @@ public class SysDictServiceImpl extends ServiceImpl impl text = SqlInjectionUtil.getSqlInjectField(text); code = SqlInjectionUtil.getSqlInjectField(code); List dictModels = Lists.newArrayList(); - try { + int existIzEnabled = sysDictMapper.existColumn(table, "iz_enabled"); + if(existIzEnabled>0){ dictModels = sysDictMapper.queryTableDictWithFilter(table, text, code, filterSql, "1"); - } catch (Exception e) { + }else{ dictModels = sysDictMapper.queryTableDictWithFilter(table, text, code, filterSql, null); } return dictModels; @@ -540,10 +542,11 @@ public class SysDictServiceImpl extends ServiceImpl impl // 3. 返回表字典数据 IPage pageList = new Page<>(); - try { - pageList = baseMapper.queryPageTableDictWithFilter(page, table, text, code, filterSql, "1"); - } catch (Exception e) { - pageList = baseMapper.queryPageTableDictWithFilter(page, table, text, code, filterSql, null); + int existIzEnabled = sysDictMapper.existColumn(table, "iz_enabled"); + if(existIzEnabled>0){ + pageList = baseMapper.queryPageTableDictWithFilter(page,table, text, code, filterSql, "1"); + }else{ + pageList = baseMapper.queryPageTableDictWithFilter(page,table, text, code, filterSql, null); } return pageList.getRecords(); } @@ -637,9 +640,10 @@ public class SysDictServiceImpl extends ServiceImpl impl text = SqlInjectionUtil.getSqlInjectField(text); code = SqlInjectionUtil.getSqlInjectField(code); List ls = Lists.newArrayList(); - try { + int existIzEnabled = sysDictMapper.existColumn(table, "iz_enabled"); + if(existIzEnabled>0){ ls = baseMapper.queryTableDictWithFilter(table, text, code, filterSql, "1"); - } catch (Exception e) { + }else{ ls = baseMapper.queryTableDictWithFilter(table, text, code, filterSql, null); } return ls;