add - 仓库信息、货道信息

master
yinq 1 year ago
parent 45268e1897
commit 0ee68dc940

@ -0,0 +1,103 @@
package com.aucma.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
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.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.enums.BusinessType;
import com.aucma.base.domain.BaseSpaceInfo;
import com.aucma.base.service.IBaseSpaceInfoService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2023-09-20
*/
@RestController
@RequestMapping("/base/spaceInfo" )
public class BaseSpaceInfoController extends BaseController {
@Autowired
private IBaseSpaceInfoService baseSpaceInfoService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceInfo:list')" )
@GetMapping("/list" )
public TableDataInfo list(BaseSpaceInfo baseSpaceInfo) {
startPage();
List<BaseSpaceInfo> list = baseSpaceInfoService.selectBaseSpaceInfoList(baseSpaceInfo);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceInfo:export')" )
@Log(title = "货道信息" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, BaseSpaceInfo baseSpaceInfo) {
List<BaseSpaceInfo> list = baseSpaceInfoService.selectBaseSpaceInfoList(baseSpaceInfo);
ExcelUtil<BaseSpaceInfo> util = new ExcelUtil<BaseSpaceInfo>(BaseSpaceInfo. class);
util.exportExcel(response, list, "货道信息数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceInfo:query')" )
@GetMapping(value = "/{objId}" )
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
return success(baseSpaceInfoService.selectBaseSpaceInfoByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceInfo:add')" )
@Log(title = "货道信息" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseSpaceInfo baseSpaceInfo) {
baseSpaceInfo.setCreatedBy(getUsername());
baseSpaceInfo.setCreatedTime(DateUtils.getNowDate());
return toAjax(baseSpaceInfoService.insertBaseSpaceInfo(baseSpaceInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceInfo:edit')" )
@Log(title = "货道信息" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseSpaceInfo baseSpaceInfo) {
baseSpaceInfo.setUpdatedBy(getUsername());
baseSpaceInfo.setUpdatedTime(DateUtils.getNowDate());
return toAjax(baseSpaceInfoService.updateBaseSpaceInfo(baseSpaceInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:spaceInfo:remove')" )
@Log(title = "货道信息" , businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}" )
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(baseSpaceInfoService.deleteBaseSpaceInfoByObjIds(objIds));
}
}

@ -0,0 +1,112 @@
package com.aucma.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
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.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.enums.BusinessType;
import com.aucma.base.domain.BaseStoreInfo;
import com.aucma.base.service.IBaseStoreInfoService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2023-09-20
*/
@RestController
@RequestMapping("/base/storeInfo")
public class BaseStoreInfoController extends BaseController {
@Autowired
private IBaseStoreInfoService baseStoreInfoService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:storeInfo:list')")
@GetMapping("/list")
public TableDataInfo list(BaseStoreInfo baseStoreInfo) {
startPage();
List<BaseStoreInfo> list = baseStoreInfoService.selectBaseStoreInfoList(baseStoreInfo);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/findStoreList")
public AjaxResult findStoreList(BaseStoreInfo baseStoreInfo) {
List<BaseStoreInfo> list = baseStoreInfoService.selectBaseStoreInfoList(baseStoreInfo);
return success(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:storeInfo:export')")
@Log(title = "仓库信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseStoreInfo baseStoreInfo) {
List<BaseStoreInfo> list = baseStoreInfoService.selectBaseStoreInfoList(baseStoreInfo);
ExcelUtil<BaseStoreInfo> util = new ExcelUtil<BaseStoreInfo>(BaseStoreInfo.class);
util.exportExcel(response, list, "仓库信息数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:storeInfo:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
return success(baseStoreInfoService.selectBaseStoreInfoByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:storeInfo:add')")
@Log(title = "仓库信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseStoreInfo baseStoreInfo) {
baseStoreInfo.setCreatedBy(getUsername());
baseStoreInfo.setCreatedTime(DateUtils.getNowDate());
return toAjax(baseStoreInfoService.insertBaseStoreInfo(baseStoreInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:storeInfo:edit')")
@Log(title = "仓库信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseStoreInfo baseStoreInfo) {
baseStoreInfo.setUpdatedBy(getUsername());
baseStoreInfo.setUpdatedTime(DateUtils.getNowDate());
return toAjax(baseStoreInfoService.updateBaseStoreInfo(baseStoreInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:storeInfo:remove')")
@Log(title = "仓库信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(baseStoreInfoService.deleteBaseStoreInfoByObjIds(objIds));
}
}

@ -0,0 +1,294 @@
package com.aucma.base.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
/**
* base_spaceinfo
*
* @author Yinq
* @date 2023-09-20
*/
public class BaseSpaceInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
*
*/
@Excel(name = "货道编号")
private String spaceCode;
/**
*
*/
@Excel(name = "货道名称")
private String spaceName;
/**
*
*/
@Excel(name = "货道容量")
private Long spaceCapacity;
/**
*
*/
@Excel(name = "货道库存")
private Long spaceStock;
/**
*
*/
@Excel(name = "货道状态")
private Long spaceStatus;
/**
*
*/
@Excel(name = "货道类型")
private Long spaceType;
/**
*
*/
@Excel(name = "所属仓库编号")
private String storeCode;
/**
*
*/
@Excel(name = "所属仓库名称")
private String storeName;
/**
*
*/
@Excel(name = "物料编号")
private String materialCode;
/**
*
*/
@Excel(name = "物料名称")
private String materialName;
/**
*
*/
@Excel(name = "工单编号")
private String orderCode;
/**
*
*/
@Excel(name = "条码编号")
private String barcodeCode;
/**
*
*/
@Excel(name = "是否标识")
private Long isFlag;
/**
*
*/
@Excel(name = "创建人")
private String createdBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
*
*/
@Excel(name = "更新人")
private String updatedBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setSpaceCode(String spaceCode) {
this.spaceCode = spaceCode;
}
public String getSpaceCode() {
return spaceCode;
}
public void setSpaceName(String spaceName) {
this.spaceName = spaceName;
}
public String getSpaceName() {
return spaceName;
}
public void setSpaceCapacity(Long spaceCapacity) {
this.spaceCapacity = spaceCapacity;
}
public Long getSpaceCapacity() {
return spaceCapacity;
}
public void setSpaceStock(Long spaceStock) {
this.spaceStock = spaceStock;
}
public Long getSpaceStock() {
return spaceStock;
}
public void setSpaceStatus(Long spaceStatus) {
this.spaceStatus = spaceStatus;
}
public Long getSpaceStatus() {
return spaceStatus;
}
public void setSpaceType(Long spaceType) {
this.spaceType = spaceType;
}
public Long getSpaceType() {
return spaceType;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public String getStoreCode() {
return storeCode;
}
public void setIsFlag(Long isFlag) {
this.isFlag = isFlag;
}
public Long getIsFlag() {
return isFlag;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getCreatedTime() {
return createdTime;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUpdatedTime() {
return updatedTime;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName() {
return materialName;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setBarcodeCode(String barcodeCode) {
this.barcodeCode = barcodeCode;
}
public String getBarcodeCode() {
return barcodeCode;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("spaceCode", getSpaceCode())
.append("spaceName", getSpaceName())
.append("spaceCapacity", getSpaceCapacity())
.append("spaceStock", getSpaceStock())
.append("spaceStatus", getSpaceStatus())
.append("spaceType", getSpaceType())
.append("storeCode", getStoreCode())
.append("isFlag", getIsFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("materialName", getMaterialName())
.append("orderCode", getOrderCode())
.append("barcodeCode", getBarcodeCode())
.toString();
}
}

@ -0,0 +1,219 @@
package com.aucma.base.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
/**
* base_storeinfo
*
* @author Yinq
* @date 2023-09-20
*/
public class BaseStoreInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
*
*/
@Excel(name = "仓库编号")
private String storeCode;
/**
*
*/
@Excel(name = "仓库名称")
private String storeName;
/**
*
*/
@Excel(name = "仓库类型")
private Long storeType;
/**
*
*/
@Excel(name = "仓库区域")
private String storeArea;
/**
*
*/
@Excel(name = "仓库状态")
private Long storeStatus;
/**
*
*/
@Excel(name = "所属工厂编号")
private String plantCode;
/**
*
*/
@Excel(name = "所属工厂名称")
private String plantName;
/**
*
*/
@Excel(name = "启用标识")
private Long isFlag;
/**
*
*/
@Excel(name = "创建人")
private String createdBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
*
*/
@Excel(name = "更新人")
private String updatedBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
public String getPlantCode() {
return plantCode;
}
public void setPlantCode(String plantCode) {
this.plantCode = plantCode;
}
public String getPlantName() {
return plantName;
}
public void setPlantName(String plantName) {
this.plantName = plantName;
}
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public String getStoreCode() {
return storeCode;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getStoreName() {
return storeName;
}
public void setStoreType(Long storeType) {
this.storeType = storeType;
}
public Long getStoreType() {
return storeType;
}
public void setStoreArea(String storeArea) {
this.storeArea = storeArea;
}
public String getStoreArea() {
return storeArea;
}
public void setStoreStatus(Long storeStatus) {
this.storeStatus = storeStatus;
}
public Long getStoreStatus() {
return storeStatus;
}
public void setIsFlag(Long isFlag) {
this.isFlag = isFlag;
}
public Long getIsFlag() {
return isFlag;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getCreatedTime() {
return createdTime;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUpdatedTime() {
return updatedTime;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("storeCode", getStoreCode())
.append("storeName", getStoreName())
.append("storeType", getStoreType())
.append("storeArea", getStoreArea())
.append("storeStatus", getStoreStatus())
.append("isFlag", getIsFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.aucma.base.mapper;
import java.util.List;
import com.aucma.base.domain.BaseSpaceInfo;
/**
* Mapper
*
* @author Yinq
* @date 2023-09-20
*/
public interface BaseSpaceInfoMapper
{
/**
*
*
* @param objId
* @return
*/
public BaseSpaceInfo selectBaseSpaceInfoByObjId(Long objId);
/**
*
*
* @param baseSpaceInfo
* @return
*/
public List<BaseSpaceInfo> selectBaseSpaceInfoList(BaseSpaceInfo baseSpaceInfo);
/**
*
*
* @param baseSpaceInfo
* @return
*/
public int insertBaseSpaceInfo(BaseSpaceInfo baseSpaceInfo);
/**
*
*
* @param baseSpaceInfo
* @return
*/
public int updateBaseSpaceInfo(BaseSpaceInfo baseSpaceInfo);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseSpaceInfoByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseSpaceInfoByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.aucma.base.mapper;
import java.util.List;
import com.aucma.base.domain.BaseStoreInfo;
/**
* Mapper
*
* @author Yinq
* @date 2023-09-20
*/
public interface BaseStoreInfoMapper
{
/**
*
*
* @param objId
* @return
*/
public BaseStoreInfo selectBaseStoreInfoByObjId(Long objId);
/**
*
*
* @param baseStoreInfo
* @return
*/
public List<BaseStoreInfo> selectBaseStoreInfoList(BaseStoreInfo baseStoreInfo);
/**
*
*
* @param baseStoreInfo
* @return
*/
public int insertBaseStoreInfo(BaseStoreInfo baseStoreInfo);
/**
*
*
* @param baseStoreInfo
* @return
*/
public int updateBaseStoreInfo(BaseStoreInfo baseStoreInfo);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseStoreInfoByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseStoreInfoByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.aucma.base.service;
import java.util.List;
import com.aucma.base.domain.BaseSpaceInfo;
/**
* Service
*
* @author Yinq
* @date 2023-09-20
*/
public interface IBaseSpaceInfoService
{
/**
*
*
* @param objId
* @return
*/
public BaseSpaceInfo selectBaseSpaceInfoByObjId(Long objId);
/**
*
*
* @param baseSpaceInfo
* @return
*/
public List<BaseSpaceInfo> selectBaseSpaceInfoList(BaseSpaceInfo baseSpaceInfo);
/**
*
*
* @param baseSpaceInfo
* @return
*/
public int insertBaseSpaceInfo(BaseSpaceInfo baseSpaceInfo);
/**
*
*
* @param baseSpaceInfo
* @return
*/
public int updateBaseSpaceInfo(BaseSpaceInfo baseSpaceInfo);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseSpaceInfoByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseSpaceInfoByObjId(Long objId);
}

@ -0,0 +1,61 @@
package com.aucma.base.service;
import java.util.List;
import com.aucma.base.domain.BaseStoreInfo;
/**
* Service
*
* @author Yinq
* @date 2023-09-20
*/
public interface IBaseStoreInfoService
{
/**
*
*
* @param objId
* @return
*/
public BaseStoreInfo selectBaseStoreInfoByObjId(Long objId);
/**
*
*
* @param baseStoreInfo
* @return
*/
public List<BaseStoreInfo> selectBaseStoreInfoList(BaseStoreInfo baseStoreInfo);
/**
*
*
* @param baseStoreInfo
* @return
*/
public int insertBaseStoreInfo(BaseStoreInfo baseStoreInfo);
/**
*
*
* @param baseStoreInfo
* @return
*/
public int updateBaseStoreInfo(BaseStoreInfo baseStoreInfo);
/**
*
*
* @param objIds
* @return
*/
public int deleteBaseStoreInfoByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteBaseStoreInfoByObjId(Long objId);
}

@ -0,0 +1,93 @@
package com.aucma.base.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.base.mapper.BaseSpaceInfoMapper;
import com.aucma.base.domain.BaseSpaceInfo;
import com.aucma.base.service.IBaseSpaceInfoService;
/**
* Service
*
* @author Yinq
* @date 2023-09-20
*/
@Service
public class BaseSpaceInfoServiceImpl implements IBaseSpaceInfoService
{
@Autowired
private BaseSpaceInfoMapper baseSpaceInfoMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public BaseSpaceInfo selectBaseSpaceInfoByObjId(Long objId)
{
return baseSpaceInfoMapper.selectBaseSpaceInfoByObjId(objId);
}
/**
*
*
* @param baseSpaceInfo
* @return
*/
@Override
public List<BaseSpaceInfo> selectBaseSpaceInfoList(BaseSpaceInfo baseSpaceInfo)
{
return baseSpaceInfoMapper.selectBaseSpaceInfoList(baseSpaceInfo);
}
/**
*
*
* @param baseSpaceInfo
* @return
*/
@Override
public int insertBaseSpaceInfo(BaseSpaceInfo baseSpaceInfo)
{
return baseSpaceInfoMapper.insertBaseSpaceInfo(baseSpaceInfo);
}
/**
*
*
* @param baseSpaceInfo
* @return
*/
@Override
public int updateBaseSpaceInfo(BaseSpaceInfo baseSpaceInfo)
{
return baseSpaceInfoMapper.updateBaseSpaceInfo(baseSpaceInfo);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteBaseSpaceInfoByObjIds(Long[] objIds)
{
return baseSpaceInfoMapper.deleteBaseSpaceInfoByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteBaseSpaceInfoByObjId(Long objId)
{
return baseSpaceInfoMapper.deleteBaseSpaceInfoByObjId(objId);
}
}

@ -0,0 +1,93 @@
package com.aucma.base.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.base.mapper.BaseStoreInfoMapper;
import com.aucma.base.domain.BaseStoreInfo;
import com.aucma.base.service.IBaseStoreInfoService;
/**
* Service
*
* @author Yinq
* @date 2023-09-20
*/
@Service
public class BaseStoreInfoServiceImpl implements IBaseStoreInfoService
{
@Autowired
private BaseStoreInfoMapper baseStoreInfoMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public BaseStoreInfo selectBaseStoreInfoByObjId(Long objId)
{
return baseStoreInfoMapper.selectBaseStoreInfoByObjId(objId);
}
/**
*
*
* @param baseStoreInfo
* @return
*/
@Override
public List<BaseStoreInfo> selectBaseStoreInfoList(BaseStoreInfo baseStoreInfo)
{
return baseStoreInfoMapper.selectBaseStoreInfoList(baseStoreInfo);
}
/**
*
*
* @param baseStoreInfo
* @return
*/
@Override
public int insertBaseStoreInfo(BaseStoreInfo baseStoreInfo)
{
return baseStoreInfoMapper.insertBaseStoreInfo(baseStoreInfo);
}
/**
*
*
* @param baseStoreInfo
* @return
*/
@Override
public int updateBaseStoreInfo(BaseStoreInfo baseStoreInfo)
{
return baseStoreInfoMapper.updateBaseStoreInfo(baseStoreInfo);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteBaseStoreInfoByObjIds(Long[] objIds)
{
return baseStoreInfoMapper.deleteBaseStoreInfoByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteBaseStoreInfoByObjId(Long objId)
{
return baseStoreInfoMapper.deleteBaseStoreInfoByObjId(objId);
}
}

@ -0,0 +1,161 @@
<?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.aucma.base.mapper.BaseSpaceInfoMapper">
<resultMap type="BaseSpaceInfo" id="BaseSpaceInfoResult">
<result property="objId" column="obj_id"/>
<result property="spaceCode" column="space_code"/>
<result property="spaceName" column="space_name"/>
<result property="spaceCapacity" column="space_capacity"/>
<result property="spaceStock" column="space_stock"/>
<result property="spaceStatus" column="space_status"/>
<result property="spaceType" column="space_type"/>
<result property="storeCode" column="store_code"/>
<result property="storeName" column="STORE_NAME"/>
<result property="isFlag" column="is_flag"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
<result property="materialName" column="material_name"/>
<result property="materialCode" column="material_code"/>
<result property="orderCode" column="order_code"/>
<result property="barcodeCode" column="barcode_code"/>
</resultMap>
<sql id="selectBaseSpaceInfoVo">
select sp.obj_id,
sp.space_code,
sp.space_name,
sp.space_capacity,
sp.space_stock,
sp.space_status,
sp.space_type,
sp.store_code,
sp.is_flag,
sp.created_by,
sp.created_time,
sp.updated_by,
sp.updated_time,
sp.material_code,
sp.order_code,
sp.barcode_code,
si.STORE_NAME
from base_spaceinfo sp
left join base_storeinfo si on si.STORE_CODE = sp.STORE_CODE
</sql>
<select id="selectBaseSpaceInfoList" parameterType="BaseSpaceInfo" resultMap="BaseSpaceInfoResult">
<include refid="selectBaseSpaceInfoVo"/>
<where>
<if test="spaceCode != null and spaceCode != ''">and sp.space_code like concat(concat('%', #{spaceCode}),
'%')
</if>
<if test="spaceName != null and spaceName != ''">and sp.space_name like concat(concat('%', #{spaceName}),
'%')
</if>
<if test="spaceCapacity != null ">and sp.space_capacity = #{spaceCapacity}</if>
<if test="spaceStock != null ">and sp.space_stock = #{spaceStock}</if>
<if test="spaceStatus != null ">and sp.space_status = #{spaceStatus}</if>
<if test="spaceType != null ">and sp.space_type = #{spaceType}</if>
<if test="storeCode != null and storeCode != ''">and sp.store_code = #{storeCode}</if>
<if test="isFlag != null ">and sp.is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''">and sp.created_by = #{createdBy}</if>
<if test="createdTime != null ">and sp.created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and sp.updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and sp.updated_time = #{updatedTime}</if>
<if test="materialName != null and materialName != ''">and sp.material_name like concat(concat('%',
#{materialName}), '%')
</if>
<if test="orderCode != null and orderCode != ''">and sp.order_code like concat(concat('%', #{orderCode}),
'%')
</if>
<if test="barcodeCode != null and barcodeCode != ''">and sp.barcode_code = #{barcodeCode}</if>
</where>
</select>
<select id="selectBaseSpaceInfoByObjId" parameterType="Long" resultMap="BaseSpaceInfoResult">
<include refid="selectBaseSpaceInfoVo"/>
where sp.obj_id = #{objId}
</select>
<insert id="insertBaseSpaceInfo" parameterType="BaseSpaceInfo">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_spaceinfo.NEXTVAL as objId FROM DUAL
</selectKey>
insert into base_spaceinfo
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="spaceCode != null">space_code,</if>
<if test="spaceName != null">space_name,</if>
<if test="spaceCapacity != null">space_capacity,</if>
<if test="spaceStock != null">space_stock,</if>
<if test="spaceStatus != null">space_status,</if>
<if test="spaceType != null">space_type,</if>
<if test="storeCode != null">store_code,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="materialCode != null">material_code,</if>
<if test="orderCode != null">order_code,</if>
<if test="barcodeCode != null">barcode_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="spaceCode != null">#{spaceCode},</if>
<if test="spaceName != null">#{spaceName},</if>
<if test="spaceCapacity != null">#{spaceCapacity},</if>
<if test="spaceStock != null">#{spaceStock},</if>
<if test="spaceStatus != null">#{spaceStatus},</if>
<if test="spaceType != null">#{spaceType},</if>
<if test="storeCode != null">#{storeCode},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="barcodeCode != null">#{barcodeCode},</if>
</trim>
</insert>
<update id="updateBaseSpaceInfo" parameterType="BaseSpaceInfo">
update base_spaceinfo
<trim prefix="SET" suffixOverrides=",">
<if test="spaceCode != null">space_code = #{spaceCode},</if>
<if test="spaceName != null">space_name = #{spaceName},</if>
<if test="spaceCapacity != null">space_capacity = #{spaceCapacity},</if>
<if test="spaceStock != null">space_stock = #{spaceStock},</if>
<if test="spaceStatus != null">space_status = #{spaceStatus},</if>
<if test="spaceType != null">space_type = #{spaceType},</if>
<if test="storeCode != null">store_code = #{storeCode},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="barcodeCode != null">barcode_code = #{barcodeCode},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteBaseSpaceInfoByObjId" parameterType="Long">
delete
from base_spaceinfo
where obj_id = #{objId}
</delete>
<delete id="deleteBaseSpaceInfoByObjIds" parameterType="String">
delete from base_spaceinfo where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,129 @@
<?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.aucma.base.mapper.BaseStoreInfoMapper">
<resultMap type="BaseStoreInfo" id="BaseStoreInfoResult">
<result property="objId" column="obj_id"/>
<result property="storeCode" column="store_code"/>
<result property="storeName" column="store_name"/>
<result property="storeType" column="store_type"/>
<result property="storeArea" column="store_area"/>
<result property="storeStatus" column="store_status"/>
<result property="isFlag" column="is_flag"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
<result property="plantCode" column="factory_code"/>
<result property="plantName" column="factory_name"/>
</resultMap>
<sql id="selectBaseStoreInfoVo">
select si.obj_id,
si.store_code,
si.store_name,
si.store_type,
si.store_area,
si.store_status,
si.is_flag,
si.created_by,
si.created_time,
si.updated_by,
si.updated_time,
si.factory_code,
bf.factory_name
from base_storeinfo si
left join base_factory bf on bf.factory_code = si.factory_code
</sql>
<select id="selectBaseStoreInfoList" parameterType="BaseStoreInfo" resultMap="BaseStoreInfoResult">
<include refid="selectBaseStoreInfoVo"/>
<where>
<if test="storeCode != null and storeCode != ''">and si.store_code = #{storeCode}</if>
<if test="storeName != null and storeName != ''">and si.store_name like concat(concat('%', #{storeName}),
'%')
</if>
<if test="storeType != null ">and si.store_type = #{storeType}</if>
<if test="storeArea != null and storeArea != ''">and si.store_area = #{storeArea}</if>
<if test="storeStatus != null ">and si.store_status = #{storeStatus}</if>
<if test="isFlag != null ">and si.is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''">and si.created_by = #{createdBy}</if>
<if test="createdTime != null ">and si.created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and si.updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and si.updated_time = #{updatedTime}</if>
</where>
</select>
<select id="selectBaseStoreInfoByObjId" parameterType="Long" resultMap="BaseStoreInfoResult">
<include refid="selectBaseStoreInfoVo"/>
where si.obj_id = #{objId}
</select>
<insert id="insertBaseStoreInfo" parameterType="BaseStoreInfo">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_storeinfo.NEXTVAL as objId FROM DUAL
</selectKey>
insert into base_storeinfo
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="storeCode != null">store_code,</if>
<if test="storeName != null">store_name,</if>
<if test="storeType != null">store_type,</if>
<if test="storeArea != null">store_area,</if>
<if test="storeStatus != null">store_status,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="plantCode != null">factory_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="storeCode != null">#{storeCode},</if>
<if test="storeName != null">#{storeName},</if>
<if test="storeType != null">#{storeType},</if>
<if test="storeArea != null">#{storeArea},</if>
<if test="storeStatus != null">#{storeStatus},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="plantCode != null">#{plantCode},</if>
</trim>
</insert>
<update id="updateBaseStoreInfo" parameterType="BaseStoreInfo">
update base_storeinfo
<trim prefix="SET" suffixOverrides=",">
<if test="storeCode != null">store_code = #{storeCode},</if>
<if test="storeName != null">store_name = #{storeName},</if>
<if test="storeType != null">store_type = #{storeType},</if>
<if test="storeArea != null">store_area = #{storeArea},</if>
<if test="storeStatus != null">store_status = #{storeStatus},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="plantCode != null">factory_code = #{plantCode},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteBaseStoreInfoByObjId" parameterType="Long">
delete
from base_storeinfo
where obj_id = #{objId}
</delete>
<delete id="deleteBaseStoreInfoByObjIds" parameterType="String">
delete from base_storeinfo where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save