Files
nanguangszwlback/mhd-modules/mhd-system/src/main/resources/mapper/basic/warehouse/WarehouseMapper.xml
T
rcx b1d92fdda8 feat(oms,wms,system): OMS下单冻结库存(防超卖)——仓库级库存锁定模式
- 仓库新增stock_lock_mode开关(1-下单冻结 2-分配库存冻结默认),查询/独立切换接口+在途冻结单切换守卫
- WMS新增out_order_freeze_record冻结记录表:下单冻结/编辑原子重锁/取消解冻/分配承接/交接扣减/反审还原全状态机,条件更新防并发超卖
- OMS下单即冻结(失败阻断+落库失败补偿解冻)、已下发禁编辑、cancelIssueOrder补调WMS清理(修存量不同步)、cancelAuditState镜像还原修复
- 达梦SQL脚本3个(WAREHOUSE加列/冻结记录建表/主键列名修复),测试库已执行并全流程实测通过
2026-09-14 15:41:32 +08:00

164 lines
8.1 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mhd.basic.domain.warehouse.repository.mapper.WarehouseMapper">
<resultMap type="com.mhd.basic.domain.warehouse.repository.po.WarehousePO" id="WarehouseResult">
<result property="warehouseId" column="warehouse_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" />
<result property="warehouseType" column="warehouse_type" />
<result property="warehouseTypeName" column="warehouse_type_name" />
<result property="warehouseStructure" column="warehouse_structure" />
<result property="warehouseNature" column="warehouse_nature" />
<result property="warmLayerCode" column="warm_layer_code" />
<result property="warmLayerName" column="warm_layer_name" />
<result property="directorName" column="director_name" />
<result property="directorPhone" column="director_phone" />
<result property="regionCode" column="region_code" />
<result property="regionName" column="region_name" />
<result property="detailAddress" column="detail_address" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="buildingRegion" column="building_region" />
<result property="usageRegion" column="usage_region" />
<result property="remark" column="remark" />
<result property="openingUp" column="opening_up" />
<result property="nullify" column="nullify" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="delFlag" column="del_flag" />
<result property="isEnable" column="IS_ENABLE" />
<result property="workMode" column="WORK_MODE" />
<result property="taskMode" column="TASK_MODE" />
<result property="sampleOutOrderNoPrefix" column="SAMPLE_OUT_ORDER_NO_PREFIX" />
<result property="orderNoGenerateRule" column="ORDER_NO_GENERATE_RULE" />
<result property="inOrderNoPrefix" column="IN_ORDER_NO_PREFIX" />
<result property="outOrderNoPrefix" column="OUT_ORDER_NO_PREFIX" />
<result property="stockLockMode" column="STOCK_LOCK_MODE" />
</resultMap>
<sql id="selectWarehousePo">
select warehouse_id, organization_id, organization_name, top_organization_id, warehouse_code, warehouse_name,
warehouse_type, warehouse_type_name, warehouse_structure, warehouse_nature, warm_layer_code, warm_layer_name,
director_name, director_phone, region_code, region_name, detail_address, longitude, latitude, building_region,
usage_region, remark, opening_up, nullify, create_time, create_by, create_by_name, update_time, update_by,
update_by_name, del_flag, IS_ENABLE ,WORK_MODE,TASK_MODE,STOCK_LOCK_MODE,SAMPLE_OUT_ORDER_NO_PREFIX,ORDER_NO_GENERATE_RULE,IN_ORDER_NO_PREFIX,
OUT_ORDER_NO_PREFIX
from warehouse
</sql>
<sql id="selectWarehousePo1">
<where>
<if test="warehouseId != null ">
and warehouse_id = #{warehouseId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="warehouseCode != null and warehouseCode != ''">
and warehouse_code like concat('%', #{warehouseCode}, '%')
</if>
<if test="warehouseName != null and warehouseName != ''">
and warehouse_name like concat('%', #{warehouseName}, '%')
</if>
<if test="warehouseType != null and warehouseType != ''">
and warehouse_type = #{warehouseType}
</if>
<if test="warehouseTypeName != null and warehouseTypeName != ''">
and warehouse_type_name like concat('%', #{warehouseTypeName}, '%')
</if>
<if test="warehouseStructure != null ">
and warehouse_structure = #{warehouseStructure}
</if>
<if test="warehouseNature != null ">
and warehouse_nature = #{warehouseNature}
</if>
<if test="warmLayerCode != null and warmLayerCode != ''">
and warm_layer_code = #{warmLayerCode}
</if>
<if test="warmLayerName != null and warmLayerName != ''">
and warm_layer_name like concat('%', #{warmLayerName}, '%')
</if>
<if test="directorName != null and directorName != ''">
and director_name like concat('%', #{directorName}, '%')
</if>
<if test="directorPhone != null and directorPhone != ''">
and director_phone = #{directorPhone}
</if>
<if test="regionCode != null and regionCode != ''">
and region_code = #{regionCode}
</if>
<if test="regionName != null and regionName != ''">
and region_name like concat('%', #{regionName}, '%')
</if>
<if test="detailAddress != null and detailAddress != ''">
and detail_address = #{detailAddress}
</if>
<if test="longitude != null and longitude != ''">
and longitude = #{longitude}
</if>
<if test="latitude != null and latitude != ''">
and latitude = #{latitude}
</if>
<if test="buildingRegion != null ">
and building_region = #{buildingRegion}
</if>
<if test="usageRegion != null ">
and usage_region = #{usageRegion}
</if>
<if test="openingUp != null ">
and opening_up = #{openingUp}
</if>
<if test="nullify != null ">
and nullify = #{nullify}
</if>
<if test="createByName != null and createByName != ''">
and create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="remark != null and remark != ''">
and remark like concat('%',#{remark},'%')
</if>
<if test="warehouseIds != null and warehouseIds.size > 0 ">
and warehouse_id in
<foreach collection="warehouseIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="orgIdList != null and orgIdList.size > 0 ">
and organization_id in
<foreach collection="orgIdList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<choose>
<when test="delFlag != null"> and del_flag = #{delFlag} </when>
<otherwise> and del_flag = 1 </otherwise>
</choose>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.basic.domain.warehouse.repository.todo.WarehouseDO" resultMap="WarehouseResult">
<include refid="selectWarehousePo"/>
<include refid="selectWarehousePo1"/>
order by create_time desc
</select>
</mapper>