feat: 유통자료 지역 검색 시 화성특례시 적용

main
thkim 2026-02-03 09:09:56 +09:00
parent 284ba53325
commit be5e7b1129
5 changed files with 56 additions and 31 deletions

View File

@ -340,16 +340,10 @@ public class MapLeftController {
//params.put("masterCompanyProjectCodes", masterCompanyProjectCodes); //params.put("masterCompanyProjectCodes", masterCompanyProjectCodes);
} }
sidoSub = getSidoSub(sido);
gugunSub = getGugunSub(gugun);
dongSub = getDongSub(dong);
if (!(sido.equals("all"))) {
sidoSub = sido.substring(0, 4);
}
if (!(gugun.equals("all"))) {
gugunSub = gugun.substring(0, 4);
}
if (!(dong.equals("all"))) {
dongSub = dong.substring(0, 5);
}
String big_region = ""; String big_region = "";
if (sidoSub.equals("1001")) { if (sidoSub.equals("1001")) {
big_region = "12:"; // 강원도 big_region = "12:"; // 강원도
@ -815,6 +809,34 @@ public class MapLeftController {
} }
private String getSidoSub(String sido) {
if (!(sido.equals("all"))) {
String[] arrSido = sido.split("\\^");
if( arrSido != null && 0 < arrSido.length ) {
return arrSido[0];
}
}
return "";
}
private String getGugunSub(String gugun) {
String[] arrGugun = gugun.split("\\^");
if( arrGugun != null && 0 < arrGugun.length ) {
return arrGugun[0];
}
return "";
}
private String getDongSub(String dong) {
String[] arrDong = dong.split("\\^");
if( arrDong != null && 0 < arrDong.length ) {
return arrDong[0];
}
return "";
}
@RequestMapping(value = "/map/mapSearchArea.do") @RequestMapping(value = "/map/mapSearchArea.do")
public String mapSearchArea(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam Map<String, Object> params) throws Exception { public String mapSearchArea(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam Map<String, Object> params) throws Exception {
@ -830,15 +852,10 @@ public class MapLeftController {
String userId = (String)request.getSession().getAttribute("USERID"); String userId = (String)request.getSession().getAttribute("USERID");
if (!(sido.equals("all"))) { sidoSub = getSidoSub(sido);
sidoSub = sido.substring(0, 4); gugunSub = getGugunSub(gugun);
} dongSub = getDongSub(dong);
if (!(gugun.equals("all"))) {
gugunSub = gugun.substring(0, 4);
}
if (!(dong.equals("all"))) {
dongSub = dong.substring(0, 5);
}
// System.out.println("sidoSub========================="+sidoSub); // System.out.println("sidoSub========================="+sidoSub);
String big_region = ""; String big_region = "";
if (sidoSub.equals("1001")) { if (sidoSub.equals("1001")) {

View File

@ -102,7 +102,7 @@ public class MapMainController {
@RequestMapping(value = "/map/getDong.do") @RequestMapping(value = "/map/getDong.do")
public String getDong(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam HashMap<String, Object> params) throws Exception { public String getDong(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam HashMap<String, Object> params) throws Exception {
List<EgovMap> dong = mapMainService.selectWebBoundDong(params); // 지역검색(구/군 선택) List<EgovMap> dong = mapMainService.selectWebBoundDong(params); // 지역검색(읍/면/동 선택)
model.addAttribute("dong", dong); model.addAttribute("dong", dong);

View File

@ -11,7 +11,9 @@
FROM TBL_PROJECT_INFO A, TBL_HEADER B FROM TBL_PROJECT_INFO A, TBL_HEADER B
]]> ]]>
<if test="(sido != 'all' and gugun != 'all' and dong == 'all')"> <if test="(sido != 'all' and gugun != 'all' and dong == 'all')">
, (SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE GUNGU_CD = #{gugunSub}) C <![CDATA[
, (SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE GUNGU_CD = #{gugunSub} AND 0 < MINX AND 0 < MAXX AND 0 < MINY AND 0 < MAXY) C
]]>
</if> </if>
<if test="(sido != 'all' and gugun != 'all' and dong != 'all')"> <if test="(sido != 'all' and gugun != 'all' and dong != 'all')">
@ -53,11 +55,15 @@
FROM TBL_PROJECT_INFO A, TBL_HEADER B FROM TBL_PROJECT_INFO A, TBL_HEADER B
]]> ]]>
<if test="(sido != 'all' and gugun != 'all' and dong == 'all')"> <if test="(sido != 'all' and gugun != 'all' and dong == 'all')">
, (SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE GUNGU_CD = #{gugunSub}) C <![CDATA[
, (SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE GUNGU_CD = #{gugunSub} AND 0 < MINX AND 0 < MAXX AND 0 < MINY AND 0 < MAXY) C
]]>
</if> </if>
<if test="(sido != 'all' and gugun != 'all' and dong != 'all')"> <if test="(sido != 'all' and gugun != 'all' and dong != 'all')">
,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE DONG_CD = #{dongSub}) C <![CDATA[
,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE DONG_CD = #{dongSub} AND 0 < MINX AND 0 < MAXX AND 0 < MINY AND 0 < MAXY) C
]]>
</if> </if>
<![CDATA[ <![CDATA[
@ -156,12 +162,12 @@
<if test="(sido != 'all' and gugun != 'all' and dong == 'all')"> <if test="(sido != 'all' and gugun != 'all' and dong == 'all')">
<![CDATA[ <![CDATA[
,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE GUNGU_CD = #{gugunSub}) C ,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE GUNGU_CD = #{gugunSub} AND 0 < MINX AND 0 < MAXX AND 0 < MINY AND 0 < MAXY) C
]]> ]]>
</if> </if>
<if test="(sido != 'all' and gugun != 'all' and dong != 'all')"> <if test="(sido != 'all' and gugun != 'all' and dong != 'all')">
<![CDATA[ <![CDATA[
,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE DONG_CD = #{dongSub}) C ,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE DONG_CD = #{dongSub} AND 0 < MINX AND 0 < MAXX AND 0 < MINY AND 0 < MAXY) C
]]> ]]>
</if> </if>
@ -213,12 +219,12 @@
<if test="(sido != 'all' and gugun != 'all' and dong == 'all')"> <if test="(sido != 'all' and gugun != 'all' and dong == 'all')">
<![CDATA[ <![CDATA[
,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE GUNGU_CD = #{gugunSub}) C ,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE GUNGU_CD = #{gugunSub} AND 0 < MINX AND 0 < MAXX AND 0 < MINY AND 0 < MAXY) C
]]> ]]>
</if> </if>
<if test="(sido != 'all' and gugun != 'all' and dong != 'all')"> <if test="(sido != 'all' and gugun != 'all' and dong != 'all')">
<![CDATA[ <![CDATA[
,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE DONG_CD = #{dongSub}) C ,(SELECT MINX, MAXX, MINY, MAXY FROM WEB_BOUND_DONG WHERE DONG_CD = #{dongSub} AND 0 < MINX AND 0 < MAXX AND 0 < MINY AND 0 < MAXY) C
]]> ]]>
</if> </if>

View File

@ -9,14 +9,14 @@
<select id="selectWebBoundGugun" parameterType="map" resultType="egovMap"> <select id="selectWebBoundGugun" parameterType="map" resultType="egovMap">
<![CDATA[ <![CDATA[
SELECT GUNGU_CD, MINX, MAXX, MINY, MAXY, GUNGU FROM WEB_BOUND_GUNGU SELECT GUNGU_CD, MINX, MAXX, MINY, MAXY, GUNGU FROM WEB_BOUND_GUNGU
WHERE DO_CD = #{do_cd} WHERE USE_YN = 'Y' AND DO_CD = #{do_cd}
]]> ]]>
</select> </select>
<select id="selectWebBoundDong" parameterType="hashMap" resultType="egovMap"> <select id="selectWebBoundDong" parameterType="hashMap" resultType="egovMap">
<![CDATA[ <![CDATA[
SELECT DONG_CD, MINX, MAXX, MINY, MAXY, DONG FROM WEB_BOUND_DONG SELECT DONG_CD, MINX, MAXX, MINY, MAXY, DONG FROM WEB_BOUND_DONG
WHERE GUNGU_CD = #{gungu_cd} WHERE USE_YN = 'Y' AND GUNGU_CD = #{gungu_cd}
]]> ]]>
</select> </select>

View File

@ -57,10 +57,12 @@ function getGuList2(callback = null, callbackParams = null) {
} }
function getDongList2(callback = null, callbackParams = null) { function getDongList2(callback = null, callbackParams = null) {
var sub_cd = $("#cmb_gungu_all").val().substring(0, 4); var sub_cd = $("#cmb_gungu_all").val();
const words = sub_cd.split("^");
var params = new Object(); var params = new Object();
params.gungu_cd = sub_cd; params.gungu_cd = words[0];
$("#cmb_dong_all").load("/map/getDong.do", params, function(response, status, xhr) { $("#cmb_dong_all").load("/map/getDong.do", params, function(response, status, xhr) {
if (status == "error") { if (status == "error") {