Authored by kun

update

... ... @@ -12,7 +12,7 @@
</resultMap>
<sql id="queryColumns">
size.id, size.size_name, sort.sort_name as sortName
size.id, size.size_name, CONCAT(IFNULL(CONCAT(sort2.sort_name,'/'),''),sort1.sort_name) AS sortName, size.order_by
</sql>
<insert id="insertSize" parameterType="com.yoho.ufo.model.commoditybasicrole.size.Size">
... ... @@ -52,27 +52,28 @@
<sql id="queryPage">
LEFT JOIN product_sort sort
ON size.sort_id = sort.id
from size
LEFT JOIN product_sort sort1
ON size.sort_id = sort1.id
left join product_sort sort2
on sort1.parent_id = sort2.id
<where>
<if test="size.sortName != null and size.sortName != ''">
sort.sort_name like concat('%', #{size.sortName}, '%')
sort1.sort_name like concat('%', #{size.sortName}, '%') or sort2.sort_name like concat('%', #{size.sortName}, '%')
</if>
<if test="size.sizeName != null and size.sizeName !=''">
size.size_name like concat('%', #{size.sizeName}, '%')
and size.size_name like concat('%', #{size.sizeName}, '%')
</if>
</where>
</sql>
<select id="selectSizeCount" resultType="integer">
select count(*)
from size
<include refid="queryPage"/>
</select>
<select id="getSizePageList" resultMap="sizeMap">
select <include refid="queryColumns"/>
from size
<include refid="queryPage"/>
order by size.update_time desc
limit #{page.startIndex}, #{page.pageSize}
... ...
... ... @@ -34,6 +34,10 @@ public class ProductSortServiceImpl implements IProductSortService {
*/
private static final Integer PRODUCT_SORT_LEVEL_1 = 1;
/**
* 二级层级
*/
private static final Integer PRODUCT_SORT_LEVEL_2 = 2;
/**
* 顶级id
... ... @@ -55,6 +59,8 @@ public class ProductSortServiceImpl implements IProductSortService {
// 一级层级
productSort.setLevel(PRODUCT_SORT_LEVEL_1);
productSort.setParentId(TOP_PARENT_ID);
} else {
productSort.setLevel(PRODUCT_SORT_LEVEL_2);
}
productSort.setStatus(0);
productSort.setCreateTime(DateUtil.currentTimeSeconds());
... ...
... ... @@ -102,7 +102,12 @@
title: "所属分类",
field: "sortName",
width: 100,
align: "center",
align: "center"
}, {
title: "排序值",
field: "orderBy",
width: 100,
align: "center"
}, {
title: "操作",
field: "operations",
... ...