Authored by Lixiaodi

增加sku 商品编码查询

@@ -23,6 +23,8 @@ public interface ProductMapper { @@ -23,6 +23,8 @@ public interface ProductMapper {
23 @Param("midSortId") Integer midSortId, 23 @Param("midSortId") Integer midSortId,
24 @Param("brandId") Integer brandId, 24 @Param("brandId") Integer brandId,
25 @Param("shelveStatus") Integer shelveStatus, 25 @Param("shelveStatus") Integer shelveStatus,
  26 + @Param("storageId") Integer storageId,
  27 + @Param("productCode") String productCode,
26 @Param("start") Integer start, 28 @Param("start") Integer start,
27 @Param("rows") Integer rows); 29 @Param("rows") Integer rows);
28 30
@@ -31,7 +33,9 @@ public interface ProductMapper { @@ -31,7 +33,9 @@ public interface ProductMapper {
31 @Param("maxSortId") Integer maxSortId, 33 @Param("maxSortId") Integer maxSortId,
32 @Param("midSortId") Integer midSortId, 34 @Param("midSortId") Integer midSortId,
33 @Param("brandId") Integer brandId, 35 @Param("brandId") Integer brandId,
34 - @Param("shelveStatus") Integer shelveStatus); 36 + @Param("shelveStatus") Integer shelveStatus,
  37 + @Param("storageId") Integer storageId,
  38 + @Param("productCode") String productCode);
35 39
36 List<Product> selectSkuPage(@Param("productCode") String productCode, 40 List<Product> selectSkuPage(@Param("productCode") String productCode,
37 @Param("productName") String productName, 41 @Param("productName") String productName,
@@ -104,6 +104,13 @@ @@ -104,6 +104,13 @@
104 <if test="shelveStatus != null and shelveStatus > -1"> 104 <if test="shelveStatus != null and shelveStatus > -1">
105 and shelve_status = #{shelveStatus} 105 and shelve_status = #{shelveStatus}
106 </if> 106 </if>
  107 + <if test="productCode != null and productCode != ''">
  108 + and product_code like concat(concat('%',#{productCode}),'%')
  109 + </if>
  110 + <if test="storageId != null and storageId > 0">
  111 + and id in (select product_id from storage where id = #{storageId})
  112 + </if>
  113 +
107 </sql> 114 </sql>
108 115
109 <select id="selectSkuPage" resultMap="BaseResultMap"> 116 <select id="selectSkuPage" resultMap="BaseResultMap">
@@ -319,7 +319,9 @@ public static void main(String[] args) { @@ -319,7 +319,9 @@ public static void main(String[] args) {
319 bo.getMaxSortId(), 319 bo.getMaxSortId(),
320 bo.getMidSortId(), 320 bo.getMidSortId(),
321 bo.getBrandId(), 321 bo.getBrandId(),
322 - bo.getShelveStatus()); 322 + bo.getShelveStatus(),
  323 + bo.getStorageId(),
  324 + bo.getProductCode());
323 List<ProductResponceBo> boList = new ArrayList<>(); 325 List<ProductResponceBo> boList = new ArrayList<>();
324 if (count > 0) { 326 if (count > 0) {
325 List<Product> productList = productMapper.selectPage(bo.getId(), 327 List<Product> productList = productMapper.selectPage(bo.getId(),
@@ -328,6 +330,8 @@ public static void main(String[] args) { @@ -328,6 +330,8 @@ public static void main(String[] args) {
328 bo.getMidSortId(), 330 bo.getMidSortId(),
329 bo.getBrandId(), 331 bo.getBrandId(),
330 bo.getShelveStatus(), 332 bo.getShelveStatus(),
  333 + bo.getStorageId(),
  334 + bo.getProductCode(),
331 bo.getStartIndex(), 335 bo.getStartIndex(),
332 bo.getRows()); 336 bo.getRows());
333 productList.forEach(p -> { 337 productList.forEach(p -> {
@@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
20 <input id="maxSortId" type="text"/> 20 <input id="maxSortId" type="text"/>
21 <input id="midSortId" type="text"/> 21 <input id="midSortId" type="text"/>
22 <input id="brandId" type="text"/> 22 <input id="brandId" type="text"/>
  23 + <input id="productCode" type="text"/>
  24 + <input id="storageId" type="text"/>
23 <input id="shelveStatus" type="text"/> 25 <input id="shelveStatus" type="text"/>
24 </div> 26 </div>
25 <div style="margin: 10px 0 0 30px;" class="div_search"> 27 <div style="margin: 10px 0 0 30px;" class="div_search">
@@ -42,6 +44,13 @@ @@ -42,6 +44,13 @@
42 $("#productName").textbox({ 44 $("#productName").textbox({
43 prompt: "商品名称" 45 prompt: "商品名称"
44 }); 46 });
  47 + $("#productCode").textbox({
  48 + prompt: "商品编号"
  49 + });
  50 + $("#storageId").textbox({
  51 + prompt: "SKU"
  52 + });
  53 +
45 var sortComboboxUrl = contextPath + "/productSort/getLevel1SortIdAndName?"; 54 var sortComboboxUrl = contextPath + "/productSort/getLevel1SortIdAndName?";
46 $('#maxSortId').myCombobox({ 55 $('#maxSortId').myCombobox({
47 url: sortComboboxUrl + "0", 56 url: sortComboboxUrl + "0",
@@ -141,6 +150,11 @@ @@ -141,6 +150,11 @@
141 width: 80, 150 width: 80,
142 align: "center", 151 align: "center",
143 }, { 152 }, {
  153 + title: "商品编号",
  154 + field: "productCode",
  155 + width: 100,
  156 + align: "center",
  157 + }, {
144 title: "商品状态", 158 title: "商品状态",
145 field: "shelveStatus", 159 field: "shelveStatus",
146 width: 170, 160 width: 170,
@@ -211,6 +225,8 @@ @@ -211,6 +225,8 @@
211 param.midSortId = $('#midSortId').combobox('getValue'); 225 param.midSortId = $('#midSortId').combobox('getValue');
212 param.brandId = $('#brandId').combobox('getValue'); 226 param.brandId = $('#brandId').combobox('getValue');
213 param.shelveStatus = $('#shelveStatus').combobox('getValue'); 227 param.shelveStatus = $('#shelveStatus').combobox('getValue');
  228 + param.productCode = $('#productCode').textbox('getText');
  229 + param.storageId = $('#storageId').textbox('getText');
214 $("#productTable").myDatagrid("load", param); 230 $("#productTable").myDatagrid("load", param);
215 } 231 }
216 }); 232 });