Просмотр исходного кода

通告列表查询添加已读查询

hu 2 лет назад
Родитель
Сommit
8282ab96a8
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      src/custom/restcontroller/webmanage/saletool/notice/notice.java

+ 9 - 0
src/custom/restcontroller/webmanage/saletool/notice/notice.java

@@ -126,6 +126,15 @@ public class notice extends Controller {
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
                 where = where + " and t1.checkdate <='" + whereObject.getString("enddate") + "'";
             }
+            if (whereObject.containsKey("isread") && !"".equals(whereObject.getString("isread"))) {
+                if(whereObject.getBooleanValue("isread")){
+                    where = where + " and (CASE WHEN  (SELECT COUNT(*) FROM sat_notice_read WHERE  siteid = t1.siteid AND sat_noticeid = t1.sat_noticeid)>0 THEN '已读' ELSE '未读' END)='已读'";
+                }else{
+                    where = where + " and (CASE WHEN  (SELECT COUNT(*) FROM sat_notice_read WHERE  siteid = t1.siteid AND sat_noticeid = t1.sat_noticeid)>0 THEN '已读' ELSE '未读' END)='未读'";
+                }
+
+            }
+
         }
         SQLFactory sqlFactory = new SQLFactory(this, "通告列表查询", pageSize, pageNumber, pageSorting);
         sqlFactory.addParameter_SQL("where", where);