hu 3 лет назад
Родитель
Сommit
e4cecbffac

+ 0 - 10
src/custom/restcontroller/sale/item/Item.java

@@ -58,15 +58,6 @@ public class Item extends Controller {
                 where = where + " and (brandname like'%" + whereObject.getString("condition") + "%') ";
             }
         }
-
-        String where2 = " 1=1 ";
-        if (content.containsKey("where")) {
-            JSONObject whereObject = content.getJSONObject("where");
-
-            if (whereObject.containsKey("classtype") && !"".equals(whereObject.getString("classtype"))) {
-                where2 = where2 + " and t1.classtype ='" + whereObject.getString("classtype") + "' ";
-            }
-        }
         /*
          * SQL通告板块查询参数设置并查询
          */
@@ -84,7 +75,6 @@ public class Item extends Controller {
             sqlFactory.addParameter("siteid", siteid);
             sqlFactory.addParameter("sa_brandid", row.getString("sa_brandid"));
             sqlFactory.addParameter("istool", istool);
-            sqlFactory.addParameter("where2", where2);
             String sql = sqlFactory.getSQL();
             Rows allrows = dbConnect.runSqlQuery(sql);
 

+ 2 - 2
src/custom/restcontroller/sale/item/SQL/查询所有分类.sql

@@ -16,9 +16,9 @@ SELECT
     t1.changedate
 FROM plm_itemclass t1
     LEFT JOIN plm_itemclass t2 ON t1.parentid = t2.itemclassid AND t1.siteid = t2.siteid
-WHERE t1.sa_brandid = $sa_brandid$
+WHERE t1.classtype = '营销'
+  AND t1.sa_brandid = $sa_brandid$
   AND t1.siteid = $siteid$
   and t1.istool = $istool$
-  and $where2$
 ORDER BY
     t1.parentid,ifnull(ISNULL( t1.num )= 0 AND LENGTH(trim( t1.num ))= 0,99) ASC

+ 0 - 1
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -182,7 +182,6 @@ public class Item extends Controller {
                 sqlFactory.addParameter("siteid", siteid);
                 sqlFactory.addParameter("itemid", itemid);
                 sqlFactory.addParameter("itemno", itemno);
-                sqlFactory.addParameter("classtype", content.getStringValue("classtype"));
                 sqlFactory.addParameter("itemclassid", itemclassid);
                 sqlList.add(sqlFactory.getSQL());
             }

+ 3 - 4
src/custom/restcontroller/webmanage/sale/item/SQL/商品营销类别新增.sql

@@ -1,10 +1,9 @@
-insert into sa_itemsaleclass (siteid, sa_itemsaleclassid, itemid, itemno, itemclassid,classtype)
-select $siteid$, $sa_itemsaleclassid$, $itemid$, $itemno$, $itemclassid$,$classtype$
+insert into sa_itemsaleclass (siteid, sa_itemsaleclassid, itemid, itemno, itemclassid)
+select $siteid$, $sa_itemsaleclassid$, $itemid$, $itemno$, $itemclassid$
 FROM dual
 WHERE not exists(SELECT 1
                  FROM sa_itemsaleclass
                  WHERE siteid = $siteid$
                    and itemid = $itemid$
                    and itemclassid = $itemclassid$
-                   AND itemno = $itemno$
-                   AND classtype = $classtype$)
+                   AND itemno = $itemno$)

+ 2 - 2
src/custom/restcontroller/webmanage/sale/item/SQL/新增营销类别.sql

@@ -1,2 +1,2 @@
-insert into sa_itemsaleclass(sa_itemsaleclassid, siteid, itemclassid, itemid, itemno,classtype)
-values ($sa_itemsaleclassid$, $siteid$, $itemclassid$, $itemid$, $itemno$,$classtype$)
+insert into sa_itemsaleclass(sa_itemsaleclassid, siteid, itemclassid, itemid, itemno)
+values ($sa_itemsaleclassid$, $siteid$, $itemclassid$, $itemid$, $itemno$)

+ 2 - 1
src/custom/restcontroller/webmanage/sale/itemclass/SQL/查询所有分类.sql

@@ -15,7 +15,8 @@ select t2.itemclassname          upitemclassname,
        t1.changedate
 from plm_itemclass t1
          left join plm_itemclass t2 on t1.parentid = t2.itemclassid and t1.siteid = t2.siteid
-where t1.sa_brandid = $sa_brandid$
+where t1.classtype = '营销'
+  and t1.sa_brandid = $sa_brandid$
   and t1.siteid = $siteid$
   and $where2$
 order by t1.parentid, ifnull(ISNULL(t1.num) = 0 and LENGTH(trim(t1.num)) = 0, 99) asc

+ 1 - 1
src/custom/restcontroller/webmanage/sale/itemclass/SQL/营销类别末级列表查询.sql

@@ -1,3 +1,3 @@
 select t2.itemclassname upitemclassname,t1.itemclassid,t1.itemclassnum,t1.itemclassname,t1.itemclassfullname,t1.itemclassfullnum,ifnull(t1.parentid,0) as parentid,t1.num,t1.ishide,t1.istool,t1.isdeep,t1.createby,t1.createdate,t1.changeby,t1.changedate from plm_itemclass t1
    left join plm_itemclass t2 on t1.parentid=t2.itemclassid and t1.siteid=t2.siteid
