Browse Source

一级市场,二级市场分类,筛选,搜索

李书文 1 năm trước cách đây
mục cha
commit
ab0e349a97

+ 3 - 2
sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/TbGoodsTransitMapper.xml

@@ -26,7 +26,7 @@
 			<if test=' this.has("merchantId") '> and merchant_id = #{merchantId} </if>
 			<if test=' this.has("merchantName") '> and merchant_name = #{merchantName} </if>
 			<if test=' this.has("goodsType") '> and goods_type = #{goodsType} </if>
-			<if test=' this.has("goodsName") '> and goods_name = #{goodsName} </if>
+			<if test=' this.has("goodsName") '> and goods_name like concat('%', #{goodsName}, '%')</if>
 			<if test=' this.has("goodsUnits") '> and goods_units = #{goodsUnits} </if>
 			<if test=' this.has("price") '> and price = #{price} </if>
 			<if test=' this.has("placeOrigin") '> and place_origin = #{placeOrigin} </if>
@@ -54,7 +54,7 @@
 			<when test='sortType == 4'> goods_type desc </when>
 			<when test='sortType == 5'> goods_name desc </when>
 			<when test='sortType == 6'> goods_units desc </when>
-			<when test='sortType == 7'> price desc </when>
+			<when test='sortType == 7'> price #{orderBy} </when>
 			<when test='sortType == 8'> place_origin desc </when>
 			<when test='sortType == 9'> discription desc </when>
 			<when test='sortType == 10'> stock desc </when>
@@ -63,6 +63,7 @@
 			<when test='sortType == 13'> audit_time desc </when>
 			<when test='sortType == 14'> remark desc </when>
 			<when test='sortType == 15'> create_time desc </when>
+			<when test='sortType == 150'> create_time asc </when>
 			<when test='sortType == 16'> create_by desc </when>
 			<when test='sortType == 17'> create_name desc </when>
 			<when test='sortType == 18'> update_time desc </when>

+ 32 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_type/TbGoodsTypeAppController.java

@@ -0,0 +1,32 @@
+package com.pj.tb_goods_type;
+
+import com.pj.utils.sg.AjaxJson;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+
+@RestController
+@RequestMapping("/app/TbGoodsType/")
+public class TbGoodsTypeAppController {
+
+	@Autowired
+	TbGoodsTypeService tbGoodsTypeService;
+
+	/** 查集合 (整个表数据转化为tree结构返回) */
+	@RequestMapping("getTree")
+	public AjaxJson getTree() { 
+		// 获取记录 
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbGoodsType> list = tbGoodsTypeService.getList(so);
+		// 转为tree结构,并返回 
+		List<SoMap> listMap = SoMap.getSoMapByList(list);
+		List<SoMap> listTree = SoMap.listToTree(listMap, "id", "parentId", "children");
+		return AjaxJson.getSuccessData(listTree);
+	}
+
+}

+ 1 - 1
sp-service/level-two-server/src/main/java/com/pj/tb_goods_demand/TbGoodsDemandMapper.xml

@@ -24,7 +24,7 @@
 		<where>
 			<if test=' this.has("id") '> and id = #{id} </if>
 			<if test=' this.has("levelOneGoodsId") '> and level_one_goods_id = #{levelOneGoodsId} </if>
-			<if test=' this.has("goodsName") '> and goods_name = #{goodsName} </if>
+			<if test=' this.has("goodsName") '> and goods_name like concat('%', #{goodsName}, '%')</if>
 			<if test=' this.has("goodsNo") '> and goods_no = #{goodsNo} </if>
 			<if test=' this.has("goodsImg") '> and goods_img = #{goodsImg} </if>
 			<if test=' this.has("purchaserId") '> and purchaser_id = #{purchaserId} </if>