|
|
|
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
|
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.check.ErpStockCheckRecordPageReqVO;
|
|
|
|
|
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockCheckItemDO;
|
|
|
|
|
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
|
|
|
|
|
import com.alibaba.excel.util.StringUtils;
|
|
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
|
|
|
|
|
|
|
@ -23,6 +24,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
public interface ErpStockCheckItemMapper extends BaseMapperX<ErpStockCheckItemDO> {
|
|
|
|
|
|
|
|
|
|
DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
Integer STOCK_CHECK_STATUS_CHECKED = 1;
|
|
|
|
|
|
|
|
|
|
default PageResult<ErpStockCheckItemDO> selectRecordPage(ErpStockCheckRecordPageReqVO reqVO) {
|
|
|
|
|
LambdaQueryWrapperX<ErpStockCheckItemDO> query = new LambdaQueryWrapperX<ErpStockCheckItemDO>()
|
|
|
|
|
@ -43,6 +45,8 @@ public interface ErpStockCheckItemMapper extends BaseMapperX<ErpStockCheckItemDO
|
|
|
|
|
|
|
|
|
|
default String buildCheckFilterSql(ErpStockCheckRecordPageReqVO reqVO) {
|
|
|
|
|
StringBuilder checkFilterSql = new StringBuilder("select id from erp_stock_check where deleted = 0");
|
|
|
|
|
checkFilterSql.append(" and check_status = ").append(STOCK_CHECK_STATUS_CHECKED);
|
|
|
|
|
checkFilterSql.append(" and status = ").append(ErpAuditStatus.APPROVE.getStatus());
|
|
|
|
|
if (StringUtils.isNotBlank(reqVO.getNo())) {
|
|
|
|
|
checkFilterSql.append(" and no like '%").append(reqVO.getNo().replace("'", "''")).append("%'");
|
|
|
|
|
}
|
|
|
|
|
@ -60,12 +64,6 @@ public interface ErpStockCheckItemMapper extends BaseMapperX<ErpStockCheckItemDO
|
|
|
|
|
if (reqVO.getCategoryType() != null) {
|
|
|
|
|
checkFilterSql.append(" and category_type = ").append(reqVO.getCategoryType());
|
|
|
|
|
}
|
|
|
|
|
if (reqVO.getCheckStatus() != null) {
|
|
|
|
|
checkFilterSql.append(" and check_status = ").append(reqVO.getCheckStatus());
|
|
|
|
|
}
|
|
|
|
|
if (reqVO.getStatus() != null) {
|
|
|
|
|
checkFilterSql.append(" and status = ").append(reqVO.getStatus());
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(reqVO.getCreator())) {
|
|
|
|
|
checkFilterSql.append(" and creator = '").append(reqVO.getCreator().replace("'", "''")).append("'");
|
|
|
|
|
}
|
|
|
|
|
|