Browse Source

fix: 地图查询排序优化

zhangying 9 months ago
parent
commit
bd5b04c18d

+ 22 - 2
src/main/resources/mapping/cquery/CompanyCQuery.xml

@@ -138,7 +138,17 @@
             distance <![CDATA[ <= ]]> #{maxDistance}
         </if>
         ORDER BY
-        Longitude DESC, Latitude DESC, distance DESC
+        CASE
+            WHEN Longitude LIKE '114%' THEN
+            0 ELSE 1
+        END,
+        Longitude DESC,
+        CASE
+            WHEN Latitude LIKE '23%' THEN
+            0 ELSE 1
+        END,
+        Latitude DESC,
+        distance DESC
     </select>
 
     <select id="getDataMapListByPostName" resultType="com.hz.employmentsite.vo.dataMap.CompanyPostMapVo">
@@ -206,6 +216,16 @@
             distance <![CDATA[ <= ]]> #{maxDistance}
         </if>
         ORDER BY
-        Longitude DESC, Latitude DESC, distance DESC, CompanyID
+        CASE
+            WHEN Longitude LIKE '114%' THEN
+            0 ELSE 1
+        END,
+        Longitude DESC,
+        CASE
+            WHEN Latitude LIKE '23%' THEN
+            0 ELSE 1
+        END,
+        Latitude DESC,
+        CompanyID
     </select>
 </mapper>

+ 11 - 6
src/main/resources/mapping/cquery/JobUserCQuery.xml

@@ -181,11 +181,7 @@
             AND jobuser.JobuserID IN (
                 SELECT label_jobuser.JobuserID
                 FROM pc_label_jobuser label_jobuser
-                WHERE label_jobuser.LabelID IN (
-                    SELECT label.LabelID
-                    FROM pc_label label
-                    WHERE label.LabelID = #{labelID}
-                )
+                WHERE label_jobuser.LabelID = #{labelID}
             )
         </if>
         <if test="minAge != null and maxAge == null">
@@ -215,7 +211,16 @@
             CURRENT_DATE ()) <![CDATA[ <= ]]> #{maxAge}
         </if>
         ORDER BY
-        Longitude DESC, Latitude DESC
+        CASE
+            WHEN Longitude LIKE '114%' THEN
+            0 ELSE 1
+        END,
+        Longitude DESC,
+        CASE
+            WHEN Latitude LIKE '23%' THEN
+            0 ELSE 1
+        END,
+        Latitude DESC
     </select>
     <select id="getJobUserDataList" resultType="com.hz.employmentsite.vo.jobUserManager.JobUserVo">
         select  jobUserID,name,userMobile  from pc_jobuser jobuser

+ 11 - 1
src/main/resources/mapping/cquery/SiteInfoCQuery.xml

@@ -103,6 +103,16 @@
         <if test="streetCode!='' and streetCode!=null">
             and streetCode like Concat('%',#{streetCode},'%')
         </if>
-        order by site.SiteLongitude desc, site.SiteLatitude DESC
+        order by
+        CASE
+            WHEN site.SiteLongitude LIKE '114%' THEN
+            0 ELSE 1
+        END,
+        site.SiteLongitude desc,
+        CASE
+            WHEN site.SiteLatitude LIKE '23%' THEN
+            0 ELSE 1
+        END,
+        site.SiteLatitude DESC
     </select>
 </mapper>