From df3fdac6f07fcb5df1b5924a99c18d8fb35b1f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=90=A6=E6=B6=9B?= Date: Tue, 6 Aug 2024 14:40:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/mapper/xml/LawsHomeSearchMapper.xml | 84 +++++++----- .../impl/LawsHomeSearchServiceImpl.java | 121 +----------------- .../laws/home/vo/LawsHomeNormalSearchVO.java | 7 + .../src/main/resources/application-dev.yml | 4 +- 4 files changed, 69 insertions(+), 147 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/home/mapper/xml/LawsHomeSearchMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/home/mapper/xml/LawsHomeSearchMapper.xml index 7ed438fb..14161174 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/home/mapper/xml/LawsHomeSearchMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/laws/home/mapper/xml/LawsHomeSearchMapper.xml @@ -6,38 +6,60 @@ select ${ew.sqlSelect} from ( - select id,'1' as resource_type,CONCAT_WS(' ',standard_number,standard_name) AS standard_name,create_time, - case when standard_class = 'UN' then 1 - when standard_class = 'EU' then 2 - when standard_class = 'GB' then 3 - when standard_class = 'GB/T' then 4 - else 8 - end as standard_type_order, - case when standard_state = 1 then 1 - when standard_state = 7 then 2 - else 4 - end as standard_state_order, - standard_class,dynamic_type,applicable_vehicle,type,standard_state,null as standard_code,null as grade_classification, - implementation_date - from laws_domestic_standard where del_flag = 0 - - and standard_state != 7 - + select * from ( + select id,'1' as resource_type,CONCAT_WS(' ',standard_number,standard_name) AS standard_name,create_time, + case when standard_class = 'UN' then 1 + when standard_class = 'EU' then 2 + when standard_class = 'GB' then 3 + when standard_class = 'GB/T' then 4 + else 8 + end as standard_type_order, + case when standard_state = 1 then 1 + when standard_state = 7 then 2 + else 4 + end as standard_state_order, + standard_class,dynamic_type,applicable_vehicle,type, + null as category_code, + applicable_market, + standard_state,null as standard_code,null as grade_classification, + implementation_date + from laws_domestic_standard where del_flag = 0 + + and standard_state != 7 + + ) s1 + + ${ew.sqlSegment} + union all - select id,'3' as resource_type,CONCAT_WS(' ',standard_number,standard_name) AS standard_name,create_time,9 as standard_type_order, - case when standard_state = 8 then 1 - when standard_state = 9 then 2 - else 4 - end as standard_state_order, - null,null,null,null,standard_state,standard_code,null as grade_classification,implementation_date - from laws_enterprise_standard where del_flag = 0 - - and standard_state != 9 - + select * from ( + select id,'3' as resource_type,CONCAT_WS(' ',standard_number,standard_name) AS standard_name,create_time,9 as standard_type_order, + case when standard_state = 8 then 1 + when standard_state = 9 then 2 + else 4 + end as standard_state_order, + NULL as standard_class, + NULL as dynamic_type, + NULL as applicable_vehicle, + NULL as type, + category_code, + null as applicable_market, + standard_state,standard_code,null as grade_classification,implementation_date + from laws_enterprise_standard where del_flag = 0 + + and standard_state != 9 + + ) s2 + + ${ew.sqlSegment} + ) as all_data - - ${ew.sqlSegment} - + ORDER BY + sort_index DESC, + standard_type_order ASC, + standard_state_order ASC, + implementation_date DESC, + create_time DESC