byd扫描漏洞。
This commit is contained in:
-82
@@ -523,30 +523,6 @@ public class SystemAPIController {
|
||||
return sysBaseAPI.loadCategoryDictItem(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典code加载字典text
|
||||
*
|
||||
* @param dictCode 顺序:tableName,text,code
|
||||
* @param keys 要查询的key
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/loadDictItem")
|
||||
public List<String> loadDictItem(@RequestParam("dictCode") String dictCode, @RequestParam("keys") String keys) {
|
||||
return sysBaseAPI.loadDictItem(dictCode, keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典code查询字典项
|
||||
*
|
||||
* @param dictCode 顺序:tableName,text,code
|
||||
* @param dictCode 要查询的key
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDictItems")
|
||||
public List<DictModel> getDictItems(@RequestParam("dictCode") String dictCode) {
|
||||
return sysBaseAPI.getDictItems(dictCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据多个字典code查询多个字典项
|
||||
*
|
||||
@@ -558,19 +534,6 @@ public class SystemAPIController {
|
||||
return sysBaseAPI.getManyDictItems(dictCodeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 【下拉搜索】
|
||||
* 大数据量的字典表 走异步加载,即前端输入内容过滤数据
|
||||
*
|
||||
* @param dictCode 字典code格式:table,text,code
|
||||
* @param keyword 过滤关键字
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/loadDictItemByKeyword")
|
||||
public List<DictModel> loadDictItemByKeyword(@RequestParam("dictCode") String dictCode, @RequestParam("keyword") String keyword, @RequestParam(value = "pageSize", required = false) Integer pageSize) {
|
||||
return sysBaseAPI.loadDictItemByKeyword(dictCode, keyword, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 48 普通字典的翻译,根据多个dictCode和多条数据,多个以逗号分割
|
||||
* @param dictCodes
|
||||
@@ -595,35 +558,6 @@ public class SystemAPIController {
|
||||
return sysBaseAPI.queryTableDictItemsByCode(table, text, code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询表字典 支持过滤数据 【接口签名验证】
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param filterSql
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryFilterTableDictInfo")
|
||||
List<DictModel> queryFilterTableDictInfo(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("filterSql") String filterSql){
|
||||
return sysBaseAPI.queryFilterTableDictInfo(table, text, code, filterSql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 【接口签名验证】
|
||||
* 查询指定table的 text code 获取字典,包含text和value
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyArray
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
@GetMapping("/queryTableDictByKeys")
|
||||
public List<String> queryTableDictByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keyArray") String[] keyArray){
|
||||
return sysBaseAPI.queryTableDictByKeys(table, text, code, keyArray);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 字典表的 翻译【接口签名验证】
|
||||
@@ -638,20 +572,4 @@ public class SystemAPIController {
|
||||
return sysBaseAPI.translateDictFromTable(table, text, code, key);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 【接口签名验证】
|
||||
* 49 字典表的 翻译,可批量
|
||||
*
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keys 多个用逗号分割
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/translateDictFromTableByKeys")
|
||||
public List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys) {
|
||||
return this.sysBaseAPI.translateDictFromTableByKeys(table, text, code, keys);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-171
@@ -187,177 +187,6 @@ public class SysDictController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典数据 【接口签名验证】
|
||||
* @param dictCode 字典code
|
||||
* @param dictCode 表名,文本字段,code字段 | 举例:sys_user,realname,id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDictItems/{dictCode}")
|
||||
public Result<List<DictModel>> getDictItems(@PathVariable String dictCode, @RequestParam(value = "sign",required = false) String sign, HttpServletRequest request) {
|
||||
log.info(" dictCode : "+ dictCode);
|
||||
Result<List<DictModel>> result = new Result<>();
|
||||
try {
|
||||
List<DictModel> ls = sysDictService.getDictItems(dictCode);
|
||||
if (ls == null) {
|
||||
return Result.error(DICT_CODE_ERROE);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
log.debug(result.toString());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(ResultCommon.ERROR);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 【接口签名验证】
|
||||
* 【JSearchSelectTag下拉搜索组件专用接口】
|
||||
* 大数据量的字典表 走异步加载 即前端输入内容过滤数据
|
||||
* @param dictCode 字典code格式:table,text,code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/loadDict/{dictCode}")
|
||||
public Result<List<DictModel>> loadDict(@PathVariable String dictCode,
|
||||
@RequestParam(name="keyword",required = false) String keyword,
|
||||
@RequestParam(value = "sign",required = false) String sign,
|
||||
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
|
||||
log.info(" 加载字典表数据,加载关键字: "+ keyword);
|
||||
Result<List<DictModel>> result = new Result<>();
|
||||
try {
|
||||
List<DictModel> ls = sysDictService.loadDict(dictCode, keyword, pageSize);
|
||||
if (ls == null) {
|
||||
return Result.error(DICT_CODE_ERROE);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
log.info(result.toString());
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error(ResultCommon.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 【给表单设计器的表字典使用】下拉搜索模式,有值时动态拼接数据
|
||||
* @param dictCode
|
||||
* @param keyword 当前控件的值,可以逗号分割
|
||||
* @param sign
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/loadDictOrderByValue/{dictCode}")
|
||||
public Result<List<DictModel>> loadDictOrderByValue(
|
||||
@PathVariable String dictCode,
|
||||
@RequestParam(name = "keyword",required = false) String keyword,
|
||||
@RequestParam(value = "sign", required = false) String sign,
|
||||
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
|
||||
// 首次查询查出来用户选中的值,并且不分页
|
||||
Result<List<DictModel>> firstRes = this.loadDict(dictCode, keyword, sign, null);
|
||||
if (!firstRes.isSuccess()) {
|
||||
return firstRes;
|
||||
}
|
||||
// 然后再查询出第一页的数据
|
||||
Result<List<DictModel>> result = this.loadDict(dictCode, "", sign, pageSize);
|
||||
if (!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
// 合并两次查询的数据
|
||||
List<DictModel> firstList = firstRes.getResult();
|
||||
List<DictModel> list = result.getResult();
|
||||
for (DictModel firstItem : firstList) {
|
||||
// anyMatch 表示:判断的条件里,任意一个元素匹配成功,返回true
|
||||
// allMatch 表示:判断条件里的元素,所有的都匹配成功,返回true
|
||||
// noneMatch 跟 allMatch 相反,表示:判断条件里的元素,所有的都匹配失败,返回true
|
||||
boolean none = list.stream().noneMatch(item -> item.getValue().equals(firstItem.getValue()));
|
||||
// 当元素不存在时,再添加到集合里
|
||||
if (none) {
|
||||
list.add(0, firstItem);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*【接口签名验证】
|
||||
* 根据字典code加载字典text 返回
|
||||
* @param dictCode 顺序:tableName,text,code
|
||||
* @param keys 要查询的key
|
||||
* @param sign
|
||||
* @param delNotExist 是否移除不存在的项,默认为true,设为false如果某个key不存在数据库中,则直接返回key本身
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/loadDictItem/{dictCode}")
|
||||
public Result<List<String>> loadDictItem(@PathVariable String dictCode, @RequestParam(name="key") String keys, @RequestParam(value = "sign",required = false) String sign, @RequestParam(value = "delNotExist",required = false,defaultValue = "true") boolean delNotExist, HttpServletRequest request) {
|
||||
Result<List<String>> result = new Result<>();
|
||||
try {
|
||||
if(dictCode.indexOf(",")!=-1) {
|
||||
String[] params = dictCode.split(",");
|
||||
if(params.length!=3) {
|
||||
return Result.error(DICT_CODE_ERROE);
|
||||
}
|
||||
List<String> texts = sysDictService.queryTableDictByKeys(params[0], params[1], params[2], keys, delNotExist);
|
||||
|
||||
result.setSuccess(true);
|
||||
result.setResult(texts);
|
||||
log.info(result.toString());
|
||||
}else {
|
||||
return Result.error(DICT_CODE_ERROE);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error(ResultCommon.ERROR);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 【接口签名验证】
|
||||
* 根据表名——显示字段-存储字段 pid 加载树形数据
|
||||
*/
|
||||
@GetMapping("/loadTreeData")
|
||||
public Result<List<TreeSelectModel>> loadTreeData(@RequestParam(name="pid") String pid, @RequestParam(name="pidField") String pidField,
|
||||
@RequestParam(name="tableName") String tbname,
|
||||
@RequestParam(name="text") String text,
|
||||
@RequestParam(name="code") String code,
|
||||
@RequestParam(name="hasChildField", required = false) String hasChildField,
|
||||
@RequestParam(value = "sign", required = false) String sign, HttpServletRequest request) {
|
||||
Result<List<TreeSelectModel>> result = new Result<>();
|
||||
|
||||
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
|
||||
String dictCode = tbname +","+ text +","+ code;
|
||||
SqlInjectionUtil.filterContent(dictCode);
|
||||
List<TreeSelectModel> ls = sysDictService.queryTreeList(null, tbname, text, code, pidField, pid, hasChildField);
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询后返回树型数据
|
||||
*/
|
||||
@GetMapping("/queryAllTreeData")
|
||||
public Result<List<TreeSelectModel>> queryAllTreeData(@RequestParam(name="pidField") String pidField,
|
||||
@RequestParam(name="tableName") String tbname,
|
||||
@RequestParam(name="text") String text,
|
||||
@RequestParam(name="code") String code,
|
||||
HttpServletRequest request) {
|
||||
Result<List<TreeSelectModel>> result = new Result<>();
|
||||
|
||||
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
|
||||
String dictCode = tbname +","+ text +","+ code;
|
||||
SqlInjectionUtil.filterContent(dictCode);
|
||||
List<TreeSelectModel> ls = sysDictService.queryAllTreeData(tbname, text, code, pidField);
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:新增
|
||||
* @param sysDict
|
||||
|
||||
+1
-140
@@ -26,20 +26,6 @@ import java.util.Map;
|
||||
*/
|
||||
public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
|
||||
/**
|
||||
* 重复检查SQL
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo);
|
||||
|
||||
/**
|
||||
* @deprecated 不推荐
|
||||
*/
|
||||
@Deprecated
|
||||
public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo);
|
||||
|
||||
public List<DictModel> queryDictItemsByCode(@Param("code") String code);
|
||||
|
||||
/**
|
||||
@@ -57,16 +43,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
* @return
|
||||
*/
|
||||
public List<DictModelMany> queryDictItemsByCodeList(@Param("dictCodeList") List<String> dictCodeList);
|
||||
/**
|
||||
* @deprecated 不推荐
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictItemsByCode(@Param("table") String table,@Param("text") String text,@Param("code") String code);
|
||||
/**
|
||||
* @deprecated 不推荐
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictItemsByCodeAndFilter(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("filterSql") String filterSql);
|
||||
|
||||
/**
|
||||
* @deprecated 不推荐
|
||||
*/
|
||||
@@ -83,29 +60,6 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
* @return
|
||||
*/
|
||||
List<DictModelMany> queryManyDictByKeys(@Param("dictCodeList") List<String> dictCodeList, @Param("keys") List<String> keys);
|
||||
/**
|
||||
* @deprecated 不推荐
|
||||
*/
|
||||
@Deprecated
|
||||
public String queryTableDictTextByKey(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("key") String key);
|
||||
|
||||
/**
|
||||
* 通过查询指定table的 text code key 获取字典值,可批量查询
|
||||
*
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keys
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
List<DictModel> queryTableDictTextByKeys(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keys") List<String> keys);
|
||||
/**
|
||||
* @deprecated 不推荐
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictByKeys(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keyArray") String[] keyArray);
|
||||
|
||||
/**
|
||||
* 查询所有部门 作为字典信息 id -->value,departName -->text
|
||||
@@ -119,62 +73,6 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
*/
|
||||
public List<DictModel> queryAllUserBackDictModel();
|
||||
|
||||
/**
|
||||
* 通过关键字查询出字典表
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyword
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictItems(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("keyword") String keyword);
|
||||
|
||||
|
||||
/**
|
||||
* 通过关键字查询出字典表
|
||||
* @param page
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
IPage<DictModel> queryTableDictItems(Page<DictModel> page, @Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keyword") String keyword);
|
||||
|
||||
/**
|
||||
* 根据表名、显示字段名、存储字段名 查询树
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param pid
|
||||
* @param hasChildField
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
List<TreeSelectModel> queryTreeList(@Param("query") Map<String, String> query,@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField,@Param("pid") String pid,@Param("hasChildField") String hasChildField);
|
||||
|
||||
/**
|
||||
* 根据表名、显示字段名、存储字段名拼接树结构
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
List<TreeSelectModel> queryTreeDataByKeyword(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField);
|
||||
|
||||
/**
|
||||
* 根据表名、显示字段名、存储字段名、自身ID查询
|
||||
* @param id
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
TreeSelectModel queryTreeDataItemById(@Param("id") String id,@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
@@ -197,42 +95,5 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
@Update("update sys_dict set del_flag = #{flag,jdbcType=INTEGER} where id = #{id,jdbcType=VARCHAR}")
|
||||
public void updateDictDelFlag(@Param("flag") int delFlag, @Param("id") String id);
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询字典表数据
|
||||
* @param page
|
||||
* @param query
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Page<DictModel> queryDictTablePageList(Page<DictModel> page, @Param("query") DictQuery query);
|
||||
|
||||
|
||||
/**
|
||||
* 查询 字典表数据 支持查询条件 分页
|
||||
* @param page
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param filterSql
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
IPage<DictModel> queryTableDictWithFilter(Page<DictModel> page, @Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql);
|
||||
|
||||
/**
|
||||
* 查询 字典表数据 支持查询条件 查询所有
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param filterSql
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
List<DictModel> queryAllTableDictItems(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql);
|
||||
|
||||
Integer checkUsed(@Param("dictCode") String dictCode);
|
||||
}
|
||||
|
||||
-125
@@ -62,57 +62,6 @@
|
||||
)
|
||||
</select>
|
||||
|
||||
<!--通过查询指定table的 text code 获取字典-->
|
||||
<select id="queryTableDictItemsByCode" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||
select ${text} as "text",${code} as "value" from ${table}
|
||||
</select>
|
||||
|
||||
<!--通过查询指定table的 text code 获取字典(指定查询条件)-->
|
||||
<select id="queryTableDictItemsByCodeAndFilter" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||
select ${text} as "text",${code} as "value" from ${table}
|
||||
<if test="filterSql != null and filterSql != ''">
|
||||
where ${filterSql}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--通过查询指定table的 text code key 获取字典值-->
|
||||
<select id="queryTableDictTextByKey" parameterType="String" resultType="String">
|
||||
select ${text} as "text" from ${table} where ${code}= #{key}
|
||||
</select>
|
||||
|
||||
<!--通过查询指定table的 text code key 获取字典值,可批量查询-->
|
||||
<select id="queryTableDictTextByKeys" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||
select ${text} as "text", ${code} as "value" from ${table} where ${code} IN (
|
||||
<foreach item="key" collection="keys" separator=",">
|
||||
#{key}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<!--通过查询指定table的 text code key 获取字典值,包含value-->
|
||||
<select id="queryTableDictByKeys" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||
select ${text} as "text", ${code} as "value" from ${table} where ${code} in
|
||||
<foreach item="key" collection="keyArray" open="(" separator="," close=")">
|
||||
#{key}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 重复校验 sql语句 -->
|
||||
<select id="duplicateCheckCountSql" resultType="Long" parameterType="com.jero.modules.system.model.DuplicateCheckVo">
|
||||
SELECT COUNT(*) FROM ${tableName} WHERE ${fieldName} = #{fieldVal} and id <> #{dataId}
|
||||
<if test="tableName == 'sys_user' or tableName == 'sys_depart'">
|
||||
and del_flag = 0
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 重复校验 sql语句 -->
|
||||
<select id="duplicateCheckCountSqlNoDataId" resultType="Long" parameterType="com.jero.modules.system.model.DuplicateCheckVo">
|
||||
SELECT COUNT(*) FROM ${tableName} WHERE ${fieldName} = #{fieldVal}
|
||||
<if test="tableName == 'sys_user' or tableName == 'sys_depart'">
|
||||
and del_flag = 0
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询部门信息 作为字典数据 -->
|
||||
<select id="queryAllDepartBackDictModel" resultType="com.jero.common.system.vo.DictModel">
|
||||
select id as "value",depart_name as "text" from sys_depart where del_flag = '0'
|
||||
@@ -123,80 +72,6 @@
|
||||
select username as "value",realname as "text" from sys_user where del_flag = '0'
|
||||
</select>
|
||||
|
||||
<!--通过查询指定table的 text code 获取字典数据,且支持关键字查询 -->
|
||||
<select id="queryTableDictItems" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||
select ${text} as "text",${code} as "value" from ${table} where ${text} like #{keyword}
|
||||
</select>
|
||||
|
||||
<!-- 根据表名、显示字段名、存储字段名、父ID查询树 -->
|
||||
<select id="queryTreeList" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
||||
select ${text} as "title",
|
||||
${code} as "key",
|
||||
<if test="hasChildField != null and hasChildField != ''">
|
||||
(case when ${hasChildField} = '1' then 0 else 1 end) as isLeaf,
|
||||
</if>
|
||||
${pidField} as parentId
|
||||
from ${table}
|
||||
where
|
||||
<choose>
|
||||
<when test="pid != null and pid != ''">
|
||||
${pidField} = #{pid}
|
||||
</when>
|
||||
<otherwise>
|
||||
(${pidField} = '' OR ${pidField} IS NULL)
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="query!= null">
|
||||
and ${text} like concat(concat('%',#{query}),'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 根据表名、显示字段名、存储字段名、父ID查询树 -->
|
||||
<select id="queryTreeDataByKeyword" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
||||
select ${text} as "title",
|
||||
${code} as "key",
|
||||
${pidField} as parentId
|
||||
from ${table}
|
||||
</select>
|
||||
|
||||
<!-- 根据表名、显示字段名、存储字段名、自身ID查询 -->
|
||||
<select id="queryTreeDataItemById" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
||||
select ${text} as "title",
|
||||
${code} as "key",
|
||||
${pidField} as parentId
|
||||
from ${table}
|
||||
where
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 分页查询字典表数据 -->
|
||||
<select id="queryDictTablePageList" parameterType="Object" resultType="com.jero.common.system.vo.DictModel">
|
||||
select ${query.text} as "text",${query.code} as "value" from ${query.table}
|
||||
where 1 = 1
|
||||
<if test="query.keyword != null and query.keyword != ''">
|
||||
and (${query.text} like '%${query.keyword}%' or ${query.code} like '%${query.keyword}%')
|
||||
</if>
|
||||
<if test="query.codeValue != null and query.codeValue != ''">
|
||||
and ${query.code} = #{query.codeValue}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--通过查询指定table的 text code 获取字典数据,且支持关键字和自定义查询条件查询 分页-->
|
||||
<select id="queryTableDictWithFilter" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||
select ${text} as "text", ${code} as "value" from ${table}
|
||||
<if test="filterSql != null and filterSql != ''">
|
||||
${filterSql}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--通过查询指定table的 text code 获取字典数据,且支持关键字和自定义查询条件查询 获取所有 -->
|
||||
<select id="queryAllTableDictItems" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||
select ${text} as "text", ${code} as "value" from ${table}
|
||||
<if test="filterSql != null and filterSql != ''">
|
||||
${filterSql}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="checkUsed" resultType="java.lang.Integer">
|
||||
select count(*) from laws_tag where dict_field = #{dictCode}
|
||||
</select>
|
||||
|
||||
-117
@@ -44,11 +44,6 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
*/
|
||||
@Deprecated
|
||||
List<DictModel> queryTableDictItemsByCode(String table, String text, String code);
|
||||
/**
|
||||
* @deprecated 不推荐
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictItemsByCodeAndFilter(String table, String text, String code, String filterSql);
|
||||
|
||||
public String queryDictTextByKey(String code, String key);
|
||||
|
||||
@@ -65,27 +60,6 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
@Deprecated
|
||||
String queryTableDictTextByKey(String table, String text, String code, String key);
|
||||
|
||||
/**
|
||||
* 通过查询指定table的 text code key 获取字典值,可批量查询
|
||||
*
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keys
|
||||
* @return
|
||||
*/
|
||||
List<DictModel> queryTableDictTextByKeys(String table, String text, String code, List<String> keys);
|
||||
/**
|
||||
* @deprecated 不推荐
|
||||
*/
|
||||
@Deprecated
|
||||
List<String> queryTableDictByKeys(String table, String text, String code, String keys);
|
||||
/**
|
||||
* @deprecated 不推荐
|
||||
*/
|
||||
@Deprecated
|
||||
List<String> queryTableDictByKeys(String table, String text, String code, String keys,boolean delNotExist);
|
||||
|
||||
/**
|
||||
* 根据字典类型删除关联表中其对应的数据
|
||||
*
|
||||
@@ -105,69 +79,6 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
*/
|
||||
public List<DictModel> queryAllDepartBackDictModel();
|
||||
|
||||
/**
|
||||
* 查询所有用户 作为字典信息 username -->value,realname -->text
|
||||
* @return
|
||||
*/
|
||||
public List<DictModel> queryAllUserBackDictModel();
|
||||
|
||||
/**
|
||||
* 通过关键字查询字典表
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyword
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictItems(String table, String text, String code,String keyword);
|
||||
|
||||
/**
|
||||
* 查询字典表数据 只查询前10条
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
public List<DictModel> queryLittleTableDictItems(String table, String text, String code, String condition, String keyword, int pageSize);
|
||||
|
||||
/**
|
||||
* 查询字典表所有数据
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param condition
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
List<DictModel> queryAllTableDictItems(String table, String text, String code, String condition, String keyword);
|
||||
|
||||
/**
|
||||
* 根据表名、显示字段名、存储字段名 查询树
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param pidField
|
||||
* @param pid
|
||||
* @param hasChildField
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
List<TreeSelectModel> queryTreeList(Map<String, String> query,String table, String text, String code, String pidField,String pid,String hasChildField);
|
||||
|
||||
/**
|
||||
* 根据表名、显示字段名、存储字段名 和查询条件拼接树结构
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param pidField
|
||||
* @return
|
||||
*/
|
||||
List<TreeSelectModel> queryAllTreeData(String table, String text, String code, String pidField);
|
||||
|
||||
/**
|
||||
* 真实删除
|
||||
* @param id
|
||||
@@ -187,34 +98,6 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
*/
|
||||
public List<SysDict> queryDeleteList();
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param query
|
||||
* @param pageSize
|
||||
* @param pageNo
|
||||
* @deprecated 不推荐
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryDictTablePageList(DictQuery query,int pageSize, int pageNo);
|
||||
|
||||
/**
|
||||
* 获取字典数据
|
||||
* @param dictCode 字典code
|
||||
* @param dictCode 表名,文本字段,code字段 | 举例:sys_user,realname,id
|
||||
* @return
|
||||
*/
|
||||
List<DictModel> getDictItems(String dictCode);
|
||||
|
||||
/**
|
||||
* 【JSearchSelectTag下拉搜索组件专用接口】
|
||||
* 大数据量的字典表 走异步加载 即前端输入内容过滤数据
|
||||
*
|
||||
* @param dictCode 字典code格式:table,text,code
|
||||
* @return
|
||||
*/
|
||||
List<DictModel> loadDict(String dictCode, String keyword, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 刷新dict缓存
|
||||
* @date 2021/4/8 9:06
|
||||
|
||||
+2
-55
@@ -569,12 +569,12 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql) {
|
||||
return sysDictService.queryTableDictItemsByCodeAndFilter(table,text,code,filterSql);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray) {
|
||||
return sysDictService.queryTableDictByKeys(table,text,code,Joiner.on(",").join(keyArray));
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1121,35 +1121,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
return sysCategoryService.loadDictItem(ids, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典code加载字典text
|
||||
*
|
||||
* @param dictCode 顺序:tableName,text,code
|
||||
* @param keys 要查询的key
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<String> loadDictItem(String dictCode, String keys) {
|
||||
String[] params = dictCode.split(",");
|
||||
return sysDictService.queryTableDictByKeys(params[0], params[1], params[2], keys, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典code查询字典项
|
||||
*
|
||||
* @param dictCode 顺序:tableName,text,code
|
||||
* @param dictCode 要查询的key
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DictModel> getDictItems(String dictCode) {
|
||||
List<DictModel> ls = sysDictService.getDictItems(dictCode);
|
||||
if (ls == null) {
|
||||
ls = new ArrayList<>();
|
||||
}
|
||||
return ls;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据多个字典code查询多个字典项
|
||||
*
|
||||
@@ -1161,19 +1132,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
return sysDictService.queryDictItemsByCodeList(dictCodeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 【下拉搜索】
|
||||
* 大数据量的字典表 走异步加载,即前端输入内容过滤数据
|
||||
*
|
||||
* @param dictCode 字典code格式:table,text,code
|
||||
* @param keyword 过滤关键字
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageSize) {
|
||||
return sysDictService.loadDict(dictCode, keyword, pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String translateByDictMap(Map<String, String> dictMap, String keys) {
|
||||
if (keys == null){
|
||||
@@ -1196,17 +1154,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
return sysDictService.queryManyDictByKeys(dictCodeList, values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys) {
|
||||
List<DictModel> dictModels = sysDictService.queryTableDictTextByKeys(table, text, code, Arrays.asList(keys.split(",")));
|
||||
dictModels.forEach(i ->{
|
||||
if (i.getText() == null){
|
||||
i.setText(StringUtils.EMPTY);
|
||||
}
|
||||
});
|
||||
return dictModels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDictItemCore> getDictItemAll() {
|
||||
List<SysDictItem> listSysDictItem = sysDictItemService.getDictItemAll();
|
||||
|
||||
+2
-232
@@ -144,13 +144,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
//@Cacheable(value = CacheConstant.SYS_DICT_TABLE_CACHE)
|
||||
public List<DictModel> queryTableDictItemsByCode(String table, String text, String code) {
|
||||
log.debug("无缓存dictTableList的时候调用这里!");
|
||||
return sysDictMapper.queryTableDictItemsByCode(table,text,code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryTableDictItemsByCodeAndFilter(String table, String text, String code, String filterSql) {
|
||||
log.debug("无缓存dictTableList的时候调用这里!");
|
||||
return sysDictMapper.queryTableDictItemsByCodeAndFilter(table,text,code,filterSql);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,54 +160,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
@Cacheable(value = CacheConstant.SYS_DICT_TABLE_CACHE, unless = "#result == null ")
|
||||
public String queryTableDictTextByKey(String table,String text,String code, String key) {
|
||||
log.debug("无缓存dictTable的时候调用这里!");
|
||||
return sysDictMapper.queryTableDictTextByKey(table,text,code,key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryTableDictTextByKeys(String table, String text, String code, List<String> keys) {
|
||||
return sysDictMapper.queryTableDictTextByKeys(table, text, code, keys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryTableDictByKeys(String table, String text, String code, String keys) {
|
||||
return this.queryTableDictByKeys(table, text, code, keys, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过查询指定table的 text code 获取字典,包含text和value
|
||||
* dictTableCache采用redis缓存有效期10分钟
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keys (逗号分隔)
|
||||
* @param delNotExist 是否移除不存在的项,默认为true,设为false如果某个key不存在数据库中,则直接返回key本身
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
//update-begin--Author:lvdandan Date:20201204 for:JT-36【online】树形列表bug修改后,还是显示原来值 暂时去掉缓存
|
||||
//@Cacheable(value = CacheConstant.SYS_DICT_TABLE_BY_KEYS_CACHE)
|
||||
//update-end--Author:lvdandan Date:20201204 for:JT-36【online】树形列表bug修改后,还是显示原来值 暂时去掉缓存
|
||||
public List<String> queryTableDictByKeys(String table, String text, String code, String keys, boolean delNotExist) {
|
||||
if(oConvertUtils.isEmpty(keys)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
String[] keyArray = keys.split(",");
|
||||
List<DictModel> dicts = sysDictMapper.queryTableDictByKeys(table, text, code, keyArray);
|
||||
List<String> texts = new ArrayList<>(dicts.size());
|
||||
|
||||
// update-begin--author:sunjianlei--date:20210514--for:新增delNotExist参数,设为false不删除数据库里不存在的key ----
|
||||
// 查询出来的顺序可能是乱的,需要排个序
|
||||
for (String key : keyArray) {
|
||||
List<DictModel> res = dicts.stream().filter(i -> key.equals(i.getValue())).collect(Collectors.toList());
|
||||
if (!res.isEmpty()) {
|
||||
texts.add(res.get(0).getText());
|
||||
} else if (!delNotExist) {
|
||||
texts.add(key);
|
||||
}
|
||||
}
|
||||
// update-end--author:sunjianlei--date:20210514--for:新增delNotExist参数,设为false不删除数据库里不存在的key ----
|
||||
|
||||
return texts;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,118 +200,6 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
return baseMapper.queryAllDepartBackDictModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryAllUserBackDictModel() {
|
||||
return baseMapper.queryAllUserBackDictModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryTableDictItems(String table, String text, String code, String keyword) {
|
||||
return baseMapper.queryTableDictItems(table, text, code, "%"+keyword+"%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryLittleTableDictItems(String table, String text, String code, String condition, String keyword, int pageSize) {
|
||||
Page<DictModel> page = new Page<>(1, pageSize);
|
||||
page.setSearchCount(false);
|
||||
String filterSql = getFilterSql(text, code, condition, keyword);
|
||||
IPage<DictModel> pageList = baseMapper.queryTableDictWithFilter(page, table, text, code, filterSql);
|
||||
return pageList.getRecords();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取条件语句
|
||||
* @param text
|
||||
* @param code
|
||||
* @param condition
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
private String getFilterSql(String text, String code, String condition, String keyword){
|
||||
String keywordSql = null;
|
||||
String filterSql = "";
|
||||
String sqlWhere = " where ";
|
||||
if(oConvertUtils.isNotEmpty(keyword)){
|
||||
// 判断是否是多选
|
||||
if (keyword.contains(",")) {
|
||||
String inKeywords = "\"" + keyword.replace(",", "\",\"") + "\"";
|
||||
keywordSql = "(" + text + " in (" + inKeywords + ") or " + code + " in (" + inKeywords + "))";
|
||||
} else {
|
||||
keywordSql = "("+text + " like '%"+keyword+"%' or "+ code + " like '%"+keyword+"%')";
|
||||
}
|
||||
}
|
||||
if(oConvertUtils.isNotEmpty(condition) && oConvertUtils.isNotEmpty(keywordSql)){
|
||||
filterSql+= sqlWhere + condition + " and " + keywordSql;
|
||||
}else if(oConvertUtils.isNotEmpty(condition)){
|
||||
filterSql+= sqlWhere + condition;
|
||||
}else if(oConvertUtils.isNotEmpty(keywordSql)){
|
||||
filterSql+= sqlWhere + keywordSql;
|
||||
}
|
||||
return filterSql;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryAllTableDictItems(String table, String text, String code, String condition, String keyword) {
|
||||
String filterSql = getFilterSql(text, code, condition, keyword);
|
||||
return baseMapper.queryAllTableDictItems(table, text, code, filterSql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeSelectModel> queryTreeList(Map<String, String> query,String table, String text, String code, String pidField,String pid,String hasChildField) {
|
||||
return baseMapper.queryTreeList(query,table, text, code, pidField, pid,hasChildField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeSelectModel> queryAllTreeData(String table, String text, String code, String pidField) {
|
||||
// 先查出要查询的数据
|
||||
List<TreeSelectModel> serachTreeNode = this.baseMapper.queryTreeDataByKeyword(table, text, code, pidField);
|
||||
|
||||
// 构建一个HashMap,按ID为key存储全部查询出的数据结构
|
||||
HashMap<String, TreeSelectModel> resultMap = new HashMap<>();
|
||||
for (TreeSelectModel treeSelectModel : serachTreeNode){
|
||||
resultMap.put(treeSelectModel.getKey(), treeSelectModel);
|
||||
|
||||
TreeSelectModel copyTreeSelectModel = treeSelectModel;
|
||||
// 叠加的查询父节点
|
||||
while (StringUtils.isNotEmpty(copyTreeSelectModel.getParentId())){
|
||||
if (resultMap.get(copyTreeSelectModel.getParentId()) != null){
|
||||
break;
|
||||
}
|
||||
|
||||
TreeSelectModel newTreeSelectModel = this.baseMapper.queryTreeDataItemById(copyTreeSelectModel.getParentId(), table, text, code, pidField);
|
||||
if(newTreeSelectModel == null){
|
||||
break;
|
||||
}
|
||||
|
||||
resultMap.put(newTreeSelectModel.getKey(), newTreeSelectModel);
|
||||
|
||||
copyTreeSelectModel = newTreeSelectModel;
|
||||
}
|
||||
}
|
||||
List<TreeSelectModel> treeNodeList = getTreeSelectModels(resultMap);
|
||||
|
||||
return treeNodeList;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<TreeSelectModel> getTreeSelectModels(HashMap<String, TreeSelectModel> resultMap) {
|
||||
// 遍历map里全部的节点,取出父节点放入list,并循环添加他的子节点
|
||||
List<TreeSelectModel> treeNodeList = new ArrayList<>();
|
||||
for (Map.Entry<String, TreeSelectModel> entry : resultMap.entrySet()){
|
||||
TreeSelectModel curTreeSelectModel = entry.getValue();
|
||||
if (StringUtils.isEmpty(curTreeSelectModel.getParentId())){
|
||||
treeNodeList.add(curTreeSelectModel);
|
||||
} else {
|
||||
// 如果有父节点,则找出自己的父节点,把自己添加进父节点的children属性里
|
||||
TreeSelectModel existParentNode = resultMap.get(curTreeSelectModel.getParentId());
|
||||
if (existParentNode != null){
|
||||
existParentNode.getChildren().add(curTreeSelectModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
return treeNodeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOneDictPhysically(String id) {
|
||||
this.baseMapper.deleteOneById(id);
|
||||
@@ -381,71 +216,6 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
return baseMapper.queryDeleteList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryDictTablePageList(DictQuery query, int pageSize, int pageNo) {
|
||||
Page<DictModel> page = new Page<>(pageNo,pageSize,false);
|
||||
Page<DictModel> pageList = baseMapper.queryDictTablePageList(page, query);
|
||||
return pageList.getRecords();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DictModel> getDictItems(String dictCode) {
|
||||
List<DictModel> ls;
|
||||
if (dictCode.contains(",")) {
|
||||
//关联表字典(举例:sys_user,realname,id)
|
||||
String[] params = dictCode.split(",");
|
||||
if (params.length < 3) {
|
||||
// 字典Code格式不正确
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//SQL注入校验(只限制非法串改数据库)
|
||||
final String[] sqlInjCheck = {params[0], params[1], params[2]};
|
||||
SqlInjectionUtil.filterContent(sqlInjCheck);
|
||||
if (params.length == 4) {
|
||||
// SQL注入校验(查询条件SQL 特殊check,此方法仅供此处使用)
|
||||
SqlInjectionUtil.specialFilterContent(params[3]);
|
||||
ls = this.queryTableDictItemsByCodeAndFilter(params[0], params[1], params[2], params[3]);
|
||||
} else if (params.length == 3) {
|
||||
ls = this.queryTableDictItemsByCode(params[0], params[1], params[2]);
|
||||
} else {
|
||||
// 字典Code格式不正确
|
||||
return Collections.emptyList();
|
||||
}
|
||||
} else {
|
||||
//字典表
|
||||
ls = this.queryDictItemsByCode(dictCode);
|
||||
}
|
||||
return ls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> loadDict(String dictCode, String keyword, Integer pageSize) {
|
||||
if (dictCode.contains(",")) {
|
||||
//update-begin-author:taoyan date:20210329 for: 下拉搜索不支持表名后加查询条件
|
||||
String[] params = dictCode.split(",");
|
||||
String condition = null;
|
||||
if (params.length != 3 && params.length != 4) {
|
||||
// 字典Code格式不正确
|
||||
return Collections.emptyList();
|
||||
} else if (params.length == 4) {
|
||||
condition = params[3];
|
||||
}
|
||||
List<DictModel> ls;
|
||||
if (pageSize != null) {
|
||||
ls = this.queryLittleTableDictItems(params[0], params[1], params[2], condition, keyword, pageSize);
|
||||
} else {
|
||||
ls = this.queryAllTableDictItems(params[0], params[1], params[2], condition, keyword);
|
||||
}
|
||||
//update-end-author:taoyan date:20210329 for: 下拉搜索不支持表名后加查询条件
|
||||
return ls;
|
||||
} else {
|
||||
// 字典Code格式不正确
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新dict、depart等的缓存
|
||||
* @date 2021/4/8 9:07
|
||||
|
||||
Reference in New Issue
Block a user