Authored by Lixiaodi

增加sku 商品编码查询

... ... @@ -23,6 +23,8 @@ public interface ProductMapper {
@Param("midSortId") Integer midSortId,
@Param("brandId") Integer brandId,
@Param("shelveStatus") Integer shelveStatus,
@Param("storageId") Integer storageId,
@Param("productCode") String productCode,
@Param("start") Integer start,
@Param("rows") Integer rows);
... ... @@ -31,7 +33,9 @@ public interface ProductMapper {
@Param("maxSortId") Integer maxSortId,
@Param("midSortId") Integer midSortId,
@Param("brandId") Integer brandId,
@Param("shelveStatus") Integer shelveStatus);
@Param("shelveStatus") Integer shelveStatus,
@Param("storageId") Integer storageId,
@Param("productCode") String productCode);
List<Product> selectSkuPage(@Param("productCode") String productCode,
@Param("productName") String productName,
... ...
... ... @@ -104,6 +104,13 @@
<if test="shelveStatus != null and shelveStatus > -1">
and shelve_status = #{shelveStatus}
</if>
<if test="productCode != null and productCode != ''">
and product_code like concat(concat('%',#{productCode}),'%')
</if>
<if test="storageId != null and storageId > 0">
and id in (select product_id from storage where id = #{storageId})
</if>
</sql>
<select id="selectSkuPage" resultMap="BaseResultMap">
... ...
... ... @@ -319,7 +319,9 @@ public static void main(String[] args) {
bo.getMaxSortId(),
bo.getMidSortId(),
bo.getBrandId(),
bo.getShelveStatus());
bo.getShelveStatus(),
bo.getStorageId(),
bo.getProductCode());
List<ProductResponceBo> boList = new ArrayList<>();
if (count > 0) {
List<Product> productList = productMapper.selectPage(bo.getId(),
... ... @@ -328,6 +330,8 @@ public static void main(String[] args) {
bo.getMidSortId(),
bo.getBrandId(),
bo.getShelveStatus(),
bo.getStorageId(),
bo.getProductCode(),
bo.getStartIndex(),
bo.getRows());
productList.forEach(p -> {
... ...
... ... @@ -20,6 +20,8 @@
<input id="maxSortId" type="text"/>
<input id="midSortId" type="text"/>
<input id="brandId" type="text"/>
<input id="productCode" type="text"/>
<input id="storageId" type="text"/>
<input id="shelveStatus" type="text"/>
</div>
<div style="margin: 10px 0 0 30px;" class="div_search">
... ... @@ -42,6 +44,13 @@
$("#productName").textbox({
prompt: "商品名称"
});
$("#productCode").textbox({
prompt: "商品编号"
});
$("#storageId").textbox({
prompt: "SKU"
});
var sortComboboxUrl = contextPath + "/productSort/getLevel1SortIdAndName?";
$('#maxSortId').myCombobox({
url: sortComboboxUrl + "0",
... ... @@ -141,6 +150,11 @@
width: 80,
align: "center",
}, {
title: "商品编号",
field: "productCode",
width: 100,
align: "center",
}, {
title: "商品状态",
field: "shelveStatus",
width: 170,
... ... @@ -211,6 +225,8 @@
param.midSortId = $('#midSortId').combobox('getValue');
param.brandId = $('#brandId').combobox('getValue');
param.shelveStatus = $('#shelveStatus').combobox('getValue');
param.productCode = $('#productCode').textbox('getText');
param.storageId = $('#storageId').textbox('getText');
$("#productTable").myDatagrid("load", param);
}
});
... ...