diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index 5eaa24d4..21982609 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -26,7 +26,9 @@ public interface ResourceDao extends BaseDao { @Cacheable(value = "selectWithAttrs", key = "#p0+'-'+#orderField+'-'+#orderType") List selectWithAttrs(@Param("dto") ResourceDTO resourceDTO, @Param("orderField") String orderField, - @Param("orderType") String orderType); + @Param("orderType") String orderType, + @Param("nonChinese") Boolean nonChinese + ); List selectTypeCount(String type); @@ -39,7 +41,8 @@ public interface ResourceDao extends BaseDao { @Param("pageSize") Integer pageSize, @Param("orderField") String orderField, @Param("orderType") String orderType, - @Param("ids") List ids + @Param("ids") List ids, + @Param("nonChinese") Boolean nonChinese ); /** diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 21b81203..22073c80 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -404,6 +404,7 @@ public class ResourceServiceImpl extends CrudServiceImpl common(Page resultPage, List selectDTOPageSpecilTotal, ResourceDTO resourceDTO, String orderField, String orderType, Integer pageNum, Integer pageSize) { + private Page common(Page resultPage, List selectDTOPageSpecilTotal, ResourceDTO resourceDTO, + String orderField, String orderType, Integer pageNum, Integer pageSize, Boolean nonChinese) { if (resourceDTO.getInfoList().isEmpty()) { List resourceDTOS; if (orderField.equals("total")) { // 对总体评价特殊处理 @@ -514,7 +516,7 @@ public class ResourceServiceImpl extends CrudServiceImpl { ResourceDTO index = (ResourceDTO) x; @@ -544,13 +546,13 @@ public class ResourceServiceImpl extends CrudServiceImpl resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType); + List resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType, nonChinese); if (resourceDTOS.isEmpty()) { resultPage.setRecords(new ArrayList<>()); resultPage.setTotal(0); @@ -1501,7 +1503,7 @@ public class ResourceServiceImpl extends CrudServiceImpl maps = resourceDao.selectAppList((pageNum - 1) * 9, type, area); maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString()))); return new HashMap() {{ - put("appList",maps); + put("appList", maps); put("total", resourceDao.selectAppListCount(type, area)); }}; } diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 9763fa3c..3c653387 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -157,9 +157,12 @@ AND MATCH (tdr.type) AGAINST ( #{dto.type} IN BOOLEAN MODE) - + AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) + + AND tdr.name LIKE CONCAT( '%', #{dto.name}, '%' ) + AND tdr.district_id = #{dto.districtId} @@ -210,7 +213,6 @@ ORDER BY ${orderField} ${orderType} - @@ -442,9 +444,12 @@ AND tdr.type != '赋能案例' - + AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) + + AND tdr.name LIKE CONCAT( '%', #{dto.name}, '%' ) + AND MATCH (tdr.type) AGAINST ( #{dto.type} IN BOOLEAN MODE) @@ -1601,7 +1606,8 @@ AND sd.type = #{type} - AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%' ) + AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, + '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%' ) ORDER BY sd.type, sr.sort, sd.sort, tdr.dept_id, tdr.visitor DESC, tdr.id DESC @@ -1868,7 +1874,8 @@ @@ -2201,12 +2209,14 @@ 1 = 1 AND MATCH ( tdr.type ) AGAINST ( '组件服务' IN BOOLEAN MODE ) AND tdr.del_flag = 0 - AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} AND del_flag = 0 ) - + AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} + AND del_flag = 0 ) + AND sd.type = #{deptType} - - AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%') + + AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, + '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%') ORDER BY sd.type, @@ -2226,12 +2236,14 @@ 1 = 1 AND MATCH ( tdr.type ) AGAINST ( '组件服务' IN BOOLEAN MODE ) AND tdr.del_flag = 0 - AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} AND del_flag = 0 ) - + AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} + AND del_flag = 0 ) + AND sd.type = #{deptType} - - AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%') + + AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, + '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%')