提交 667c3375 作者: 925993793@qq.com

智库绑定信息源功能迭代

上级 fc5fc0ab
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>8.0.21</version> <version>8.0.21</version>
</dependency> </dependency>
<!-- 动态数据源 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.2.0</version>
</dependency>
<!-- excel工具包 --> <!-- excel工具包 -->
<dependency> <dependency>
......
package com.zzsn.thinktank.config;
import com.baomidou.mybatisplus.extension.incrementer.OracleKeyGenerator;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* @author
* @description: mybatis-plus配置
* @date
*/
@Configuration
public class MybatisPlusConfig {
/**
* mybatis-plus分页配置
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
return interceptor;
}
}
...@@ -35,6 +35,10 @@ public class InfoSourceGroupMap implements Serializable { ...@@ -35,6 +35,10 @@ public class InfoSourceGroupMap implements Serializable {
/**信息源id*/ /**信息源id*/
@Excel(name = "信息源id", width = 15) @Excel(name = "信息源id", width = 15)
private String sourceId; private String sourceId;
/**标签值编码(专题绑定信息源标签时特有的字段)*/
private String sourceItemId;
/**绑定的信息源类型*/
private Integer type;
/**创建人*/ /**创建人*/
private String createBy; private String createBy;
/**创建日期*/ /**创建日期*/
......
package com.zzsn.thinktank.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @Author zhangweijian
* @since 2018-12-28
*/
@Data
@TableName("sys_dict_item")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysDictItem implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**
* 字典id
*/
private String dictId;
/**
* 字典项文本
*/
@Excel(name = "字典项文本", width = 20)
private String itemText;
/**
* 字典项值
*/
@Excel(name = "字典项值", width = 30)
private String itemValue;
/**
* 描述
*/
@Excel(name = "描述", width = 40)
private String description;
/**
* 排序
*/
@Excel(name = "排序", width = 15,type=4)
private Integer sortOrder;
/**
* 状态(1启用 0不启用)
*/
private Integer status;
private String createBy;
private Date createTime;
private String updateBy;
private Date updateTime;
/**
* 字典id
*/
private String pid;
/**
* 字典id
*/
private String hasChild;
/**
* 字典id
*/
private String pathIds;
private String names;
/**
* 字典id
*/
private String dictItemCode;
/**
* 层级
*/
private Integer level;
/**
* 字典编码
*/
@TableField(exist = false)
private String dictCode;
}
package com.zzsn.thinktank.enums;
import java.util.ArrayList;
import java.util.List;
/**
* @author zs
* @Description 信息源/信息源组 枚举
* @since 2021/12/9
*/
public enum BindTypeEnum {
INFO_SOURCE(1,"绑定的通用信息源栏目"),
INFO_SOURCE_GROUP(2,"绑定的通用信息源栏目组"),
EXCLUDE_INFO_SOURCE(3,"排除的信息源栏目"),
EXCLUDE_INFO_SOURCE_GROUP(4,"排除的信息源栏目组"),
DIRECTIONA_INFO_SOURCE_GROUP(5,"定向的信息源栏目组"),
DIRECTIONA_INFO_SOURCE(6,"定向的信息源栏目"),
INFO_SOURCE_LABEL(12,"通用信息源栏目标签"),
EXCLUDE_INFO_SOURCE_LABEL(14,"排除信息源栏目标签"),
DIRECTIONA_INFO_SOURCE_LABEL(15,"定向信息源栏目标签"),
INFO_MAIN_SOURCE(31,"绑定的通用信息源"),
INFO_MAIN_SOURCE_GROUP(32,"绑定的通用信息源组"),
EXCLUDE_MAIN_INFO_SOURCE(33,"排除的信息源"),
EXCLUDE_MAIN_INFO_SOURCE_GROUP(34,"排除的信息源组"),
DIRECTIONA_MAIN_INFO_SOURCE_GROUP(35,"定向的信息源组"),
DIRECTIONA_MAIN_INFO_SOURCE(36,"定向的信息源"),
INFO_SOURCE_MAIN_LABEL(312,"通用信息源标签"),
EXCLUDE_INFO_MAIN_SOURCE_LABEL(314,"排除信息源标签"),
DIRECTIONA_INFO_MAIN_SOURCE_LABEL(315,"定向信息源标签")
;
private Integer value;
private String des;
BindTypeEnum(int value, String des) {
this.value = value;
this.des = des;
}
public Integer getvalue() {
return value;
}
public String getDes() {
return des;
}
//定向、通用、屏蔽信息源栏目组类型返回
public static List<Integer> getInfoSourceGroupType() {
List<Integer> values = new ArrayList<>();
values.add(BindTypeEnum.INFO_SOURCE_GROUP.getvalue());
values.add(BindTypeEnum.EXCLUDE_INFO_SOURCE_GROUP.getvalue());
values.add(BindTypeEnum.DIRECTIONA_INFO_SOURCE_GROUP.getvalue());
return values;
}
//定向、通用、屏蔽信息源类栏目型返回
public static List<Integer> getInfoSourceType() {
List<Integer> values = new ArrayList<>();
values.add(BindTypeEnum.INFO_SOURCE.getvalue());
values.add(BindTypeEnum.EXCLUDE_INFO_SOURCE.getvalue());
values.add(BindTypeEnum.DIRECTIONA_INFO_SOURCE.getvalue());
return values;
}
//定向、通用、屏蔽 信息源栏目标签类型返回
public static List<Integer> getInfoSourceLabelType() {
List<Integer> values = new ArrayList<>();
values.add(BindTypeEnum.INFO_SOURCE_LABEL.getvalue());
values.add(BindTypeEnum.EXCLUDE_INFO_SOURCE_LABEL.getvalue());
values.add(BindTypeEnum.DIRECTIONA_INFO_SOURCE_LABEL.getvalue());
return values;
}
//定向、通用、屏蔽信息源组类型返回
public static List<Integer> getInfoSourceMainGroupType() {
List<Integer> values = new ArrayList<>();
values.add(BindTypeEnum.INFO_MAIN_SOURCE_GROUP.getvalue());
values.add(BindTypeEnum.EXCLUDE_MAIN_INFO_SOURCE_GROUP.getvalue());
values.add(BindTypeEnum.DIRECTIONA_MAIN_INFO_SOURCE_GROUP.getvalue());
return values;
}
//定向、通用、屏蔽信息源类型返回
public static List<Integer> getInfoSourceMainType() {
List<Integer> values = new ArrayList<>();
values.add(BindTypeEnum.INFO_MAIN_SOURCE.getvalue());
values.add(BindTypeEnum.EXCLUDE_MAIN_INFO_SOURCE.getvalue());
values.add(BindTypeEnum.DIRECTIONA_MAIN_INFO_SOURCE.getvalue());
return values;
}
//定向、通用、屏蔽 信息源标签类型返回
public static List<Integer> getInfoSourceMainLabelType() {
List<Integer> values = new ArrayList<>();
values.add(BindTypeEnum.INFO_SOURCE_MAIN_LABEL.getvalue());
values.add(BindTypeEnum.EXCLUDE_INFO_MAIN_SOURCE_LABEL.getvalue());
values.add(BindTypeEnum.DIRECTIONA_INFO_MAIN_SOURCE_LABEL.getvalue());
return values;
}
public static BindTypeEnum getEnumByValue(Integer value) {
for (BindTypeEnum bindTypeEnum : BindTypeEnum.values()) {
if (bindTypeEnum.getvalue().equals(value)) {
return bindTypeEnum;
}
}
return null;
}
}
package com.zzsn.thinktank.mapper; package com.zzsn.thinktank.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsn.thinktank.entity.InfoSource; import com.zzsn.thinktank.entity.InfoSource;
import com.zzsn.thinktank.vo.InfoSourceVo; import com.zzsn.thinktank.vo.*;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -21,11 +23,103 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> { ...@@ -21,11 +23,103 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
Integer totalCountByGroupId(@Param("infoSourceVo") InfoSourceVo infoSourceVo, @Param("ynBind") Integer ynBind, @Param("groupId") String groupId); Integer totalCountByGroupId(@Param("infoSourceVo") InfoSourceVo infoSourceVo, @Param("ynBind") Integer ynBind, @Param("groupId") String groupId);
List<InfoSourceVo> pageList(@Param("customerId") String customerId,@Param("userId") String userId,@Param("infoSourceVo") InfoSourceVo infoSourceVo, @Param("typeIds") List<String> typeIds, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); List<InfoSourceVo> pageList(@Param("customerId") String customerId, @Param("userId") String userId, @Param("infoSourceVo") InfoSourceVo infoSourceVo, @Param("typeIds") List<String> typeIds, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);
List<InfoSourceVo> listBySidList(@Param("customerId") String customerId,@Param("userId") String userId,List<String> collect); List<InfoSourceVo> listBySidList(@Param("customerId") String customerId, @Param("userId") String userId, List<String> collect);
Integer totalCount(@Param("customerId") String customerId,@Param("userId") String userId,@Param("infoSourceVo") InfoSourceVo infoSourceVo, @Param("typeIds") List<String> typeIds); Integer totalCount(@Param("customerId") String customerId, @Param("userId") String userId, @Param("infoSourceVo") InfoSourceVo infoSourceVo, @Param("typeIds") List<String> typeIds);
List<String> listByGroupId(@Param("groupId") String groupId); List<String> listByGroupId(@Param("groupId") String groupId);
/**
* 智库绑定信息源分页列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @param page 分页信息
* @author lkg
* @date 2025/8/2
*/
IPage<BindInfoSourceVO> bindInfoSourcePageList(@Param("thinkTankId") String thinkTankId, @Param("infoSearchCondition") InfoSearchCondition infoSearchCondition, Page<BindInfoSourceVO> page);
/**
* 智库绑定信息源栏目分页列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @param page 分页信息
* @author lkg
* @date 2025/8/2
*/
IPage<BindInfoSourceColumnVO> bindInfoSourceColumnPageList(@Param("thinkTankId") String thinkTankId, @Param("infoSearchCondition") InfoSearchCondition infoSearchCondition, Page<BindInfoSourceColumnVO> page);
/**
* 智库绑定信息源栏目列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @author lkg
* @date 2025/8/2
*/
List<BindInfoSourceColumnVO> bindInfoSourceColumnPageList(@Param("thinkTankId") String thinkTankId, @Param("infoSearchCondition") InfoSearchCondition infoSearchCondition);
/**
* 智库绑定信息源组列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List<InfoSourceGroupVO> bindInfoSourceGroupList(@Param("thinkTankId") String thinkTankId, @Param("types") List<Integer> types);
/**
* 智库绑定信息源列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List<BindInfoSourceVO> bindInfoSourceList(@Param("thinkTankId") String thinkTankId, @Param("types") List<Integer> types);
/**
* 智库绑定信息源/信息源栏目标签列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List<InfoSourceLabelVO> bindInfoSourceLabelList(@Param("thinkTankId") String thinkTankId, @Param("types") List<Integer> types);
/**
* 智库绑定信息源栏目组列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List<InfoSourceGroupVO> bindInfoSourceColumnGroupList(@Param("thinkTankId") String thinkTankId, @Param("types") List<Integer> types);
/**
* 智库绑定信息源栏目列表
*
* @param thinkTankId 智库id
* @param types 信息源类型
* @author lkg
* @date 2025/8/2
*/
List<BindInfoSourceColumnVO> bindInfoSourceColumnList(@Param("thinkTankId") String thinkTankId, @Param("types") List<Integer> types);
/**
* 获取智库绑定信息源的数量
*
* @param thinkTankIds 智库id集合
* @author lkg
* @date 2025/8/5
*/
List<BindSourceDetailVO> bindSourceCount(@Param("thinkTankIds") List<String> thinkTankIds);
} }
package com.zzsn.thinktank.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.thinktank.entity.SysDictItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @Author zhangweijian
* @since 2018-12-28
*/
@Mapper
public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
List<SysDictItem> listByDictCode(@Param("dictCode") String dictCode);
}
...@@ -2,6 +2,7 @@ package com.zzsn.thinktank.service; ...@@ -2,6 +2,7 @@ package com.zzsn.thinktank.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.thinktank.entity.InfoSourceGroupMap; import com.zzsn.thinktank.entity.InfoSourceGroupMap;
import com.zzsn.thinktank.vo.BindVO;
import com.zzsn.thinktank.vo.ThinkTankSourceVO; import com.zzsn.thinktank.vo.ThinkTankSourceVO;
import java.util.List; import java.util.List;
...@@ -30,4 +31,22 @@ public interface InfoSourceGroupMapService extends IService<InfoSourceGroupMap> ...@@ -30,4 +31,22 @@ public interface InfoSourceGroupMapService extends IService<InfoSourceGroupMap>
* @date 2024/8/23 * @date 2024/8/23
*/ */
List<ThinkTankSourceVO> listOfThinkTank(List<String> groupIds); List<ThinkTankSourceVO> listOfThinkTank(List<String> groupIds);
/**
* 绑定信息源
*
* @param bindVO 绑定信息
* @author lkg
* @date 2025/8/2
*/
void bind(BindVO bindVO);
/**
* 解绑信息源
*
* @param bindVO 绑定信息
* @author lkg
* @date 2025/8/5
*/
void unBind(BindVO bindVO);
} }
package com.zzsn.thinktank.service; package com.zzsn.thinktank.service;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.thinktank.entity.InfoSource; import com.zzsn.thinktank.entity.InfoSource;
import com.zzsn.thinktank.vo.InfoSourceVo; import com.zzsn.thinktank.vo.*;
import java.util.List; import java.util.List;
...@@ -17,15 +18,104 @@ public interface InfoSourceService extends IService<InfoSource> { ...@@ -17,15 +18,104 @@ public interface InfoSourceService extends IService<InfoSource> {
/** /**
* 根据分类id获取信息源列表(ynBind=0 :查询没有绑定该组的信息源列表 ynBind=1 :查询绑定该组的信息源列表 ) * 根据分类id获取信息源列表(ynBind=0 :查询没有绑定该组的信息源列表 ynBind=1 :查询绑定该组的信息源列表 )
*/ */
IPage<InfoSourceVo> pageListByGroupId (InfoSourceVo infoSourceVo, Integer ynBind, String groupId, Integer pageNo, Integer pageSize); IPage<InfoSourceVo> pageListByGroupId(InfoSourceVo infoSourceVo, Integer ynBind, String groupId, Integer pageNo, Integer pageSize);
/** /**
* 根据分类id获取信息源列表 * 根据分类id获取信息源列表
*/ */
IPage<InfoSourceVo> pageListByTypeId (String customerId, String userId, InfoSourceVo infoSourceVo, Integer pageNo, Integer pageSize, String infoSourceTypeId); IPage<InfoSourceVo> pageListByTypeId(String customerId, String userId, InfoSourceVo infoSourceVo, Integer pageNo, Integer pageSize, String infoSourceTypeId);
/** /**
* 获取信息源组下的信息源id集合 * 获取信息源组下的信息源id集合
*/ */
List<String> listByGroupId(String groupId); List<String> listByGroupId(String groupId);
/**
* 智库绑定信息源分页列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @param pageNo 页码
* @param pageSize 每页条数
* @author lkg
* @date 2025/8/2
*/
IPage<BindInfoSourceVO> bindInfoSourcePageList(String thinkTankId, InfoSearchCondition infoSearchCondition, Integer pageNo, Integer pageSize);
/**
* 智库绑定信息源栏目分页列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @param pageNo 页码
* @param pageSize 每页条数
* @author lkg
* @date 2025/8/2
*/
IPage<BindInfoSourceColumnVO> bindInfoSourceColumnPageList(String thinkTankId, InfoSearchCondition infoSearchCondition, Integer pageNo, Integer pageSize);
/**
* 智库绑定信息源栏目列表
*
* @param thinkTankId 智库id
* @param infoSearchCondition 检索条件
* @author lkg
* @date 2025/8/4
*/
List<BindInfoSourceColumnVO> bindInfoSourceColumnPageList(String thinkTankId, InfoSearchCondition infoSearchCondition);
/**
* 智库绑定信息源组列表
*
* @param thinkTankId 智库id
* @author lkg
* @date 2025/8/2
*/
JSONObject bindInfoSourceGroupList(String thinkTankId);
/**
* 智库绑定信息源列表
*
* @param thinkTankId 智库id
* @author lkg
* @date 2025/8/2
*/
JSONObject bindInfoSourceList(String thinkTankId);
/**
* 智库绑定信息源标签列表
*
* @param thinkTankId 智库id
* @param category 类型(1-信息源栏目;2-信息源)
* @author lkg
* @date 2025/8/2
*/
JSONObject bindInfoSourceLabelList(String thinkTankId, Integer category);
/**
* 智库绑定信息源栏目组列表
*
* @param thinkTankId 智库id
* @author lkg
* @date 2025/8/2
*/
JSONObject bindInfoSourceColumnGroupList(String thinkTankId);
/**
* 智库绑定信息源栏目列表
*
* @param thinkTankId 智库id
* @author lkg
* @date 2025/8/2
*/
JSONObject bindInfoSourceColumnList(String thinkTankId);
/**
* 获取智库绑定信息源的数量
*
* @param thinkTankIds 智库id集合
* @author lkg
* @date 2025/8/5
*/
List<BindSourceDetailVO> bindSourceCount(List<String> thinkTankIds);
} }
package com.zzsn.thinktank.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.thinktank.entity.SysDictItem;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @Author zhangweijian
* @since 2018-12-28
*/
public interface SysDictItemService extends IService<SysDictItem> {
List<SysDictItem> listByDictCode(String dictCode);
}
...@@ -27,7 +27,7 @@ public interface ThinktankBasicInfoService extends IService<ThinktankBasicInfo> ...@@ -27,7 +27,7 @@ public interface ThinktankBasicInfoService extends IService<ThinktankBasicInfo>
void downloadTemplate(HttpServletResponse response); void downloadTemplate(HttpServletResponse response);
Result<?> getListBaseData(String id, Integer pageNo, Integer pageSize, Integer office); Result<?> getListBaseData(String id, Integer pageNo, Integer pageSize);
/** /**
* 批量导入智库信息 * 批量导入智库信息
......
package com.zzsn.thinktank.service.impl; package com.zzsn.thinktank.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.zzsn.thinktank.entity.InfoSource; import com.zzsn.thinktank.entity.InfoSource;
import com.zzsn.thinktank.entity.SysDictItem;
import com.zzsn.thinktank.enums.BindTypeEnum;
import com.zzsn.thinktank.mapper.InfoSourceMapper; import com.zzsn.thinktank.mapper.InfoSourceMapper;
import com.zzsn.thinktank.service.InfoSourceService; import com.zzsn.thinktank.service.InfoSourceService;
import com.zzsn.thinktank.service.SysDictItemService;
import com.zzsn.thinktank.util.PageBuilderParser; import com.zzsn.thinktank.util.PageBuilderParser;
import com.zzsn.thinktank.vo.InfoSourceVo; import com.zzsn.thinktank.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -28,6 +32,8 @@ import java.util.stream.Collectors; ...@@ -28,6 +32,8 @@ import java.util.stream.Collectors;
@Service @Service
public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSource> implements InfoSourceService { public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSource> implements InfoSourceService {
@Autowired
private SysDictItemService sysDictItemService;
/** /**
* 根据分类id获取信息源列表(ynBind=0 :查询没有绑定该组的信息源列表 ynBind=1 :查询绑定该组的信息源列表 ) * 根据分类id获取信息源列表(ynBind=0 :查询没有绑定该组的信息源列表 ynBind=1 :查询绑定该组的信息源列表 )
...@@ -192,4 +198,152 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou ...@@ -192,4 +198,152 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou
public List<String> listByGroupId(String groupId) { public List<String> listByGroupId(String groupId) {
return baseMapper.listByGroupId(groupId); return baseMapper.listByGroupId(groupId);
} }
@Override
public IPage<BindInfoSourceVO> bindInfoSourcePageList(String thinkTankId, InfoSearchCondition infoSearchCondition, Integer pageNo, Integer pageSize) {
Page<BindInfoSourceVO> page = new Page<>(pageNo, pageSize);
return baseMapper.bindInfoSourcePageList(thinkTankId, infoSearchCondition, page);
}
@Override
public IPage<BindInfoSourceColumnVO> bindInfoSourceColumnPageList(String thinkTankId, InfoSearchCondition infoSearchCondition, Integer pageNo, Integer pageSize) {
Page<BindInfoSourceColumnVO> page = new Page<>(pageNo, pageSize);
return baseMapper.bindInfoSourceColumnPageList(thinkTankId, infoSearchCondition, page);
}
@Override
public List<BindInfoSourceColumnVO> bindInfoSourceColumnPageList(String thinkTankId, InfoSearchCondition infoSearchCondition) {
return baseMapper.bindInfoSourceColumnPageList(thinkTankId, infoSearchCondition);
}
@Override
public JSONObject bindInfoSourceGroupList(String thinkTankId) {
JSONObject jsonObject = new JSONObject();
List<InfoSourceGroupVO> groupList = baseMapper.bindInfoSourceGroupList(thinkTankId, BindTypeEnum.getInfoSourceMainGroupType());
Map<Integer, List<InfoSourceGroupVO>> collect = groupList.stream().collect(Collectors.groupingBy(InfoSourceGroupVO::getSourceType));
collect.forEach((k,v)-> {
BindTypeEnum enumByValue = BindTypeEnum.getEnumByValue(k);
if (ObjectUtil.isNotNull(enumByValue)) {
//合并相同信息源组
List<InfoSourceGroupVO> list = new ArrayList<>();
for (InfoSourceGroupVO groupPage : v) {
Optional<InfoSourceGroupVO> first = list.stream().filter(f -> StrUtil.equals(f.getId(), groupPage.getId())).findFirst();
if(first.isPresent()){
InfoSourceGroupVO infoSourceGroupVO = first.get();
infoSourceGroupVO.setGroupTypeName(infoSourceGroupVO.getGroupTypeName()+"、"+groupPage.getGroupTypeName());
}else {
list.add(groupPage);
}
}
jsonObject.put(enumByValue.toString(), list);
}
});
return jsonObject;
}
@Override
public JSONObject bindInfoSourceList(String thinkTankId) {
JSONObject jsonObject = new JSONObject();
List<BindInfoSourceVO> infoSourceVos = baseMapper.bindInfoSourceList(thinkTankId, BindTypeEnum.getInfoSourceMainType());
if (CollectionUtil.isEmpty(infoSourceVos)) {
return jsonObject;
}
Map<Integer, List<BindInfoSourceVO>> collect = infoSourceVos.stream().collect(Collectors.groupingBy(BindInfoSourceVO::getSourceType));
collect.forEach((k,v)-> {
BindTypeEnum enumByValue = BindTypeEnum.getEnumByValue(k);
if (ObjectUtil.isNotNull(enumByValue)) {
jsonObject.put(enumByValue.toString(), v);
}
});
return jsonObject;
}
@Override
public JSONObject bindInfoSourceLabelList(String thinkTankId,Integer category) {
JSONObject jsonObject = new JSONObject();
List<Integer> typeList = null;
if (category == 1) {
typeList = BindTypeEnum.getInfoSourceLabelType();
} else if (category == 2) {
typeList = BindTypeEnum.getInfoSourceMainLabelType();
}
List<InfoSourceLabelVO> infoSourceLabelVOS = baseMapper.bindInfoSourceLabelList(thinkTankId, typeList);
if (CollectionUtil.isEmpty(infoSourceLabelVOS)) {
return jsonObject;
}
//字典类的标签处理层级关系
List<String> dictCodes = infoSourceLabelVOS.stream().filter(f -> "3".equals(f.getBusinessCaliber())).map(InfoSourceLabelVO::getDictCode).collect(Collectors.toList());
dictCodes.forEach(e -> {
List<SysDictItem> dictList = sysDictItemService.listByDictCode(e);
infoSourceLabelVOS.forEach(ee -> {
if ("3".equals(ee.getBusinessCaliber())){
//标签使用的字典
Optional<SysDictItem> first = dictList.stream().filter(f -> f.getItemValue().equals(ee.getLabelItemCode())).findFirst();
if (first.isPresent()) {
SysDictItem dictItem = first.get();
if (StrUtil.isNotBlank(dictItem.getNames())) {
ee.setLabelItemName(dictItem.getNames());
}else{
ee.setLabelItemName(dictItem.getItemText());
}
}
}
});
});
Map<Integer, List<InfoSourceLabelVO>> collect = infoSourceLabelVOS.stream().collect(Collectors.groupingBy(InfoSourceLabelVO::getSourceType));
collect.forEach((k,v)-> {
BindTypeEnum enumByValue = BindTypeEnum.getEnumByValue(k);
if (ObjectUtil.isNotNull(enumByValue)) {
jsonObject.put(enumByValue.toString(), v);
}
});
return jsonObject;
}
@Override
public JSONObject bindInfoSourceColumnGroupList(String thinkTankId) {
JSONObject jsonObject = new JSONObject();
List<InfoSourceGroupVO> groupList = baseMapper.bindInfoSourceColumnGroupList(thinkTankId, BindTypeEnum.getInfoSourceGroupType());
Map<Integer, List<InfoSourceGroupVO>> collect = groupList.stream().collect(Collectors.groupingBy(InfoSourceGroupVO::getSourceType));
collect.forEach((k,v)-> {
BindTypeEnum enumByValue = BindTypeEnum.getEnumByValue(k);
if (ObjectUtil.isNotNull(enumByValue)) {
//合并相同信息源组
List<InfoSourceGroupVO> list = new ArrayList<>();
for (InfoSourceGroupVO groupPage : v) {
Optional<InfoSourceGroupVO> first = list.stream().filter(f -> StrUtil.equals(f.getId(), groupPage.getId())).findFirst();
if(first.isPresent()){
InfoSourceGroupVO infoSourceGroupVO = first.get();
infoSourceGroupVO.setGroupTypeName(infoSourceGroupVO.getGroupTypeName()+"、"+groupPage.getGroupTypeName());
}else {
list.add(groupPage);
}
}
jsonObject.put(enumByValue.toString(), list);
}
});
return jsonObject;
}
@Override
public JSONObject bindInfoSourceColumnList(String thinkTankId) {
List<BindInfoSourceColumnVO> infoSourceVos = baseMapper.bindInfoSourceColumnList(thinkTankId,BindTypeEnum.getInfoSourceType());
JSONObject jsonObject = new JSONObject();
if (CollectionUtil.isEmpty(infoSourceVos)) {
return jsonObject;
}
Map<Integer, List<BindInfoSourceColumnVO>> collect = infoSourceVos.stream().collect(Collectors.groupingBy(BindInfoSourceColumnVO::getSourceType));
collect.forEach((k,v)-> {
BindTypeEnum enumByValue = BindTypeEnum.getEnumByValue(k);
if (ObjectUtil.isNotNull(enumByValue)) {
jsonObject.put(enumByValue.toString(), v);
}
});
return jsonObject;
}
@Override
public List<BindSourceDetailVO> bindSourceCount(List<String> thinkTankIds) {
return baseMapper.bindSourceCount(thinkTankIds);
}
} }
package com.zzsn.thinktank.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.thinktank.mapper.SysDictItemMapper;
import com.zzsn.thinktank.service.SysDictItemService;
import com.zzsn.thinktank.entity.SysDictItem;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @Author zhangweijian
* @since 2018-12-28
*/
@Service
@DS("slave")
public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDictItem> implements SysDictItemService {
@Override
public List<SysDictItem> listByDictCode(String dictCode) {
return this.baseMapper.listByDictCode(dictCode);
}
}
...@@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -68,6 +69,9 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -68,6 +69,9 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
InfoSourceGroupMapService infoSourceGroupMapService; InfoSourceGroupMapService infoSourceGroupMapService;
@Autowired @Autowired
private InfoSourceService infoSourceService;
@Autowired
EsUtil esUtil; EsUtil esUtil;
@Resource @Resource
...@@ -265,6 +269,78 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -265,6 +269,78 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
@Override @Override
public Result<?> getList(ThinktankBasicInfoListVo thinktankBasicInfoListVo) { public Result<?> getList(ThinktankBasicInfoListVo thinktankBasicInfoListVo) {
IPage page = new Page(); IPage page = new Page();
thinktankBasicInfoListVo.setColumn(StringUtil.humpToLine(thinktankBasicInfoListVo.getColumn()));
//查询列表
List<ThinktankBasicInfoVo> list = thinktankBasicInfoMapper.getList(thinktankBasicInfoListVo);
page.setRecords(list);
//查询总数
Integer total = thinktankBasicInfoMapper.getCount(thinktankBasicInfoListVo);
page.setTotal(total);
Integer pageNo = thinktankBasicInfoListVo.getPageNo();
Integer pageSize = thinktankBasicInfoListVo.getPageSize();
page.setCurrent(pageNo);
page.setSize(pageSize);
if (list.size() == 0) {
return Result.OK(page);
}
//智库id集合
List<String> groupIds = list.stream().map(ThinktankBasicInfoVo::getId).collect(Collectors.toList());
//智库绑定信息源栏目详细情况
List<BindSourceDetailVO> bindSourceDetailList = infoSourceService.bindSourceCount(groupIds);
//按智库分组
Map<String, List<BindSourceDetailVO>> collect = bindSourceDetailList.stream().collect(Collectors.groupingBy(BindSourceDetailVO::getThinkTankId));
//所有绑定的信息源栏目id集合
List<String> sidList = bindSourceDetailList.stream().map(BindSourceDetailVO::getSourceId).collect(Collectors.toList());
//智库绑定信息源栏目采集资讯的数量
Map<String, Integer> groupCount = new HashMap<>();
//查询es
BoolQueryBuilder boolQuerylist = QueryBuilders.boolQuery();
boolQuerylist.must(QueryBuilders.termsQuery("sid", sidList));
try {
Map<String, Long> mapGroup = esUtil.groupBy("basedata", "sid", boolQuerylist, sidList.size());
for (Map.Entry<String, List<BindSourceDetailVO>> entry : collect.entrySet()) {
String thinkTankId = entry.getKey();
List<String> bindSidList = entry.getValue().stream().map(BindSourceDetailVO::getSourceId).collect(Collectors.toList());
long count = 0;
for (Map.Entry<String, Long> longEntry : mapGroup.entrySet()) {
if (bindSidList.contains(longEntry.getKey())) {
count += longEntry.getValue();
}
}
groupCount.put(thinkTankId, Math.toIntExact(count));
}
} catch (IOException e) {
log.error("ES查询失败");
e.printStackTrace();
}
for (ThinktankBasicInfoVo thinktankBasicInfoVo : list) {
String id = thinktankBasicInfoVo.getId();
List<BindSourceDetailVO> bindSourceDetailVOS = collect.get(id);
if (CollectionUtils.isEmpty(bindSourceDetailVOS)) {
continue;
}
thinktankBasicInfoVo.setInfoSourceCount(bindSourceDetailVOS.size());
Integer count = groupCount.get(id);
if (count == null) {
continue;
}
thinktankBasicInfoVo.setCollectionCount(count);
}
CompletableFuture.runAsync(()->{
//记录热门标签
String tagId = thinktankBasicInfoListVo.getTagId();
if (tagId != null && tagId.length() > 0) {
String[] tagIdArr = tagId.split(",");
for (String s : tagIdArr) {
thinktankTagService.addTagTop(s);
}
}
});
return Result.OK(page);
}
public Result<?> getList_old(ThinktankBasicInfoListVo thinktankBasicInfoListVo) {
IPage page = new Page();
thinktankBasicInfoListVo.setColumn(StringUtil.humpToLine(thinktankBasicInfoListVo.getColumn())); thinktankBasicInfoListVo.setColumn(StringUtil.humpToLine(thinktankBasicInfoListVo.getColumn()));
//查询列表 //查询列表
...@@ -386,39 +462,30 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -386,39 +462,30 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
} }
@Override @Override
public Result<?> getListBaseData(String id, Integer pageNo, Integer pageSize, Integer office) { public Result<?> getListBaseData(String id, Integer pageNo, Integer pageSize) {
List<InfoSourceGroupMap> infoSourceGroupMapList = infoSourceGroupMapService.getSourceGroupMap(Arrays.asList(id)); List<BindInfoSourceColumnVO> sourceColumnList = infoSourceService.bindInfoSourceColumnPageList(id, null);
List<String> sidList = sourceColumnList.stream().map(BindInfoSourceColumnVO::getId).collect(Collectors.toList());
List<String> sidList = new ArrayList<>();
for (InfoSourceGroupMap infoSourceGroupMap : infoSourceGroupMapList) {
sidList.add(infoSourceGroupMap.getSourceId());
}
//设置分页参数 //设置分页参数
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
// searchSourceBuilder.size(pageSize);
// searchSourceBuilder.from(office);
searchSourceBuilder.trackTotalHits(true); searchSourceBuilder.trackTotalHits(true);
//排序 //排序
searchSourceBuilder.sort("createDate", SortOrder.ASC); searchSourceBuilder.sort("createDate", SortOrder.ASC);
//查询es //查询es
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
boolQuery.must(QueryBuilders.termsQuery("sid", sidList)); boolQuery.must(QueryBuilders.termsQuery("sid", sidList));
//查询数据 //查询数据
searchSourceBuilder.query(boolQuery); searchSourceBuilder.query(boolQuery);
Page<TransferData> page = null; Page<TransferData> page = new Page<>(pageNo, pageSize);
try { try {
page = esUtil.queryPage("basedata", searchSourceBuilder, TransferData.class, pageNo, pageSize); page = esUtil.queryPage("basedata", searchSourceBuilder, TransferData.class, pageNo, pageSize);
for (TransferData transferData : page.getRecords()) {
transferData.setCreateDate(EsDateUtil.esFieldDateMapping(transferData.getCreateDate()));
transferData.setPublishDate(EsDateUtil.esFieldDateMapping(transferData.getPublishDate()));
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
for (TransferData transferData : page.getRecords()) {
transferData.setCreateDate(EsDateUtil.esFieldDateMapping(transferData.getCreateDate()));
transferData.setPublishDate(EsDateUtil.esFieldDateMapping(transferData.getPublishDate()));
}
return Result.OK(page); return Result.OK(page);
} }
...@@ -649,7 +716,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -649,7 +716,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
Map<String, Long> monthlyCountMap = new HashMap<>(); Map<String, Long> monthlyCountMap = new HashMap<>();
try { try {
//所有 //所有
totalCountMap = esUtil.groupBy("basedata", "sid", boolQuerylist, 100); totalCountMap = esUtil.groupBy("basedata", "sid", boolQuerylist, sourceIds.size());
//近一个月 //近一个月
DateTime yesterday = cn.hutool.core.date.DateUtil.yesterday(); DateTime yesterday = cn.hutool.core.date.DateUtil.yesterday();
DateTime startTime = cn.hutool.core.date.DateUtil.offsetDay(yesterday, -30); DateTime startTime = cn.hutool.core.date.DateUtil.offsetDay(yesterday, -30);
......
package com.zzsn.thinktank.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
/**
* <p>
* 信息源表
* </p>
*
* @author obcy
* @since 2025-06-19
*/
@Data
public class BindInfoSourceColumnVO {
/**
* 信息源栏目id
*/
private String id;
/**
* 信息源栏目编码
*/
private String infoSourceCode;
/**
* 信息源栏目名称
*/
private String siteName;
/**
* 信息源栏目地址
*/
private String siteUri;
/**
* 信息源名称
*/
private String webSiteName;
/**
* 信息源栏目状态
*/
private Integer status;
/**
* 绑定的信息源类型
*/
private Integer sourceType;
}
package com.zzsn.thinktank.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
/**
* <p>
* 信息源表
* </p>
*
* @author obcy
* @since 2025-06-19
*/
@Data
public class BindInfoSourceVO {
/**
* 信息源id
*/
private String id;
/**
* 信息源编码
*/
private String code;
/**
* 信息源名称
*/
private String infoName;
/**
* 地址
*/
private String infoAddress;
/**
* 绑定的信息源类型
*/
private Integer sourceType;
}
package com.zzsn.thinktank.vo;
import lombok.Data;
import java.util.List;
@Data
public class BindLabelVo {
private String labelCode ;
private String labelItemCode ;
private List<BindLabelVo> labelItems;
}
package com.zzsn.thinktank.vo;
import lombok.Data;
/**
* 智库绑定信息源数量对象
*
* @author lkg
* @date 2025/8/5
*/
@Data
public class BindSourceDetailVO {
private String thinkTankId;
private String sourceId;
}
package com.zzsn.thinktank.vo;
import lombok.Data;
import java.util.List;
/**
* 绑定信息源对象
*
* @author lkg
* @date 2025/8/2
*/
@Data
public class BindVO {
//智库id
private String thinkTankId;
//id(可以是信息源/信息源栏目组id集合,可以是信息源/信息源栏目id集合)
private List<String> bindIds;
//信息源标签
private List<BindLabelVo> bindLabels;
//绑定类型类型(1:通用 2:定向)
private Integer sourceBindType;
//信息源类型(1:信息源栏目组 2:信息源栏目 3:信息源栏目标签 4:信息源组 5:信息源 6:信息源标签)
private Integer sourceType;
}
package com.zzsn.thinktank.vo;
import lombok.Data;
/**
* 绑定信息源的检索条件
*
* @author lkg
* @date 2025/8/2
*/
@Data
public class InfoSearchCondition {
/**
* 信息源编码
*/
private String code;
/**
* 信息源名称
*/
private String infoName;
/**
* 信息源URL
*/
private String infoAddress;
/**
* 信息源栏目名称
*/
private String siteName;
/**
* 信息源栏目URL
*/
private String siteUri;
/**
* 信息源栏目状态
*/
private String status;
/**
* 爬虫类别
*/
private Integer crawlType;
}
package com.zzsn.thinktank.vo;
import lombok.Data;
/**
* 信息源组信息
*
* @author lkg
* @date 2025/8/2
*/
@Data
public class InfoSourceGroupVO {
/**
* 信息源组id
*/
private String id;
/**
* 信息源组编码
*/
private String groupCode;
/**
* 信息源组名称
*/
private String groupName;
/**
* 信息源组名称
*/
private Integer sourceType;
/**
* 信息源组分类名称
*/
private String groupTypeName;
}
package com.zzsn.thinktank.vo;
import lombok.Data;
/**
* 信息源标签信息
*
* @author lkg
* @date 2025/8/2
*/
@Data
public class InfoSourceLabelVO {
/**
* 标签值id
*/
private String id;
/**
* 标签编码
*/
private String labelCode;
/**
* 标签名称
*/
private String labelName;
/**
* 业务口径(1自定义,2实体表引用,3字典引用)
*/
private String businessCaliber;
/**
* 引用数据字典的编码
*/
private String dictCode;
/**
* 标签值编码
*/
private String labelItemCode;
/**
* 标签值名称
*/
private String labelItemName;
/**
* 绑定的信息源类型
*/
private Integer sourceType;
}
...@@ -78,9 +78,9 @@ public class ThinktankBasicInfoVo extends Model<ThinktankBasicInfoVo> { ...@@ -78,9 +78,9 @@ public class ThinktankBasicInfoVo extends Model<ThinktankBasicInfoVo> {
private Date updateTime; private Date updateTime;
//采集信息总量 //采集信息总量
private Integer collectionCount; private Integer collectionCount = 0;
//绑定信息源个数 //绑定信息源个数
private Integer infoSourceCount; private Integer infoSourceCount = 0;
//语言 //语言
private String lang; private String lang;
......
...@@ -10,11 +10,50 @@ spring: ...@@ -10,11 +10,50 @@ spring:
max-file-size: 100MB max-file-size: 100MB
#总上传文件大小 #总上传文件大小
max-request-size: 1000MB max-request-size: 1000MB
datasource: datasource:
url: jdbc:mysql://1.95.14.228:3306/clb_project?useUnicode=true&characterEncoding=utf-8&AllowPublicKeyRetrieval=True&serverTimezone=Asia/Shanghai&autoReconnect=true&rewriteBatchedStatements=true druid:
username: ciglobal stat-view-servlet:
password: _PSuWVQ4CLpX enabled: true
loginUsername: admin
loginPassword: 123456667
allow:
web-stat-filter:
enabled: true
dynamic:
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
# 连接池的配置信息
# 初始化大小,最小,最大
initial-size: 5
min-idle: 10
maxActive: 100
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 600000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,wall,slf4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://1.95.14.228:3306/clb_project?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
username: ciglobal
password: _PSuWVQ4CLpX
slave:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://1.95.14.228:3306/clb_system?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
username: ciglobal
password: _PSuWVQ4CLpX
redis: redis:
database: 0 database: 0
host: 1.95.69.2 host: 1.95.69.2
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsn.thinktank.mapper.SysDictItemMapper">
<select id="listByDictCode" resultType="com.zzsn.thinktank.entity.SysDictItem">
select * from sys_dict_item item inner join sys_dict dict on item.dict_id = dict.id
where dict.dict_code = #{dictCode} and item.status = 1
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论