erp库位、物料优化
This commit is contained in:
@@ -13,6 +13,9 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode ERP_CUSTOMER_NOT_EXISTS = new ErrorCode(1_001_000_001, "ERP客商主数据不存在");
|
||||
|
||||
ErrorCode ERP_MATERIAL_NOT_EXISTS = new ErrorCode(1_002_000_001, "ERP物料数据不存在");
|
||||
ErrorCode ERP_MATERIAL_NOT_ALLOW_UPDATE = new ErrorCode(1_002_000_001, "只允许编辑状态为“供应链”的数据");
|
||||
ErrorCode ERP_MATERIAL_NOT_ALLOW_DELETE = new ErrorCode(1_002_000_001, "不允许删除状态为“ERP”的数据");
|
||||
ErrorCode ERP_MATERIAL_OTHER_NOT_ALLOW_DELETE = new ErrorCode(1_002_000_001, "只允许删除不存在配置关系的数据");
|
||||
|
||||
ErrorCode ERP_COMPANY_NOT_EXISTS = new ErrorCode(1_003_000_001, "ERP公司数据不存在");
|
||||
ErrorCode ERP_COMPANY_REDIS_NOT_EXISTS = new ErrorCode(1_003_000_002, "ERP公司代码缓存数据丢失,请重新同步公司代码");
|
||||
@@ -40,6 +43,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode ERP_SALES_ORGANIZATION_NOT_EXISTS = new ErrorCode(1_013_000_001, "ERP销售组织数据不存在");
|
||||
|
||||
ErrorCode ERP_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_014_000_001, "ERP库位数据不存在");
|
||||
ErrorCode ERP_WAREHOUSE_NOT_ALLOW_UPDATE = new ErrorCode(1_014_000_002, "只允许状态为“供应链”,且“禁用”的数据编辑");
|
||||
|
||||
ErrorCode ERP_ASSET_NOT_EXISTS = new ErrorCode(1_015_000_001, "ERP资产卡片数据不存在");
|
||||
|
||||
|
||||
@@ -88,14 +88,6 @@ public class ErpFactoryController {
|
||||
return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/pageByCpn")
|
||||
@Operation(summary = "获得ERP工厂分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:query')")
|
||||
public CommonResult<PageResult<ErpFactoryRespVO>> getErpFactoryPageByCpn(@Valid ErpFactoryPageReqVO pageReqVO) {
|
||||
PageResult<ErpFactoryDO> pageResult = erpFactoryService.getErpFactoryPageByCpn(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP工厂 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:export')")
|
||||
|
||||
@@ -101,6 +101,14 @@ public class ErpWarehouseController {
|
||||
BeanUtils.toBean(list, ErpWarehouseRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新")
|
||||
@PreAuthorize("@ss.hasPermission('base:warehouse:update')")
|
||||
public CommonResult<Boolean> enableWarehouseList(@RequestBody List<ErpWarehouseSaveReqVO> saveReqVOS) {
|
||||
erpWarehouseService.enableWarehouseList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/getErpWarehouseTask")
|
||||
@Operation(summary = "定时获得erp更新库位")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:create')")
|
||||
|
||||
@@ -8,6 +8,9 @@ import lombok.Data;
|
||||
@Data
|
||||
public class ErpWarehousePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "工厂编码;将查询参数存入")
|
||||
private String factoryNumber;
|
||||
|
||||
@@ -17,4 +20,8 @@ public class ErpWarehousePageReqVO extends PageParam {
|
||||
@Schema(description = "库位编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
|
||||
}
|
||||
@@ -26,4 +26,16 @@ public class ErpWarehouseRespVO {
|
||||
@ExcelProperty("库位编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "类别")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "绑定库位名")
|
||||
private String relName;
|
||||
|
||||
@Schema(description = "绑定库位编码")
|
||||
private String relnumber;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private String isEnable;
|
||||
|
||||
}
|
||||
@@ -22,4 +22,16 @@ public class ErpWarehouseSaveReqVO {
|
||||
@NotEmpty(message = "库位编码不能为空")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "类别")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "绑定库位名")
|
||||
private String relName;
|
||||
|
||||
@Schema(description = "绑定库位编码")
|
||||
private String relnumber;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private String isEnable;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zt.plat.module.erp.dal.dataobject.erp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
/**
|
||||
* ERP库位 DO
|
||||
@@ -18,7 +19,7 @@ import lombok.*;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpWarehouseDO {
|
||||
public class ErpWarehouseDO extends BusinessBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
@@ -30,6 +31,11 @@ public class ErpWarehouseDO {
|
||||
*/
|
||||
@TableField("FACT_NUM")
|
||||
private String factoryNumber;
|
||||
/**
|
||||
* 工厂名称;将查询参数存入
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String factoryName;
|
||||
/**
|
||||
* 库位描述
|
||||
*/
|
||||
@@ -47,4 +53,22 @@ public class ErpWarehouseDO {
|
||||
@TableField("TP")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 绑定库位名
|
||||
*/
|
||||
@TableField("REL_NAME")
|
||||
private String relName;
|
||||
|
||||
/**
|
||||
* 绑定库位编码
|
||||
*/
|
||||
@TableField("REL_NUM")
|
||||
private String relnumber;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("IS_ENB")
|
||||
private String isEnable;
|
||||
|
||||
}
|
||||
@@ -18,14 +18,6 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface ErpFactoryMapper extends BaseMapperX<ErpFactoryDO> {
|
||||
|
||||
default PageResult<ErpFactoryDO> selectPage(ErpFactoryPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpFactoryDO>()
|
||||
.likeIfPresent(ErpFactoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ErpFactoryDO::getNumber, reqVO.getNumber())
|
||||
.eqIfPresent(ErpFactoryDO::getType, reqVO.getType())
|
||||
.orderByDesc(ErpFactoryDO::getId));
|
||||
}
|
||||
|
||||
String selectMaxCode();
|
||||
|
||||
List<ErpFactoryDO> getPageByReq(ErpFactoryPageReqVO pageReqVO);
|
||||
|
||||
@@ -37,4 +37,8 @@ public interface ErpMaterialMapper extends BaseMapperX<ErpMaterialDO> {
|
||||
}
|
||||
|
||||
void updateBatchByNumber(@Param("toUpdate") List<ErpMaterialDO> toUpdate);
|
||||
|
||||
String selectMaxCode();
|
||||
|
||||
Integer selectByErpMNumbers(List<String> erpMNumber);
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import com.zt.plat.module.erp.controller.admin.erp.vo.ErpWarehousePageReqVO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP库位 Mapper
|
||||
*
|
||||
@@ -15,13 +17,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface ErpWarehouseMapper extends BaseMapperX<ErpWarehouseDO> {
|
||||
|
||||
default PageResult<ErpWarehouseDO> selectPage(ErpWarehousePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpWarehouseDO>()
|
||||
.eqIfPresent(ErpWarehouseDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||
.likeIfPresent(ErpWarehouseDO::getName, reqVO.getName())
|
||||
// .betweenIfPresent(ErpWarehouseDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ErpWarehouseDO::getNumber, reqVO.getNumber())
|
||||
.orderByDesc(ErpWarehouseDO::getId));
|
||||
}
|
||||
String selectMaxCode();
|
||||
|
||||
List<ErpWarehouseDO> getPageByReq(ErpWarehousePageReqVO pageReqVO);
|
||||
}
|
||||
@@ -64,6 +64,4 @@ public interface ErpFactoryService {
|
||||
void callErpRfcInterface();
|
||||
|
||||
void enableFactoryList(List<ErpFactoryRespVO> saveReqVOS);
|
||||
|
||||
PageResult<ErpFactoryDO> getErpFactoryPageByCpn(ErpFactoryPageReqVO pageReqVO);
|
||||
}
|
||||
@@ -120,20 +120,6 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
|
||||
|
||||
@Override
|
||||
public PageResult<ErpFactoryDO> getErpFactoryPage(ErpFactoryPageReqVO pageReqVO) {
|
||||
return erpFactoryMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableFactoryList(List<ErpFactoryRespVO> saveReqVOS) {
|
||||
List<ErpFactoryDO> updateObj = BeanUtils.toBean(saveReqVOS, ErpFactoryDO.class);
|
||||
List<BatchResult> count = erpFactoryMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(ERP_FACTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpFactoryDO> getErpFactoryPageByCpn(ErpFactoryPageReqVO pageReqVO) {
|
||||
// 获取分页数据
|
||||
List<ErpFactoryDO> list = erpFactoryMapper.getPageByReq(pageReqVO);
|
||||
if (list == null) {
|
||||
@@ -155,6 +141,15 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
|
||||
return new PageResult<>(pageList, (long) total);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableFactoryList(List<ErpFactoryRespVO> saveReqVOS) {
|
||||
List<ErpFactoryDO> updateObj = BeanUtils.toBean(saveReqVOS, ErpFactoryDO.class);
|
||||
List<BatchResult> count = erpFactoryMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(ERP_FACTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@XxlJob("getErpFactoryTask")
|
||||
|
||||
@@ -29,8 +29,7 @@ import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_INTERNAL_ORDER_NOT_EXISTS;
|
||||
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_MATERIAL_NOT_EXISTS;
|
||||
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.*;
|
||||
import static dm.jdbc.util.DriverUtil.log;
|
||||
|
||||
/**
|
||||
@@ -53,6 +52,19 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
|
||||
public ErpMaterialRespVO createErpMaterial(ErpMaterialSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpMaterialDO erpMaterial = BeanUtils.toBean(createReqVO, ErpMaterialDO.class);
|
||||
// 工厂编码自动生成,格式 GC-0001,依次新增
|
||||
if (erpMaterial.getDownCenterNumber() == null) {
|
||||
String maxCode = erpMaterialMapper.selectMaxCode();
|
||||
if (maxCode == null) {
|
||||
erpMaterial.setDownCenterNumber("WL-0001");
|
||||
} else {
|
||||
String prefix = "WL-";
|
||||
String numberPart = maxCode.substring(prefix.length());
|
||||
int nextNumber = Integer.parseInt(numberPart) + 1;
|
||||
String nextCode = prefix + String.format("%04d", nextNumber);
|
||||
erpMaterial.setDownCenterNumber(nextCode);
|
||||
}
|
||||
}
|
||||
erpMaterialMapper.insert(erpMaterial);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpMaterial, ErpMaterialRespVO.class);
|
||||
@@ -64,7 +76,11 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
|
||||
validateErpMaterialExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpMaterialDO updateObj = BeanUtils.toBean(updateReqVO, ErpMaterialDO.class);
|
||||
if (updateObj.getType().equals("供应链")) {
|
||||
erpMaterialMapper.updateById(updateObj);
|
||||
} else {
|
||||
throw exception(ERP_MATERIAL_NOT_ALLOW_UPDATE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,6 +104,22 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
List<ErpMaterialDO> erpMaterialDOList = list.stream()
|
||||
.filter(erpMaterialDO -> erpMaterialDO.getType().equals("ERP"))
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(erpMaterialDOList)) {
|
||||
throw exception(ERP_MATERIAL_NOT_ALLOW_DELETE);
|
||||
}
|
||||
// 优化成批量查询,使用IN语句
|
||||
List<String> downCenterNumbers = list.stream()
|
||||
.map(ErpMaterialDO::getDownCenterNumber)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 使用IN语句批量查询所有物料编码的数量
|
||||
Integer countMap = erpMaterialMapper.selectByErpMNumbers(downCenterNumbers);
|
||||
if (countMap > 1) {
|
||||
throw exception(ERP_MATERIAL_OTHER_NOT_ALLOW_DELETE);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpMaterialExists(Long id) {
|
||||
|
||||
@@ -62,4 +62,6 @@ public interface ErpWarehouseService {
|
||||
PageResult<ErpWarehouseDO> getErpWarehousePage(ErpWarehousePageReqVO pageReqVO);
|
||||
|
||||
void callErpRfcInterface();
|
||||
|
||||
void enableWarehouseList(List<ErpWarehouseSaveReqVO> saveReqVOS);
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpFactoryDO;
|
||||
import com.zt.plat.module.erp.utils.ErpConfig;
|
||||
import com.zt.plat.module.erp.utils.MyRedisConfig;
|
||||
import com.zt.plat.module.erp.enums.OftenEnum;
|
||||
@@ -16,6 +17,7 @@ import com.zt.plat.module.erp.controller.admin.erp.vo.ErpWarehouseSaveReqVO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO;
|
||||
import com.zt.plat.module.erp.dal.mysql.erp.ErpWarehouseMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.ibatis.executor.BatchResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -50,10 +52,25 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
|
||||
@Override
|
||||
public ErpWarehouseRespVO createErpWarehouse(ErpWarehouseSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpWarehouseDO erpWarehouse = BeanUtils.toBean(createReqVO, ErpWarehouseDO.class);
|
||||
erpWarehouseMapper.insert(erpWarehouse);
|
||||
ErpWarehouseDO warehouse = BeanUtils.toBean(createReqVO, ErpWarehouseDO.class);
|
||||
// 库位编码自动生成,格式 KW-0001,依次新增
|
||||
String maxCode = erpWarehouseMapper.selectMaxCode();
|
||||
if (warehouse.getNumber() == null){
|
||||
if (maxCode == null) {
|
||||
warehouse.setNumber("KW-0001");
|
||||
} else {
|
||||
String prefix = "KW-";
|
||||
String numberPart = maxCode.substring(prefix.length());
|
||||
int nextNumber = Integer.parseInt(numberPart) + 1;
|
||||
String nextCode = prefix + String.format("%04d", nextNumber);
|
||||
warehouse.setNumber(nextCode);
|
||||
}
|
||||
}
|
||||
warehouse.setType("供应链");
|
||||
warehouse.setIsEnable("1");
|
||||
erpWarehouseMapper.insert(warehouse);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpWarehouse, ErpWarehouseRespVO.class);
|
||||
return BeanUtils.toBean(warehouse, ErpWarehouseRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,7 +79,11 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
|
||||
validateErpWarehouseExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpWarehouseDO updateObj = BeanUtils.toBean(updateReqVO, ErpWarehouseDO.class);
|
||||
if (updateObj.getType().equals("供应链")&&updateObj.getIsEnable().equals("0")){
|
||||
erpWarehouseMapper.updateById(updateObj);
|
||||
}else {
|
||||
throw exception(ERP_WAREHOUSE_NOT_ALLOW_UPDATE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,9 +120,37 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
|
||||
return erpWarehouseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableWarehouseList(List<ErpWarehouseSaveReqVO> saveReqVOS) {
|
||||
List<ErpWarehouseDO> updateObj = BeanUtils.toBean(saveReqVOS, ErpWarehouseDO.class);
|
||||
List<BatchResult> count = erpWarehouseMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(ERP_WAREHOUSE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<ErpWarehouseDO> getErpWarehousePage(ErpWarehousePageReqVO pageReqVO) {
|
||||
return erpWarehouseMapper.selectPage(pageReqVO);
|
||||
// 获取分页数据
|
||||
List<ErpWarehouseDO> list = erpWarehouseMapper.getPageByReq(pageReqVO);
|
||||
if (list == null) {
|
||||
list = CollUtil.newArrayList();
|
||||
}
|
||||
// 分页处理
|
||||
int pageNo = pageReqVO.getPageNo();
|
||||
int pageSize = pageReqVO.getPageSize();
|
||||
int total = list.size();
|
||||
// 计算分页起始和结束位置
|
||||
int fromIndex = (pageNo - 1) * pageSize;
|
||||
int toIndex = Math.min(fromIndex + pageSize, total);
|
||||
// 如果起始位置超出范围,则返回空列表
|
||||
if (fromIndex >= total) {
|
||||
return new PageResult<>(new ArrayList<>(), (long) total);
|
||||
}
|
||||
// 截取当前页数据
|
||||
List<ErpWarehouseDO> pageList = list.subList(fromIndex, toIndex);
|
||||
return new PageResult<>(pageList, (long) total);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,6 +31,6 @@
|
||||
</select>
|
||||
|
||||
<select id="selectMaxCode" resultType="java.lang.String">
|
||||
SELECT MAX(NUM) FROM sply_erp_fact where TP = '供应链'
|
||||
SELECT MAX(NUM) FROM sply_erp_fact
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -33,5 +33,21 @@
|
||||
WHERE DOWN_CTR_NUM = #{item.downCenterNumber}
|
||||
</foreach>
|
||||
</update>
|
||||
<select id="selectMaxCode" resultType="java.lang.String">
|
||||
SELECT MAX(MTRL_CODE) FROM SPLY_ERP_MTRL
|
||||
</select>
|
||||
|
||||
<select id="selectByErpMId">
|
||||
SELECT * FROM SPLY_ERP_MTRL WHERE MTRL_ID = #{erpMId}
|
||||
</select>
|
||||
|
||||
<select id="selectByErpMNumbers" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*)
|
||||
FROM sply_mtrl_oth
|
||||
WHERE ERP_MTRL_NUM IN
|
||||
<foreach item="erpMNumber" collection="erpMNumbers" open="(" separator="," close=")">
|
||||
#{erpMNumber}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -9,4 +9,28 @@
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectMaxCode" resultType="java.lang.String">
|
||||
SELECT MAX(NUM) FROM sply_erp_wrh
|
||||
</select>
|
||||
|
||||
<select id="getPageByReq" resultType="com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO">
|
||||
select f.*, c.NAME as f
|
||||
from sply_erp_wrh f left join sply_erp_fact c on f.FACT_NUM = c.NUM;
|
||||
where f.DELETED = 0
|
||||
<if test="reqVO.name != null">
|
||||
and f.NAME like concat('%', #{reqVO.name}, '%')
|
||||
</if>
|
||||
<if test="reqVO.number != null">
|
||||
and f.NUM like concat('%', #{reqVO.number}, '%')
|
||||
</if>
|
||||
<if test="reqVO.factoryNumber != null">
|
||||
and f.FACT_NUM = like concat('%', #{factoryNumber}, '%')
|
||||
</if>
|
||||
<if test="reqVO.factoryName != null">
|
||||
and c.NAME like concat('%', #{factoryName}, '%')
|
||||
</if>
|
||||
<if test="reqVO.type != null">
|
||||
and f.TP like concat('%', #{reqVO.type}, '%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user