|
@@ -29,6 +29,16 @@ public class ReportType extends Controller {
|
|
|
|
|
|
@API(title = "授权报表中心应用的报表查询", apiversion = R.ID20240407094904.v1.class)
|
|
|
public String queryReport() throws YosException {
|
|
|
+
|
|
|
+ StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
+ if (content.containsKey("where")) {
|
|
|
+ JSONObject whereObject = content.getJSONObject("where");
|
|
|
+ if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
+ where.append(" and (");
|
|
|
+ where.append("if(t1.reporttype = '积木报表', t2.name, t1.name) like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+ }
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_report", "sys_reportid");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "jimu_report", "t2", "t1.jimu_report_id = t2.id");
|
|
@@ -38,6 +48,7 @@ public class ReportType extends Controller {
|
|
|
querySQL.addQueryFields("type", "group_concat(t3.type separator ',')");
|
|
|
querySQL.addGroupBy("t1.sys_reportid", "t1.name", "t2.name");
|
|
|
querySQL.setWhere("((t1.reporttype = '积木报表' and t2.id is not null) or (t1.reporttype != '积木报表'))");
|
|
|
+ querySQL.setWhere(where.toString());
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
Rows query = querySQL.query();
|
|
|
return getSucReturnObject().setData(query).toString();
|