Authored by kun

update

@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 </resultMap> 12 </resultMap>
13 13
14 <sql id="queryColumns"> 14 <sql id="queryColumns">
15 - size.id, size.size_name, sort.sort_name as sortName 15 + size.id, size.size_name, CONCAT(IFNULL(CONCAT(sort2.sort_name,'/'),''),sort1.sort_name) AS sortName, size.order_by
16 </sql> 16 </sql>
17 17
18 <insert id="insertSize" parameterType="com.yoho.ufo.model.commoditybasicrole.size.Size"> 18 <insert id="insertSize" parameterType="com.yoho.ufo.model.commoditybasicrole.size.Size">
@@ -52,27 +52,28 @@ @@ -52,27 +52,28 @@
52 52
53 53
54 <sql id="queryPage"> 54 <sql id="queryPage">
55 - LEFT JOIN product_sort sort  
56 - ON size.sort_id = sort.id 55 + from size
  56 + LEFT JOIN product_sort sort1
  57 + ON size.sort_id = sort1.id
  58 + left join product_sort sort2
  59 + on sort1.parent_id = sort2.id
57 <where> 60 <where>
58 <if test="size.sortName != null and size.sortName != ''"> 61 <if test="size.sortName != null and size.sortName != ''">
59 - sort.sort_name like concat('%', #{size.sortName}, '%') 62 + sort1.sort_name like concat('%', #{size.sortName}, '%') or sort2.sort_name like concat('%', #{size.sortName}, '%')
60 </if> 63 </if>
61 <if test="size.sizeName != null and size.sizeName !=''"> 64 <if test="size.sizeName != null and size.sizeName !=''">
62 - size.size_name like concat('%', #{size.sizeName}, '%') 65 + and size.size_name like concat('%', #{size.sizeName}, '%')
63 </if> 66 </if>
64 </where> 67 </where>
65 </sql> 68 </sql>
66 69
67 <select id="selectSizeCount" resultType="integer"> 70 <select id="selectSizeCount" resultType="integer">
68 select count(*) 71 select count(*)
69 - from size  
70 <include refid="queryPage"/> 72 <include refid="queryPage"/>
71 </select> 73 </select>
72 74
73 <select id="getSizePageList" resultMap="sizeMap"> 75 <select id="getSizePageList" resultMap="sizeMap">
74 select <include refid="queryColumns"/> 76 select <include refid="queryColumns"/>
75 - from size  
76 <include refid="queryPage"/> 77 <include refid="queryPage"/>
77 order by size.update_time desc 78 order by size.update_time desc
78 limit #{page.startIndex}, #{page.pageSize} 79 limit #{page.startIndex}, #{page.pageSize}
@@ -34,6 +34,10 @@ public class ProductSortServiceImpl implements IProductSortService { @@ -34,6 +34,10 @@ public class ProductSortServiceImpl implements IProductSortService {
34 */ 34 */
35 private static final Integer PRODUCT_SORT_LEVEL_1 = 1; 35 private static final Integer PRODUCT_SORT_LEVEL_1 = 1;
36 36
  37 + /**
  38 + * 二级层级
  39 + */
  40 + private static final Integer PRODUCT_SORT_LEVEL_2 = 2;
37 41
38 /** 42 /**
39 * 顶级id 43 * 顶级id
@@ -55,6 +59,8 @@ public class ProductSortServiceImpl implements IProductSortService { @@ -55,6 +59,8 @@ public class ProductSortServiceImpl implements IProductSortService {
55 // 一级层级 59 // 一级层级
56 productSort.setLevel(PRODUCT_SORT_LEVEL_1); 60 productSort.setLevel(PRODUCT_SORT_LEVEL_1);
57 productSort.setParentId(TOP_PARENT_ID); 61 productSort.setParentId(TOP_PARENT_ID);
  62 + } else {
  63 + productSort.setLevel(PRODUCT_SORT_LEVEL_2);
58 } 64 }
59 productSort.setStatus(0); 65 productSort.setStatus(0);
60 productSort.setCreateTime(DateUtil.currentTimeSeconds()); 66 productSort.setCreateTime(DateUtil.currentTimeSeconds());
@@ -102,7 +102,12 @@ @@ -102,7 +102,12 @@
102 title: "所属分类", 102 title: "所属分类",
103 field: "sortName", 103 field: "sortName",
104 width: 100, 104 width: 100,
105 - align: "center", 105 + align: "center"
  106 + }, {
  107 + title: "排序值",
  108 + field: "orderBy",
  109 + width: 100,
  110 + align: "center"
106 }, { 111 }, {
107 title: "操作", 112 title: "操作",
108 field: "operations", 113 field: "operations",