标签-树形+搜索%修改
This commit is contained in:
+10
-27
@@ -95,37 +95,20 @@ public class SysCategoryController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**通过字典id查询
|
/**标签内容-树形结构列表
|
||||||
*
|
*
|
||||||
* @param sysDictId
|
* @param params
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "标签内容-树形结构-通过sysDictId查询")
|
@AutoLog(value = "标签内容-树形结构列表")
|
||||||
@ApiOperation(value="标签内容-树形结构-通过sysDictId查询", notes="标签内容-树形结构-通过sysDictId查询")
|
@ApiOperation(value="标签内容-树形结构列表", notes="标签内容-树形结构列表")
|
||||||
@GetMapping(value = "/queryBySysDictId")
|
@PostMapping(value = "/queryPageList")
|
||||||
// @RequiresPermissions("sys:category:queryBySysDictId")
|
// @RequiresPermissions("sys:category:queryPageList")
|
||||||
public Result<?> queryBySysDictId(@RequestParam(name="id",required=true) String sysDictId) {
|
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
|
||||||
List<SysCategory> sysCategory = sysCategoryService.queryBySysDictId(sysDictId);
|
IPage<SysCategory> pageList= sysCategoryService.queryPageList(params);
|
||||||
if(sysCategory==null) {
|
return Result.OK(pageList);
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(sysCategory);
|
|
||||||
}
|
}
|
||||||
/**树形结构搜索条件-名称
|
|
||||||
*
|
|
||||||
* @param
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "标签内容-树形结构-通过名称查询")
|
|
||||||
@ApiOperation(value="标签内容-树形结构-通过名称查询", notes="标签内容-树形结构-通过名称查询")
|
|
||||||
@GetMapping(value = "/queryBySysName")
|
|
||||||
public Result<?> queryBySysName(@RequestParam(name="name",required=true) String sysName) {
|
|
||||||
List<SysCategory> sysCategory = sysCategoryService.queryBySysName(sysName);
|
|
||||||
if(sysCategory==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(sysCategory);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
* @param sysCategory
|
* @param sysCategory
|
||||||
|
|||||||
+13
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.system.controller;
|
package com.jero.modules.system.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -18,6 +19,7 @@ import com.jero.common.util.oConvertUtils;
|
|||||||
import com.jero.modules.enums.FixedFieldEnum;
|
import com.jero.modules.enums.FixedFieldEnum;
|
||||||
import com.jero.modules.system.entity.SysDict;
|
import com.jero.modules.system.entity.SysDict;
|
||||||
import com.jero.modules.system.entity.SysDictItem;
|
import com.jero.modules.system.entity.SysDictItem;
|
||||||
|
import com.jero.modules.system.entity.SysUser;
|
||||||
import com.jero.modules.system.model.SysDictTree;
|
import com.jero.modules.system.model.SysDictTree;
|
||||||
import com.jero.modules.system.model.TreeSelectModel;
|
import com.jero.modules.system.model.TreeSelectModel;
|
||||||
import com.jero.modules.system.service.ISysDictItemService;
|
import com.jero.modules.system.service.ISysDictItemService;
|
||||||
@@ -193,6 +195,8 @@ public class SysDictController {
|
|||||||
public Result<?> queryAllDictItems(HttpServletRequest request) {
|
public Result<?> queryAllDictItems(HttpServletRequest request) {
|
||||||
Map<String, List<DictModel>> res = new HashMap<String, List<DictModel>>();
|
Map<String, List<DictModel>> res = new HashMap<String, List<DictModel>>();
|
||||||
res = sysDictService.queryAllDictItems();
|
res = sysDictService.queryAllDictItems();
|
||||||
|
//添加成功后需要刷新缓存
|
||||||
|
sysDictService.refreshCache();
|
||||||
return Result.OK(res);
|
return Result.OK(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,6 +212,15 @@ public class SysDictController {
|
|||||||
res = sysDictService.queryAllDictItemsByCut(cut);
|
res = sysDictService.queryAllDictItemsByCut(cut);
|
||||||
return Result.OK(res);
|
return Result.OK(res);
|
||||||
}
|
}
|
||||||
|
@ApiOperation(value = "更新浏览器内保存的数据字典数据", notes = "更新浏览器内保存的数据字典数据")
|
||||||
|
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
||||||
|
private Result<JSONObject> userInfo(SysUser sysUser, Result<JSONObject> result) {
|
||||||
|
// 获取数据字典
|
||||||
|
JSONObject obj = new JSONObject();
|
||||||
|
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||||
|
result.setResult(obj);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取字典数据
|
* 获取字典数据
|
||||||
|
|||||||
+3
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.system.mapper;
|
package com.jero.modules.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.jero.modules.system.entity.SysCategory;
|
import com.jero.modules.system.entity.SysCategory;
|
||||||
import com.jero.modules.system.model.TreeSelectModel;
|
import com.jero.modules.system.model.TreeSelectModel;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -18,6 +19,8 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public interface SysCategoryMapper extends BaseMapper<SysCategory> {
|
public interface SysCategoryMapper extends BaseMapper<SysCategory> {
|
||||||
|
|
||||||
|
IPage<SysCategory> queryPageList(IPage page, @Param("params") Map<String,Object> params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据父级ID查询树节点数据
|
* 根据父级ID查询树节点数据
|
||||||
* @param pid
|
* @param pid
|
||||||
|
|||||||
+28
-11
@@ -4,18 +4,35 @@
|
|||||||
|
|
||||||
<select id="queryListByPid" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
<select id="queryListByPid" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
||||||
select code,
|
select code,
|
||||||
name as "title",
|
name as "title",
|
||||||
id as "key",
|
id as "key",
|
||||||
(case when has_child = '1' then 0 else 1 end) as isLeaf,
|
(case when has_child = '1' then 0 else 1 end) as isLeaf,
|
||||||
pid as parentId
|
pid as parentId
|
||||||
from sys_category
|
from sys_category
|
||||||
where pid = #{pid}
|
where pid = #{pid}
|
||||||
<if test="query!= null">
|
<if test="query!= null">
|
||||||
<foreach collection="query.entrySet()" item="value" index="key" >
|
<foreach collection="query.entrySet()" item="value" index="key" >
|
||||||
and ${key} = #{value}
|
and ${key} = #{value}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryPageList" resultType="com.jero.modules.system.entity.SysCategory">
|
||||||
|
select create_by,create_time,sys_org_code,update_by,update_time,attribute_type,code,
|
||||||
|
del_flag,description,en_name,has_child,id,is_read_only,is_tag_dict,item_value,name,pid,sys_dict_id
|
||||||
|
from sys_category
|
||||||
|
where is_tag_dict=1 and sys_dict_id=#{params.sys_dict_id}
|
||||||
|
|
||||||
|
<!--搜索条件:标签名称包含%,单独搜索-->
|
||||||
|
<choose>
|
||||||
|
<when test='params.name != null and params.name != "" and params.name.contains("%")'>
|
||||||
|
and name like '%1%%' escape '1'
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
and name like concat('%',#{params.name},'%')
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
|
||||||
|
order by create_time desc
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+47
-34
@@ -4,16 +4,16 @@
|
|||||||
|
|
||||||
<!-- 通过字典code获取字典数据 -->
|
<!-- 通过字典code获取字典数据 -->
|
||||||
<select id="queryDictItemsByCode" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
<select id="queryDictItemsByCode" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||||
select s.item_value as "value",s.item_text as "text" from sys_dict_item s
|
select s.item_value as "value",s.item_text as "text" from sys_dict_item s
|
||||||
where dict_id = (select id from sys_dict where dict_code = #{code})
|
where dict_id = (select id from sys_dict where dict_code = #{code})
|
||||||
order by s.sort_order asc
|
order by s.sort_order asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 通过字典code获取字典数据 -->
|
<!-- 通过字典code获取字典数据 -->
|
||||||
<select id="queryDictTextByKey" parameterType="String" resultType="String">
|
<select id="queryDictTextByKey" parameterType="String" resultType="String">
|
||||||
select s.item_text from sys_dict_item s
|
select s.item_text from sys_dict_item s
|
||||||
where s.dict_id = (select id from sys_dict where dict_code = #{code})
|
where s.dict_id = (select id from sys_dict where dict_code = #{code})
|
||||||
and s.item_value = #{key}
|
and s.item_value = #{key}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 通过字典code获取字典数据 -->
|
<!-- 通过字典code获取字典数据 -->
|
||||||
@@ -25,12 +25,12 @@
|
|||||||
|
|
||||||
<!--通过查询指定table的 text code 获取字典-->
|
<!--通过查询指定table的 text code 获取字典-->
|
||||||
<select id="queryTableDictItemsByCode" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
<select id="queryTableDictItemsByCode" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||||
select ${text} as "text",${code} as "value" from ${table}
|
select ${text} as "text",${code} as "value" from ${table}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--通过查询指定table的 text code 获取字典(指定查询条件)-->
|
<!--通过查询指定table的 text code 获取字典(指定查询条件)-->
|
||||||
<select id="queryTableDictItemsByCodeAndFilter" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
<select id="queryTableDictItemsByCodeAndFilter" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
|
||||||
select ${text} as "text",${code} as "value" from ${table}
|
select ${text} as "text",${code} as "value" from ${table}
|
||||||
<if test="filterSql != null and filterSql != ''">
|
<if test="filterSql != null and filterSql != ''">
|
||||||
where ${filterSql}
|
where ${filterSql}
|
||||||
</if>
|
</if>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
<!--通过查询指定table的 text code key 获取字典值-->
|
<!--通过查询指定table的 text code key 获取字典值-->
|
||||||
<select id="queryTableDictTextByKey" parameterType="String" resultType="String">
|
<select id="queryTableDictTextByKey" parameterType="String" resultType="String">
|
||||||
select distinct ${text} as "text" from ${table} where ${code}= #{key}
|
select distinct ${text} as "text" from ${table} where ${code}= #{key}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--通过查询指定table的 text code key 获取字典值,包含value-->
|
<!--通过查询指定table的 text code key 获取字典值,包含value-->
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
select id as "value",depart_name as "text" from sys_depart where del_flag = '0'
|
select id as "value",depart_name as "text" from sys_depart where del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询用户信息 作为字典数据 -->
|
<!-- 查询用户信息 作为字典数据 -->
|
||||||
<select id="queryAllUserBackDictModel" resultType="com.jero.common.system.vo.DictModel">
|
<select id="queryAllUserBackDictModel" resultType="com.jero.common.system.vo.DictModel">
|
||||||
select username as "value",realname as "text" from sys_user where del_flag = '0'
|
select username as "value",realname as "text" from sys_user where del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
@@ -77,42 +77,42 @@
|
|||||||
<!-- 根据表名、显示字段名、存储字段名、父ID查询树 -->
|
<!-- 根据表名、显示字段名、存储字段名、父ID查询树 -->
|
||||||
<select id="queryTreeList" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
<select id="queryTreeList" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
||||||
select ${text} as "title",
|
select ${text} as "title",
|
||||||
${code} as "key",
|
${code} as "key",
|
||||||
<if test="hasChildField != null and hasChildField != ''">
|
<if test="hasChildField != null and hasChildField != ''">
|
||||||
(case when ${hasChildField} = '1' then 0 else 1 end) as isLeaf,
|
(case when ${hasChildField} = '1' then 0 else 1 end) as isLeaf,
|
||||||
</if>
|
</if>
|
||||||
${pidField} as parentId
|
${pidField} as parentId
|
||||||
from ${table}
|
from ${table}
|
||||||
where
|
where
|
||||||
<choose>
|
<choose>
|
||||||
<when test="pid != null and pid != ''">
|
<when test="pid != null and pid != ''">
|
||||||
${pidField} = #{pid}
|
${pidField} = #{pid}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
(${pidField} = '' OR ${pidField} IS NULL)
|
(${pidField} = '' OR ${pidField} IS NULL)
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="query!= null">
|
<if test="query!= null">
|
||||||
and ${text} like concat(concat('%',#{query}),'%')
|
and ${text} like concat(concat('%',#{query}),'%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 根据表名、显示字段名、存储字段名、父ID查询树 -->
|
<!-- 根据表名、显示字段名、存储字段名、父ID查询树 -->
|
||||||
<select id="queryTreeDataByKeyword" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
<select id="queryTreeDataByKeyword" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
||||||
select ${text} as "title",
|
select ${text} as "title",
|
||||||
${code} as "key",
|
${code} as "key",
|
||||||
${pidField} as parentId
|
${pidField} as parentId
|
||||||
from ${table}
|
from ${table}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 根据表名、显示字段名、存储字段名、自身ID查询 -->
|
<!-- 根据表名、显示字段名、存储字段名、自身ID查询 -->
|
||||||
<select id="queryTreeDataItemById" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
<select id="queryTreeDataItemById" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
||||||
select ${text} as "title",
|
select ${text} as "title",
|
||||||
${code} as "key",
|
${code} as "key",
|
||||||
${pidField} as parentId
|
${pidField} as parentId
|
||||||
from ${table}
|
from ${table}
|
||||||
where
|
where
|
||||||
id = #{id}
|
id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 分页查询字典表数据 -->
|
<!-- 分页查询字典表数据 -->
|
||||||
@@ -136,7 +136,8 @@
|
|||||||
from sys_dict as d
|
from sys_dict as d
|
||||||
left join sys_dict_item as i on d.attribute_type=i.item_value
|
left join sys_dict_item as i on d.attribute_type=i.item_value
|
||||||
where i.dict_id="1494570247913512962" and d.del_flag=0 and d.is_tag_dict=1
|
where i.dict_id="1494570247913512962" and d.del_flag=0 and d.is_tag_dict=1
|
||||||
<choose>
|
<!--切换数据成英文-->
|
||||||
|
<!--<choose>
|
||||||
<when test="params.dictName != null and params.dictName != ''">
|
<when test="params.dictName != null and params.dictName != ''">
|
||||||
<if test='params.cut="cn"'>
|
<if test='params.cut="cn"'>
|
||||||
and d.dict_name like concat('%',#{params.dictName},'%')
|
and d.dict_name like concat('%',#{params.dictName},'%')
|
||||||
@@ -146,7 +147,19 @@
|
|||||||
and d.dict_en_name like concat('%',#{params.dictName},'%')
|
and d.dict_en_name like concat('%',#{params.dictName},'%')
|
||||||
</if>
|
</if>
|
||||||
</when>
|
</when>
|
||||||
|
</choose>-->
|
||||||
|
|
||||||
|
<!--搜索条件:标签名称包含%,单独搜索-->
|
||||||
|
<choose>
|
||||||
|
<when test='params.dictName != null and params.dictName != "" and params.dictName.contains("%")'>
|
||||||
|
and dict_name like '%1%%' escape '1'
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
and dict_name like concat('%',#{params.dictName},'%')
|
||||||
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
|
|
||||||
|
|
||||||
order by d.create_time desc
|
order by d.create_time desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+3
-8
@@ -1,5 +1,6 @@
|
|||||||
package com.jero.modules.system.service;
|
package com.jero.modules.system.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.modules.system.entity.SysCategory;
|
import com.jero.modules.system.entity.SysCategory;
|
||||||
@@ -59,12 +60,8 @@ public interface ISysCategoryService extends IService<SysCategory> {
|
|||||||
*/
|
*/
|
||||||
void deleteSysCategory(String ids);
|
void deleteSysCategory(String ids);
|
||||||
|
|
||||||
/**通过字典id查询
|
|
||||||
*
|
IPage<SysCategory> queryPageList(Map<String, Object> params);
|
||||||
* @param sysDictId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<SysCategory> queryBySysDictId(String sysDictId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取树形结构
|
* 获取树形结构
|
||||||
@@ -72,8 +69,6 @@ public interface ISysCategoryService extends IService<SysCategory> {
|
|||||||
*/
|
*/
|
||||||
List<SysCategoryTreeVO> getSysCategoryTree();
|
List<SysCategoryTreeVO> getSysCategoryTree();
|
||||||
|
|
||||||
List<SysCategory> queryBySysName(String sysDictId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改delFlag
|
* 修改delFlag
|
||||||
* @param delFlag
|
* @param delFlag
|
||||||
|
|||||||
+15
-7
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
import com.jero.common.constant.FillRuleConstant;
|
import com.jero.common.constant.FillRuleConstant;
|
||||||
@@ -18,6 +20,7 @@ import com.jero.modules.system.model.TreeSelectModel;
|
|||||||
import com.jero.modules.system.service.ISysCategoryService;
|
import com.jero.modules.system.service.ISysCategoryService;
|
||||||
import com.jero.modules.system.util.TreeUtils;
|
import com.jero.modules.system.util.TreeUtils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -34,6 +37,8 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCategory> implements ISysCategoryService {
|
public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCategory> implements ISysCategoryService {
|
||||||
|
@Autowired
|
||||||
|
SysCategoryMapper sysCategoryMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addSysCategory(SysCategory sysCategory) {
|
public void addSysCategory(SysCategory sysCategory) {
|
||||||
@@ -211,22 +216,25 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
|||||||
|
|
||||||
/**通过字典id查询
|
/**通过字典id查询
|
||||||
*
|
*
|
||||||
* @param sysDictId
|
* @param params
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCategory> queryBySysDictId(String sysDictId) {
|
public IPage<SysCategory> queryPageList(Map<String, Object> params) {
|
||||||
QueryWrapper<SysCategory> queryWrapper=new QueryWrapper<>();
|
Integer pageNo = Integer.parseInt(params.get("pageNo").toString());
|
||||||
queryWrapper.eq("sys_dict_id",sysDictId).eq("del_flag", CommonConstant.DEL_FLAG_0);
|
Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
||||||
return list(queryWrapper);
|
IPage page = new Page(pageNo, pageSize);
|
||||||
|
IPage<SysCategory> result = sysCategoryMapper.queryPageList(page, params);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
/**搜索条件*/
|
|
||||||
|
/**搜索条件*//*
|
||||||
@Override
|
@Override
|
||||||
public List<SysCategory> queryBySysName(String sysName) {
|
public List<SysCategory> queryBySysName(String sysName) {
|
||||||
QueryWrapper<SysCategory> queryWrapper=new QueryWrapper<>();
|
QueryWrapper<SysCategory> queryWrapper=new QueryWrapper<>();
|
||||||
queryWrapper.like("name",sysName).eq("del_flag", CommonConstant.DEL_FLAG_0);
|
queryWrapper.like("name",sysName).eq("del_flag", CommonConstant.DEL_FLAG_0);
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCategoryTreeVO> getSysCategoryTree() {
|
public List<SysCategoryTreeVO> getSysCategoryTree() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
+17
-17
@@ -210,21 +210,21 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型id删除关联表中其对应的数据
|
* 根据字典类型id删除关联表中其对应的数据
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteByDictId(SysDict sysDict) {
|
public boolean deleteByDictId(SysDict sysDict) {
|
||||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_1);
|
sysDict.setDelFlag(CommonConstant.DEL_FLAG_1);
|
||||||
return this.updateById(sysDict);
|
return this.updateById(sysDict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Integer saveMain(SysDict sysDict, List<SysDictItem> sysDictItemList) {
|
public Integer saveMain(SysDict sysDict, List<SysDictItem> sysDictItemList) {
|
||||||
int insert=0;
|
int insert=0;
|
||||||
try{
|
try{
|
||||||
insert = sysDictMapper.insert(sysDict);
|
insert = sysDictMapper.insert(sysDict);
|
||||||
if (sysDictItemList != null) {
|
if (sysDictItemList != null) {
|
||||||
for (SysDictItem entity : sysDictItemList) {
|
for (SysDictItem entity : sysDictItemList) {
|
||||||
entity.setDictId(sysDict.getId());
|
entity.setDictId(sysDict.getId());
|
||||||
@@ -236,7 +236,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
|||||||
return insert;
|
return insert;
|
||||||
}
|
}
|
||||||
return insert;
|
return insert;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DictModel> queryAllDepartBackDictModel() {
|
public List<DictModel> queryAllDepartBackDictModel() {
|
||||||
@@ -255,7 +255,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DictModel> queryLittleTableDictItems(String table, String text, String code, String keyword, int pageSize) {
|
public List<DictModel> queryLittleTableDictItems(String table, String text, String code, String keyword, int pageSize) {
|
||||||
Page<DictModel> page = new Page<DictModel>(1, pageSize);
|
Page<DictModel> page = new Page<DictModel>(1, pageSize);
|
||||||
IPage<DictModel> pageList = baseMapper.queryTableDictItems(page, table, text, code, "%"+keyword+"%");
|
IPage<DictModel> pageList = baseMapper.queryTableDictItems(page, table, text, code, "%"+keyword+"%");
|
||||||
return pageList.getRecords();
|
return pageList.getRecords();
|
||||||
}
|
}
|
||||||
@@ -406,7 +406,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
|||||||
Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
||||||
IPage page = new Page(pageNo, pageSize);
|
IPage page = new Page(pageNo, pageSize);
|
||||||
IPage<SysDict> result = sysDictMapper.queryPageList(page, params);
|
IPage<SysDict> result = sysDictMapper.queryPageList(page, params);
|
||||||
List<SysDict> records = result.getRecords();
|
/*List<SysDict> records = result.getRecords();
|
||||||
String cut = (String) params.get("cut");
|
String cut = (String) params.get("cut");
|
||||||
//中英切换-字典名称+属性类型列
|
//中英切换-字典名称+属性类型列
|
||||||
if(CutEnum.EN.getValue().equals(cut)){
|
if(CutEnum.EN.getValue().equals(cut)){
|
||||||
@@ -414,7 +414,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
|||||||
data.setDictName(data.getDictEnName());
|
data.setDictName(data.getDictEnName());
|
||||||
data.setAttributeTypeName(data.getAttributeTypeEnName());
|
data.setAttributeTypeName(data.getAttributeTypeEnName());
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-11
@@ -41,18 +41,31 @@
|
|||||||
where f.cgform_head_id="48308196e7b04761b533dc31bc899707"
|
where f.cgform_head_id="48308196e7b04761b533dc31bc899707"
|
||||||
and f.is_delete=0
|
and f.is_delete=0
|
||||||
and i.dict_id=1493098515761917954
|
and i.dict_id=1493098515761917954
|
||||||
<choose>
|
<!--切换数据成英文-->
|
||||||
<when test="params.dbFieldTxt != null and params.dbFieldTxt != ''">
|
<!-- <choose>
|
||||||
<if test='params.cut="cn"'>
|
<when test="params.dbFieldTxt != null and params.dbFieldTxt != ''">
|
||||||
|
<if test='params.cut="cn"'>
|
||||||
|
and f.db_field_txt like concat('%',#{params.dbFieldTxt},'%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test='params.cut="en"'>
|
||||||
|
and f.db_field_en_name like concat('%',#{params.dbFieldTxt},'%')
|
||||||
|
</if>
|
||||||
|
</when>
|
||||||
|
</choose>-->
|
||||||
|
|
||||||
|
|
||||||
|
<if test="params.dbFieldTxt != null and params.dbFieldTxt != ''">
|
||||||
|
<!--搜索条件:标签名称包含%,单独搜索-->
|
||||||
|
<choose>
|
||||||
|
<when test='params.dbFieldTxt != null and params.dbFieldTxt != "" and params.dbFieldTxt.contains("%")'>
|
||||||
|
and f.db_field_txt like '%1%%' escape '1'
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
and f.db_field_txt like concat('%',#{params.dbFieldTxt},'%')
|
and f.db_field_txt like concat('%',#{params.dbFieldTxt},'%')
|
||||||
</if>
|
</otherwise>
|
||||||
|
</choose>
|
||||||
<if test='params.cut="en"'>
|
</if>
|
||||||
and f.db_field_en_name like concat('%',#{params.dbFieldTxt},'%')
|
|
||||||
</if>
|
|
||||||
</when>
|
|
||||||
</choose>
|
|
||||||
|
|
||||||
<if test="params.showArea != null and params.showArea != '' ">
|
<if test="params.showArea != null and params.showArea != '' ">
|
||||||
and f.show_area like concat('%',#{params.showArea},'%')
|
and f.show_area like concat('%',#{params.showArea},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
+2
-2
@@ -145,14 +145,14 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
|
|||||||
Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
||||||
IPage page = new Page(pageNo, pageSize);
|
IPage page = new Page(pageNo, pageSize);
|
||||||
IPage<OnlCgformArea> result = onlCgformAreaMapper.queryPageList(page, params);
|
IPage<OnlCgformArea> result = onlCgformAreaMapper.queryPageList(page, params);
|
||||||
List<OnlCgformArea> records = result.getRecords();
|
/*List<OnlCgformArea> records = result.getRecords();
|
||||||
String cut = (String) params.get("cut");
|
String cut = (String) params.get("cut");
|
||||||
//中英切换-所属模块
|
//中英切换-所属模块
|
||||||
if(CutEnum.EN.getValue().equals(cut)){
|
if(CutEnum.EN.getValue().equals(cut)){
|
||||||
for(OnlCgformArea data:records){
|
for(OnlCgformArea data:records){
|
||||||
data.setIsModelName(data.getEnName());
|
data.setIsModelName(data.getEnName());
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-3
@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
import com.jero.common.constant.enums.CutEnum;
|
|
||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||||
@@ -182,7 +181,8 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
|||||||
Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
||||||
IPage page = new Page(pageNo, pageSize);
|
IPage page = new Page(pageNo, pageSize);
|
||||||
IPage<OnlCgformTag> result = onlCgformTagMapper.queryPageList(page, params);
|
IPage<OnlCgformTag> result = onlCgformTagMapper.queryPageList(page, params);
|
||||||
List<OnlCgformTag> records = result.getRecords();
|
//params.get("dbFieldTxt").toString().contains("%");
|
||||||
|
/*List<OnlCgformTag> records = result.getRecords();
|
||||||
String cut = (String) params.get("cut");
|
String cut = (String) params.get("cut");
|
||||||
//中英切换-属性类型+展示区域列
|
//中英切换-属性类型+展示区域列
|
||||||
if(CutEnum.EN.getValue().equals(cut)){
|
if(CutEnum.EN.getValue().equals(cut)){
|
||||||
@@ -190,7 +190,7 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
|||||||
data.setFieldShowTypeName(data.getFieldShowTypeEnName());
|
data.setFieldShowTypeName(data.getFieldShowTypeEnName());
|
||||||
data.setShowAreaName(data.getShowAreaEnName());
|
data.setShowAreaName(data.getShowAreaEnName());
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user