13#if __DCL_HAVE_THIS_FILE__
22ZipCodeListView::ZipCodeListView(
HtmlPage* pPage)
29void ZipCodeListView::init(
SQLFields& fields)
35 if (__mapParams.lookup(L
"PARTS", rValue) && !rValue.isEmpty()) {
37 if (5 <= n && n <= 20)
41 if (__mapParams.lookup(L
"ROWS", rValue) && !rValue.isEmpty()) {
48void ZipCodeListView::onPrint(
Session& session)
52 ListedStringToStringArrayMap& mapQuery = session.__ctx.__queryMap;
54 int nCurrentPart =
Integer::parse(getDefault(mapQuery, L
"part"), 10, 1);
57 StringBuilder strThisPage = __pPage->__strPageID;
58 String strThisPageEnc;
60 String strSido = getDefault(mapQuery, L
"sido");
61 String strGugun = getDefault(mapQuery, L
"gugun");
62 String strDong = getDefault(mapQuery, L
"dong");
64 StringBuilder strWhere;
66 if (!strSido.isEmpty()) {
67 strWhere = L
"SIDO LIKE \'" + strSido + L
"%\'";
68 strThisPage += L
"&sido=" + strSido;
70 if (!strGugun.isEmpty()) {
71 if (!strWhere.isEmpty())
73 strWhere += L
"GUGUN LIKE \'" + strGugun + L
"%\'";
74 strThisPage += L
"&gugun=" + strGugun;
76 if (!strDong.isEmpty()) {
77 if (!strWhere.isEmpty())
79 strWhere += L
"DONG LIKE \'" + strDong + L
"%\'";
80 strThisPage += L
"&dong=" + strDong;
83 if (strWhere.isEmpty()) {
84 assign(L
"DEFAULT", (*
this)[L
"DEFAULT"]);
89 assign(L
"SIDO", strSido);
90 assign(L
"GUGUN", strGugun);
91 assign(L
"DONG", strDong);
93 int nUsingRecord = nRows;
94 int nTotalRecord = nUsingRecord;
97 StringBuilder strSQL = L
""
99 "\n FROM DCL_ZIPCODE";
100 if (!strWhere.isEmpty())
101 strSQL += L
"\n WHERE " + strWhere.toString();
105 nTotalRecord = q.
fields()[0].asInteger();
106 if (nTotalRecord == 0) {
107 assign(L
"EMPTY", (*
this)[L
"EMPTY"]);
114 nTotalPart = nTotalRecord / nUsingRecord;
115 if (nTotalRecord % nUsingRecord)
118 if (nCurrentPart <= 0 || nCurrentPart > nTotalPart)
119 nCurrentPart = nTotalPart;
121 StringBuilder strThisPageEx = strThisPage;
122 if (nCurrentPart > 1)
123 strThisPageEx += L
"&part=" + String::valueOf(nCurrentPart);
125 assign(L
"_THIS", strThisPageEnc);
127 int nOffset = (nCurrentPart - 1) * nUsingRecord;
128 int nNo = nTotalRecord - ((nCurrentPart - 1) * nUsingRecord);
135 ", CONCAT(SIDO, ' ', GUGUN, ' ', DONG) AS ADDRESS"
137 "\n FROM DCL_ZIPCODE";
139 if (!strWhere.isEmpty())
140 strSQL += L
"\n WHERE " + strWhere.
toString();
142 strSQL += L
"\n ORDER BY ZIPCODE"
143 "\n LIMIT " + String::valueOf(nUsingRecord) + L
""
144 "\n OFFSET " + String::valueOf(nOffset);
149 assign(L
"EMPTY", (*
this)[L
"EMPTY"]);
156 ROW.assign(q.
fields(), L
" ");
157 ROW.assign(L
"VNO", VNO());
163 if (pPART_LINK && nTotalPart > 1) {
164 PartLink pl(pPART_LINK, strThisPage, String());
165 pl.assign(
this, nTotalPart, nCurrentPart, __nParts);
#define IMPLEMENT_CLASSINFO_EX(class_name, base_class_name)
#define __DCL_VERIFY(expr)
virtual void onPrint(Session &session) __DCL_THROWS1(Exception *)
virtual void init(SQLFields &fields) __DCL_THROWS1(Exception *)
static int parse(const wchar_t *_number, unsigned _base=10) __DCL_THROWS1(NumericConvertException *)
virtual String toString() const
_CONST SQLFields & fields() _CONST
void execute() __DCL_THROWS1(SQLException *)
void fetch() __DCL_THROWS1(SQLException *)
static ByteString encode(const ByteString &_str)