Ver Fonte

业绩目标新增查询

hu há 4 meses atrás
pai
commit
8023a20103

+ 1 - 1
src/custom/restcontroller/webmanage/sale/salestarget/SQL/企业-业绩目标完成列表.sql

@@ -24,7 +24,7 @@ from sa_salestarget m
          LEFT JOIN sa_salestarget m4 ON m4.year = m.year and m4.point = 4 and m.sys_enterpriseid = m4.sys_enterpriseid
          LEFT JOIN sys_enterprise t1 on t1.sys_enterpriseid=m.sys_enterpriseid
          LEFT JOIN sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t1.siteid=t2.siteid
-
+        where $where1$
 ORDER BY m.year desc
 
 

+ 12 - 0
src/custom/restcontroller/webmanage/sale/salestarget/enterprisetarget.java

@@ -166,14 +166,25 @@ public class enterprisetarget extends Controller {
     public String selectList() throws YosException {
         ArrayList<Long> sys_enterpriseids = new ArrayList<>();
         StringBuffer where = new StringBuffer(" 1=1 ");
+        StringBuffer where1 = new StringBuffer(" 1=1 ");
         if (!content_where.getStringValue("year").isEmpty()) {
             where.append(" and(");
             where.append("year ='").append(content_where.getString("year")).append("' ");
             where.append(")");
         }
+
         if (!content_where.getStringValue("sys_enterpriseid").isEmpty()) {
             sys_enterpriseids.add(content_where.getLong("sys_enterpriseid"));
         }
+        if (content_where.containsKey("tablefilter")) {
+            if(content_where.getJSONObject("tablefilter").containsKey("enterprisename")){
+                if(StringUtils.isNotBlank(content_where.getJSONObject("tablefilter").getStringValue("enterprisename"))){
+                    where1.append(" and(");
+                    where1.append(" t1.enterprisename like '%").append(content_where.getJSONObject("tablefilter").getStringValue("enterprisename")).append("%' ");
+                    where1.append(")");
+                }
+            }
+        }
 
         long totalPage = 0;
         long totalRows = 0;
@@ -191,6 +202,7 @@ public class enterprisetarget extends Controller {
 
         SQLFactory sqlFactory = new SQLFactory(this, "企业-业绩目标完成列表");
         sqlFactory.addParameter_SQL("where", where);
+        sqlFactory.addParameter_SQL("where1", where1);
         sqlFactory.addParameter_in("sys_enterpriseids", sys_enterpriseids);
         sqlFactory.addParameter("siteid", siteid);
         String sql = sqlFactory.getSQL();