后端:
多个 Controller 中对状态判断使用了安全的 Convert.toInt(..., 0)(带默认值),避免空值拆箱导致 NPE:修改点包括 CheckStockinController、CheckStockinDetailController、InStockinController、InStockinDetailController、ReceiveStockinController、ReceiveStockinDetailController 等。 实体 InStockinDetail 新增字段:productName(物料名称)和 supplierName(供应商名称),并加了 @Excel 注解以支持导出/映射。 前端(Vue): 把“常用编码”改名为“产品分类”,同时把某些列/占位文本更新为“价格”或“产品分类”。 在多个视图中注释或调整了部分列(如来源/台次/创建时间等),以隐藏或调整显示。 优化了“入库新增”页面中的供应商选择流程:修复分页回调(对话框分页现在调用 getSupplierListForDialog),为供应商表格添加了双击快速确认事件 @row-dblclick,并在 handleSupplierRowClick / handleSupplierRowDblClick / confirmSelectSupplier 中加入了 console.log 调试输出与防护($refs 判空)。 其他小修订: 在 BasProduct 中把 @Excel(name = "常用编码") 改为 @Excel(name = "产品分类"),并把 “单价” 注解改为 @Excel(name="价格")。 调整一些表格列的注释与显示,以改进 UX 或临时隐藏列。
This commit is contained in:
@@ -458,7 +458,7 @@ public class ToErpServiceImpl implements IToErpService {
|
||||
* 入库单据 -> 请求入库单列表
|
||||
* @return
|
||||
*/
|
||||
@Scheduled(fixedDelay = 600_000)
|
||||
// @Scheduled(fixedDelay = 600_000)
|
||||
public AjaxResult getErpStockinList(){
|
||||
|
||||
ErpStockinParam erpStockinParam = new ErpStockinParam();
|
||||
|
||||
@@ -139,16 +139,19 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
mydoJobService.getInJobId(map);//存储过程【util_serial_job】生成作业号
|
||||
mydoJob.setJobId(map.get("v_serial"));
|
||||
mydoJob.setCargoSpaceId(cargoSpaceId);
|
||||
mydoJob.setStatus("3");
|
||||
mydoJob.setInOrOut("1");
|
||||
mydoJob.setTrayCode(requestEnter.getTrayCode());
|
||||
|
||||
|
||||
// HashMap<String, String> result = new HashMap<>();
|
||||
// result.put("cargoSpaceId",cargoSpaceId);
|
||||
map.put("v_param", "1");
|
||||
mydoJobService.getInTask(map);
|
||||
mydoJob.setTaskNo(map.get("v_serial"));
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(cargoSpaceId);
|
||||
mydoJob.setRoadwayId(basCargoSpace.getTheFloor().toString());
|
||||
mydoJob.setCreateTime(new Date());
|
||||
mydoJobService.insertMydoJob(mydoJob);
|
||||
|
||||
return AjaxResult.success(mydoJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* requestEnterByTrayCode -> 入库货位分配
|
||||
* 入库任务请求根据托盘码 -> 向子单明细分配入库货位
|
||||
@@ -157,10 +160,8 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
* @return
|
||||
*/
|
||||
public String getCargoSpaceByProductInfo(String productId){
|
||||
|
||||
//>>>>>>>>>>>>>>获取物料库存信息 -> 有库存 -> 货位(cargospace) -> 存储区组(groupCodingNo) -> 根据groupCoding(由高到低) -> 获取状态1的货位分配
|
||||
//>>>>>>>>>>>>>>获取物料库存信息 -> 无库存 -> 遍历存储区组(groupCodingNo) -> 查找全部货位空的区组 -> 根据groupCoding(由高到低) -> 获取状态1的货位分配
|
||||
|
||||
try {
|
||||
//获取物料的货位集合 - 首先查找已经存放该物料的存储区
|
||||
List<BasStock> stocks = basStockService.selectBasStockListByProductId(productId);
|
||||
@@ -215,7 +216,6 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
}catch(Exception e){
|
||||
log.error("入库子单获取目标货位失败,异常信息:" + e.getMessage());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ public interface MydoJobMapper
|
||||
|
||||
public void getInJobId(HashMap<String, String> map);
|
||||
|
||||
|
||||
public void getInTask(HashMap<String, String> map);
|
||||
/**
|
||||
* 修改任务表
|
||||
*
|
||||
|
||||
@@ -39,6 +39,9 @@ public interface IMydoJobService
|
||||
|
||||
public void getInJobId(HashMap<String, String> map);
|
||||
|
||||
public void getInTask(HashMap<String, String> map);
|
||||
|
||||
|
||||
/**
|
||||
* 新增任务表
|
||||
*
|
||||
|
||||
@@ -123,6 +123,11 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
mydoJobMapper.getInJobId(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getInTask(HashMap<String, String> map){
|
||||
mydoJobMapper.getInTask(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务表
|
||||
*
|
||||
@@ -131,9 +136,7 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
*/
|
||||
@Override
|
||||
public int insertMydoJob(MydoJob mydoJob) {
|
||||
mydoJob.setCreateTime(new Date());
|
||||
mydoJob.setJobId(basJobIdService.getJobId("RK"));
|
||||
mydoJob.setTaskNo(Convert.toStr(basTaskNoService.getTaskNo("1")));
|
||||
|
||||
return mydoJobMapper.insertMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,36 +63,5 @@ public class StockSummaryController extends BaseController
|
||||
return success(stockSummaryService.selectStockSummaryByOnlyIdentity(onlyIdentity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存汇总
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('search:StockSummary:add')")
|
||||
@Log(title = "库存汇总", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody StockSummary stockSummary)
|
||||
{
|
||||
return toAjax(stockSummaryService.insertStockSummary(stockSummary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存汇总
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('search:StockSummary:edit')")
|
||||
@Log(title = "库存汇总", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody StockSummary stockSummary)
|
||||
{
|
||||
return toAjax(stockSummaryService.updateStockSummary(stockSummary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库存汇总
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('search:StockSummary:remove')")
|
||||
@Log(title = "库存汇总", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{onlyIdentitys}")
|
||||
public AjaxResult remove(@PathVariable Long[] onlyIdentitys)
|
||||
{
|
||||
return toAjax(stockSummaryService.deleteStockSummaryByOnlyIdentitys(onlyIdentitys));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,277 +22,104 @@ public class StockSummary extends BaseEntity
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 序号 */
|
||||
// @Excel(name = "序号")
|
||||
private Long onlyIdentity;
|
||||
|
||||
@Excel(name = "订单号")
|
||||
private String orderId;
|
||||
/** 物料编码 */
|
||||
/** 库存ID */
|
||||
@Excel(name = "库存编码")
|
||||
private String stockId;
|
||||
|
||||
/** 产品ID */
|
||||
@Excel(name = "物料编码")
|
||||
private String productId;
|
||||
|
||||
/** 物料名称 */
|
||||
/** 产品名称 */
|
||||
@Excel(name = "物料名称")
|
||||
private String productName;
|
||||
|
||||
/** 规格 */
|
||||
@Excel(name = "规格")
|
||||
private String spec;
|
||||
/** 货位ID */
|
||||
@Excel(name = "货位ID")
|
||||
private String cargoSpaceId;
|
||||
|
||||
/** 单位 */
|
||||
// @Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
/** 批号 */
|
||||
@Excel(name = "批号")
|
||||
private String lotNo;
|
||||
|
||||
/** 仓库 */
|
||||
private String warehouseId;
|
||||
// @Excel(name = "仓库")
|
||||
private String warehouseName;
|
||||
|
||||
@Excel(name = "货位")
|
||||
private String cargoSpaceName;
|
||||
|
||||
/** 巷道 */
|
||||
@Excel(name = "巷道")
|
||||
private String roadwayId;
|
||||
|
||||
/** 库存数量 */
|
||||
/** 数量 */
|
||||
@Excel(name = "库存数量")
|
||||
private Double quantity;
|
||||
|
||||
|
||||
/** 价格 */
|
||||
// @Excel(name = "价格")
|
||||
private String price;
|
||||
private java.math.BigDecimal quantity;
|
||||
|
||||
/** 产品分类 */
|
||||
@Excel(name = "产品分类")
|
||||
private String parentId;
|
||||
|
||||
/** 英文描述 */
|
||||
@Excel(name = "英文描述")
|
||||
/** 价格 */
|
||||
@Excel(name = "价格")
|
||||
private java.math.BigDecimal price;
|
||||
|
||||
/** 产品编码 */
|
||||
@Excel(name = "产品编码")
|
||||
private String cargoNo;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
/** 型号 */
|
||||
@Excel(name = "型号")
|
||||
private String spec;
|
||||
|
||||
/** 单位名称 */
|
||||
@Excel(name = "单位名称")
|
||||
private String spare1;
|
||||
|
||||
/** 单件净重 */
|
||||
@Excel(name = "单件净重")
|
||||
private String spare2;
|
||||
|
||||
/** 颜色 */
|
||||
@Excel(name = "颜色")
|
||||
/** url */
|
||||
@Excel(name = "url")
|
||||
private String spare3;
|
||||
|
||||
/** 序列号 */
|
||||
@Excel(name = "序列号")
|
||||
/** btnurl */
|
||||
@Excel(name = "btnurl")
|
||||
private String spare4;
|
||||
|
||||
/** 电压 */
|
||||
@Excel(name = "电压")
|
||||
/** unitPrices */
|
||||
@Excel(name = "unitPrices")
|
||||
private String spare5;
|
||||
|
||||
/** 功率 */
|
||||
@Excel(name = "功率")
|
||||
/** units */
|
||||
@Excel(name = "units")
|
||||
private String spare6;
|
||||
|
||||
/** 相位 */
|
||||
@Excel(name = "相位")
|
||||
/** unitjb */
|
||||
@Excel(name = "unitjb")
|
||||
private String spare7;
|
||||
|
||||
/** 毛重 */
|
||||
@Excel(name = "毛重")
|
||||
private String spare8;
|
||||
|
||||
/** NC号 */
|
||||
@Excel(name = "NC号")
|
||||
private String spare9;
|
||||
|
||||
/** 电源线 */
|
||||
@Excel(name = "电源线")
|
||||
private String spare10;
|
||||
|
||||
/** 插头 */
|
||||
@Excel(name = "插头")
|
||||
private String spare11;
|
||||
|
||||
/** 接嘴 */
|
||||
@Excel(name = "接嘴")
|
||||
private String spare12;
|
||||
|
||||
/** 快捷码 */
|
||||
@Excel(name = "快捷码")
|
||||
private String spare13;
|
||||
|
||||
/** 库存单位编号 */
|
||||
@Excel(name = "库存单位编号")
|
||||
private String spare14;
|
||||
|
||||
/** 库存单位名称 */
|
||||
@Excel(name = "库存单位名称")
|
||||
private String spare15;
|
||||
|
||||
/** 品号群组 */
|
||||
@Excel(name = "品号群组")
|
||||
private String spare16;
|
||||
|
||||
/** 归类品 */
|
||||
@Excel(name = "归类品")
|
||||
private String spare17;
|
||||
|
||||
/** 计量体系 */
|
||||
@Excel(name = "计量体系")
|
||||
private String spare18;
|
||||
|
||||
/** 群组名称 */
|
||||
@Excel(name = "群组名称")
|
||||
private String spare19;
|
||||
|
||||
/** 批号管理 */
|
||||
@Excel(name = "批号管理")
|
||||
private String spare20;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String spare21;
|
||||
|
||||
/** 产品大类 */
|
||||
@Excel(name = "产品大类")
|
||||
private String spare22;
|
||||
|
||||
/** 产品二类 */
|
||||
@Excel(name = "产品二类")
|
||||
private String spare23;
|
||||
|
||||
/** 产品线/产品系列(组码) */
|
||||
@Excel(name = "产品线/产品系列")
|
||||
private String spare24;
|
||||
|
||||
/** BOM状态(组码) */
|
||||
@Excel(name = "BOM状态")
|
||||
private String spare25;
|
||||
|
||||
/** 产品定位(组码) */
|
||||
@Excel(name = "产品定位")
|
||||
private String spare26;
|
||||
|
||||
/** 电脑板型号(组码) */
|
||||
@Excel(name = "电脑板型号")
|
||||
private String spare27;
|
||||
|
||||
/** 非标要求 */
|
||||
@Excel(name = "非标要求")
|
||||
private String spare28;
|
||||
|
||||
/** 品牌(组码) */
|
||||
@Excel(name = "品牌")
|
||||
private String spare29;
|
||||
|
||||
/** 非标颜色 */
|
||||
@Excel(name = "非标颜色")
|
||||
private String spare30;
|
||||
|
||||
/** 主颜色 */
|
||||
@Excel(name = "主颜色")
|
||||
private String spare31;
|
||||
|
||||
/** 辅助颜色 */
|
||||
@Excel(name = "辅助颜色")
|
||||
private String spare32;
|
||||
|
||||
/** 是否标准款(组码) */
|
||||
@Excel(name = "是否标准款")
|
||||
private String spare33;
|
||||
|
||||
/** 包装方式 */
|
||||
@Excel(name = "包装方式")
|
||||
private String spare34;
|
||||
|
||||
/** 主要包装方式 */
|
||||
@Excel(name = "主要包装方式")
|
||||
private String spare35;
|
||||
|
||||
/** 长 */
|
||||
@Excel(name = "长")
|
||||
private String spare36;
|
||||
|
||||
/** 宽 */
|
||||
@Excel(name = "宽")
|
||||
private String spare37;
|
||||
|
||||
/** 高 */
|
||||
@Excel(name = "高")
|
||||
private String spare38;
|
||||
|
||||
/** 包装材积 */
|
||||
@Excel(name = "包装材积")
|
||||
private String spare39;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
private String cargoSpaceId;
|
||||
|
||||
/** 货位名称 */
|
||||
@Excel(name = "货位名称")
|
||||
private String cargoSpaceName;
|
||||
|
||||
/** 货位状态 */
|
||||
@Excel(name = "货位状态",dictType = "cargo_space_status")
|
||||
private String status;
|
||||
|
||||
/** 货位锁 */
|
||||
@Excel(name = "货位锁",dictType = "cargo_space_lock_status")
|
||||
private String locked;
|
||||
|
||||
|
||||
/** 分组字段控制 */
|
||||
// private Boolean groupByStockId;
|
||||
private Boolean groupByCargoSpaceId;
|
||||
private Boolean groupByProductId;
|
||||
private Boolean groupByProductName;
|
||||
private Boolean groupByOrderId;
|
||||
private Boolean groupBySpec;
|
||||
private Boolean groupByUnit;
|
||||
private Boolean groupByLotNo;
|
||||
private Boolean groupByWarehouseId;
|
||||
private Boolean groupByRoadwayId;
|
||||
private Boolean groupByPrice;
|
||||
private Boolean groupByParentId;
|
||||
private Boolean groupByCargoNo;
|
||||
private Boolean groupByPrice;
|
||||
private Boolean groupBycCargoNo;
|
||||
private Boolean groupByUnit;
|
||||
private Boolean groupBySpec;
|
||||
private Boolean groupBySpare1;
|
||||
private Boolean groupBySpare2;
|
||||
private Boolean groupBySpare3;
|
||||
private Boolean groupBySpare4;
|
||||
private Boolean groupBySpare5;
|
||||
private Boolean groupBySpare6;
|
||||
private Boolean groupBySpare7;
|
||||
private Boolean groupBySpare8;
|
||||
private Boolean groupBySpare9;
|
||||
private Boolean groupBySpare10;
|
||||
private Boolean groupBySpare11;
|
||||
private Boolean groupBySpare12;
|
||||
private Boolean groupBySpare13;
|
||||
private Boolean groupBySpare14;
|
||||
private Boolean groupBySpare15;
|
||||
private Boolean groupBySpare16;
|
||||
private Boolean groupBySpare17;
|
||||
private Boolean groupBySpare18;
|
||||
private Boolean groupBySpare19;
|
||||
private Boolean groupBySpare20;
|
||||
private Boolean groupBySpare21;
|
||||
private Boolean groupBySpare22;
|
||||
private Boolean groupBySpare23;
|
||||
private Boolean groupBySpare24;
|
||||
private Boolean groupBySpare25;
|
||||
private Boolean groupBySpare26;
|
||||
private Boolean groupBySpare27;
|
||||
private Boolean groupBySpare28;
|
||||
private Boolean groupBySpare29;
|
||||
private Boolean groupBySpare30;
|
||||
private Boolean groupBySpare31;
|
||||
private Boolean groupBySpare32;
|
||||
private Boolean groupBySpare33;
|
||||
private Boolean groupBySpare34;
|
||||
private Boolean groupBySpare35;
|
||||
private Boolean groupBySpare36;
|
||||
private Boolean groupBySpare37;
|
||||
private Boolean groupBySpare38;
|
||||
private Boolean groupBySpare39;
|
||||
private Boolean groupByCargoSpaceId;
|
||||
private Boolean groupByCargoSpaceName;
|
||||
private Boolean groupByStatus;
|
||||
private Boolean groupByLocked;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,35 +28,5 @@ public interface StockSummaryMapper
|
||||
*/
|
||||
public List<StockSummary> selectStockSummaryList(StockSummary stockSummary);
|
||||
|
||||
/**
|
||||
* 新增库存汇总
|
||||
*
|
||||
* @param stockSummary 库存汇总
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStockSummary(StockSummary stockSummary);
|
||||
|
||||
/**
|
||||
* 修改库存汇总
|
||||
*
|
||||
* @param stockSummary 库存汇总
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStockSummary(StockSummary stockSummary);
|
||||
|
||||
/**
|
||||
* 删除库存汇总
|
||||
*
|
||||
* @param onlyIdentity 库存汇总主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStockSummaryByOnlyIdentity(Long onlyIdentity);
|
||||
|
||||
/**
|
||||
* 批量删除库存汇总
|
||||
*
|
||||
* @param onlyIdentitys 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStockSummaryByOnlyIdentitys(Long[] onlyIdentitys);
|
||||
}
|
||||
|
||||
@@ -28,35 +28,5 @@ public interface IStockSummaryService
|
||||
*/
|
||||
public List<StockSummary> selectStockSummaryList(StockSummary stockSummary);
|
||||
|
||||
/**
|
||||
* 新增库存汇总
|
||||
*
|
||||
* @param stockSummary 库存汇总
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStockSummary(StockSummary stockSummary);
|
||||
|
||||
/**
|
||||
* 修改库存汇总
|
||||
*
|
||||
* @param stockSummary 库存汇总
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStockSummary(StockSummary stockSummary);
|
||||
|
||||
/**
|
||||
* 批量删除库存汇总
|
||||
*
|
||||
* @param onlyIdentitys 需要删除的库存汇总主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStockSummaryByOnlyIdentitys(Long[] onlyIdentitys);
|
||||
|
||||
/**
|
||||
* 删除库存汇总信息
|
||||
*
|
||||
* @param onlyIdentity 库存汇总主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStockSummaryByOnlyIdentity(Long onlyIdentity);
|
||||
}
|
||||
|
||||
@@ -46,51 +46,10 @@ public class StockSummaryServiceImpl implements IStockSummaryService
|
||||
return stockSummaryMapper.selectStockSummaryList(stockSummary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存汇总
|
||||
*
|
||||
* @param stockSummary 库存汇总
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertStockSummary(StockSummary stockSummary)
|
||||
{
|
||||
return stockSummaryMapper.insertStockSummary(stockSummary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存汇总
|
||||
*
|
||||
* @param stockSummary 库存汇总
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateStockSummary(StockSummary stockSummary)
|
||||
{
|
||||
return stockSummaryMapper.updateStockSummary(stockSummary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库存汇总
|
||||
*
|
||||
* @param onlyIdentitys 需要删除的库存汇总主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStockSummaryByOnlyIdentitys(Long[] onlyIdentitys)
|
||||
{
|
||||
return stockSummaryMapper.deleteStockSummaryByOnlyIdentitys(onlyIdentitys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库存汇总信息
|
||||
*
|
||||
* @param onlyIdentity 库存汇总主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStockSummaryByOnlyIdentity(Long onlyIdentity)
|
||||
{
|
||||
return stockSummaryMapper.deleteStockSummaryByOnlyIdentity(onlyIdentity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -113,6 +113,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
) }
|
||||
</select>
|
||||
|
||||
<select id="getInTask" statementType="CALLABLE" parameterType="java.util.Map">
|
||||
{ CALL util_serial_task(
|
||||
#{v_param,jdbcType=VARCHAR,mode=IN},
|
||||
#{v_serial,mode=OUT,jdbcType=VARCHAR}
|
||||
) }
|
||||
</select>
|
||||
|
||||
<insert id="insertMydoJob">
|
||||
insert into mydo_job
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
@@ -6,239 +6,144 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<resultMap type="StockSummary" id="StockSummaryResult">
|
||||
<result property="onlyIdentity" column="only_identity" />
|
||||
<result property="stockId" column="stock_id" />
|
||||
<result property="cargoSpaceId" column="cargo_space_id" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="spec" column="spec" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="lotNo" column="lot_no" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="price" column="price" />
|
||||
<result property="roadwayId" column="roadway_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="price" column="price" />
|
||||
<result property="cargoNo" column="cargo_no" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="spec" column="spec" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<result property="spare4" column="spare4" />
|
||||
<result property="spare5" column="spare5" />
|
||||
<result property="spare6" column="spare6" />
|
||||
<result property="spare7" column="spare7" />
|
||||
<result property="spare8" column="spare8" />
|
||||
<result property="spare9" column="spare9" />
|
||||
<result property="spare10" column="spare10" />
|
||||
<result property="spare11" column="spare11" />
|
||||
<result property="spare12" column="spare12" />
|
||||
<result property="spare13" column="spare13" />
|
||||
<result property="spare14" column="spare14" />
|
||||
<result property="spare15" column="spare15" />
|
||||
<result property="spare16" column="spare16" />
|
||||
<result property="spare17" column="spare17" />
|
||||
<result property="spare18" column="spare18" />
|
||||
<result property="spare19" column="spare19" />
|
||||
<result property="spare20" column="spare20" />
|
||||
<result property="spare21" column="spare21" />
|
||||
<result property="spare22" column="spare22" />
|
||||
<result property="spare23" column="spare23" />
|
||||
<result property="spare24" column="spare24" />
|
||||
<result property="spare25" column="spare25" />
|
||||
<result property="spare26" column="spare26" />
|
||||
<result property="spare27" column="spare27" />
|
||||
<result property="spare28" column="spare28" />
|
||||
<result property="spare29" column="spare29" />
|
||||
<result property="spare30" column="spare30" />
|
||||
<result property="spare31" column="spare31" />
|
||||
<result property="spare32" column="spare32" />
|
||||
<result property="spare33" column="spare33" />
|
||||
<result property="spare34" column="spare34" />
|
||||
<result property="spare35" column="spare35" />
|
||||
<result property="spare36" column="spare36" />
|
||||
<result property="spare37" column="spare37" />
|
||||
<result property="spare38" column="spare38" />
|
||||
<result property="spare39" column="spare39" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="cargoSpaceId" column="cargo_space_id" />
|
||||
<result property="cargoSpaceName" column="cargo_space_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="locked" column="locked" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStockSummaryVo">
|
||||
SELECT
|
||||
<choose>
|
||||
<when test="groupByProductId != null and groupByProductId or groupByProductName != null and groupByProductName or groupBySpec != null and groupBySpec or groupByUnit != null and groupByUnit or groupByLotNo != null and groupByLotNo or groupByWarehouseId != null and groupByWarehouseId or groupByCargoSpaceId != null and groupByCargoSpaceId or groupByPrice != null and groupByPrice or groupByParentId != null and groupByParentId or groupByCargoNo != null and groupByCargoNo or groupBySpare1 != null and groupBySpare1 or groupBySpare2 != null and groupBySpare2 or groupBySpare3 != null and groupBySpare3 or groupBySpare4 != null and groupBySpare4 or groupBySpare5 != null and groupBySpare5 or groupBySpare6 != null and groupBySpare6 or groupBySpare7 != null and groupBySpare7 or groupBySpare8 != null and groupBySpare8 or groupBySpare9 != null and groupBySpare9 or groupBySpare10 != null and groupBySpare10">
|
||||
<if test="groupByProductId != null and groupByProductId">p.product_id,</if>
|
||||
<if test="groupByProductName != null and groupByProductName">p.product_name,</if>
|
||||
<if test="groupByOrderId != null and groupByOrderId">s.order_id,</if>
|
||||
<if test="groupBySpec != null and groupBySpec">p.spec,</if>
|
||||
<if test="groupByUnit != null and groupByUnit">p.unit,</if>
|
||||
<if test="groupByPrice != null and groupByPrice">p.price,</if>
|
||||
<when test="groupByCargoSpaceId != null and groupByCargoSpaceId or groupByProductId != null and groupByProductId or groupByProductName != null and groupByProductName or groupByParentId != null and groupByParentId or groupByPrice != null and groupByPrice or groupBycCargoNo != null and groupBycCargoNo or groupByUnit != null and groupByUnit or groupBySpec != null and groupBySpec or groupBySpare1 != null and groupBySpare1 or groupBySpare3 != null and groupBySpare3 or groupBySpare4 != null and groupBySpare4 or groupBySpare5 != null and groupBySpare5 or groupBySpare6 != null and groupBySpare6 or groupBySpare7 != null and groupBySpare7 or groupByCargoSpaceName != null and groupByCargoSpaceName or groupByStatus != null and groupByStatus or groupByLocked != null and groupByLocked ">
|
||||
MIN(s.stock_id) as stock_id,
|
||||
<if test="groupByCargoSpaceId != null and groupByCargoSpaceId">s.cargo_space_id,</if>
|
||||
<if test="groupByProductId != null and groupByProductId">s.product_id,</if>
|
||||
<if test="groupByProductName != null and groupByProductName">s.product_name,</if>
|
||||
<if test="groupByParentId != null and groupByParentId">p.parent_id,</if>
|
||||
<if test="groupByCargoNo != null and groupByCargoNo">p.cargo_no,</if>
|
||||
<if test="groupByPrice != null and groupByPrice">p.price,</if>
|
||||
<if test="groupBycCargoNo != null and groupBycCargoNo">p.cargo_no,</if>
|
||||
<if test="groupByUnit != null and groupByUnit">p.unit,</if>
|
||||
<if test="groupBySpec != null and groupBySpec">p.spec,</if>
|
||||
<if test="groupBySpare1 != null and groupBySpare1">p.spare1,</if>
|
||||
<if test="groupBySpare2 != null and groupBySpare2">p.spare2,</if>
|
||||
<if test="groupBySpare3 != null and groupBySpare3">p.spare3,</if>
|
||||
<if test="groupBySpare4 != null and groupBySpare4">p.spare4,</if>
|
||||
<if test="groupBySpare5 != null and groupBySpare5">p.spare5,</if>
|
||||
<if test="groupBySpare6 != null and groupBySpare6">p.spare6,</if>
|
||||
<if test="groupBySpare7 != null and groupBySpare7">p.spare7,</if>
|
||||
<if test="groupBySpare8 != null and groupBySpare8">p.spare8,</if>
|
||||
<if test="groupBySpare9 != null and groupBySpare9">p.spare9,</if>
|
||||
<if test="groupBySpare10 != null and groupBySpare10">p.spare10,</if>
|
||||
<if test="groupByLotNo != null and groupByLotNo">s.lot_no,</if>
|
||||
<if test="groupByWarehouseId != null and groupByWarehouseId">s.warehouse_id,</if>
|
||||
<if test="groupByWarehouseId != null and groupByWarehouseId">bw.warehouse_name,</if>
|
||||
<if test="groupByCargoSpaceId != null and groupByCargoSpaceId">s.cargo_space_id,</if>
|
||||
<if test="groupByCargoSpaceId != null and groupByCargoSpaceId">bcs.cargo_space_name,</if>
|
||||
<if test="groupByRoadwayId != null and groupByRoadwayId">bcs.roadway_id,</if>
|
||||
<if test="groupByCargoSpaceName != null and groupByCargoSpaceName">bcs.cargo_space_name,</if>
|
||||
<if test="groupByStatus != null and groupByStatus">bcs.status,</if>
|
||||
<if test="groupByLocked != null and groupByLocked">bcs.locked,</if>
|
||||
SUM(CAST(s.quantity AS DECIMAL(18,2))) as quantity
|
||||
FROM bas_stock s
|
||||
LEFT JOIN bas_product p ON s.product_id = p.product_id
|
||||
LEFT JOIN bas_warehouse bw ON bw.warehouse_id = s.warehouse_id
|
||||
LEFT JOIN bas_cargo_space bcs ON bcs.cargo_space_id = s.cargo_space_id
|
||||
<where>
|
||||
AND p.product_id IS NOT NULL AND p.product_id != ''
|
||||
<if test="productId != null and productId != ''"> AND p.product_id like concat('%', #{productId}, '%')</if>
|
||||
<if test="productName != null and productName != ''"> AND p.product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="orderId != null and orderId != ''"> AND s.order_id like concat('%', #{orderId}, '%')</if>
|
||||
<if test="spec != null and spec != ''"> AND p.spec like concat('%', #{spec}, '%')</if>
|
||||
<if test="unit != null and unit != ''"> AND p.unit like concat('%', #{unit}, '%')</if>
|
||||
<if test="price != null and price != ''"> AND p.price like concat('%', #{price}, '%')</if>
|
||||
<if test="spare1 != null and spare1 != ''"> AND p.spare1 like concat('%', #{spare1}, '%')</if>
|
||||
<if test="spare2 != null and spare2 != ''"> AND p.spare2 like concat('%', #{spare2}, '%')</if>
|
||||
<if test="spare5 != null and spare5 != ''"> AND p.spare5 like concat('%', #{spare5}, '%')</if>
|
||||
<if test="spare6 != null and spare6 != ''"> AND p.spare6 like concat('%', #{spare6}, '%')</if>
|
||||
<if test="spare8 != null and spare8 != ''"> AND p.spare8 like concat('%', #{spare8}, '%')</if>
|
||||
<if test="spare7 != null and spare7 != ''"> AND p.spare7 like concat('%', #{spare7}, '%')</if>
|
||||
<if test="remark != null and remark != ''"> AND p.spare7 like concat('%', #{remark}, '%')}</if>
|
||||
<if test="lotNo != null and lotNo != ''"> AND s.lot_no like concat('%', #{lotNo}, '%')</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> AND s.warehouse_id like concat('%', #{warehouseId}, '%')</if>
|
||||
<if test="stockId != null and stockId != ''"> AND s.stock_id like concat('%', #{stockId}, '%')</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> AND s.cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
|
||||
<if test="cargoSpaceName != null and cargoSpaceName != ''"> AND bcs.cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
|
||||
<if test="spare9 != null and spare9 != ''"> AND p.spare9 like concat('%', #{spare9}, '%')</if>
|
||||
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
||||
${params.warehouseDataScope}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
<trim prefixOverrides=",">
|
||||
<if test="groupByProductId != null and groupByProductId">,p.product_id</if>
|
||||
<if test="groupByProductName != null and groupByProductName">,p.product_name</if>
|
||||
<if test="groupByOrderId != null and groupByOrderId">,s.order_id</if>
|
||||
<if test="groupBySpec != null and groupBySpec">,p.spec</if>
|
||||
<if test="groupByUnit != null and groupByUnit">,p.unit</if>
|
||||
<if test="groupByPrice != null and groupByPrice">,p.price</if>
|
||||
<if test="groupByParentId != null and groupByParentId">,p.parent_id</if>
|
||||
<if test="groupByCargoNo != null and groupByCargoNo">,p.cargo_no</if>
|
||||
<if test="groupBySpare1 != null and groupBySpare1">,p.spare1</if>
|
||||
<if test="groupBySpare2 != null and groupBySpare2">,p.spare2</if>
|
||||
<if test="groupBySpare3 != null and groupBySpare3">,p.spare3</if>
|
||||
<if test="groupBySpare4 != null and groupBySpare4">,p.spare4</if>
|
||||
<if test="groupBySpare5 != null and groupBySpare5">,p.spare5</if>
|
||||
<if test="groupBySpare6 != null and groupBySpare6">,p.spare6</if>
|
||||
<if test="groupBySpare7 != null and groupBySpare7">,p.spare7</if>
|
||||
<if test="groupBySpare8 != null and groupBySpare8">,p.spare8</if>
|
||||
<if test="groupBySpare9 != null and groupBySpare9">,p.spare9</if>
|
||||
<if test="groupBySpare10 != null and groupBySpare10">,p.spare10</if>
|
||||
<if test="groupBySpare11 != null and groupBySpare11">,p.spare11</if>
|
||||
<if test="groupBySpare12 != null and groupBySpare12">,p.spare12</if>
|
||||
<if test="groupBySpare13 != null and groupBySpare13">,p.spare13</if>
|
||||
<if test="groupBySpare14 != null and groupBySpare14">,p.spare14</if>
|
||||
<if test="groupBySpare15 != null and groupBySpare15">,p.spare15</if>
|
||||
<if test="groupBySpare16 != null and groupBySpare16">,p.spare16</if>
|
||||
<if test="groupBySpare17 != null and groupBySpare17">,p.spare17</if>
|
||||
<if test="groupBySpare18 != null and groupBySpare18">,p.spare18</if>
|
||||
<if test="groupBySpare19 != null and groupBySpare19">,p.spare19</if>
|
||||
<if test="groupBySpare20 != null and groupBySpare20">,p.spare20</if>
|
||||
<if test="groupBySpare21 != null and groupBySpare21">,p.spare21</if>
|
||||
<if test="groupBySpare22 != null and groupBySpare22">,p.spare22</if>
|
||||
<if test="groupBySpare23 != null and groupBySpare23">,p.spare23</if>
|
||||
<if test="groupBySpare24 != null and groupBySpare24">,p.spare24</if>
|
||||
<if test="groupBySpare25 != null and groupBySpare25">,p.spare25</if>
|
||||
<if test="groupBySpare26 != null and groupBySpare26">,p.spare26</if>
|
||||
<if test="groupBySpare27 != null and groupBySpare27">,p.spare27</if>
|
||||
<if test="groupBySpare28 != null and groupBySpare28">,p.spare28</if>
|
||||
<if test="groupBySpare29 != null and groupBySpare29">,p.spare29</if>
|
||||
<if test="groupBySpare30 != null and groupBySpare30">,p.spare30</if>
|
||||
<if test="groupBySpare31 != null and groupBySpare31">,p.spare31</if>
|
||||
<if test="groupBySpare32 != null and groupBySpare32">,p.spare32</if>
|
||||
<if test="groupBySpare33 != null and groupBySpare33">,p.spare33</if>
|
||||
<if test="groupBySpare34 != null and groupBySpare34">,p.spare34</if>
|
||||
<if test="groupBySpare35 != null and groupBySpare35">,p.spare35</if>
|
||||
<if test="groupBySpare36 != null and groupBySpare36">,p.spare36</if>
|
||||
<if test="groupBySpare37 != null and groupBySpare37">,p.spare37</if>
|
||||
<if test="groupBySpare38 != null and groupBySpare38">,p.spare38</if>
|
||||
<if test="groupBySpare39 != null and groupBySpare39">,p.spare39</if>
|
||||
<if test="groupByLotNo != null and groupByLotNo">,s.lot_no</if>
|
||||
<if test="groupByWarehouseId != null and groupByWarehouseId">,s.warehouse_id</if>
|
||||
<if test="groupByWarehouseId != null and groupByWarehouseId">,bw.warehouse_name</if>
|
||||
<if test="groupByCargoSpaceId != null and groupByCargoSpaceId">,s.cargo_space_id</if>
|
||||
<if test="groupByCargoSpaceId != null and groupByCargoSpaceId">,bcs.cargo_space_name</if>
|
||||
<if test="groupByRoadwayId != null and groupByRoadwayId">,bcs.roadway_id</if>
|
||||
</trim>
|
||||
</when>
|
||||
<otherwise>
|
||||
1 as group_all,
|
||||
SUM(CAST(s.quantity AS DECIMAL(18,2))) as quantity
|
||||
FROM bas_stock s
|
||||
LEFT JOIN bas_product p ON s.product_id = p.product_id
|
||||
<where>
|
||||
AND p.product_id IS NOT NULL AND p.product_id != ''
|
||||
<if test="productId != null and productId != ''"> AND p.product_id like concat('%', #{productId}, '%')</if>
|
||||
<if test="productName != null and productName != ''"> AND p.product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="orderId != null and orderId != ''"> AND s.order_id like concat('%', #{orderId}, '%')</if>
|
||||
<if test="spec != null and spec != ''"> AND p.spec like concat('%', #{spec}, '%')</if>
|
||||
<if test="unit != null and unit != ''"> AND p.unit like concat('%', #{unit}, '%')</if>
|
||||
<if test="price != null and price != ''"> AND p.price like concat('%', #{price}, '%')</if>
|
||||
<if test="productId != null and productId != ''"> AND s.product_id like concat('%', #{productId}, '%')</if>
|
||||
<if test="productName != null and productName != ''"> AND s.product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="parentId != null and parentId != ''"> AND p.parent_id like concat('%', #{parentId}, '%')</if>
|
||||
<if test="price != null and price != ''"> AND p.price like concat('%', #{price}, '%')</if>
|
||||
<if test="cargoNo != null and cargoNo != ''"> AND p.cargo_no like concat('%', #{cargoNo}, '%')</if>
|
||||
<if test="unit != null and unit != ''"> AND p.unit like concat('%', #{unit}, '%')</if>
|
||||
<if test="spec != null and spec != ''"> AND p.spec like concat('%', #{spec}, '%')</if>
|
||||
<if test="remark != null and remark != ''"> AND p.remark like concat('%', #{remark}, '%')</if>
|
||||
<if test="spare1 != null and spare1 != ''"> AND p.spare1 like concat('%', #{spare1}, '%')</if>
|
||||
<if test="spare2 != null and spare2 != ''"> AND p.spare2 like concat('%', #{spare2}, '%')</if>
|
||||
<if test="spare3 != null and spare3 != ''"> AND p.spare3 like concat('%', #{spare3}, '%')</if>
|
||||
<if test="spare4 != null and spare4 != ''"> AND p.spare4 like concat('%', #{spare4}, '%')</if>
|
||||
<if test="spare5 != null and spare5 != ''"> AND p.spare5 like concat('%', #{spare5}, '%')</if>
|
||||
<if test="spare6 != null and spare6 != ''"> AND p.spare6 like concat('%', #{spare6}, '%')</if>
|
||||
<if test="spare7 != null and spare7 != ''"> AND p.spare7 like concat('%', #{spare7}, '%')</if>
|
||||
<if test="spare8 != null and spare8 != ''"> AND p.spare8 like concat('%', #{spare8}, '%')</if>
|
||||
<if test="spare9 != null and spare9 != ''"> AND p.spare9 like concat('%', #{spare9}, '%')</if>
|
||||
<if test="spare10 != null and spare10 != ''"> AND p.spare10 like concat('%', #{spare10}, '%')</if>
|
||||
<if test="spare11 != null and spare11 != ''"> AND p.spare11 like concat('%', #{spare11}, '%')</if>
|
||||
<if test="spare12 != null and spare12 != ''"> AND p.spare12 like concat('%', #{spare12}, '%')</if>
|
||||
<if test="spare13 != null and spare13 != ''"> AND p.spare13 like concat('%', #{spare13}, '%')</if>
|
||||
<if test="spare14 != null and spare14 != ''"> AND p.spare14 like concat('%', #{spare14}, '%')</if>
|
||||
<if test="spare15 != null and spare15 != ''"> AND p.spare15 like concat('%', #{spare15}, '%')</if>
|
||||
<if test="spare16 != null and spare16 != ''"> AND p.spare16 like concat('%', #{spare16}, '%')</if>
|
||||
<if test="spare17 != null and spare17 != ''"> AND p.spare17 like concat('%', #{spare17}, '%')</if>
|
||||
<if test="spare18 != null and spare18 != ''"> AND p.spare18 like concat('%', #{spare18}, '%')</if>
|
||||
<if test="spare19 != null and spare19 != ''"> AND p.spare19 like concat('%', #{spare19}, '%')</if>
|
||||
<if test="spare20 != null and spare20 != ''"> AND p.spare20 like concat('%', #{spare20}, '%')</if>
|
||||
<if test="spare21 != null and spare21 != ''"> AND p.spare21 like concat('%', #{spare21}, '%')</if>
|
||||
<if test="spare22 != null and spare22 != ''"> AND p.spare22 like concat('%', #{spare22}, '%')</if>
|
||||
<if test="spare23 != null and spare23 != ''"> AND p.spare23 like concat('%', #{spare23}, '%')</if>
|
||||
<if test="spare24 != null and spare24 != ''"> AND p.spare24 like concat('%', #{spare24}, '%')</if>
|
||||
<if test="spare25 != null and spare25 != ''"> AND p.spare25 like concat('%', #{spare25}, '%')</if>
|
||||
<if test="spare26 != null and spare26 != ''"> AND p.spare26 like concat('%', #{spare26}, '%')</if>
|
||||
<if test="spare27 != null and spare27 != ''"> AND p.spare27 like concat('%', #{spare27}, '%')</if>
|
||||
<if test="spare28 != null and spare28 != ''"> AND p.spare28 like concat('%', #{spare28}, '%')</if>
|
||||
<if test="spare29 != null and spare29 != ''"> AND p.spare29 like concat('%', #{spare29}, '%')</if>
|
||||
<if test="spare30 != null and spare30 != ''"> AND p.spare30 like concat('%', #{spare30}, '%')</if>
|
||||
<if test="spare31 != null and spare31 != ''"> AND p.spare31 like concat('%', #{spare31}, '%')</if>
|
||||
<if test="spare32 != null and spare32 != ''"> AND p.spare32 like concat('%', #{spare32}, '%')</if>
|
||||
<if test="spare33 != null and spare33 != ''"> AND p.spare33 like concat('%', #{spare33}, '%')</if>
|
||||
<if test="spare34 != null and spare34 != ''"> AND p.spare34 like concat('%', #{spare34}, '%')</if>
|
||||
<if test="spare35 != null and spare35 != ''"> AND p.spare35 like concat('%', #{spare35}, '%')</if>
|
||||
<if test="spare36 != null and spare36 != ''"> AND p.spare36 like concat('%', #{spare36}, '%')</if>
|
||||
<if test="spare37 != null and spare37 != ''"> AND p.spare37 like concat('%', #{spare37}, '%')</if>
|
||||
<if test="spare38 != null and spare38 != ''"> AND p.spare38 like concat('%', #{spare38}, '%')</if>
|
||||
<if test="spare39 != null and spare39 != ''"> AND p.spare39 like concat('%', #{spare39}, '%')</if>
|
||||
<if test="remark != null and remark != ''"> AND p.remark like concat('%', #{remark}, '%')</if>
|
||||
<if test="lotNo != null and lotNo != ''"> AND s.lot_no like concat('%', #{lotNo}, '%')</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> AND s.warehouse_id like concat('%', #{warehouseId}, '%')</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> AND s.cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
|
||||
<if test="cargoSpaceName != null and cargoSpaceName != ''"> AND bcs.cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
|
||||
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
||||
${params.warehouseDataScope}
|
||||
</if>
|
||||
<if test="status != null and status != ''"> AND bcs.status like concat('%', #{status}, '%')</if>
|
||||
<if test="locked != null and locked != ''"> AND bcs.locked like concat('%', #{locked}, '%')</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
<trim prefixOverrides=",">
|
||||
<if test="groupByCargoSpaceId != null and groupByCargoSpaceId">,s.cargo_space_id</if>
|
||||
<if test="groupByProductId != null and groupByProductId">,s.product_id</if>
|
||||
<if test="groupByProductName != null and groupByProductName">,s.product_name</if>
|
||||
<if test="groupByParentId != null and groupByParentId">,p.parent_id</if>
|
||||
<if test="groupByPrice != null and groupByPrice">,p.price</if>
|
||||
<if test="groupBycCargoNo != null and groupBycCargoNo">,p.cargo_no</if>
|
||||
<if test="groupByUnit != null and groupByUnit">,p.unit</if>
|
||||
<if test="groupBySpec != null and groupBySpec">,p.spec</if>
|
||||
<if test="groupBySpare1 != null and groupBySpare1">,p.spare1</if>
|
||||
<if test="groupBySpare3 != null and groupBySpare3">,p.spare3</if>
|
||||
<if test="groupBySpare4 != null and groupBySpare4">,p.spare4</if>
|
||||
<if test="groupBySpare5 != null and groupBySpare5">,p.spare5</if>
|
||||
<if test="groupBySpare6 != null and groupBySpare6">,p.spare6</if>
|
||||
<if test="groupBySpare7 != null and groupBySpare7">,p.spare7</if>
|
||||
<if test="groupByCargoSpaceName != null and groupByCargoSpaceName">,bcs.cargo_space_name</if>
|
||||
<if test="groupByStatus != null and groupByStatus">,bcs.status</if>
|
||||
<if test="groupByLocked != null and groupByLocked">,bcs.locked</if>
|
||||
</trim>
|
||||
</when>
|
||||
<otherwise>
|
||||
s.stock_id,
|
||||
s.cargo_space_id,
|
||||
s.product_id,
|
||||
s.product_name,
|
||||
CAST(s.quantity AS DECIMAL(18,2)) as quantity,
|
||||
p.parent_id,
|
||||
p.price,
|
||||
p.cargo_no,
|
||||
p.unit,
|
||||
p.spec,
|
||||
p.remark,
|
||||
p.spare1,
|
||||
p.spare3,
|
||||
p.spare4,
|
||||
p.spare5,
|
||||
p.spare6,
|
||||
p.spare7,
|
||||
bcs.cargo_space_name,
|
||||
bcs.status,
|
||||
bcs.locked
|
||||
FROM bas_stock s
|
||||
LEFT JOIN bas_product p ON s.product_id = p.product_id
|
||||
LEFT JOIN bas_cargo_space bcs ON bcs.cargo_space_id = s.cargo_space_id
|
||||
<where>
|
||||
AND p.product_id IS NOT NULL AND p.product_id != ''
|
||||
|
||||
<if test="stockId != null and stockId != ''"> AND s.stock_id like concat('%', #{stockId}, '%')</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> AND s.cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
|
||||
<if test="productId != null and productId != ''"> AND p.product_id like concat('%', #{productId}, '%')</if>
|
||||
<if test="productName != null and productName != ''"> AND s.product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="parentId != null and parentId != ''"> AND p.parent_id like concat('%', #{parentId}, '%')</if>
|
||||
<if test="price != null and price != ''"> AND p.price like concat('%', #{price}, '%')</if>
|
||||
<if test="cargoNo != null and cargoNo != ''"> AND p.cargo_no like concat('%', #{cargoNo}, '%')</if>
|
||||
<if test="unit != null and unit != ''"> AND p.unit like concat('%', #{unit}, '%')</if>
|
||||
<if test="spec != null and spec != ''"> AND p.spec like concat('%', #{spec}, '%')</if>
|
||||
<if test="remark != null and remark != ''"> AND p.remark like concat('%', #{remark}, '%')</if>
|
||||
<if test="spare1 != null and spare1 != ''"> AND p.spare1 like concat('%', #{spare1}, '%')</if>
|
||||
<if test="spare3 != null and spare3 != ''"> AND p.spare3 like concat('%', #{spare3}, '%')</if>
|
||||
<if test="spare4 != null and spare4 != ''"> AND p.spare4 like concat('%', #{spare4}, '%')</if>
|
||||
<if test="spare5 != null and spare5 != ''"> AND p.spare5 like concat('%', #{spare5}, '%')</if>
|
||||
<if test="spare6 != null and spare6 != ''"> AND p.spare6 like concat('%', #{spare6}, '%')</if>
|
||||
<if test="spare7 != null and spare7 != ''"> AND p.spare7 like concat('%', #{spare7}, '%')</if>
|
||||
<if test="cargoSpaceName != null and cargoSpaceName != ''"> AND bcs.cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
|
||||
<if test="status != null and status != ''"> AND bcs.status like concat('%', #{status}, '%')</if>
|
||||
<if test="locked != null and locked != ''"> AND bcs.locked like concat('%', #{locked}, '%')</if>
|
||||
</where>
|
||||
</otherwise>
|
||||
</choose>
|
||||
@@ -253,184 +158,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where only_identity = #{onlyIdentity}
|
||||
</select>
|
||||
|
||||
<insert id="insertStockSummary" parameterType="StockSummary">
|
||||
insert into stock_summary
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="onlyIdentity != null">only_identity,</if>
|
||||
<if test="productId != null and productId != ''">product_id,</if>
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="spec != null">spec,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="cargoNo != null">cargo_no,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
<if test="spare4 != null">spare4,</if>
|
||||
<if test="spare5 != null">spare5,</if>
|
||||
<if test="spare6 != null">spare6,</if>
|
||||
<if test="spare7 != null">spare7,</if>
|
||||
<if test="spare8 != null">spare8,</if>
|
||||
<if test="spare9 != null">spare9,</if>
|
||||
<if test="spare10 != null">spare10,</if>
|
||||
<if test="spare11 != null">spare11,</if>
|
||||
<if test="spare12 != null">spare12,</if>
|
||||
<if test="spare13 != null">spare13,</if>
|
||||
<if test="spare14 != null">spare14,</if>
|
||||
<if test="spare15 != null">spare15,</if>
|
||||
<if test="spare16 != null">spare16,</if>
|
||||
<if test="spare17 != null">spare17,</if>
|
||||
<if test="spare18 != null">spare18,</if>
|
||||
<if test="spare19 != null">spare19,</if>
|
||||
<if test="spare20 != null">spare20,</if>
|
||||
<if test="spare21 != null">spare21,</if>
|
||||
<if test="spare22 != null">spare22,</if>
|
||||
<if test="spare23 != null">spare23,</if>
|
||||
<if test="spare24 != null">spare24,</if>
|
||||
<if test="spare25 != null">spare25,</if>
|
||||
<if test="spare26 != null">spare26,</if>
|
||||
<if test="spare27 != null">spare27,</if>
|
||||
<if test="spare28 != null">spare28,</if>
|
||||
<if test="spare29 != null">spare29,</if>
|
||||
<if test="spare30 != null">spare30,</if>
|
||||
<if test="spare31 != null">spare31,</if>
|
||||
<if test="spare32 != null">spare32,</if>
|
||||
<if test="spare33 != null">spare33,</if>
|
||||
<if test="spare34 != null">spare34,</if>
|
||||
<if test="spare35 != null">spare35,</if>
|
||||
<if test="spare36 != null">spare36,</if>
|
||||
<if test="spare37 != null">spare37,</if>
|
||||
<if test="spare38 != null">spare38,</if>
|
||||
<if test="spare39 != null">spare39,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="lotNo != null">lot_no,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="onlyIdentity != null">#{onlyIdentity},</if>
|
||||
<if test="productId != null and productId != ''">#{productId},</if>
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="spec != null">#{spec},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="cargoNo != null">#{cargoNo},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
<if test="spare4 != null">#{spare4},</if>
|
||||
<if test="spare5 != null">#{spare5},</if>
|
||||
<if test="spare6 != null">#{spare6},</if>
|
||||
<if test="spare7 != null">#{spare7},</if>
|
||||
<if test="spare8 != null">#{spare8},</if>
|
||||
<if test="spare9 != null">#{spare9},</if>
|
||||
<if test="spare10 != null">#{spare10},</if>
|
||||
<if test="spare11 != null">#{spare11},</if>
|
||||
<if test="spare12 != null">#{spare12},</if>
|
||||
<if test="spare13 != null">#{spare13},</if>
|
||||
<if test="spare14 != null">#{spare14},</if>
|
||||
<if test="spare15 != null">#{spare15},</if>
|
||||
<if test="spare16 != null">#{spare16},</if>
|
||||
<if test="spare17 != null">#{spare17},</if>
|
||||
<if test="spare18 != null">#{spare18},</if>
|
||||
<if test="spare19 != null">#{spare19},</if>
|
||||
<if test="spare20 != null">#{spare20},</if>
|
||||
<if test="spare21 != null">#{spare21},</if>
|
||||
<if test="spare22 != null">#{spare22},</if>
|
||||
<if test="spare23 != null">#{spare23},</if>
|
||||
<if test="spare24 != null">#{spare24},</if>
|
||||
<if test="spare25 != null">#{spare25},</if>
|
||||
<if test="spare26 != null">#{spare26},</if>
|
||||
<if test="spare27 != null">#{spare27},</if>
|
||||
<if test="spare28 != null">#{spare28},</if>
|
||||
<if test="spare29 != null">#{spare29},</if>
|
||||
<if test="spare30 != null">#{spare30},</if>
|
||||
<if test="spare31 != null">#{spare31},</if>
|
||||
<if test="spare32 != null">#{spare32},</if>
|
||||
<if test="spare33 != null">#{spare33},</if>
|
||||
<if test="spare34 != null">#{spare34},</if>
|
||||
<if test="spare35 != null">#{spare35},</if>
|
||||
<if test="spare36 != null">#{spare36},</if>
|
||||
<if test="spare37 != null">#{spare37},</if>
|
||||
<if test="spare38 != null">#{spare38},</if>
|
||||
<if test="spare39 != null">#{spare39},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="lotNo != null">#{lotNo},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStockSummary" parameterType="StockSummary">
|
||||
update stock_summary
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productId != null and productId != ''">product_id = #{productId},</if>
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="spec != null">spec = #{spec},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
<if test="spare4 != null">spare4 = #{spare4},</if>
|
||||
<if test="spare5 != null">spare5 = #{spare5},</if>
|
||||
<if test="spare6 != null">spare6 = #{spare6},</if>
|
||||
<if test="spare7 != null">spare7 = #{spare7},</if>
|
||||
<if test="spare8 != null">spare8 = #{spare8},</if>
|
||||
<if test="spare9 != null">spare9 = #{spare9},</if>
|
||||
<if test="spare10 != null">spare10 = #{spare10},</if>
|
||||
<if test="spare11 != null">spare11 = #{spare11},</if>
|
||||
<if test="spare12 != null">spare12 = #{spare12},</if>
|
||||
<if test="spare13 != null">spare13 = #{spare13},</if>
|
||||
<if test="spare14 != null">spare14 = #{spare14},</if>
|
||||
<if test="spare15 != null">spare15 = #{spare15},</if>
|
||||
<if test="spare16 != null">spare16 = #{spare16},</if>
|
||||
<if test="spare17 != null">spare17 = #{spare17},</if>
|
||||
<if test="spare18 != null">spare18 = #{spare18},</if>
|
||||
<if test="spare19 != null">spare19 = #{spare19},</if>
|
||||
<if test="spare20 != null">spare20 = #{spare20},</if>
|
||||
<if test="spare21 != null">spare21 = #{spare21},</if>
|
||||
<if test="spare22 != null">spare22 = #{spare22},</if>
|
||||
<if test="spare23 != null">spare23 = #{spare23},</if>
|
||||
<if test="spare24 != null">spare24 = #{spare24},</if>
|
||||
<if test="spare25 != null">spare25 = #{spare25},</if>
|
||||
<if test="spare26 != null">spare26 = #{spare26},</if>
|
||||
<if test="spare27 != null">spare27 = #{spare27},</if>
|
||||
<if test="spare28 != null">spare28 = #{spare28},</if>
|
||||
<if test="spare29 != null">spare29 = #{spare29},</if>
|
||||
<if test="spare30 != null">spare30 = #{spare30},</if>
|
||||
<if test="spare31 != null">spare31 = #{spare31},</if>
|
||||
<if test="spare32 != null">spare32 = #{spare32},</if>
|
||||
<if test="spare33 != null">spare33 = #{spare33},</if>
|
||||
<if test="spare34 != null">spare34 = #{spare34},</if>
|
||||
<if test="spare35 != null">spare35 = #{spare35},</if>
|
||||
<if test="spare36 != null">spare36 = #{spare36},</if>
|
||||
<if test="spare37 != null">spare37 = #{spare37},</if>
|
||||
<if test="spare38 != null">spare38 = #{spare38},</if>
|
||||
<if test="spare39 != null">spare39 = #{spare39},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="lotNo != null">lot_no = #{lotNo},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
</trim>
|
||||
where only_identity = #{onlyIdentity}
|
||||
</update>
|
||||
|
||||
<delete id="deleteStockSummaryByOnlyIdentity" parameterType="Long">
|
||||
delete from stock_summary where only_identity = #{onlyIdentity}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStockSummaryByOnlyIdentitys" parameterType="String">
|
||||
delete from stock_summary where only_identity in
|
||||
<foreach item="onlyIdentity" collection="array" open="(" separator="," close=")">
|
||||
#{onlyIdentity}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user