-where $where$ and  ifnull(t1.isdeep,0)=1 and t1.siteid=$siteid$ order by t1.parentid,ifnull(ISNULL(t1.num)=0 and LENGTH(trim(t1.num))=0,99) asc
+where $where$ and  ifnull(t1.isdeep,0)=1 and t1.classtype='营销'  and t1.siteid=$siteid$ order by t1.parentid,ifnull(ISNULL(t1.num)=0 and LENGTH(trim(t1.num))=0,99) asc

+ 3 - 10
src/custom/restcontroller/webmanage/sale/itemclass/itemclass.java

@@ -193,7 +193,6 @@ public class itemclass extends Controller {
 			if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
 				where = where + " and (brandname like'%" + whereObject.getString("condition") + "%') ";
 			}
-
 		}
 
 		String where2 = " 1=1 ";
@@ -203,9 +202,6 @@ public class itemclass extends Controller {
 			if (whereObject.containsKey("istool") && !"".equals(whereObject.getString("istool"))) {
 				where2 = where2 + " and (t1.istool ='" + whereObject.getString("istool") + "') ";
 			}
-			if (whereObject.containsKey("classtype") && !"".equals(whereObject.getString("classtype"))) {
-				where2 = where2 + " and t1.classtype ='" + whereObject.getString("classtype") + "' ";
-			}
 		}
 		/*
 		 * SQL通告板块查询参数设置并查询
@@ -297,9 +293,6 @@ public class itemclass extends Controller {
 			if (whereObject.containsKey("istool") && !"".equals(whereObject.getString("istool"))) {
 				where = where + " and t1.istool=" + whereObject.getLongValue("istool");
 			}
-			if (whereObject.containsKey("classtype") && !"".equals(whereObject.getString("classtype"))) {
-				where = where + " and t1.classtype=" + whereObject.getLongValue("classtype");
-			}
 		}
 		SQLFactory factory = new SQLFactory(this, "营销类别末级列表查询");
 		factory.addParameter("siteid", siteid);
@@ -357,7 +350,7 @@ public class itemclass extends Controller {
 			throws YosException {
 		if (parentid > 0) {
 			Rows rows = dbConnect.runSqlQuery(
-					"select ifnull(parentid,0) as parentid from plm_itemclass where  itemclassid= '"
+					"select ifnull(parentid,0) as parentid from plm_itemclass where classtype='营销'  and itemclassid= '"
 							+ parentid + "'");
 			if (!rows.isEmpty()) {
 				level++;
@@ -373,7 +366,7 @@ public class itemclass extends Controller {
 		String fullnum = "";
 		if (parentid > 0) {
 			Rows rows = dbConnect.runSqlQuery(
-					"select ifnull(parentid,0) as parentid,itemclassfullnum from plm_itemclass where  itemclassid= '"
+					"select ifnull(parentid,0) as parentid,itemclassfullnum from plm_itemclass where classtype='营销'  and itemclassid= '"
 							+ parentid + "'");
 			if (!rows.isEmpty()) {
 				fullnum = rows.get(0).getString("itemclassfullnum") + "/" + fullname;
@@ -392,7 +385,7 @@ public class itemclass extends Controller {
 		String fullnum = "";
 		if (parentid > 0) {
 			Rows rows = dbConnect.runSqlQuery(
-					"select ifnull(parentid,0) as parentid,itemclassfullname from plm_itemclass where  itemclassid= '"
+					"select ifnull(parentid,0) as parentid,itemclassfullname from plm_itemclass where classtype='营销'  and itemclassid= '"
 							+ parentid + "'");
 			if (!rows.isEmpty()) {
 				fullnum = rows.get(0).getString("itemclassfullname") + "/" + fullname;

+ 1 - 4
src/custom/restcontroller/webmanage/sale/itemsaleclass/ItemSaleClass.java

@@ -37,7 +37,6 @@ public class ItemSaleClass extends Controller {
             sqlFactory.addParameter("siteid", siteid);
             sqlFactory.addParameter("itemid", itemid);
             sqlFactory.addParameter("itemno", itemno);
-            sqlFactory.addParameter("classtype", content.getStringValue("classtype"));
             sqlFactory.addParameter("itemclassid", itemclassid);
             sqlList.add(sqlFactory.getSQL());
         }
@@ -70,9 +69,7 @@ public class ItemSaleClass extends Controller {
                 where.append("or t1.itemclassnum like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append(")");
             }
-            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
-                where.append(" and t4.classtype ='" + whereObject.getString("classtype") + "' ");
-            }
+
 
         }
         Long itemid = content.getLong("itemid");

+ 3 - 4
src/custom/restcontroller/webmanage/sale/itemsaleclass/SQL/商品营销类别新增.sql

@@ -1,10 +1,9 @@
-insert into sa_itemsaleclass (siteid, sa_itemsaleclassid, itemid, itemno, itemclassid,classtype)
-select $siteid$, $sa_itemsaleclassid$, $itemid$, $itemno$, $itemclassid$,$classtype$
+insert into sa_itemsaleclass (siteid, sa_itemsaleclassid, itemid, itemno, itemclassid)
+select $siteid$, $sa_itemsaleclassid$, $itemid$, $itemno$, $itemclassid$
 FROM dual
 WHERE not exists(SELECT 1
                  FROM sa_itemsaleclass
                  WHERE siteid = $siteid$
                    and itemid = $itemid$
                    and itemclassid = $itemclassid$
-                   AND itemno = $itemno$
-                   and classtype=$classtype$)
+                   AND itemno = $itemno$)