给多属性接口增加属性值的查询条件
This commit is contained in:
@@ -55,7 +55,8 @@ public class MaterialAttributeController extends BaseController {
|
|||||||
public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search,
|
public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search,
|
||||||
HttpServletRequest request)throws Exception {
|
HttpServletRequest request)throws Exception {
|
||||||
String attributeName = StringUtil.getInfo(search, "attributeName");
|
String attributeName = StringUtil.getInfo(search, "attributeName");
|
||||||
List<MaterialAttribute> list = materialAttributeService.select(attributeName);
|
String attributeValue = StringUtil.getInfo(search, "attributeValue");
|
||||||
|
List<MaterialAttribute> list = materialAttributeService.select(attributeName, attributeValue);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import java.util.List;
|
|||||||
public interface MaterialAttributeMapperEx {
|
public interface MaterialAttributeMapperEx {
|
||||||
|
|
||||||
List<MaterialAttribute> selectByConditionMaterialAttribute(
|
List<MaterialAttribute> selectByConditionMaterialAttribute(
|
||||||
@Param("attributeName") String attributeName);
|
@Param("attributeName") String attributeName,
|
||||||
|
@Param("attributeValue") String attributeValue);
|
||||||
|
|
||||||
int batchDeleteMaterialAttributeByIds(
|
int batchDeleteMaterialAttributeByIds(
|
||||||
@Param("ids") String ids[]);
|
@Param("ids") String ids[]);
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ public class MaterialAttributeService {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MaterialAttribute> select(String attributeName) throws Exception{
|
public List<MaterialAttribute> select(String attributeName, String attributeValue) throws Exception{
|
||||||
List<MaterialAttribute> list = new ArrayList<>();
|
List<MaterialAttribute> list = new ArrayList<>();
|
||||||
try{
|
try{
|
||||||
PageUtils.startPage();
|
PageUtils.startPage();
|
||||||
list = materialAttributeMapperEx.selectByConditionMaterialAttribute(attributeName);
|
list = materialAttributeMapperEx.selectByConditionMaterialAttribute(attributeName, attributeValue);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
<bind name="bindAttributeName" value="'%'+attributeName+'%'"/>
|
<bind name="bindAttributeName" value="'%'+attributeName+'%'"/>
|
||||||
and ma.attribute_name like #{bindAttributeName}
|
and ma.attribute_name like #{bindAttributeName}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="attributeValue != null">
|
||||||
|
<bind name="bindAttributeValue" value="'%'+attributeValue+'%'"/>
|
||||||
|
and ma.attribute_value like #{bindAttributeValue}
|
||||||
|
</if>
|
||||||
and ifnull(ma.delete_flag,'0') !='1'
|
and ifnull(ma.delete_flag,'0') !='1'
|
||||||
order by ma.id desc
|
order by ma.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user