Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-10-26 10:34:28 +08:00
commit 840348979c
5 changed files with 12 additions and 9 deletions

View File

@ -636,8 +636,8 @@ public class ResourceController {
@GetMapping("/getCountByFuzzyQuery")
@ApiOperation("获取各类资源模糊查询总数")
@LogOperation("获取各类资源模糊查询总数")
public Result getCountByFuzzyQuery(@RequestParam String keyWorld) {
return new Result<>().ok(resourceService.getCountByFuzzyQuery(keyWorld));
public Result getCountByFuzzyQuery(@RequestParam String keyWorld, @RequestParam String nonChinese) {
return new Result<>().ok(resourceService.getCountByFuzzyQuery(keyWorld, nonChinese));
}

View File

@ -178,7 +178,7 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
String selectPicByResId(@Param("id") String id);
List<Map> selectTypeCountByName(@Param("keyWorld") String keyWorld);
List<Map> selectTypeCountByName(@Param("keyWorld") String keyWorld, @Param("nonChinese") Boolean nonChinese);
List<Map> countByCIMType(@Param("deptId") Long deptId);

View File

@ -140,7 +140,7 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
Object selectAppList(Map params);
Object getCountByFuzzyQuery(String keyWorld);
Object getCountByFuzzyQuery(String keyWorld, String nonChinese);
Object selectApplyDeptDetailTypeCountList(Map params);

View File

@ -477,8 +477,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
* 从本库内查询
*/
@SneakyThrows
private Page<ResourceDTO> common(Page<ResourceDTO> resultPage, List<Map> selectDTOPageSpecilTotal, ResourceDTO resourceDTO,
String orderField, String orderType, Integer pageNum, Integer pageSize, Boolean nonChinese) {
private Page<ResourceDTO> common(Page<ResourceDTO> resultPage, List<Map> selectDTOPageSpecilTotal, ResourceDTO resourceDTO, String orderField, String orderType, Integer pageNum, Integer pageSize, Boolean nonChinese) {
if (resourceDTO.getInfoList().isEmpty()) {
List<ResourceDTO> resourceDTOS;
if (orderField.equals("total")) { // 对总体评价特殊处理
@ -1978,9 +1977,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
}
@Override
public Object getCountByFuzzyQuery(String keyWorld) {
public Object getCountByFuzzyQuery(String keyWorld, String nonChinese) {
ArrayList<Map> resultList = new ArrayList<>();
CompletableFuture<Void> DBresourceCount = CompletableFuture.runAsync(() -> resultList.addAll(resourceDao.selectTypeCountByName(keyWorld)));
Boolean nonChinese_ = Boolean.getBoolean(nonChinese);// 不传默认为中文走全文索引
CompletableFuture<Void> DBresourceCount = CompletableFuture.runAsync(() -> resultList.addAll(resourceDao.selectTypeCountByName(keyWorld, nonChinese_)));
final Integer[] meetCountNew = new Integer[1];
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: {

View File

@ -1632,9 +1632,12 @@
FROM tb_data_resource
WHERE 1 = 1
AND del_flag = 0
<if test="keyWorld != null and keyWorld != ''">
<if test="keyWorld != null and keyWorld != '' and nonChinese == false">
AND MATCH (name) AGAINST ( #{keyWorld} IN BOOLEAN MODE)
</if>
<if test="keyWorld != null and keyWorld != '' and nonChinese == true">
AND name LIKE CONCAT( '%', #{keyWorld}, '%' )
</if>
AND type != '赋能案例'
GROUP BY type
ORDER BY type