This commit is contained in:
sxu 2025-05-15 16:00:56 +08:00
parent 03e369c5ee
commit 4dbb3a8088
12 changed files with 606 additions and 471 deletions

View File

@ -1,85 +0,0 @@
package com.bonus.canteen.core.warehouse.controller;
import com.bonus.canteen.core.warehouse.domain.WareHouseInfo;
import com.bonus.canteen.core.warehouse.service.WareHouseInfoService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 仓库Controller
*
* @author jsk
* @date 2025-04-05
*/
@Api(tags = "仓库接口")
@RestController
@RequestMapping("/warehouse_info")
public class WareHouseInfoController extends BaseController {
@Autowired
private WareHouseInfoService wareHouseInfoService;
/**
* @author jsk
* 查询仓库列表
*/
@ApiOperation(value = "查询仓库列表")
@GetMapping("/list")
public TableDataInfo list(WareHouseInfo WareHouseInfo) {
startPage();
List<WareHouseInfo> list = wareHouseInfoService.selectWareHouseInfoList(WareHouseInfo);
return getDataTable(list);
}
/**
* @author jsk
* 新增仓库
*/
@ApiOperation(value = "新增仓库")
//@PreventRepeatSubmit
//@RequiresPermissions("WareHouse:info:add")
@SysLog(title = "仓库", businessType = OperaType.INSERT, logType = 1,module = "库存管理->新增仓库")
@PostMapping("/add")
public AjaxResult add(@RequestBody WareHouseInfo WareHouseInfo) {
try {
return toAjax(wareHouseInfoService.insertWareHouseInfo(WareHouseInfo));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* @author jsk
* 修改仓库
*/
@ApiOperation(value = "修改仓库")
@SysLog(title = "仓库", businessType = OperaType.UPDATE, logType = 1,module = "库存管理->修改仓库")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody WareHouseInfo WareHouseInfo) {
try {
return toAjax(wareHouseInfoService.updateWareHouseInfo(WareHouseInfo));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* @author jsk
* 删除仓库
*/
@ApiOperation(value = "删除仓库")
@SysLog(title = "仓库", businessType = OperaType.DELETE, logType = 1,module = "库存管理->删除仓库")
@PostMapping("/del")
public AjaxResult remove(@RequestBody WareHouseInfo WareHouseInfo) {
return toAjax(wareHouseInfoService.deleteWareHouseInfoByWareHouseId(WareHouseInfo));
}
}

View File

@ -0,0 +1,119 @@
package com.bonus.canteen.core.warehouse.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.canteen.core.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.canteen.core.warehouse.domain.WarehouseInfo;
import com.bonus.canteen.core.warehouse.service.IWarehouseInfoService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.page.TableDataInfo;
/**
* 仓库信息Controller
*
* @author xsheng
* @date 2025-05-15
*/
@Api(tags = "仓库信息接口")
@RestController
@RequestMapping("/warehouse_info")
public class WarehouseInfoController extends BaseController {
@Autowired
private IWarehouseInfoService warehouseInfoService;
/**
* 查询仓库信息列表
*/
@ApiOperation(value = "查询仓库信息列表")
//@RequiresPermissions("warehouse:info:list")
@GetMapping("/list")
public TableDataInfo list(WarehouseInfo warehouseInfo) {
startPage();
List<WarehouseInfo> list = warehouseInfoService.selectWarehouseInfoList(warehouseInfo);
return getDataTable(list);
}
/**
* 导出仓库信息列表
*/
@ApiOperation(value = "导出仓库信息列表")
//@PreventRepeatSubmit
//@RequiresPermissions("warehouse:info:export")
@SysLog(title = "仓库信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出仓库信息")
@PostMapping("/export")
public void export(HttpServletResponse response, WarehouseInfo warehouseInfo) {
List<WarehouseInfo> list = warehouseInfoService.selectWarehouseInfoList(warehouseInfo);
ExcelUtil<WarehouseInfo> util = new ExcelUtil<WarehouseInfo>(WarehouseInfo.class);
util.exportExcel(response, list, "仓库信息数据");
}
/**
* 获取仓库信息详细信息
*/
@ApiOperation(value = "获取仓库信息详细信息")
//@RequiresPermissions("warehouse:info:query")
@GetMapping(value = "/{warehouseId}")
public AjaxResult getInfo(@PathVariable("warehouseId") Long warehouseId) {
return success(warehouseInfoService.selectWarehouseInfoByWarehouseId(warehouseId));
}
/**
* 新增仓库信息
*/
@ApiOperation(value = "新增仓库信息")
//@PreventRepeatSubmit
//@RequiresPermissions("warehouse:info:add")
@SysLog(title = "仓库信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增仓库信息")
@PostMapping
public AjaxResult add(@RequestBody WarehouseInfo warehouseInfo) {
try {
return toAjax(warehouseInfoService.insertWarehouseInfo(warehouseInfo));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 修改仓库信息
*/
@ApiOperation(value = "修改仓库信息")
//@PreventRepeatSubmit
//@RequiresPermissions("warehouse:info:edit")
@SysLog(title = "仓库信息", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改仓库信息")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody WarehouseInfo warehouseInfo) {
try {
return toAjax(warehouseInfoService.updateWarehouseInfo(warehouseInfo));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 删除仓库信息
*/
@ApiOperation(value = "删除仓库信息")
//@PreventRepeatSubmit
//@RequiresPermissions("warehouse:info:remove")
@SysLog(title = "仓库信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除仓库信息")
@PostMapping("/del/{warehouseIds}")
public AjaxResult remove(@PathVariable Long[] warehouseIds) {
return toAjax(warehouseInfoService.deleteWarehouseInfoByWarehouseIds(warehouseIds));
}
}

View File

@ -1,44 +0,0 @@
package com.bonus.canteen.core.warehouse.domain;
import com.bonus.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.ToString;
/**
* 超市对象 orderInfo
*
* @author xsheng
* @date 2025-04-05
*/
@Data
@ToString
public class WareHouseInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
private String warehouseId ;
private String warehouseNum ;
private String warehouseName ;
private String userId ;
private String regionProvince ;
private String regionCity ;
private String regionDistrict ;
private String address ;
private String warehouseType ;
private String status ;
private String delFlag ;
private String categoryId ;
private String categoryName ;
private String areaId ;
private String revision ;
private String createBy ;
private String updateBy ;
private String ifUseWarehouseArea ;
private String ifUseWarehouseLocation;
private String parentId ;
private String canteenId ;
private String fetchUserId ;
private String userName ;
}

View File

@ -0,0 +1,114 @@
package com.bonus.canteen.core.warehouse.domain;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
/**
* 仓库信息对象 warehouse_info
*
* @author xsheng
* @date 2025-05-15
*/
@Data
@ToString
public class WarehouseInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 仓库id */
private Long warehouseId;
/** 仓库编号 */
@Excel(name = "仓库编号")
@ApiModelProperty(value = "仓库编号")
private String warehouseNum;
/** 仓库名称 */
@Excel(name = "仓库名称")
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
/** 仓库管理员id */
@Excel(name = "仓库管理员id")
@ApiModelProperty(value = "仓库管理员id")
private Long userId;
/** 区域-省 */
@Excel(name = "区域-省")
@ApiModelProperty(value = "区域-省")
private String regionProvince;
/** 区域-市 */
@Excel(name = "区域-市")
@ApiModelProperty(value = "区域-市")
private String regionCity;
/** 区域-区 */
@Excel(name = "区域-区")
@ApiModelProperty(value = "区域-区")
private String regionDistrict;
/** 详细地址 */
@Excel(name = "详细地址")
@ApiModelProperty(value = "详细地址")
private String address;
/** 仓库类型 1原料 2商品 */
@Excel(name = "仓库类型 1原料 2商品")
@ApiModelProperty(value = "仓库类型 1原料 2商品")
private Long warehouseType;
/** 状态(1禁用2正常) */
@Excel(name = "状态(1禁用2正常)")
@ApiModelProperty(value = "状态(1禁用2正常)")
private Long status;
/** 仓库类别id warehouse_category */
@Excel(name = "仓库类别id warehouse_category")
@ApiModelProperty(value = "仓库类别id warehouse_category")
private Long categoryId;
/** 区域id */
@Excel(name = "区域id")
@ApiModelProperty(value = "区域id")
private Long areaId;
/** 乐观锁 */
@Excel(name = "乐观锁")
@ApiModelProperty(value = "乐观锁")
private Long revision;
/** 删除标识(0-正常,2-删除) */
private Long delFlag;
/** 是否启用库区(1是2否) */
@Excel(name = "是否启用库区(1是2否)")
@ApiModelProperty(value = "是否启用库区(1是2否)")
private Long ifUseWarehouseArea;
/** 是否启用库位(1是2否) */
@Excel(name = "是否启用库位(1是2否)")
@ApiModelProperty(value = "是否启用库位(1是2否)")
private Long ifUseWarehouseLocation;
/** 父级id */
@Excel(name = "父级id")
@ApiModelProperty(value = "父级id")
private Long parentId;
/** 食堂ID */
@Excel(name = "食堂ID")
@ApiModelProperty(value = "食堂ID")
private Long canteenId;
/** 领取人id */
@Excel(name = "领取人id")
@ApiModelProperty(value = "领取人id")
private Long fetchUserId;
}

View File

@ -1,55 +0,0 @@
package com.bonus.canteen.core.warehouse.mapper;
import com.bonus.canteen.core.warehouse.domain.WareHouseInfo;
import java.util.List;
/**
* 仓库Mapper接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface WareHouseInfoMapper {
/**
* 查询仓库列表
*
* @param wareHouseInfo 仓库
* @return 仓库集合
*/
public List<WareHouseInfo> selectWareHouseInfoList(WareHouseInfo wareHouseInfo);
/**
* 新增仓库
*
* @param wareHouseInfo 仓库
* @return 结果
*/
public int insertWareHouseInfo(WareHouseInfo wareHouseInfo);
/**
* 修改仓库
*
* @param wareHouseInfo 仓库
* @return 结果
*/
public int updateWareHouseInfo(WareHouseInfo wareHouseInfo);
/**
* 删除仓库
*
* @param WareHouseInfo 仓库主键
* @return 结果
*/
public int deleteWareHouseInfoByWareHouseId(WareHouseInfo WareHouseInfo);
/**
* 批量删除仓库
*
* @param wareHouseIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteWareHouseInfoByWareHouseIds(Long[] wareHouseIds);
}

View File

@ -0,0 +1,60 @@
package com.bonus.canteen.core.warehouse.mapper;
import java.util.List;
import com.bonus.canteen.core.warehouse.domain.WarehouseInfo;
/**
* 仓库信息Mapper接口
*
* @author xsheng
* @date 2025-05-15
*/
public interface WarehouseInfoMapper {
/**
* 查询仓库信息
*
* @param warehouseId 仓库信息主键
* @return 仓库信息
*/
public WarehouseInfo selectWarehouseInfoByWarehouseId(Long warehouseId);
/**
* 查询仓库信息列表
*
* @param warehouseInfo 仓库信息
* @return 仓库信息集合
*/
public List<WarehouseInfo> selectWarehouseInfoList(WarehouseInfo warehouseInfo);
/**
* 新增仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
public int insertWarehouseInfo(WarehouseInfo warehouseInfo);
/**
* 修改仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
public int updateWarehouseInfo(WarehouseInfo warehouseInfo);
/**
* 删除仓库信息
*
* @param warehouseId 仓库信息主键
* @return 结果
*/
public int deleteWarehouseInfoByWarehouseId(Long warehouseId);
/**
* 批量删除仓库信息
*
* @param warehouseIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteWarehouseInfoByWarehouseIds(Long[] warehouseIds);
}

View File

@ -0,0 +1,60 @@
package com.bonus.canteen.core.warehouse.service;
import java.util.List;
import com.bonus.canteen.core.warehouse.domain.WarehouseInfo;
/**
* 仓库信息Service接口
*
* @author xsheng
* @date 2025-05-15
*/
public interface IWarehouseInfoService {
/**
* 查询仓库信息
*
* @param warehouseId 仓库信息主键
* @return 仓库信息
*/
public WarehouseInfo selectWarehouseInfoByWarehouseId(Long warehouseId);
/**
* 查询仓库信息列表
*
* @param warehouseInfo 仓库信息
* @return 仓库信息集合
*/
public List<WarehouseInfo> selectWarehouseInfoList(WarehouseInfo warehouseInfo);
/**
* 新增仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
public int insertWarehouseInfo(WarehouseInfo warehouseInfo);
/**
* 修改仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
public int updateWarehouseInfo(WarehouseInfo warehouseInfo);
/**
* 批量删除仓库信息
*
* @param warehouseIds 需要删除的仓库信息主键集合
* @return 结果
*/
public int deleteWarehouseInfoByWarehouseIds(Long[] warehouseIds);
/**
* 删除仓库信息信息
*
* @param warehouseId 仓库信息主键
* @return 结果
*/
public int deleteWarehouseInfoByWarehouseId(Long warehouseId);
}

View File

@ -1,54 +0,0 @@
package com.bonus.canteen.core.warehouse.service;
import com.bonus.canteen.core.warehouse.domain.WareHouseInfo;
import java.util.List;
/**
* 仓库Service接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface WareHouseInfoService {
/**
* 查询仓库列表
*
* @param wareHouseInfo 仓库
* @return 仓库集合
*/
public List<WareHouseInfo> selectWareHouseInfoList(WareHouseInfo wareHouseInfo);
/**
* 新增仓库
*
* @param wareHouseInfo 仓库
* @return 结果
*/
public int insertWareHouseInfo(WareHouseInfo wareHouseInfo);
/**
* 修改仓库
*
* @param wareHouseInfo 仓库
* @return 结果
*/
public int updateWareHouseInfo(WareHouseInfo wareHouseInfo);
/**
* 批量删除仓库
*
* @param wareHouseIds 需要删除的仓库主键集合
* @return 结果
*/
public int deleteWareHouseInfoByWareHouseIds(Long[] wareHouseIds);
/**
* 删除仓库信息
*
* @param wareHouseId 仓库主键
* @return 结果
*/
public int deleteWareHouseInfoByWareHouseId(WareHouseInfo WareHouseInfo);
}

View File

@ -1,88 +0,0 @@
package com.bonus.canteen.core.warehouse.service.impl;
import com.bonus.canteen.core.warehouse.domain.WareHouseInfo;
import com.bonus.canteen.core.warehouse.mapper.WareHouseInfoMapper;
import com.bonus.canteen.core.warehouse.service.WareHouseInfoService;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 仓库Service业务层处理
*
* @author xsheng
* @date 2025-04-05
*/
@Service
public class WareHouseInfoServiceImpl implements WareHouseInfoService {
@Autowired
private WareHouseInfoMapper wareHouseInfoMapper;
/**
* 查询仓库列表
*
* @param WareHouseInfo 仓库
* @return 仓库
*/
@Override
public List<WareHouseInfo> selectWareHouseInfoList(WareHouseInfo WareHouseInfo) {
return wareHouseInfoMapper.selectWareHouseInfoList(WareHouseInfo);
}
/**
* 新增仓库
*
* @param WareHouseInfo 仓库
* @return 结果
*/
@Override
public int insertWareHouseInfo(WareHouseInfo WareHouseInfo) {
WareHouseInfo.setCreateTime(DateUtils.getNowDate());
try {
return wareHouseInfoMapper.insertWareHouseInfo(WareHouseInfo);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 修改仓库
*
* @param WareHouseInfo 仓库
* @return 结果
*/
@Override
public int updateWareHouseInfo(WareHouseInfo WareHouseInfo) {
WareHouseInfo.setUpdateTime(DateUtils.getNowDate());
try {
return wareHouseInfoMapper.updateWareHouseInfo(WareHouseInfo);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 批量删除仓库
*
* @param WareHouseIds 需要删除的仓库主键
* @return 结果
*/
@Override
public int deleteWareHouseInfoByWareHouseIds(Long[] WareHouseIds) {
return wareHouseInfoMapper.deleteWareHouseInfoByWareHouseIds(WareHouseIds);
}
/**
* 删除仓库信息
*
* @param WareHouseId 仓库主键
* @return 结果
*/
@Override
public int deleteWareHouseInfoByWareHouseId(WareHouseInfo WareHouseInfo) {
return wareHouseInfoMapper.deleteWareHouseInfoByWareHouseId(WareHouseInfo);
}
}

View File

@ -0,0 +1,98 @@
package com.bonus.canteen.core.warehouse.service.impl;
import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.canteen.core.warehouse.mapper.WarehouseInfoMapper;
import com.bonus.canteen.core.warehouse.domain.WarehouseInfo;
import com.bonus.canteen.core.warehouse.service.IWarehouseInfoService;
/**
* 仓库信息Service业务层处理
*
* @author xsheng
* @date 2025-05-15
*/
@Service
public class WarehouseInfoServiceImpl implements IWarehouseInfoService {
@Autowired
private WarehouseInfoMapper warehouseInfoMapper;
/**
* 查询仓库信息
*
* @param warehouseId 仓库信息主键
* @return 仓库信息
*/
@Override
public WarehouseInfo selectWarehouseInfoByWarehouseId(Long warehouseId) {
return warehouseInfoMapper.selectWarehouseInfoByWarehouseId(warehouseId);
}
/**
* 查询仓库信息列表
*
* @param warehouseInfo 仓库信息
* @return 仓库信息
*/
@Override
public List<WarehouseInfo> selectWarehouseInfoList(WarehouseInfo warehouseInfo) {
return warehouseInfoMapper.selectWarehouseInfoList(warehouseInfo);
}
/**
* 新增仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
@Override
public int insertWarehouseInfo(WarehouseInfo warehouseInfo) {
warehouseInfo.setCreateTime(DateUtils.getNowDate());
try {
return warehouseInfoMapper.insertWarehouseInfo(warehouseInfo);
} catch (Exception e) {
throw new ServiceException("错误信息描述, " + e.getMessage());
}
}
/**
* 修改仓库信息
*
* @param warehouseInfo 仓库信息
* @return 结果
*/
@Override
public int updateWarehouseInfo(WarehouseInfo warehouseInfo) {
warehouseInfo.setUpdateTime(DateUtils.getNowDate());
try {
return warehouseInfoMapper.updateWarehouseInfo(warehouseInfo);
} catch (Exception e) {
throw new ServiceException("错误信息描述, " + e.getMessage());
}
}
/**
* 批量删除仓库信息
*
* @param warehouseIds 需要删除的仓库信息主键
* @return 结果
*/
@Override
public int deleteWarehouseInfoByWarehouseIds(Long[] warehouseIds) {
return warehouseInfoMapper.deleteWarehouseInfoByWarehouseIds(warehouseIds);
}
/**
* 删除仓库信息信息
*
* @param warehouseId 仓库信息主键
* @return 结果
*/
@Override
public int deleteWarehouseInfoByWarehouseId(Long warehouseId) {
return warehouseInfoMapper.deleteWarehouseInfoByWarehouseId(warehouseId);
}
}

View File

@ -1,145 +0,0 @@
<?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.bonus.canteen.core.warehouse.mapper.WareHouseInfoMapper">
<resultMap type="com.bonus.canteen.core.warehouse.domain.WareHouseInfo" id="WareHouseInfoResult">
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseNum" column="warehouse_num" />
<result property="warehouseName" column="warehouse_name" />
<result property="userId" column="user_id" />
<result property="regionProvince" column="region_province" />
<result property="regionCity" column="region_city" />
<result property="regionDistrict" column="region_district" />
<result property="address" column="address" />
<result property="warehouseType" column="warehouse_type" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="categoryId" column="category_id" />
<result property="areaId" column="area_id" />
<result property="revision" column="revision" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="ifUseWarehouseArea" column="if_use_warehouse_area" />
<result property="ifUseWarehouseLocation" column="if_use_warehouse_location" />
<result property="parentId" column="parent_id" />
<result property="canteenId" column="canteen_id" />
<result property="fetchUserId" column="fetch_user_id" />
</resultMap>
<sql id="selectWareHouseInfoVo">
select warehouse_id,warehouse_num,warehouse_name,user_id,region_province,region_city,region_district,address,warehouse_type,status,del_flag,category_id,area_id,revision,create_by,create_time,update_by,update_time,if_use_warehouse_area,if_use_warehouse_location,parent_id,canteen_id,fetch_user_id from warehouse_info
</sql>
<select id="selectWareHouseInfoList" parameterType="com.bonus.canteen.core.warehouse.domain.WareHouseInfo" resultType="com.bonus.canteen.core.warehouse.domain.WareHouseInfo">
select wh.warehouse_id as warehouseid,wh.warehouse_num as warehousenum,wh.warehouse_name as warehousename,wh.user_id as userid,wh.region_province as regionprovince,
wh.region_city as regioncity,wh.region_district as regiondistrict,wh.address,wh.warehouse_type as warehousetype,wh.status,wh.del_flag as delflag,
wh.category_id as typeid,wh.area_id as areaid,aa.area_name as areaname,wh.revision,wh.create_by as createby,wh.create_time as createtime,wh.update_by as updateby,wh.update_time as updatetime,
wh.if_use_warehouse_area as ifusewarehousearea,wh.if_use_warehouse_location as ifusewarehouselocation
,wh.parent_id as parentid,wh.canteen_id as canteenid,ac.canteen_name as canteenname,wh.fetch_user_id,su.user_name as username
from warehouse_info wh
left join alloc_area aa on wh.area_id=aa.area_id
left join alloc_canteen ac on wh.canteen_id=ac.canteen_id
left join sys_user su on wh.fetch_user_id=su.user_id
<where>
<if test="areaId != null and areaId != ''"> and wh.area_id = #{areaId}</if>
<if test="warehouseName != null and warehouseName != ''"> and wh.warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="userName != null and userName != ''"> and su.user_name like concat('%', #{userName}, '%')</if>
</where>
</select>
<insert id="insertWareHouseInfo" parameterType="com.bonus.canteen.core.warehouse.domain.WareHouseInfo">
insert into warehouse_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseNum !=null" >warehouse_num , </if>
<if test="warehouseName !=null" >warehouse_name , </if>
<if test="userId !=null" >user_id , </if>
<if test="userType !=null" >user_type , </if>
<if test="regionProvince !=null" >region_province , </if>
<if test="regionCity !=null" >region_city , </if>
<if test="regionDistrict !=null" >region_district , </if>
<if test="address !=null" >address , </if>
<if test="warehouseType !=null" >warehouse_type , </if>
<if test="status !=null" >status , </if>
<if test="delFlag !=null" >del_flag , </if>
<if test="categoryId !=null" >category_id , </if>
<if test="areaId !=null" >area_id , </if>
<if test="revision !=null" >revision , </if>
<if test="createBy !=null" >create_by , </if>
<if test="createTime !=null" >create_time , </if>
<if test="updateBy !=null" >update_by , </if>
<if test="updateTime !=null" >update_time , </if>
<if test="ifUseWarehouseArea !=null" >if_use_warehouse_area , </if>
<if test="ifUseWarehouseLocation!=null" >if_use_warehouse_location , </if>
<if test="parentId !=null" >parent_id , </if>
<if test="canteenId !=null" >canteen_id , </if>
<if test="fetchUserId !=null" >fetch_user_id , </if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseNum !=null" >#{warehouseNum },</if>
<if test="warehouseName !=null" >#{warehouseName },</if>
<if test="userId !=null" >#{userId },</if>
<if test="userType !=null" >#{userType },</if>
<if test="regionProvince !=null" >#{regionProvince },</if>
<if test="regionCity !=null" >#{regionCity },</if>
<if test="regionDistrict !=null" >#{regionDistrict },</if>
<if test="address !=null" >#{address },</if>
<if test="warehouseType !=null" >#{warehouseType },</if>
<if test="status !=null" >#{status },</if>
<if test="delFlag !=null" >#{delFlag },</if>
<if test="typeId !=null" >#{typeId },</if>
<if test="areaId !=null" >#{areaId },</if>
<if test="revision !=null" >#{revision },</if>
<if test="createBy !=null" >#{createBy },</if>
<if test="createTime !=null" >#{createTime },</if>
<if test="updateBy !=null" >#{updateBy },</if>
<if test="updateTime !=null" >#{updateTime },</if>
<if test="ifUseWarehouseArea !=null" >#{ifUseWarehouseArea },</if>
<if test="ifUseWarehouseLocation!=null" >#{ifUseWarehouseLocation },</if>
<if test="parentId !=null" >#{parentId },</if>
<if test="canteenId !=null" >#{canteenId },</if>
<if test="fetchUserId !=null" >#{fetchUserId },</if>
</trim>
</insert>
<update id="updateWareHouseInfo" parameterType="com.bonus.canteen.core.warehouse.domain.WareHouseInfo">
update warehouse_info
<trim prefix="SET" suffixOverrides=",">
<if test="warehouseNum !=null" >warehouse_num =#{warehouseNum },</if>
<if test="warehouseName !=null" >warehouse_name =#{warehouseName },</if>
<if test="userId !=null" >user_id =#{userId },</if>
<if test="userType !=null" >user_type =#{userType },</if>
<if test="regionProvince !=null" >region_province =#{regionProvince },</if>
<if test="regionCity !=null" >region_city =#{regionCity },</if>
<if test="regionDistrict !=null" >region_district =#{regionDistrict },</if>
<if test="address !=null" >address =#{address },</if>
<if test="warehouseType !=null" >warehouse_type =#{warehouseType },</if>
<if test="status !=null" >status =#{status },</if>
<if test="delFlag !=null" >del_flag =#{delFlag },</if>
<if test="categoryId !=null" >category_id =#{categoryId },</if>
<if test="areaId !=null" >area_id =#{areaId },</if>
<if test="revision !=null" >revision =#{revision },</if>
<if test="updateBy !=null" >update_by =#{updateBy },</if>
<if test="updateTime !=null" >update_time =#{updateTime },</if>
<if test="ifUseWarehouseArea !=null" >if_use_warehouse_area =#{ifUseWarehouseArea },</if>
<if test="ifUseWarehouseLocation!=null" >if_use_warehouse_location =#{ifUseWarehouseLocation },</if>
<if test="parentId !=null" >parent_id =#{parentId },</if>
<if test="canteenId !=null" >canteen_id =#{canteenId },</if>
<if test="fetchUserId !=null" >fetch_user_id =#{fetchUserId },</if>
</trim>
where warehouse_id = #{warehouseId}
</update>
<delete id="deleteWareHouseInfoByWareHouseId" parameterType="com.bonus.canteen.core.warehouse.domain.WareHouseInfo">
delete from warehouse_info where warehouse_id = #{warehouseId}
</delete>
<delete id="deleteWareHouseInfoByWareHouseIds" parameterType="String">
delete from warehouse_info where warehouse_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{warehouseId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,155 @@
<?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.bonus.canteen.core.warehouse.mapper.WarehouseInfoMapper">
<resultMap type="com.bonus.canteen.core.warehouse.domain.WarehouseInfo" id="WarehouseInfoResult">
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseNum" column="warehouse_num" />
<result property="warehouseName" column="warehouse_name" />
<result property="userId" column="user_id" />
<result property="regionProvince" column="region_province" />
<result property="regionCity" column="region_city" />
<result property="regionDistrict" column="region_district" />
<result property="address" column="address" />
<result property="warehouseType" column="warehouse_type" />
<result property="status" column="status" />
<result property="categoryId" column="category_id" />
<result property="areaId" column="area_id" />
<result property="revision" column="revision" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="ifUseWarehouseArea" column="if_use_warehouse_area" />
<result property="ifUseWarehouseLocation" column="if_use_warehouse_location" />
<result property="parentId" column="parent_id" />
<result property="canteenId" column="canteen_id" />
<result property="fetchUserId" column="fetch_user_id" />
</resultMap>
<sql id="selectWarehouseInfoVo">
select warehouse_id, warehouse_num, warehouse_name, user_id, region_province, region_city, region_district, address, warehouse_type, status, category_id, area_id, revision, del_flag, create_by, create_time, update_by, update_time, if_use_warehouse_area, if_use_warehouse_location, parent_id, canteen_id, fetch_user_id from warehouse_info
</sql>
<select id="selectWarehouseInfoList" parameterType="com.bonus.canteen.core.warehouse.domain.WarehouseInfo" resultMap="WarehouseInfoResult">
<include refid="selectWarehouseInfoVo"/>
<where>
<if test="warehouseNum != null and warehouseNum != ''"> and warehouse_num = #{warehouseNum}</if>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="regionProvince != null and regionProvince != ''"> and region_province = #{regionProvince}</if>
<if test="regionCity != null and regionCity != ''"> and region_city = #{regionCity}</if>
<if test="regionDistrict != null and regionDistrict != ''"> and region_district = #{regionDistrict}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="warehouseType != null "> and warehouse_type = #{warehouseType}</if>
<if test="status != null "> and status = #{status}</if>
<if test="categoryId != null "> and category_id = #{categoryId}</if>
<if test="areaId != null "> and area_id = #{areaId}</if>
<if test="revision != null "> and revision = #{revision}</if>
<if test="ifUseWarehouseArea != null "> and if_use_warehouse_area = #{ifUseWarehouseArea}</if>
<if test="ifUseWarehouseLocation != null "> and if_use_warehouse_location = #{ifUseWarehouseLocation}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
<if test="fetchUserId != null "> and fetch_user_id = #{fetchUserId}</if>
</where>
</select>
<select id="selectWarehouseInfoByWarehouseId" parameterType="Long" resultMap="WarehouseInfoResult">
<include refid="selectWarehouseInfoVo"/>
where warehouse_id = #{warehouseId}
</select>
<insert id="insertWarehouseInfo" parameterType="com.bonus.canteen.core.warehouse.domain.WarehouseInfo" useGeneratedKeys="true" keyProperty="warehouseId">
insert into warehouse_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseNum != null">warehouse_num,</if>
<if test="warehouseName != null and warehouseName != ''">warehouse_name,</if>
<if test="userId != null">user_id,</if>
<if test="regionProvince != null">region_province,</if>
<if test="regionCity != null">region_city,</if>
<if test="regionDistrict != null">region_district,</if>
<if test="address != null">address,</if>
<if test="warehouseType != null">warehouse_type,</if>
<if test="status != null">status,</if>
<if test="categoryId != null">category_id,</if>
<if test="areaId != null">area_id,</if>
<if test="revision != null">revision,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="ifUseWarehouseArea != null">if_use_warehouse_area,</if>
<if test="ifUseWarehouseLocation != null">if_use_warehouse_location,</if>
<if test="parentId != null">parent_id,</if>
<if test="canteenId != null">canteen_id,</if>
<if test="fetchUserId != null">fetch_user_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseNum != null">#{warehouseNum},</if>
<if test="warehouseName != null and warehouseName != ''">#{warehouseName},</if>
<if test="userId != null">#{userId},</if>
<if test="regionProvince != null">#{regionProvince},</if>
<if test="regionCity != null">#{regionCity},</if>
<if test="regionDistrict != null">#{regionDistrict},</if>
<if test="address != null">#{address},</if>
<if test="warehouseType != null">#{warehouseType},</if>
<if test="status != null">#{status},</if>
<if test="categoryId != null">#{categoryId},</if>
<if test="areaId != null">#{areaId},</if>
<if test="revision != null">#{revision},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="ifUseWarehouseArea != null">#{ifUseWarehouseArea},</if>
<if test="ifUseWarehouseLocation != null">#{ifUseWarehouseLocation},</if>
<if test="parentId != null">#{parentId},</if>
<if test="canteenId != null">#{canteenId},</if>
<if test="fetchUserId != null">#{fetchUserId},</if>
</trim>
</insert>
<update id="updateWarehouseInfo" parameterType="com.bonus.canteen.core.warehouse.domain.WarehouseInfo">
update warehouse_info
<trim prefix="SET" suffixOverrides=",">
<if test="warehouseNum != null">warehouse_num = #{warehouseNum},</if>
<if test="warehouseName != null and warehouseName != ''">warehouse_name = #{warehouseName},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="regionProvince != null">region_province = #{regionProvince},</if>
<if test="regionCity != null">region_city = #{regionCity},</if>
<if test="regionDistrict != null">region_district = #{regionDistrict},</if>
<if test="address != null">address = #{address},</if>
<if test="warehouseType != null">warehouse_type = #{warehouseType},</if>
<if test="status != null">status = #{status},</if>
<if test="categoryId != null">category_id = #{categoryId},</if>
<if test="areaId != null">area_id = #{areaId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="ifUseWarehouseArea != null">if_use_warehouse_area = #{ifUseWarehouseArea},</if>
<if test="ifUseWarehouseLocation != null">if_use_warehouse_location = #{ifUseWarehouseLocation},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="canteenId != null">canteen_id = #{canteenId},</if>
<if test="fetchUserId != null">fetch_user_id = #{fetchUserId},</if>
</trim>
where warehouse_id = #{warehouseId}
</update>
<delete id="deleteWarehouseInfoByWarehouseId" parameterType="Long">
delete from warehouse_info where warehouse_id = #{warehouseId}
</delete>
<delete id="deleteWarehouseInfoByWarehouseIds" parameterType="String">
delete from warehouse_info where warehouse_id in
<foreach item="warehouseId" collection="array" open="(" separator="," close=")">
#{warehouseId}
</foreach>
</delete>
</mapper>