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