给库存报表增加排序
This commit is contained in:
@@ -535,6 +535,8 @@ public class MaterialController {
|
|||||||
* @param categoryId
|
* @param categoryId
|
||||||
* @param materialParam
|
* @param materialParam
|
||||||
* @param mpList
|
* @param mpList
|
||||||
|
* @param column
|
||||||
|
* @param order
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
@@ -546,6 +548,8 @@ public class MaterialController {
|
|||||||
@RequestParam("categoryId") Long categoryId,
|
@RequestParam("categoryId") Long categoryId,
|
||||||
@RequestParam("materialParam") String materialParam,
|
@RequestParam("materialParam") String materialParam,
|
||||||
@RequestParam("mpList") String mpList,
|
@RequestParam("mpList") String mpList,
|
||||||
|
@RequestParam("column") String column,
|
||||||
|
@RequestParam("order") String order,
|
||||||
HttpServletRequest request)throws Exception {
|
HttpServletRequest request)throws Exception {
|
||||||
BaseResponseInfo res = new BaseResponseInfo();
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
@@ -555,7 +559,7 @@ public class MaterialController {
|
|||||||
idList = materialService.getListByParentId(categoryId);
|
idList = materialService.getListByParentId(categoryId);
|
||||||
}
|
}
|
||||||
List<MaterialVo4Unit> dataList = materialService.getListWithStock(depotId, idList, StringUtil.toNull(materialParam),
|
List<MaterialVo4Unit> dataList = materialService.getListWithStock(depotId, idList, StringUtil.toNull(materialParam),
|
||||||
(currentPage-1)*pageSize, pageSize);
|
column, order, (currentPage-1)*pageSize, pageSize);
|
||||||
int total = materialService.getListWithStockCount(depotId, idList, StringUtil.toNull(materialParam));
|
int total = materialService.getListWithStockCount(depotId, idList, StringUtil.toNull(materialParam));
|
||||||
MaterialVo4Unit materialVo4Unit= materialService.getTotalStockAndPrice(depotId, idList, StringUtil.toNull(materialParam));
|
MaterialVo4Unit materialVo4Unit= materialService.getTotalStockAndPrice(depotId, idList, StringUtil.toNull(materialParam));
|
||||||
map.put("total", total);
|
map.put("total", total);
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ public interface MaterialMapperEx {
|
|||||||
@Param("depotId") Long depotId,
|
@Param("depotId") Long depotId,
|
||||||
@Param("idList") List<Long> idList,
|
@Param("idList") List<Long> idList,
|
||||||
@Param("materialParam") String materialParam,
|
@Param("materialParam") String materialParam,
|
||||||
|
@Param("column") String column,
|
||||||
|
@Param("order") String order,
|
||||||
@Param("offset") Integer offset,
|
@Param("offset") Integer offset,
|
||||||
@Param("rows") Integer rows);
|
@Param("rows") Integer rows);
|
||||||
|
|
||||||
|
|||||||
@@ -818,8 +818,9 @@ public class MaterialService {
|
|||||||
return materialMapperEx.getMaterialByBarCode(barCodeArray);
|
return materialMapperEx.getMaterialByBarCode(barCodeArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MaterialVo4Unit> getListWithStock(Long depotId, List<Long> idList, String materialParam, Integer offset, Integer rows) {
|
public List<MaterialVo4Unit> getListWithStock(Long depotId, List<Long> idList, String materialParam,
|
||||||
return materialMapperEx.getListWithStock(depotId, idList, materialParam, offset, rows);
|
String column, String order, Integer offset, Integer rows) {
|
||||||
|
return materialMapperEx.getListWithStock(depotId, idList, materialParam, column, order, offset, rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getListWithStockCount(Long depotId, List<Long> idList, String materialParam) {
|
public int getListWithStockCount(Long depotId, List<Long> idList, String materialParam) {
|
||||||
|
|||||||
@@ -367,7 +367,12 @@
|
|||||||
</if>
|
</if>
|
||||||
and ifnull(m.delete_flag,'0') !='1'
|
and ifnull(m.delete_flag,'0') !='1'
|
||||||
group by m.id
|
group by m.id
|
||||||
order by m.id desc
|
<if test="column == 'createTime'">
|
||||||
|
order by m.id desc
|
||||||
|
</if>
|
||||||
|
<if test="column != 'createTime'">
|
||||||
|
order by ${column} ${order}
|
||||||
|
</if>
|
||||||
<if test="offset != null and rows != null">
|
<if test="offset != null and rows != null">
|
||||||
limit #{offset},#{rows}
|
limit #{offset},#{rows}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user