260521_02_ENH: 사전답사 pkey 변경 및 투표소 코드 관련된 정리

This commit is contained in:
2026-05-21 12:26:18 +09:00
parent ed52d4cdfd
commit 09893c6b3a
3 changed files with 36 additions and 32 deletions

View File

@@ -10,32 +10,32 @@ Dim flag
select case gubun select case gubun
case "List" 'case "List"
'
DBConnect() ' DBConnect()
'
SQL = "" ' SQL = ""
SQL = SQL&" select a.*, case isnull(b.Status,'') when '1' then '진행중' when '11' then '수정가능' when '10' then '완료' else '미진행' end as status from [No.6].krc_survey.dbo.Dat_2002020_B_exit a "&VbCrlf ' SQL = SQL&" select a.*, case isnull(b.Status,'') when '1' then '진행중' when '11' then '수정가능' when '10' then '완료' else '미진행' end as status from [No.6].krc_survey.dbo.Dat_2002020_B_exit a "&VbCrlf
SQL = SQL&" left join [No.6].krc_survey.dbo.Dat_2002020_B b on a.id=case when CHARINDEX('_', b.IDKey)<>0 then LEFT(b.IDKey, CHARINDEX('_', b.IDKey)-1) end where a.flag='1' "&VbCrlf ' SQL = SQL&" left join [No.6].krc_survey.dbo.Dat_2002020_B b on a.id=case when CHARINDEX('_', b.IDKey)<>0 then LEFT(b.IDKey, CHARINDEX('_', b.IDKey)-1) end where a.flag='1' "&VbCrlf
'response.write SQL ' 'response.write SQL
Objdb.Open SQL,DBConn,3,1,1 ' Objdb.Open SQL,DBConn,3,1,1
If not objdb.eof Then ' If not objdb.eof Then
while not objdb.eof ' while not objdb.eof
response.write "<tr>"&VbCrlf ' response.write "<tr>"&VbCrlf
response.write " <td>"&objdb("Q1")&"</td>"&VbCrlf ' response.write " <td>"&objdb("Q1")&"</td>"&VbCrlf
response.write " <td>"&objdb("cluster_nm")&"</td>"&VbCrlf ' response.write " <td>"&objdb("cluster_nm")&"</td>"&VbCrlf
response.write " <td>"&objdb("Q4")&"<input type='hidden' name='E_No' value='"&objdb("ID")&"'/></td>"&VbCrlf ' response.write " <td>"&objdb("Q4")&"<input type='hidden' name='E_No' value='"&objdb("ID")&"'/></td>"&VbCrlf
response.write " <td>"&objdb("Q3")&"</td>"&VbCrlf ' response.write " <td>"&objdb("Q3")&"</td>"&VbCrlf
response.write " <td>"&objdb("Q10")&"</td>"&VbCrlf ' response.write " <td>"&objdb("Q10")&"</td>"&VbCrlf
response.write " <td>"&objdb("pre_name")&"</td>"&VbCrlf ' response.write " <td>"&objdb("pre_name")&"</td>"&VbCrlf
response.write " <td>"&objdb("pre_phone")&"</td>"&VbCrlf ' response.write " <td>"&objdb("pre_phone")&"</td>"&VbCrlf
response.write " <td>"&objdb("status")&"</td>"&VbCrlf ' response.write " <td>"&objdb("status")&"</td>"&VbCrlf
response.write "</tr>"&VbCrlf ' response.write "</tr>"&VbCrlf
objdb.movenext ' objdb.movenext
wend ' wend
End If ' End If
'
DBClose() ' DBClose()
case "json_list" case "json_list"
DBConnect() DBConnect()
@@ -43,11 +43,11 @@ case "json_list"
SQL = "" SQL = ""
SQL = SQL & " SELECT e_subarea_cd " & VbCrlf SQL = SQL & " SELECT e_subarea_cd " & VbCrlf
SQL = SQL & " ,e_subarea_nm " & VbCrlf SQL = SQL & " ,e_subarea_nm " & VbCrlf
SQL = SQL & " ,e_exit_cd " & VbCrlf 'SQL = SQL & " ,e_exit_cd " & VbCrlf
SQL = SQL & " ,e_full_it " & VbCrlf SQL = SQL & " ,e_full_it " & VbCrlf
SQL = SQL & " ,e_it " & VbCrlf '' SQL = SQL & " ,e_it " & VbCrlf
SQL = SQL & " ,ex_cd " & VbCrlf 'SQL = SQL & " ,ex_cd " & VbCrlf
SQL = SQL & " ,cluster " & VbCrlf 'SQL = SQL & " ,cluster " & VbCrlf
SQL = SQL & " ,e_exit_nm " & VbCrlf SQL = SQL & " ,e_exit_nm " & VbCrlf
SQL = SQL & " ,e_full_nm " & VbCrlf SQL = SQL & " ,e_full_nm " & VbCrlf
SQL = SQL & " ,e_full_ad " & VbCrlf SQL = SQL & " ,e_full_ad " & VbCrlf

View File

@@ -59,7 +59,11 @@ case "code"
SQL = " select gubun, r_cd, r_nm, Flag from exitpoll.dbo.R_code where Flag = '1' and gubun = '" & sel_code & "' " SQL = " select gubun, r_cd, r_nm, Flag from exitpoll.dbo.R_code where Flag = '1' and gubun = '" & sel_code & "' "
if sel_code = "district" Then if sel_code = "district" Then
SQL = SQL & " and left(r_cd,2) = '" & Request("area_cd") & "' " if LEN(Request("area_cd")) > 2 then
SQL = SQL & " and len(r_cd) > 4 and left(r_cd,4) = '" & Request("area_cd") & "' "
else
SQL = SQL & " and len(r_cd) < 5 and left(r_cd,2) = '" & Request("area_cd") & "' "
end if
End If End If
Objdb.Open SQL,DBConn,3,1,1 Objdb.Open SQL,DBConn,3,1,1
if not Objdb.eof Then if not Objdb.eof Then

View File

@@ -9,7 +9,7 @@ SQL = ""
SQL = SQL&" SELECT 'P' + D.VALUE + 'H' + CONVERT(varchar, Q.IDKEY) AS pcode " SQL = SQL&" SELECT 'P' + D.VALUE + 'H' + CONVERT(varchar, Q.IDKEY) AS pcode "
SQL = SQL&" FROM exitpoll.dbo.POLL_EXP_LOGIN Q CROSS APPLY STRING_SPLIT(MATCHING,',') AS D " SQL = SQL&" FROM exitpoll.dbo.POLL_EXP_LOGIN Q CROSS APPLY STRING_SPLIT(MATCHING,',') AS D "
SQL = SQL&" inner join kon.dbo.DATA DA on Q.PKEY = DA.PKEY and DA.IDKEY = 'P' + D.VALUE + 'H' + CONVERT(varchar, Q.IDKEY) " SQL = SQL&" inner join kon.dbo.DATA DA on Q.PKEY = DA.PKEY and DA.IDKEY = 'P' + D.VALUE + 'H' + CONVERT(varchar, Q.IDKEY) "
SQL = SQL&" WHERE Q.PKEY = '2504025_A' AND D.VALUE = '"&Exit_cd&"' and DA.status = '10' " SQL = SQL&" WHERE Q.PKEY = '2604001_A' AND D.VALUE = '"&Exit_cd&"' and DA.status = '10' "
Objdb.Open SQL,DBConn,3,1,1 Objdb.Open SQL,DBConn,3,1,1
If not Objdb.eof then If not Objdb.eof then
%> %>