Commit baf116d4 authored by 季圣华's avatar 季圣华
Browse files

给商品查询接口增加扩展信息的查询

parent b00aa14c
......@@ -19,6 +19,7 @@ public interface MaterialMapperEx {
List<MaterialVo4Unit> selectByConditionMaterial(
@Param("materialParam") String materialParam,
@Param("color") String color,
@Param("materialOther") String materialOther,
@Param("weight") String weight,
@Param("expiryNum") String expiryNum,
@Param("enableSerialNumber") String enableSerialNumber,
......@@ -33,6 +34,7 @@ public interface MaterialMapperEx {
Long countsByMaterial(
@Param("materialParam") String materialParam,
@Param("color") String color,
@Param("materialOther") String materialOther,
@Param("weight") String weight,
@Param("expiryNum") String expiryNum,
@Param("enableSerialNumber") String enableSerialNumber,
......
......@@ -36,6 +36,7 @@ public class MaterialComponent implements ICommonQuery {
String categoryId = StringUtil.getInfo(search, "categoryId");
String materialParam = StringUtil.getInfo(search, "materialParam");
String color = StringUtil.getInfo(search, "color");
String materialOther = StringUtil.getInfo(search, "materialOther");
String weight = StringUtil.getInfo(search, "weight");
String expiryNum = StringUtil.getInfo(search, "expiryNum");
String enableSerialNumber = StringUtil.getInfo(search, "enableSerialNumber");
......@@ -43,7 +44,7 @@ public class MaterialComponent implements ICommonQuery {
String enabled = StringUtil.getInfo(search, "enabled");
String remark = StringUtil.getInfo(search, "remark");
String mpList = StringUtil.getInfo(search, "mpList");
return materialService.select(materialParam, color, weight, expiryNum,
return materialService.select(materialParam, color, materialOther, weight, expiryNum,
enableSerialNumber, enableBatchNumber, enabled, remark, categoryId, mpList, QueryUtils.offset(map), QueryUtils.rows(map));
}
......@@ -53,6 +54,7 @@ public class MaterialComponent implements ICommonQuery {
String categoryId = StringUtil.getInfo(search, "categoryId");
String materialParam = StringUtil.getInfo(search, "materialParam");
String color = StringUtil.getInfo(search, "color");
String materialOther = StringUtil.getInfo(search, "materialOther");
String weight = StringUtil.getInfo(search, "weight");
String expiryNum = StringUtil.getInfo(search, "expiryNum");
String enableSerialNumber = StringUtil.getInfo(search, "enableSerialNumber");
......@@ -60,7 +62,7 @@ public class MaterialComponent implements ICommonQuery {
String enabled = StringUtil.getInfo(search, "enabled");
String remark = StringUtil.getInfo(search, "remark");
String mpList = StringUtil.getInfo(search, "mpList");
return materialService.countMaterial(materialParam, color, weight, expiryNum,
return materialService.countMaterial(materialParam, color, materialOther, weight, expiryNum,
enableSerialNumber, enableBatchNumber, enabled, remark, categoryId, mpList);
}
......
......@@ -111,7 +111,7 @@ public class MaterialService {
return list;
}
public List<MaterialVo4Unit> select(String materialParam, String color, String weight, String expiryNum,
public List<MaterialVo4Unit> select(String materialParam, String color, String materialOther, String weight, String expiryNum,
String enableSerialNumber, String enableBatchNumber, String enabled,
String remark, String categoryId, String mpList, int offset, int rows)
throws Exception{
......@@ -126,7 +126,7 @@ public class MaterialService {
if(StringUtil.isNotEmpty(categoryId)){
idList = getListByParentId(Long.parseLong(categoryId));
}
list= materialMapperEx.selectByConditionMaterial(materialParam, color, weight, expiryNum,
list= materialMapperEx.selectByConditionMaterial(materialParam, color, materialOther, weight, expiryNum,
enableSerialNumber, enableBatchNumber, enabled, remark, idList, mpList, offset, rows);
if (null != list && list.size()>0) {
Map<Long,BigDecimal> currentStockMap = getCurrentStockMapByMaterialList(list);
......@@ -143,7 +143,7 @@ public class MaterialService {
return resList;
}
public Long countMaterial(String materialParam, String color, String weight, String expiryNum,
public Long countMaterial(String materialParam, String color, String materialOther, String weight, String expiryNum,
String enableSerialNumber, String enableBatchNumber, String enabled,
String remark, String categoryId,String mpList)throws Exception {
Long result =null;
......@@ -152,7 +152,7 @@ public class MaterialService {
if(StringUtil.isNotEmpty(categoryId)){
idList = getListByParentId(Long.parseLong(categoryId));
}
result= materialMapperEx.countsByMaterial(materialParam, color, weight, expiryNum,
result= materialMapperEx.countsByMaterial(materialParam, color, materialOther, weight, expiryNum,
enableSerialNumber, enableBatchNumber, enabled, remark, idList, mpList);
}catch(Exception e){
JshException.readFail(logger, e);
......
......@@ -51,6 +51,11 @@
<bind name="bindColor" value="'%'+color+'%'"/>
and m.color like #{bindColor}
</if>
<if test="materialOther != null and materialOther !=''">
<bind name="bindOther" value="'%'+materialOther+'%'"/>
and (m.mfrs like #{bindOther} or m.other_field1 like #{bindOther}
or m.other_field2 like #{bindOther} or m.other_field3 like #{bindOther})
</if>
<if test="weight != null and weight !=''">
and m.weight = #{weight}
</if>
......@@ -101,6 +106,11 @@
<bind name="bindColor" value="'%'+color+'%'"/>
and m.color like #{bindColor}
</if>
<if test="materialOther != null and materialOther !=''">
<bind name="bindOther" value="'%'+materialOther+'%'"/>
and (m.mfrs like #{bindOther} or m.other_field1 like #{bindOther}
or m.other_field2 like #{bindOther} or m.other_field3 like #{bindOther})
</if>
<if test="weight != null and weight !=''">
and m.weight = #{weight}
</if>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment