提交 879beaac authored 作者: 吴德鹏's avatar 吴德鹏

完成商品二级分类排序

上级 d350d360
......@@ -58,6 +58,16 @@ public class TbCfDescripitonEntity implements Serializable {
private Integer count;
private Integer sort;
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getCount() {
return count;
}
......
......@@ -30,6 +30,8 @@ public class TbCfGoodstwotypeEntity implements Serializable {
*/
private String goodstwotypeUrl;
private Integer sort;
/**
* 设置:商品二级分类Id
*/
......@@ -82,4 +84,12 @@ public class TbCfGoodstwotypeEntity implements Serializable {
public String getGoodstwotypeUrl() {
return goodstwotypeUrl;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
}
......@@ -27,6 +27,16 @@ public class GoodsTypeToGoodsTwo implements Serializable {
private Integer count;
private Integer sort;
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getCount() {
return count;
}
......
......@@ -12,6 +12,7 @@
<result property="image" column="image"/>
<result property="postage" column="postage"/>
<result property="morePostage" column="more_postage"/>
<result property="sort" column="sort"/>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfDescripitonEntity">
......@@ -23,7 +24,8 @@
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`
`more_postage`,
sort
from tb_cf_descripiton
where descripition_id = #{id}
</select>
......@@ -43,7 +45,8 @@
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`
`more_postage`,
sort
from tb_cf_descripiton
where goodstwotype_id = #{id}
</select>
......@@ -57,6 +60,7 @@
d.image,
d.postage,
d.more_postage,
d.sort,
o.goodstype_title type,
t.goodstwotype_title twoType,
t.count count
......@@ -97,7 +101,8 @@
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`)
`more_postage`,
sort)
values(
#{descripitionId},
#{descripitionName},
......@@ -106,7 +111,8 @@
#{goodstwotypeId},
#{image},
#{postage},
#{morePostage})
#{morePostage},
#{sort})
</insert>
<update id="update" parameterType="com.platform.entity.TbCfDescripitonEntity">
......@@ -119,6 +125,7 @@
<if test="image != null">`image` = #{image},</if>
<if test="postage != null">`postage` = #{postage},</if>
<if test="morePostage != null">`more_postage` = #{morePostage}</if>
<if test="sort != null">`sort` = #{sort}</if>
</set>
where descripition_id = #{descripitionId}
</update>
......
......@@ -8,6 +8,7 @@
<result property="goodstwotypeTitle" column="goodstwotype_title"/>
<result property="goodstypeId" column="goodstype_id"/>
<result property="goodstwotypeUrl" column="goodstwotype_url"/>
<result property="sort" column="sort"/>
</resultMap>
<resultMap type="com.platform.entity.merge.GoodsTypeToGoodsTwo" id="GoodsToTwo">
......@@ -16,6 +17,7 @@
<result property="goodstypeId" column="goodstype_id"/>
<result property="goodstypeTitle" column="goodstype_title"/>
<result property="goodstwotypeUrl" column="goodstwotype_url"/>
<result property="sort" column="sort"/>
</resultMap>
<select id="queryGoodsTypeId" resultMap="GoodsToTwo">
......@@ -23,6 +25,7 @@
tw.`goodstwotype_id`,
tw.`goodstwotype_title`,
tw.`goodstwotype_url`,
tw.sort,
ds.`goodstype_id`,
ds.`goodstype_title`
FROM tb_cf_goodstwotype tw
......@@ -42,7 +45,8 @@
`goodstwotype_id`,
`goodstwotype_title`,
`goodstwotype_url`,
`goodstype_id`
`goodstype_id`,
sort
from tb_cf_goodstwotype
WHERE goodstype_id= #{id}
</select>
......@@ -52,7 +56,8 @@
`goodstwotype_id`,
`goodstwotype_title`,
`goodstype_id`,
`goodstwotype_url`
`goodstwotype_url`,
sort
from tb_cf_goodstwotype
where goodstwotype_id = #{id}
</select>
......@@ -62,17 +67,22 @@
tw.`goodstwotype_id`,
tw.`goodstwotype_title`,
tw.`goodstwotype_url`,
tw.sort,
ds.`goodstype_id`,
ds.`goodstype_title`,
IFNULL(t.count,0) count
IFNULL(t.count,0) count
FROM
tb_cf_goodstwotype tw
left JOIN tb_cf_goodstype ds ON ds.goodstype_id = tw.goodstype_id
left JOIN ( SELECT count( * ) count, c.item_categorytwo FROM tb_cf_station_item c where c.enable_flag!=0 GROUP BY item_categorytwo ) t ON tw.goodstwotype_id = t.item_categorytwo
left JOIN ( SELECT count( * ) count, c.item_categorytwo FROM tb_cf_station_item c where c.enable_flag!=0 GROUP
BY item_categorytwo ) t ON tw.goodstwotype_id = t.item_categorytwo
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND goodstwotype_title LIKE concat('%',#{name},'%')
</if>
<if test="category != null and category.trim() != ''">
AND tw.goodstype_id=#{category}
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
......@@ -99,20 +109,24 @@
`goodstwotype_id`,
`goodstwotype_title`,
`goodstype_id`,
`goodstwotype_url`)
`goodstwotype_url`,
sort)
values(
#{goodstwotypeId},
#{goodstwotypeTitle},
#{goodstypeId},
#{goodstwotypeUrl})
#{goodstwotypeUrl},
#{sort}
)
</insert>
<update id="update" parameterType="com.platform.entity.TbCfGoodstwotypeEntity">
update tb_cf_goodstwotype
<set>
<if test="goodstwotypeTitle != null">`goodstwotype_title` = #{goodstwotypeTitle}, </if>
<if test="goodstypeId != null">`goodstype_id` = #{goodstypeId}, </if>
<if test="goodstwotypeUrl != null">`goodstwotype_url` = #{goodstwotypeUrl}</if>
<if test="goodstwotypeTitle != null">`goodstwotype_title` = #{goodstwotypeTitle},</if>
<if test="goodstypeId != null">`goodstype_id` = #{goodstypeId},</if>
<if test="goodstwotypeUrl != null">`goodstwotype_url` = #{goodstwotypeUrl},</if>
<if test="sort != null">`sort` = #{sort}</if>
</set>
where goodstwotype_id = #{goodstwotypeId}
</update>
......
......@@ -4,9 +4,10 @@
<title></title>
#parse("sys/header.html")
<style>
.ui-jqgrid .ui-jqgrid-bdiv{
height:auto!important;
.ui-jqgrid .ui-jqgrid-bdiv {
height: auto !important;
}
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
border-top: 2px solid #e7eaec;
line-height: 1.38857;
......@@ -17,12 +18,25 @@
</head>
<body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;">
<div v-show="showList" style="height: 100%;">
<Row :gutter="16">
<div class="search-group">
<i-col span="4">
<i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
</i-col>
<span style="margin-left: 30px">
二级分类名称:
<i-input v-model="q.name" @on-enter="query" placeholder="名称" style="width:160px"/>
</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span>
一级分类:
<i-select v-model="q.category" @on-enter="query"
placeholder="一级分类" style="width:160px">
<i-option v-for="(el,i) in Goodstype" :key='i'
:value="el.goodstypeId">{{el.goodstypeTitle}}
</i-option>
</i-select>
</span>
<i-button @click="query">查询</i-button>
<i-button @click="reloadSearch">重置</i-button>
</div>
......@@ -39,17 +53,18 @@
</div>
</Row>
<div id="speedp"></div>
<table id="jqGrid"></table>
<table id="jqGrid"></table>
</div>
<Card v-show="!showList">
<p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfGoodstwotype" :rules="ruleValidate" :label-width="80">
<i-form ref="formValidate" :model="tbCfGoodstwotype" :rules="ruleValidate" :label-width="80">
<Form-item label="商品一级分类" prop="goodstypeId">
<i-select placeholder="请选择" v-model="tbCfGoodstwotype.goodstypeId">
<i-select placeholder="请选择" v-model="tbCfGoodstwotype.goodstypeId">
<i-option
v-for="(el,i) in Goodstype" :key = 'i'
:value="el.goodstypeId">{{el.goodstypeTitle}}</i-option>
v-for="(el,i) in Goodstype" :key='i'
:value="el.goodstypeId">{{el.goodstypeTitle}}
</i-option>
</i-select>
</Form-item>
......@@ -60,15 +75,19 @@
<Form-item label="商品二级分类标题" prop="goodstwotypeTitle">
<i-input v-model="tbCfGoodstwotype.goodstwotypeTitle" placeholder="商品二级分类标题"/>
</Form-item>
<Form-item label="排序" prop="sort">
<i-input v-model="tbCfGoodstwotype.sort" placeholder="排序"/>
</Form-item>
<Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>
返回</i-button>
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item>
</i-form>
</Card>
</Card>
</div>
<script src="${rc.contextPath}/js/sys/tbcfgoodstwotype.js?_${date.systemTime}"></script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -6,7 +6,9 @@ $(function () {
{label: '商品一级分类', name: 'goodstypeTitle', index: 'goodstype_title', width: 80},
{label: '商品二级分类', name: 'goodstwotypeTitle', index: 'goodstwotype_title', width: 80},
{label: '二级分类图片', name: 'goodstwotypeUrl', index: 'goodstwotype_url', width: 80, formatter: imageFormat},
{label: '商品数量', name: 'count', index: 'count', width: 80}],
{label: '商品数量', name: 'count', index: 'count', width: 80},
{label: '排序', name: 'sort', index: 'sort', width: 80}
],
shrinkToFit: true,
datatype: "json",
rowNum: 15,
......@@ -18,7 +20,9 @@ $(function () {
pager: '#speedp',
sortname: 'goodstwotype_id',
viewrecords: true,
sortorder: "asc"
sortorder: "asc",
});
});
......@@ -28,14 +32,15 @@ let vm = new Vue({
showList: true,
title: null,
tbCfGoodstwotype: {},
Goodstype: null,
Goodstype: [],
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
name: '',
category: ''
}
},
methods: {
......@@ -104,7 +109,7 @@ let vm = new Vue({
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
postData: {'name': vm.q.name, 'category': vm.q.category},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
......@@ -138,7 +143,8 @@ let vm = new Vue({
},
reloadSearch: function () {
vm.q = {
name: ''
name: '',
category: ''
};
vm.reload();
},
......@@ -158,5 +164,6 @@ let vm = new Vue({
that.Goodstype = res.list;
// console.log(that.Goodstype);
})
}
});
\ No newline at end of file
});
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论