feat 修改了一些搜索模块
This commit is contained in:
@@ -22,11 +22,12 @@ public class CodeGen {
|
||||
|
||||
// x.x.x.x:3306/xxxx --MYSQL
|
||||
// 192.168.10.140:1521:foton_slrs_test
|
||||
private static final String DB_IP="localhost:3306/foton_slrs_test";
|
||||
// foton_slrs_test@101.36.227.22
|
||||
private static final String DB_IP="101.36.227.22:33050/foton_slrs_test";
|
||||
|
||||
private static final String DB_USER="root";
|
||||
|
||||
private static final String DB_PWD="Zxy20010202";
|
||||
private static final String DB_PWD="1q2w3e4r";
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
# 数据库配置
|
||||
#=============================================
|
||||
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url = jdbc:mysql://localhost:3306/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
|
||||
spring.datasource.url = jdbc:mysql:/101.36.227.22:33050/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
|
||||
spring.datasource.username = root
|
||||
spring.datasource.password = Zxy20010202
|
||||
|
||||
spring.datasource.password = 1q2w3e4r
|
||||
#==============================================
|
||||
# 应用设置
|
||||
spring.application.name=FotonLAWSSystem
|
||||
|
||||
@@ -139,8 +139,8 @@ upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg
|
||||
# =============================================================================
|
||||
# elasticsearch 配置
|
||||
# =============================================================================
|
||||
elasticsearch.clustername=laws
|
||||
elasticsearch.ip=localhost
|
||||
elasticsearch.clustername=elasticsearch
|
||||
elasticsearch.ip=192.168.10.47
|
||||
elasticsearch.port=9300
|
||||
elasticsearch.poolSize=5
|
||||
elas.flag=true
|
||||
@@ -60,6 +60,11 @@
|
||||
<artifactId>adc-da-base</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
<artifactId>adc-da-slrs</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
|
||||
@@ -50,7 +50,6 @@ public class ElasticsearchConfig {
|
||||
if (client != null) {
|
||||
client.close();
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.adc.da.search.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "elasticsearch")
|
||||
public class ElasticsearchProperties {
|
||||
private String clustername;
|
||||
@@ -11,35 +14,4 @@ public class ElasticsearchProperties {
|
||||
private Integer port;
|
||||
private Integer poolSize;
|
||||
|
||||
public String getClustername() {
|
||||
return clustername;
|
||||
}
|
||||
|
||||
public void setClustername(String clustername) {
|
||||
this.clustername = clustername;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public Integer getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(Integer port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public Integer getPoolSize() {
|
||||
return poolSize;
|
||||
}
|
||||
|
||||
public void setPoolSize(Integer poolSize) {
|
||||
this.poolSize = poolSize;
|
||||
}
|
||||
}
|
||||
|
||||
+21
-4
@@ -7,6 +7,7 @@ import com.adc.da.excel.poi.excel.entity.enums.ExcelType;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.search.dto.*;
|
||||
import com.adc.da.search.entity.CommonSearchInfoEO;
|
||||
import com.adc.da.search.entity.SarAdvanceSearchVO;
|
||||
import com.adc.da.search.entity.SeniorSearchInfoEO;
|
||||
import com.adc.da.search.service.ElasticsearchService;
|
||||
@@ -14,6 +15,8 @@ import com.adc.da.search.service.SearchCenterService;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu;
|
||||
import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService;
|
||||
import com.adc.da.util.IOUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -23,10 +26,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.elasticsearch.client.transport.TransportClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -52,6 +52,15 @@ public class SearchCenterController extends BaseController<Map<String, Object>>
|
||||
@Autowired
|
||||
private ElasticsearchService elasticsearchService;
|
||||
|
||||
@Autowired
|
||||
private ITsDicTypeService iTsDictypeService;
|
||||
|
||||
@ApiOperation("获取筛选条件")
|
||||
@PostMapping("/getMenu")
|
||||
public ResponseMessage<List<TsSearchMenu>> getSearchMenu(){
|
||||
return Result.success(iTsDictypeService.getSearchMenu());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param searchInfoEO
|
||||
@@ -98,6 +107,14 @@ public class SearchCenterController extends BaseController<Map<String, Object>>
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("根据多个key去查询")
|
||||
@PostMapping("/searchByKey")
|
||||
public void searchByKey(@RequestBody CommonSearchInfoEO commonSearchInfoEO){
|
||||
searchCenterService.searchByKey(commonSearchInfoEO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "|SearchCenter|查询用于导出数据")
|
||||
@PostMapping(value="/searchIdToImport")
|
||||
public ResponseMessage<String []> searchIdToImport(SeniorSearchInfoEO searchInfoEO){
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.adc.da.search.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BasicSearchEntity {
|
||||
private String key;
|
||||
private String sign;
|
||||
private String value;
|
||||
private List<String> values;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.adc.da.search.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CommonSearchInfoEO {
|
||||
|
||||
private List<BasicSearchEntity> searchEntities;
|
||||
|
||||
private String searchType;
|
||||
|
||||
private String searchIndex;
|
||||
|
||||
private String searchBox;
|
||||
|
||||
private Integer currents;
|
||||
|
||||
private Integer size;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.adc.da.search.service;
|
||||
|
||||
import com.adc.da.search.entity.CommonSearchInfoEO;
|
||||
import com.adc.da.search.entity.SeniorSearchInfoEO;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
|
||||
@@ -27,4 +28,6 @@ public interface SearchCenterService {
|
||||
|
||||
List<Map<String, Object>> searchSarBykeyAndHighLightNumber(SeniorSearchInfoEO searchInfoEO) throws Exception;
|
||||
|
||||
void searchByKey(CommonSearchInfoEO commonSearchInfoEO);
|
||||
|
||||
}
|
||||
|
||||
+33
-3
@@ -1,11 +1,10 @@
|
||||
package com.adc.da.search.service.impl;
|
||||
|
||||
import com.adc.da.person.dao.PersonSearchEODao;
|
||||
import com.adc.da.search.entity.SarAdvanceSearchVO;
|
||||
import com.adc.da.search.entity.SearchListDto;
|
||||
import com.adc.da.search.entity.SeniorSearchInfoEO;
|
||||
import com.adc.da.search.entity.*;
|
||||
import com.adc.da.search.service.SearchCenterService;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.elasticsearch.action.search.SearchRequestBuilder;
|
||||
@@ -40,6 +39,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
private final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(SearchCenterServiceImpl.class);
|
||||
|
||||
@@ -1246,6 +1246,36 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
searchInfoEO.getPager().setRowCount((int) response.getHits().getTotalHits());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchByKey(CommonSearchInfoEO commonSearchInfoEO) {
|
||||
|
||||
//写个假的根据字段查询
|
||||
SearchRequestBuilder searchRequestBuilder;
|
||||
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
|
||||
BoolQueryBuilder boolQueryShould = QueryBuilders.boolQuery();
|
||||
BoolQueryBuilder boolQueryMust = QueryBuilders.boolQuery();
|
||||
|
||||
for (BasicSearchEntity entity: commonSearchInfoEO.getSearchEntities()) {
|
||||
if(entity.getKey()!=null&&entity.getValue()!=null&&(entity.getSign()==null||entity.getSign().equals("=")))boolQueryMust.must(QueryBuilders.wildcardQuery(entity.getKey(),"*"+entity.getValue()+"*"));
|
||||
}
|
||||
|
||||
searchRequestBuilder=client.prepareSearch(commonSearchInfoEO.getSearchIndex())
|
||||
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
|
||||
.setFrom((commonSearchInfoEO.getCurrents()-1)*commonSearchInfoEO.getSize())
|
||||
.setSize(commonSearchInfoEO.getSize());
|
||||
boolQueryBuilder.must(QueryBuilders.matchQuery("validFlag", 0));
|
||||
|
||||
boolQueryBuilder.must(boolQueryMust);
|
||||
boolQueryShould.should(boolQueryShould);
|
||||
|
||||
searchRequestBuilder.setQuery(boolQueryBuilder);
|
||||
// 获取查询到的结果
|
||||
SearchResponse response = searchRequestBuilder.get();
|
||||
|
||||
log.info(response.getHits().toString());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDictionary;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|TsDictionary|")
|
||||
@RequestMapping("/tsDictionaryType/ts-dictionary")
|
||||
public class TsDictionaryController extends BaseController<TsDictionary> {
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDicType;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|TsDictype|")
|
||||
@RequestMapping("/tsDictionaryType/ts-dictype")
|
||||
public class TsDictypeController extends BaseController<TsDicType> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.dao;
|
||||
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDicType;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
public interface TsDicTypeDao extends BaseMapper<TsDicType> {
|
||||
public List<TsSearchMenu> getSearchMenu();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.dao;
|
||||
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDictionary;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
public interface TsDictionaryDao extends BaseMapper<TsDictionary> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.entity;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
class MenuType{
|
||||
private String id;
|
||||
private String dicId;
|
||||
private String dicTypeName;
|
||||
private String dicTypeCode;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="TsDicType对象", description="")
|
||||
@TableName("ts_dictype")
|
||||
public class TsDicType extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "数据字典ID")
|
||||
@TableField("DIC_ID")
|
||||
private String dicId;
|
||||
|
||||
@ApiModelProperty(value = "数据内容")
|
||||
@TableField("DIC_TYPE_NAME")
|
||||
private String dicTypeName;
|
||||
|
||||
@ApiModelProperty(value = "数据编码")
|
||||
@TableField("DIC_TYPE_CODE")
|
||||
private String dicTypeCode;
|
||||
|
||||
@ApiModelProperty(value = "描述")
|
||||
@TableField("DESCRIBES")
|
||||
private String describes;
|
||||
|
||||
@ApiModelProperty(value = "展示排序")
|
||||
@TableField("SHOW_INDEX")
|
||||
private BigDecimal showIndex;
|
||||
|
||||
@ApiModelProperty(value = "关联的父级ID")
|
||||
@TableField("PARENT_ID")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "树结构父级ID")
|
||||
@TableField("TREE_PID")
|
||||
private String treePid;
|
||||
|
||||
@ApiModelProperty(value = "冗余字段")
|
||||
@TableField("OTHERS")
|
||||
private String others;
|
||||
|
||||
@TableField("CREATION_USER")
|
||||
private String creationUser;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private String validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
private LocalDateTime creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="TsDictionary对象", description="")
|
||||
public class TsDictionary extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "数据字典编码")
|
||||
@TableField("DICTIONARY_CODE")
|
||||
private String dictionaryCode;
|
||||
|
||||
@ApiModelProperty(value = "数据字典名称")
|
||||
@TableField("DICTIONARY_NAME")
|
||||
private String dictionaryName;
|
||||
|
||||
@ApiModelProperty(value = "数据字典排序序号")
|
||||
@TableField("ORDER_NUM")
|
||||
private BigDecimal orderNum;
|
||||
|
||||
@ApiModelProperty(value = "是否启用(0是,1否)")
|
||||
@TableField("ENABLE")
|
||||
private String enable;
|
||||
|
||||
@ApiModelProperty(value = "类型(SEL_OPTION下拉选项,TREE树形结构)")
|
||||
@TableField("DICTION_TYPE")
|
||||
private String dictionType;
|
||||
|
||||
@ApiModelProperty(value = "是否有关联类别(0是,1否)")
|
||||
@TableField("IS_RELATE")
|
||||
private String isRelate;
|
||||
|
||||
@ApiModelProperty(value = "关联类别ID")
|
||||
@TableField("RELATE_DIC_ID")
|
||||
private String relateDicId;
|
||||
|
||||
@TableField("CREATION_USER")
|
||||
private String creationUser;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private String validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
private LocalDateTime creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "是否可编辑数据")
|
||||
@TableField("IS_EDIT_DATA")
|
||||
private String isEditData;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TsSearchMenu {
|
||||
|
||||
private String dicId;
|
||||
|
||||
private String dictionaryName;
|
||||
|
||||
private String dictionaryCode;
|
||||
|
||||
public List<MenuType> menuTypes;
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.service;
|
||||
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDicType;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
public interface ITsDicTypeService extends IService<TsDicType> {
|
||||
|
||||
public List<TsSearchMenu> getSearchMenu();
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.service;
|
||||
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDictionary;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
public interface ITsDictionaryService extends IService<TsDictionary> {
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.service.impl;
|
||||
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDicType;
|
||||
import com.adc.da.slrs.tsDictionaryType.dao.TsDicTypeDao;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu;
|
||||
import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
@Service
|
||||
public class TsDicTypeServiceImpl extends ServiceImpl<TsDicTypeDao, TsDicType> implements ITsDicTypeService {
|
||||
|
||||
@Override
|
||||
public List<TsSearchMenu> getSearchMenu() {
|
||||
return getBaseMapper().getSearchMenu();
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.tsDictionaryType.service.impl;
|
||||
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDictionary;
|
||||
import com.adc.da.slrs.tsDictionaryType.dao.TsDictionaryDao;
|
||||
import com.adc.da.slrs.tsDictionaryType.service.ITsDictionaryService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-28
|
||||
*/
|
||||
@Service
|
||||
public class TsDictionaryServiceImpl extends ServiceImpl<TsDictionaryDao, TsDictionary> implements ITsDictionaryService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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.adc.da.slrs.tsDictionaryType.dao.TsDicTypeDao">
|
||||
|
||||
<resultMap id="searchMenu" type="com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu">
|
||||
<id property="dicId" column="id"/>
|
||||
<result property="dictionaryCode" column="dictionary_code"/>
|
||||
<result property="dictionaryName" column="dictionary_name"/>
|
||||
<collection property="menuTypes" javaType="list" ofType="com.adc.da.slrs.tsDictionaryType.entity.MenuType">
|
||||
<id property="id" column="type_id"/>
|
||||
<result property="dicId" column="id"/>
|
||||
<result property="dicTypeName" column="type_name"/>
|
||||
<result property="dicTypeCode" column="type_code"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="getSearchMenu" resultMap="searchMenu">
|
||||
select t_d.ID as id,
|
||||
t_d.DICTIONARY_CODE as dictionary_code,
|
||||
t_d.DICTIONARY_NAME as dictionary_name,
|
||||
t_d_t.ID as type_id,
|
||||
t_d_t.DIC_TYPE_NAME as type_name,
|
||||
t_d_t.DIC_TYPE_CODE as type_code
|
||||
from ts_dictionary as t_d left join ts_dictype as t_d_t on t_d.ID=t_d_t.DIC_ID
|
||||
where
|
||||
t_d.ENABLE=0 and
|
||||
t_d.DICTION_TYPE='SEL_OPTION' and
|
||||
t_d_t.DIC_ID is not null and
|
||||
t_d_t.DIC_TYPE_NAME is not null and
|
||||
t_d.DICTIONARY_NAME is not null
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.adc.da.slrs.tsDictionaryType.dao.TsDictionaryDao">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user