业务辅助表-业务字典管理平台 分页展示条件搜索,(新增修改部分功能未完善)
This commit is contained in:
@@ -128,19 +128,19 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
||||
this.endDate = endDate;
|
||||
}
|
||||
@JsonIgnore
|
||||
public static void sortList(List<ServiceDictInfo> list, List<ServiceDictInfo> sourcelist, Long parentId, boolean cascade){
|
||||
public static void sortList(List<ServiceDictInfo> list, List<ServiceDictInfo> sourcelist, Integer parentId, boolean cascade){
|
||||
for (int i=0; i<sourcelist.size(); i++){
|
||||
ServiceDictInfo serviceDictInfo = sourcelist.get(i);
|
||||
if (serviceDictInfo.getParent()!=null && serviceDictInfo.getParent().getId()!=null
|
||||
&& serviceDictInfo.getParent().getId().equals(parentId)){
|
||||
if (serviceDictInfo.getParent()!=null && serviceDictInfo.getParent().getServiceDictId()!=null
|
||||
&& serviceDictInfo.getParent().getServiceDictId().equals(parentId)){
|
||||
list.add(serviceDictInfo);
|
||||
if (cascade){
|
||||
// 判断是否还有子节点, 有则继续获取子节点
|
||||
for (int j=0; j<sourcelist.size(); j++){
|
||||
ServiceDictInfo child = sourcelist.get(j);
|
||||
if (child.getParent()!=null && child.getParent().getId()!=null
|
||||
&& child.getParent().getId().equals(serviceDictInfo.getId())){
|
||||
sortList(list, sourcelist, serviceDictInfo.getId(), true);
|
||||
if (child.getParent()!=null && child.getParent().getServiceDictId()!=null
|
||||
&& child.getParent().getServiceDictId().equals(serviceDictInfo.getServiceDictId())){
|
||||
sortList(list, sourcelist, serviceDictInfo.getServiceDictId(), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -148,4 +148,31 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public static void checkList(List<ServiceDictInfo> list,List<ServiceDictInfo> parentList, List<ServiceDictInfo> sourcelist, boolean cascade){
|
||||
for(ServiceDictInfo serviceUp:parentList){
|
||||
list.add(serviceUp);
|
||||
//判断是否有子节点,有则继续获取子节点
|
||||
sortList(list, sourcelist, serviceUp.getServiceDictId(), true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//顶层的数量
|
||||
|
||||
public static Integer topCount(List<ServiceDictInfo> list,Integer parentId){
|
||||
Integer count = 0;
|
||||
List<ServiceDictInfo> listTemp = new ArrayList<ServiceDictInfo>();
|
||||
for(ServiceDictInfo serviceDictInfo:list){
|
||||
if(serviceDictInfo.getParent()!=null&&serviceDictInfo.getParent().getServiceDictId()!=null&&serviceDictInfo.getParent().getServiceDictId()==parentId){
|
||||
listTemp.add(serviceDictInfo);
|
||||
}
|
||||
}
|
||||
|
||||
return listTemp.size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryName;
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
@@ -58,7 +56,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-业务字典信息列表
|
||||
* 查询业务辅助表-业务字典信息列表(无条件分页查询)
|
||||
* @param serviceDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
@@ -68,13 +66,66 @@ public class ServiceDictInfoController extends BaseController {
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
//查出顶层分页数据
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findTopDictList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
//查出所有数据
|
||||
List<ServiceDictInfo> allList = serviceDictInfoService.findAllDictList();
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
boolean flag = false;
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
ServiceDictInfo temp = allList.get(i);
|
||||
if(temp.getParent()!=null&&temp.getParent().getServiceDictId()!=null&&temp.getParent().getServiceDictId()==0){
|
||||
for(ServiceDictInfo topTemp:page.getList()){
|
||||
if(temp.getServiceDictId()==topTemp.getServiceDictId()){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
allList.remove(temp);
|
||||
flag=false;
|
||||
}else{
|
||||
flag=false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
ServiceDictInfo.sortList(list,allList,0,true);
|
||||
//ServiceDictInfo.sortList(list, allList, 0, true);
|
||||
model.addAttribute("list", list);
|
||||
return "/cfg/serviceDictList";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-业务字典信息列表(含条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"searchList"})
|
||||
public String searchList(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
if(StringUtils.strIsBlank(serviceDictInfo.getItemValue())
|
||||
&&serviceDictInfo.getItemCode()==null
|
||||
&&serviceDictInfo.getItemType()==null
|
||||
&&serviceDictInfo.getBeginDate()==null
|
||||
&&serviceDictInfo.getEditTime()==null){
|
||||
|
||||
return "redirect:"+ adminPath + "/configuration/serviceDictInfo/list";
|
||||
}
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictSearchList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
return "/cfg/serviceDictInfoSearchList";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 进入添加或修改页面
|
||||
* @param serviceDictInfo
|
||||
@@ -86,6 +137,13 @@ public class ServiceDictInfoController extends BaseController {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/serviceDictInfo";
|
||||
}
|
||||
if (serviceDictInfo.getParent() == null || serviceDictInfo.getParent().getId() == null) {
|
||||
ServiceDictInfo parent = new ServiceDictInfo();
|
||||
parent.setServiceDictId(0);
|
||||
serviceDictInfo.setParent(parent);
|
||||
}
|
||||
model.addAttribute("serviceDictInfo", serviceDictInfo);
|
||||
|
||||
return "/cfg/serviceDictForm";
|
||||
}
|
||||
/**
|
||||
@@ -106,13 +164,17 @@ public class ServiceDictInfoController extends BaseController {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "保存配置失败!");
|
||||
}
|
||||
if(serviceDictInfo.getItemType()==3){
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/markList";
|
||||
}else{
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list";
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* 删除(删除时删除所有下级菜单)
|
||||
* @param serviceDictInfo
|
||||
* @param model
|
||||
* @return
|
||||
@@ -142,11 +204,12 @@ public class ServiceDictInfoController extends BaseController {
|
||||
@RequestMapping(value = "treeData")
|
||||
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response) {
|
||||
List<Map<String, Object>> mapList = Lists.newArrayList();
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.findAllDict();
|
||||
//找出所有的非叶子配置
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.findAllNoLeafDictList();
|
||||
for (int i=0; i<list.size(); i++){
|
||||
ServiceDictInfo serviceDictInfo = list.get(i);
|
||||
if (StringUtils.isBlank(extId) || (extId !=null && !extId.equals(serviceDictInfo.getServiceDictId().toString()))) {
|
||||
if(isShowHide != null && isShowHide.equals("0") && serviceDictInfo.getIsValid().equals(0)){
|
||||
if(serviceDictInfo.getIsValid().equals(0)){
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
@@ -178,12 +241,19 @@ public class ServiceDictInfoController extends BaseController {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/serviceDictMarkInfo";
|
||||
}
|
||||
if (serviceDictInfo.getParent() == null || serviceDictInfo.getParent().getId() == null) {
|
||||
ServiceDictInfo parent = new ServiceDictInfo();
|
||||
parent.setServiceDictId(0);
|
||||
serviceDictInfo.setParent(parent);
|
||||
}
|
||||
model.addAttribute("serviceDictInfo", serviceDictInfo);
|
||||
|
||||
return "/cfg/serviceDictMarkForm";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-业务字典信息列表
|
||||
* 查询标签列表(无条件分页查询)
|
||||
* @param serviceDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
@@ -191,15 +261,67 @@ public class ServiceDictInfoController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"markList"})
|
||||
@RequestMapping(value = {"markList", ""})
|
||||
public String markList(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
//查出顶层分页数据
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findTopDictMarkList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
//查出所有数据
|
||||
List<ServiceDictInfo> allList = serviceDictInfoService.findAllDictMarkList();
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
boolean flag = false;
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
ServiceDictInfo temp = allList.get(i);
|
||||
if(temp.getParent()!=null&&temp.getParent().getServiceDictId()!=null&&temp.getParent().getServiceDictId()==0){
|
||||
for(ServiceDictInfo topTemp:page.getList()){
|
||||
if(temp.getServiceDictId()==topTemp.getServiceDictId()){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
allList.remove(temp);
|
||||
flag=false;
|
||||
}else{
|
||||
flag=false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictMarkList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
ServiceDictInfo.sortList(list,allList,0,true);
|
||||
//ServiceDictInfo.sortList(list, allList, 0, true);
|
||||
model.addAttribute("list", list);
|
||||
return "/cfg/serviceDictMarkList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-业务字典信息列表(含条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"searchMarkList"})
|
||||
public String searchMarkList(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
if(StringUtils.strIsBlank(serviceDictInfo.getItemValue())
|
||||
&&serviceDictInfo.getItemCode()==null
|
||||
&&serviceDictInfo.getItemType()==null
|
||||
&&serviceDictInfo.getBeginDate()==null
|
||||
&&serviceDictInfo.getEditTime()==null){
|
||||
|
||||
return "redirect:"+ adminPath + "/configuration/serviceDictInfo/markList";
|
||||
}
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictSearchMarkList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
return "/cfg/serviceDictInfoSearchMarkList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
@@ -242,4 +364,34 @@ public class ServiceDictInfoController extends BaseController {
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/markList";
|
||||
}
|
||||
|
||||
/**
|
||||
* isShowHide是否显示隐藏菜单
|
||||
* @param extId
|
||||
* @param isShowHidden
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "treeMarkData")
|
||||
public List<Map<String, Object>> treeMarkData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response) {
|
||||
List<Map<String, Object>> mapList = Lists.newArrayList();
|
||||
//找出所有的非叶子配置
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.findAllNoLeafDictMarkList();
|
||||
for (int i=0; i<list.size(); i++){
|
||||
ServiceDictInfo serviceDictInfo = list.get(i);
|
||||
if (StringUtils.isBlank(extId) || (extId !=null && !extId.equals(serviceDictInfo.getServiceDictId().toString()))) {
|
||||
if(serviceDictInfo.getIsValid().equals(0)){
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", serviceDictInfo.getServiceDictId());
|
||||
map.put("pId", serviceDictInfo.getParent().getServiceDictId());
|
||||
map.put("name",serviceDictInfo.getItemValue());
|
||||
mapList.add(map);
|
||||
}
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@@ -12,18 +13,25 @@ import com.nis.web.dao.MyBatisDao;
|
||||
public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
|
||||
|
||||
/**
|
||||
* 查询分类性质字典列表,
|
||||
* 查询分类性质顶层字典列表(无条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictList(ServiceDictInfo serviceDictInfo);
|
||||
|
||||
List<ServiceDictInfo> findTopDictList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询标签字典列表
|
||||
* 查出所有分类性质
|
||||
*/
|
||||
List<ServiceDictInfo> findAllDictList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
*/
|
||||
List<ServiceDictInfo> findAllNoLeafDictList();
|
||||
/**
|
||||
* 查询分类性质字典列表(含条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictMarkList(ServiceDictInfo serviceDictInfo);
|
||||
List<ServiceDictInfo> findDictSearchList(ServiceDictInfo serviceDictInfo);
|
||||
|
||||
|
||||
/**
|
||||
@@ -39,14 +47,40 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
|
||||
*/
|
||||
ServiceDictInfo getDictById(Integer serviceDictId);
|
||||
|
||||
/**
|
||||
* 查询所有非叶子节点字典配置信息
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findAllDict();
|
||||
|
||||
//标签管理
|
||||
/**
|
||||
* 查询标签顶层字典列表(无条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findTopDictMarkList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查出所有标签
|
||||
*/
|
||||
List<ServiceDictInfo> findAllDictMarkList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询标签字典列表(条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictSearchMarkList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findAllNoLeafDictMarkList();
|
||||
|
||||
|
||||
List<ServiceDictInfo> findItemDict(@Param("itemType")int itemType,@Param("isValid")int isValid);
|
||||
List<ServiceDictInfo> findAllItemDict(@Param("itemType")int itemType);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,12 +52,12 @@
|
||||
|
||||
|
||||
|
||||
<!-- 查询分类性质列表 -->
|
||||
<select id="findDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type <![CDATA[<>]]> 3
|
||||
<!-- 查询分类性质顶层分页列表 -->
|
||||
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type <![CDATA[<>]]> 3 AND parent_id = 0
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
@@ -81,8 +81,110 @@
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 查询标签列表 -->
|
||||
<select id="findDictMarkList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
|
||||
<!-- 查询标签顶层分页列表 -->
|
||||
<select id="findTopDictMarkList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type = 3 AND parent_id = 0
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 查出所有分类性质 -->
|
||||
<select id="findAllDictList" resultType="serviceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1 AND s.item_type <![CDATA[<>]]> 3
|
||||
</select>
|
||||
|
||||
<!-- 查出所有标签-->
|
||||
<select id="findAllDictMarkList" resultType="serviceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1 AND s.item_type = 3
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询所有非叶子配置 -->
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type <![CDATA[<>]]> 3
|
||||
</select>
|
||||
<!-- 查询所有非叶子标签配置 -->
|
||||
<select id="findAllNoLeafDictMarkList" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = 3
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 分类性质条件查询 -->
|
||||
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type <![CDATA[<>]]> 3
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 标签条件查询 -->
|
||||
<select id="findDictSearchMarkList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type=3
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
@@ -91,7 +193,9 @@
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
@@ -133,12 +237,12 @@
|
||||
|
||||
|
||||
<!-- 查询非叶子节点的所有字典信息 -->
|
||||
|
||||
<!--
|
||||
<select id="findAllDict">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns" />
|
||||
from service_dict_info s where s.is_leaf = 0;
|
||||
</select>
|
||||
</select> -->
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="update">
|
||||
@@ -172,5 +276,15 @@
|
||||
<include refid="serviceDictInfoColumns" />
|
||||
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType};
|
||||
</select>
|
||||
|
||||
<sql id="menuJoins">
|
||||
LEFT JOIN service_dict_info p ON p.service_dict_id = s.parent_id
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.util.Constants;
|
||||
@@ -23,40 +24,51 @@ public class ServiceDictInfoService extends BaseService{
|
||||
private ServiceDictInfoDao serviceDictInfoDao;
|
||||
|
||||
/**
|
||||
* 查询分类性质字典分页
|
||||
* 查询分类性质字典分页(无条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
public Page<ServiceDictInfo> findTopDictList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
List<ServiceDictInfo> sourcelist = serviceDictInfoDao.findDictList(serviceDictInfo);
|
||||
ServiceDictInfo.sortList(list, sourcelist, 0l, true);
|
||||
page.setList(sourcelist);
|
||||
//查出顶层分页查询
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findTopDictList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询所有有效字典配置
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllDictList() {
|
||||
|
||||
return serviceDictInfoDao.findAllDictList(new ServiceDictInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标签分页
|
||||
* 查询所有的非叶子配置
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllNoLeafDictList() {
|
||||
return serviceDictInfoDao.findAllNoLeafDictList();
|
||||
}
|
||||
/**
|
||||
* 查询分类性质字典分页(含条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictMarkList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
public Page<ServiceDictInfo> findDictSearchList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
List<ServiceDictInfo> sourcelist = serviceDictInfoDao.findDictMarkList(serviceDictInfo);
|
||||
ServiceDictInfo.sortList(list, sourcelist, 0l, true);
|
||||
page.setList(sourcelist);
|
||||
return page;
|
||||
serviceDictInfo.setPage(page);
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询字典详细信息
|
||||
* @param serviceDictId
|
||||
@@ -99,19 +111,82 @@ public class ServiceDictInfoService extends BaseService{
|
||||
* 查询所有非叶子节点字典配置信息
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllDict() {
|
||||
/* public List<ServiceDictInfo> findAllDict() {
|
||||
|
||||
return serviceDictInfoDao.findAllDict();
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param serviceDictInfo
|
||||
*/
|
||||
public void deleteDict(ServiceDictInfo serviceDictInfo) {
|
||||
serviceDictInfo.setIsValid(0);
|
||||
serviceDictInfoDao.delete(serviceDictInfo);
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
//找出所有下级
|
||||
//查出所有节点
|
||||
ServiceDictInfo.sortList(list, serviceDictInfoDao.findAllDictList(new ServiceDictInfo()), serviceDictInfo.getServiceDictId(), true);
|
||||
list.add(serviceDictInfo);
|
||||
for(ServiceDictInfo se:list){
|
||||
se.setIsValid(0);
|
||||
serviceDictInfoDao.delete(se);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//标签管理
|
||||
|
||||
/**
|
||||
* 查询标签分页(无条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findTopDictMarkList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
//查出顶层分页查询
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findTopDictMarkList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询所有有效标签配置
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllDictMarkList() {
|
||||
|
||||
return serviceDictInfoDao.findAllDictMarkList(new ServiceDictInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标签字典分页(含条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictSearchMarkList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findDictSearchMarkList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllNoLeafDictMarkList() {
|
||||
return serviceDictInfoDao.findAllNoLeafDictMarkList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* findFlDict(查找所有有效的分类)
|
||||
@@ -185,5 +260,10 @@ public class ServiceDictInfoService extends BaseService{
|
||||
public List<ServiceDictInfo> findAllLableDict() {
|
||||
return serviceDictInfoDao.findAllItemDict(Constants.ITEM_TYPE_LABEL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user