From 1ebd70df03827a52549125d346a48021c0b38436 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 22 Jul 2022 10:28:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4mysql=20=E5=85=A8=E6=96=87?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E4=BD=BF=E7=94=A8=E8=87=AA=E7=84=B6=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E6=90=9C=E7=B4=A2=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusControllerV2.java | 2 +- .../resources/mapper/resource/ResourceDao.xml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java index 22765634..e650cf24 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java @@ -245,7 +245,7 @@ public class CensusControllerV2 { }); - String sqlFormat = "SELECT COUNT( tda.data_resource_id ) FROM tb_data_attr tda JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id AND MATCH ( tda.attr_value) AGAINST ( '%s' IN BOOLEAN MODE) AND tda.attr_type = '组件类型' AND tda.del_flag = 0 AND tdr.del_flag = 0;"; + String sqlFormat = "SELECT COUNT( tda.data_resource_id ) FROM tb_data_attr tda JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id AND MATCH ( tda.attr_value) AGAINST ( '%s' IN NATURAL LANGUAGE MODE) AND tda.attr_type = '组件类型' AND tda.del_flag = 0 AND tdr.del_flag = 0;"; CompletableFuture aiAssemblyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台智能算法组件服务数目 return jdbcTemplate.queryForObject(String.format(sqlFormat, "智能算法"), Long.class); diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 56315a0c..6b8964bc 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -129,10 +129,10 @@ AND tdr.type != '赋能案例' - AND MATCH (tdr.type) AGAINST ( #{dto.type} IN BOOLEAN MODE) + AND MATCH (tdr.type) AGAINST ( #{dto.type} IN NATURAL LANGUAGE MODE) - AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) + AND MATCH (tdr.name) AGAINST ( #{dto.name} IN NATURAL LANGUAGE MODE) AND tdr.district_id = #{dto.districtId} @@ -166,7 +166,7 @@ SELECT data_resource_id FROM tb_data_attr WHERE attr_type = #{item.attrType} - AND MATCH ( attr_value) AGAINST ( #{item.attrValue} IN BOOLEAN MODE) + AND MATCH ( attr_value) AGAINST ( #{item.attrValue} IN NATURAL LANGUAGE MODE) AND del_flag = 0 ) tb GROUP BY tb.data_resource_id @@ -244,11 +244,11 @@ AND tdr.del_flag = 0 - AND MATCH (tdr.type) AGAINST ( #{type} IN BOOLEAN MODE) + AND MATCH (tdr.type) AGAINST ( #{type} IN NATURAL LANGUAGE MODE) - AND MATCH (tdr.name) AGAINST ( #{name} IN BOOLEAN MODE) + AND MATCH (tdr.name) AGAINST ( #{name} IN NATURAL LANGUAGE MODE) ORDER BY ${orderFiled} ${orderType} LIMIT ${pageNum}, ${pageSize} @@ -383,7 +383,7 @@ AND tdr.type != '赋能案例' - AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) + AND MATCH (tdr.name) AGAINST ( #{dto.name} IN NATURAL LANGUAGE MODE) AND tdr.type = #{dto.type} @@ -433,7 +433,7 @@ 1 = 1 AND tdr.del_flag = 0 - AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) + AND MATCH (tdr.name) AGAINST ( #{dto.name} IN NATURAL LANGUAGE MODE) AND tdr.type = #{dto.type} @@ -465,7 +465,7 @@ 1 = 1 AND tdr.del_flag = 0 - AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) + AND MATCH (tdr.name) AGAINST ( #{dto.name} IN NATURAL LANGUAGE MODE) @@ -1035,7 +1035,7 @@ AND tdr.del_flag = 0 AND tda.del_flag = 0 AND tdr.id = tda.data_resource_id - AND MATCH (attr_value) AGAINST ( #{type} IN BOOLEAN MODE) + AND MATCH (attr_value) AGAINST ( #{type} IN NATURAL LANGUAGE MODE)