Эх сурвалжийг харах

히스토리 그레이드 선택 상태에 따라 카운트 변경

radian 1 жил өмнө
parent
commit
0927288006

+ 7 - 1
app/src/main/java/kr/co/iyapp/todayhan/dao/TodayHanjaDAO.java

@@ -621,7 +621,13 @@ public class TodayHanjaDAO {
         try {
             // DB connetion
             mDb = dbutl.connetion();
-            String sql = "select count(1) as cnt  from study_content where study_date  is not null";
+            String sql  =  "select count(1) as cnt  from study_content where study_date  is not null \n";
+                   sql +=  "and grade in ";
+                   sql +=  "(";
+                   sql +=  "select case value when 'Y' then 'M' else null end as grade from study_config where keys = 'middleGrade' \n";
+                   sql +=  "union all \n" ;
+                   sql +=  "select case value when 'Y' then 'H' else null end as grade from study_config where keys = 'highGrade' ";
+                   sql +=  ")";
 
             Log.d(TAG, "selectSql >>> " + sql);