仓库优化

This commit is contained in:
sxu 2025-07-01 11:07:04 +08:00
parent fdd2832866
commit 572bc11109
2 changed files with 36 additions and 18 deletions

View File

@ -37,11 +37,15 @@ public class WarehouseInfo extends BaseEntity {
@ApiModelProperty(value = "区域id") @ApiModelProperty(value = "区域id")
private Long areaId; private Long areaId;
private String areaName;
/** 食堂ID */ /** 食堂ID */
@Excel(name = "食堂ID") @Excel(name = "食堂ID")
@ApiModelProperty(value = "食堂ID") @ApiModelProperty(value = "食堂ID")
private Long canteenId; private Long canteenId;
private String canteenName;
/** 仓库编号 */ /** 仓库编号 */
@Excel(name = "仓库编号") @Excel(name = "仓库编号")
@ApiModelProperty(value = "仓库编号") @ApiModelProperty(value = "仓库编号")
@ -62,6 +66,8 @@ public class WarehouseInfo extends BaseEntity {
@ApiModelProperty(value = "仓库管理员") @ApiModelProperty(value = "仓库管理员")
private String manager; private String manager;
private String managerPhone;
/** 领取人id */ /** 领取人id */
@Excel(name = "领取人id") @Excel(name = "领取人id")
@ApiModelProperty(value = "领取人id") @ApiModelProperty(value = "领取人id")

View File

@ -8,11 +8,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="parentId" column="parent_id" /> <result property="parentId" column="parent_id" />
<result property="categoryId" column="category_id" /> <result property="categoryId" column="category_id" />
<result property="areaId" column="area_id" /> <result property="areaId" column="area_id" />
<result property="areaName" column="area_name" />
<result property="canteenId" column="canteen_id" /> <result property="canteenId" column="canteen_id" />
<result property="canteenName" column="canteen_name" />
<result property="warehouseCode" column="warehouse_code" /> <result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" /> <result property="warehouseName" column="warehouse_name" />
<result property="userId" column="user_id" /> <result property="userId" column="user_id" />
<result property="manager" column="manager" /> <result property="manager" column="manager" />
<result property="managerPhone" column="manager_phone" />
<result property="fetchUserId" column="fetch_user_id" /> <result property="fetchUserId" column="fetch_user_id" />
<result property="regionProvince" column="region_province" /> <result property="regionProvince" column="region_province" />
<result property="regionCity" column="region_city" /> <result property="regionCity" column="region_city" />
@ -29,34 +32,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectImsWarehouseInfoVo"> <sql id="selectImsWarehouseInfoVo">
select warehouse_id, parent_id, category_id, area_id, canteen_id, warehouse_code, warehouse_name, user_id, manager, fetch_user_id, region_province, region_city, region_district, address, warehouse_type, if_use_warehouse_area, if_use_warehouse_location, del_flag, create_by, create_time, update_by, update_time from ims_warehouse_info select iwi.warehouse_id, iwi.parent_id, iwi.category_id, iwi.area_id, iwi.canteen_id, iwi.warehouse_code,
iwi.warehouse_name, iwi.user_id, iwi.manager, iwi.manager_phone, iwi.fetch_user_id, iwi.region_province, iwi.region_city,
iwi.region_district, iwi.address, iwi.warehouse_type, iwi.if_use_warehouse_area, iwi.if_use_warehouse_location,
iwi.del_flag, iwi.create_by, iwi.create_time, iwi.update_by, iwi.update_time, bc.canteen_name, ba.area_name
from ims_warehouse_info iwi
left join basic_canteen bc on bc.canteen_id = iwi.canteen_id
left join basic_area ba on ba.area_id = bc.area_id
</sql> </sql>
<select id="selectImsWarehouseInfoList" parameterType="com.bonus.canteen.core.ims.domain.WarehouseInfo" resultMap="ImsWarehouseInfoResult"> <select id="selectImsWarehouseInfoList" parameterType="com.bonus.canteen.core.ims.domain.WarehouseInfo" resultMap="ImsWarehouseInfoResult">
<include refid="selectImsWarehouseInfoVo"/> <include refid="selectImsWarehouseInfoVo"/>
<where> <where>
<if test="parentId != null "> and parent_id = #{parentId}</if> <if test="parentId != null "> and iwi.parent_id = #{parentId}</if>
<if test="categoryId != null "> and category_id = #{categoryId}</if> <if test="categoryId != null "> and iwi.category_id = #{categoryId}</if>
<if test="areaId != null "> and area_id = #{areaId}</if> <if test="areaId != null "> and iwi.area_id = #{areaId}</if>
<if test="canteenId != null "> and canteen_id = #{canteenId}</if> <if test="canteenId != null "> and iwi.canteen_id = #{canteenId}</if>
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if> <if test="warehouseCode != null and warehouseCode != ''"> and iwi.warehouse_code = #{warehouseCode}</if>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if> <if test="warehouseName != null and warehouseName != ''"> and iwi.warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and iwi.user_id = #{userId}</if>
<if test="manager != null and manager != ''"> and manager = #{manager}</if> <if test="manager != null and manager != ''"> and iwi.manager = #{manager}</if>
<if test="fetchUserId != null "> and fetch_user_id = #{fetchUserId}</if> <if test="fetchUserId != null "> and iwi.fetch_user_id = #{fetchUserId}</if>
<if test="regionProvince != null and regionProvince != ''"> and region_province = #{regionProvince}</if> <if test="regionProvince != null and regionProvince != ''"> and iwi.region_province = #{regionProvince}</if>
<if test="regionCity != null and regionCity != ''"> and region_city = #{regionCity}</if> <if test="regionCity != null and regionCity != ''"> and iwi.region_city = #{regionCity}</if>
<if test="regionDistrict != null and regionDistrict != ''"> and region_district = #{regionDistrict}</if> <if test="regionDistrict != null and regionDistrict != ''"> and iwi.region_district = #{regionDistrict}</if>
<if test="address != null and address != ''"> and address = #{address}</if> <if test="address != null and address != ''"> and iwi.address = #{address}</if>
<if test="warehouseType != null "> and warehouse_type = #{warehouseType}</if> <if test="warehouseType != null "> and iwi.warehouse_type = #{warehouseType}</if>
<if test="ifUseWarehouseArea != null "> and if_use_warehouse_area = #{ifUseWarehouseArea}</if> <if test="ifUseWarehouseArea != null "> and iwi.if_use_warehouse_area = #{ifUseWarehouseArea}</if>
<if test="ifUseWarehouseLocation != null "> and if_use_warehouse_location = #{ifUseWarehouseLocation}</if> <if test="ifUseWarehouseLocation != null "> and iwi.if_use_warehouse_location = #{ifUseWarehouseLocation}</if>
</where> </where>
</select> </select>
<select id="selectImsWarehouseInfoByWarehouseId" parameterType="Long" resultMap="ImsWarehouseInfoResult"> <select id="selectImsWarehouseInfoByWarehouseId" parameterType="Long" resultMap="ImsWarehouseInfoResult">
<include refid="selectImsWarehouseInfoVo"/> <include refid="selectImsWarehouseInfoVo"/>
where warehouse_id = #{warehouseId} where iwi.warehouse_id = #{warehouseId}
</select> </select>
<select id="getImsWarehouseCountByAreaIds" resultType="Integer"> <select id="getImsWarehouseCountByAreaIds" resultType="Integer">
@ -79,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warehouseName != null and warehouseName != ''">warehouse_name,</if> <if test="warehouseName != null and warehouseName != ''">warehouse_name,</if>
<if test="userId != null">user_id,</if> <if test="userId != null">user_id,</if>
<if test="manager != null">manager,</if> <if test="manager != null">manager,</if>
<if test="managerPhone != null">manager_phone,</if>
<if test="fetchUserId != null">fetch_user_id,</if> <if test="fetchUserId != null">fetch_user_id,</if>
<if test="regionProvince != null">region_province,</if> <if test="regionProvince != null">region_province,</if>
<if test="regionCity != null">region_city,</if> <if test="regionCity != null">region_city,</if>
@ -102,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warehouseName != null and warehouseName != ''">#{warehouseName},</if> <if test="warehouseName != null and warehouseName != ''">#{warehouseName},</if>
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
<if test="manager != null">#{manager},</if> <if test="manager != null">#{manager},</if>
<if test="managerPhone != null">#{managerPhone},</if>
<if test="fetchUserId != null">#{fetchUserId},</if> <if test="fetchUserId != null">#{fetchUserId},</if>
<if test="regionProvince != null">#{regionProvince},</if> <if test="regionProvince != null">#{regionProvince},</if>
<if test="regionCity != null">#{regionCity},</if> <if test="regionCity != null">#{regionCity},</if>
@ -129,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warehouseName != null and warehouseName != ''">warehouse_name = #{warehouseName},</if> <if test="warehouseName != null and warehouseName != ''">warehouse_name = #{warehouseName},</if>
<if test="userId != null">user_id = #{userId},</if> <if test="userId != null">user_id = #{userId},</if>
<if test="manager != null">manager = #{manager},</if> <if test="manager != null">manager = #{manager},</if>
<if test="managerPhone != null">managerPhone = #{managerPhone},</if>
<if test="fetchUserId != null">fetch_user_id = #{fetchUserId},</if> <if test="fetchUserId != null">fetch_user_id = #{fetchUserId},</if>
<if test="regionProvince != null">region_province = #{regionProvince},</if> <if test="regionProvince != null">region_province = #{regionProvince},</if>
<if test="regionCity != null">region_city = #{regionCity},</if> <if test="regionCity != null">region_city = #{regionCity},</if>