物料管理相关代码

This commit is contained in:
2026-03-11 09:05:29 +08:00
parent edcb2a666d
commit 454128ae64
25 changed files with 1903 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
package com.shzg.worn.config;//package com.zg.project.wisdom.config; package com.shzg.project.worn.config;//package com.zg.project.wisdom.config;
import com.shzg.worn.mqtt.dispatcher.MqttMessageDispatcher; import com.shzg.project.worn.mqtt.dispatcher.MqttMessageDispatcher;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.*; import org.eclipse.paho.client.mqttv3.*;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;

View File

@@ -1,4 +1,4 @@
package com.shzg.worn.config; package com.shzg.project.worn.config;
import lombok.Data; import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -1,4 +1,4 @@
package com.shzg.worn.config; package com.shzg.project.worn.config;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttClient; import org.eclipse.paho.client.mqttv3.MqttClient;

View File

@@ -0,0 +1,104 @@
package com.shzg.project.worn.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.shzg.framework.aspectj.lang.annotation.Log;
import com.shzg.framework.aspectj.lang.enums.BusinessType;
import com.shzg.project.worn.domain.WornMaterial;
import com.shzg.project.worn.service.IWornMaterialService;
import com.shzg.framework.web.controller.BaseController;
import com.shzg.framework.web.domain.AjaxResult;
import com.shzg.common.utils.poi.ExcelUtil;
import com.shzg.framework.web.page.TableDataInfo;
/**
* 物料Controller
*
* @author shzg
* @date 2026-03-11
*/
@RestController
@RequestMapping("/worn/material")
public class WornMaterialController extends BaseController
{
@Autowired
private IWornMaterialService wornMaterialService;
/**
* 查询物料列表
*/
@PreAuthorize("@ss.hasPermi('worn:material:list')")
@GetMapping("/list")
public TableDataInfo list(WornMaterial wornMaterial)
{
startPage();
List<WornMaterial> list = wornMaterialService.selectWornMaterialList(wornMaterial);
return getDataTable(list);
}
/**
* 导出物料列表
*/
@PreAuthorize("@ss.hasPermi('worn:material:export')")
@Log(title = "物料", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WornMaterial wornMaterial)
{
List<WornMaterial> list = wornMaterialService.selectWornMaterialList(wornMaterial);
ExcelUtil<WornMaterial> util = new ExcelUtil<WornMaterial>(WornMaterial.class);
util.exportExcel(response, list, "物料数据");
}
/**
* 获取物料详细信息
*/
@PreAuthorize("@ss.hasPermi('worn:material:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(wornMaterialService.selectWornMaterialById(id));
}
/**
* 新增物料
*/
@PreAuthorize("@ss.hasPermi('worn:material:add')")
@Log(title = "物料", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WornMaterial wornMaterial)
{
return toAjax(wornMaterialService.insertWornMaterial(wornMaterial));
}
/**
* 修改物料
*/
@PreAuthorize("@ss.hasPermi('worn:material:edit')")
@Log(title = "物料", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WornMaterial wornMaterial)
{
return toAjax(wornMaterialService.updateWornMaterial(wornMaterial));
}
/**
* 删除物料
*/
@PreAuthorize("@ss.hasPermi('worn:material:remove')")
@Log(title = "物料", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wornMaterialService.deleteWornMaterialByIds(ids));
}
}

View File

@@ -0,0 +1,104 @@
package com.shzg.project.worn.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.shzg.framework.aspectj.lang.annotation.Log;
import com.shzg.framework.aspectj.lang.enums.BusinessType;
import com.shzg.project.worn.domain.WornMaterialType;
import com.shzg.project.worn.service.IWornMaterialTypeService;
import com.shzg.framework.web.controller.BaseController;
import com.shzg.framework.web.domain.AjaxResult;
import com.shzg.common.utils.poi.ExcelUtil;
import com.shzg.framework.web.page.TableDataInfo;
/**
* 废旧系统物料类型支持父子级树结构Controller
*
* @author shzg
* @date 2026-03-11
*/
@RestController
@RequestMapping("/worn/type")
public class WornMaterialTypeController extends BaseController
{
@Autowired
private IWornMaterialTypeService wornMaterialTypeService;
/**
* 查询废旧系统物料类型(支持父子级树结构)列表
*/
@PreAuthorize("@ss.hasPermi('worn:type:list')")
@GetMapping("/list")
public TableDataInfo list(WornMaterialType wornMaterialType)
{
startPage();
List<WornMaterialType> list = wornMaterialTypeService.selectWornMaterialTypeList(wornMaterialType);
return getDataTable(list);
}
/**
* 导出废旧系统物料类型(支持父子级树结构)列表
*/
@PreAuthorize("@ss.hasPermi('worn:type:export')")
@Log(title = "废旧系统物料类型(支持父子级树结构)", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WornMaterialType wornMaterialType)
{
List<WornMaterialType> list = wornMaterialTypeService.selectWornMaterialTypeList(wornMaterialType);
ExcelUtil<WornMaterialType> util = new ExcelUtil<WornMaterialType>(WornMaterialType.class);
util.exportExcel(response, list, "废旧系统物料类型(支持父子级树结构)数据");
}
/**
* 获取废旧系统物料类型(支持父子级树结构)详细信息
*/
@PreAuthorize("@ss.hasPermi('worn:type:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(wornMaterialTypeService.selectWornMaterialTypeById(id));
}
/**
* 新增废旧系统物料类型(支持父子级树结构)
*/
@PreAuthorize("@ss.hasPermi('worn:type:add')")
@Log(title = "废旧系统物料类型(支持父子级树结构)", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WornMaterialType wornMaterialType)
{
return toAjax(wornMaterialTypeService.insertWornMaterialType(wornMaterialType));
}
/**
* 修改废旧系统物料类型(支持父子级树结构)
*/
@PreAuthorize("@ss.hasPermi('worn:type:edit')")
@Log(title = "废旧系统物料类型(支持父子级树结构)", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WornMaterialType wornMaterialType)
{
return toAjax(wornMaterialTypeService.updateWornMaterialType(wornMaterialType));
}
/**
* 删除废旧系统物料类型(支持父子级树结构)
*/
@PreAuthorize("@ss.hasPermi('worn:type:remove')")
@Log(title = "废旧系统物料类型(支持父子级树结构)", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wornMaterialTypeService.deleteWornMaterialTypeByIds(ids));
}
}

View File

@@ -0,0 +1,104 @@
package com.shzg.project.worn.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.shzg.framework.aspectj.lang.annotation.Log;
import com.shzg.framework.aspectj.lang.enums.BusinessType;
import com.shzg.project.worn.domain.WornMaterialUnit;
import com.shzg.project.worn.service.IWornMaterialUnitService;
import com.shzg.framework.web.controller.BaseController;
import com.shzg.framework.web.domain.AjaxResult;
import com.shzg.common.utils.poi.ExcelUtil;
import com.shzg.framework.web.page.TableDataInfo;
/**
* 物料单位Controller
*
* @author shzg
* @date 2026-03-11
*/
@RestController
@RequestMapping("/worn/unit")
public class WornMaterialUnitController extends BaseController
{
@Autowired
private IWornMaterialUnitService wornMaterialUnitService;
/**
* 查询物料单位列表
*/
@PreAuthorize("@ss.hasPermi('worn:unit:list')")
@GetMapping("/list")
public TableDataInfo list(WornMaterialUnit wornMaterialUnit)
{
startPage();
List<WornMaterialUnit> list = wornMaterialUnitService.selectWornMaterialUnitList(wornMaterialUnit);
return getDataTable(list);
}
/**
* 导出物料单位列表
*/
@PreAuthorize("@ss.hasPermi('worn:unit:export')")
@Log(title = "物料单位", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WornMaterialUnit wornMaterialUnit)
{
List<WornMaterialUnit> list = wornMaterialUnitService.selectWornMaterialUnitList(wornMaterialUnit);
ExcelUtil<WornMaterialUnit> util = new ExcelUtil<WornMaterialUnit>(WornMaterialUnit.class);
util.exportExcel(response, list, "物料单位数据");
}
/**
* 获取物料单位详细信息
*/
@PreAuthorize("@ss.hasPermi('worn:unit:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(wornMaterialUnitService.selectWornMaterialUnitById(id));
}
/**
* 新增物料单位
*/
@PreAuthorize("@ss.hasPermi('worn:unit:add')")
@Log(title = "物料单位", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WornMaterialUnit wornMaterialUnit)
{
return toAjax(wornMaterialUnitService.insertWornMaterialUnit(wornMaterialUnit));
}
/**
* 修改物料单位
*/
@PreAuthorize("@ss.hasPermi('worn:unit:edit')")
@Log(title = "物料单位", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WornMaterialUnit wornMaterialUnit)
{
return toAjax(wornMaterialUnitService.updateWornMaterialUnit(wornMaterialUnit));
}
/**
* 删除物料单位
*/
@PreAuthorize("@ss.hasPermi('worn:unit:remove')")
@Log(title = "物料单位", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wornMaterialUnitService.deleteWornMaterialUnitByIds(ids));
}
}

View File

@@ -0,0 +1,268 @@
package com.shzg.project.worn.domain;
import java.math.BigDecimal;
import com.shzg.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.shzg.framework.aspectj.lang.annotation.Excel;
/**
* 物料对象 worn_material
*
* @author shzg
* @date 2026-03-11
*/
public class WornMaterial extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料简称 */
@Excel(name = "物料简称")
private String materialShortName;
/** 物料编码 */
@Excel(name = "物料编码")
private String materialCode;
/** 物料类型ID */
@Excel(name = "物料类型ID")
private Long typeId;
/** 物料单位ID */
@Excel(name = "物料单位ID")
private Long unitId;
/** 物料类别 */
@Excel(name = "物料类别")
private String materialCategory;
/** 公斤转换系数 */
@Excel(name = "公斤转换系数")
private BigDecimal kgFactor;
/** 规格 */
@Excel(name = "规格")
private String specification;
/** 型号 */
@Excel(name = "型号")
private String model;
/** 条形码 */
@Excel(name = "条形码")
private String barcode;
/** 单件重量(kg) */
@Excel(name = "单件重量(kg)")
private BigDecimal weight;
/** 描述 */
@Excel(name = "描述")
private String description;
/** 排序 */
@Excel(name = "排序")
private Long orderNum;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 逻辑删除0正常 1删除 */
@Excel(name = "逻辑删除", readConverterExp = "0=正常,1=删除")
private String isDelete;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setMaterialShortName(String materialShortName)
{
this.materialShortName = materialShortName;
}
public String getMaterialShortName()
{
return materialShortName;
}
public void setMaterialCode(String materialCode)
{
this.materialCode = materialCode;
}
public String getMaterialCode()
{
return materialCode;
}
public void setTypeId(Long typeId)
{
this.typeId = typeId;
}
public Long getTypeId()
{
return typeId;
}
public void setUnitId(Long unitId)
{
this.unitId = unitId;
}
public Long getUnitId()
{
return unitId;
}
public void setMaterialCategory(String materialCategory)
{
this.materialCategory = materialCategory;
}
public String getMaterialCategory()
{
return materialCategory;
}
public void setKgFactor(BigDecimal kgFactor)
{
this.kgFactor = kgFactor;
}
public BigDecimal getKgFactor()
{
return kgFactor;
}
public void setSpecification(String specification)
{
this.specification = specification;
}
public String getSpecification()
{
return specification;
}
public void setModel(String model)
{
this.model = model;
}
public String getModel()
{
return model;
}
public void setBarcode(String barcode)
{
this.barcode = barcode;
}
public String getBarcode()
{
return barcode;
}
public void setWeight(BigDecimal weight)
{
this.weight = weight;
}
public BigDecimal getWeight()
{
return weight;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setOrderNum(Long orderNum)
{
this.orderNum = orderNum;
}
public Long getOrderNum()
{
return orderNum;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setIsDelete(String isDelete)
{
this.isDelete = isDelete;
}
public String getIsDelete()
{
return isDelete;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("materialName", getMaterialName())
.append("materialShortName", getMaterialShortName())
.append("materialCode", getMaterialCode())
.append("typeId", getTypeId())
.append("unitId", getUnitId())
.append("materialCategory", getMaterialCategory())
.append("kgFactor", getKgFactor())
.append("specification", getSpecification())
.append("model", getModel())
.append("barcode", getBarcode())
.append("weight", getWeight())
.append("description", getDescription())
.append("orderNum", getOrderNum())
.append("status", getStatus())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@@ -0,0 +1,191 @@
package com.shzg.project.worn.domain;
import com.shzg.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.shzg.framework.aspectj.lang.annotation.Excel;
/**
* 废旧系统物料类型(支持父子级树结构)对象 worn_material_type
*
* @author shzg
* @date 2026-03-11
*/
public class WornMaterialType extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 父级ID */
@Excel(name = "父级ID")
private Long parentId;
/** 祖级列表 */
@Excel(name = "祖级列表")
private String ancestors;
/** 类型编码 */
@Excel(name = "类型编码")
private String typeCode;
/** 类型名称 */
@Excel(name = "类型名称")
private String typeName;
/** 首字母代码 */
@Excel(name = "首字母代码")
private String firstLetter;
/** 描述 */
@Excel(name = "描述")
private String description;
/** 层级 */
@Excel(name = "层级")
private Long level;
/** 显示排序 */
@Excel(name = "显示排序")
private Long orderNum;
/** 状态(0正常1停用) */
@Excel(name = "状态(0正常1停用)")
private String status;
/** 逻辑删除 */
@Excel(name = "逻辑删除")
private String isDelete;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
public Long getParentId()
{
return parentId;
}
public void setAncestors(String ancestors)
{
this.ancestors = ancestors;
}
public String getAncestors()
{
return ancestors;
}
public void setTypeCode(String typeCode)
{
this.typeCode = typeCode;
}
public String getTypeCode()
{
return typeCode;
}
public void setTypeName(String typeName)
{
this.typeName = typeName;
}
public String getTypeName()
{
return typeName;
}
public void setFirstLetter(String firstLetter)
{
this.firstLetter = firstLetter;
}
public String getFirstLetter()
{
return firstLetter;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setLevel(Long level)
{
this.level = level;
}
public Long getLevel()
{
return level;
}
public void setOrderNum(Long orderNum)
{
this.orderNum = orderNum;
}
public Long getOrderNum()
{
return orderNum;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setIsDelete(String isDelete)
{
this.isDelete = isDelete;
}
public String getIsDelete()
{
return isDelete;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("parentId", getParentId())
.append("ancestors", getAncestors())
.append("typeCode", getTypeCode())
.append("typeName", getTypeName())
.append("firstLetter", getFirstLetter())
.append("description", getDescription())
.append("level", getLevel())
.append("orderNum", getOrderNum())
.append("status", getStatus())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@@ -0,0 +1,116 @@
package com.shzg.project.worn.domain;
import com.shzg.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.shzg.framework.aspectj.lang.annotation.Excel;
/**
* 物料单位对象 worn_material_unit
*
* @author shzg
* @date 2026-03-11
*/
public class WornMaterialUnit extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 单位名称 */
@Excel(name = "单位名称")
private String unitName;
/** 描述信息 */
@Excel(name = "描述信息")
private String description;
/** 显示排序 */
@Excel(name = "显示排序")
private Long orderNum;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 逻辑删除0正常 1删除 */
@Excel(name = "逻辑删除", readConverterExp = "0=正常,1=删除")
private String isDelete;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUnitName(String unitName)
{
this.unitName = unitName;
}
public String getUnitName()
{
return unitName;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setOrderNum(Long orderNum)
{
this.orderNum = orderNum;
}
public Long getOrderNum()
{
return orderNum;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setIsDelete(String isDelete)
{
this.isDelete = isDelete;
}
public String getIsDelete()
{
return isDelete;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("unitName", getUnitName())
.append("description", getDescription())
.append("orderNum", getOrderNum())
.append("status", getStatus())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.shzg.project.worn.mapper;
import java.util.List;
import com.shzg.project.worn.domain.WornMaterial;
/**
* 物料Mapper接口
*
* @author shzg
* @date 2026-03-11
*/
public interface WornMaterialMapper
{
/**
* 查询物料
*
* @param id 物料主键
* @return 物料
*/
public WornMaterial selectWornMaterialById(Long id);
/**
* 查询物料列表
*
* @param wornMaterial 物料
* @return 物料集合
*/
public List<WornMaterial> selectWornMaterialList(WornMaterial wornMaterial);
/**
* 新增物料
*
* @param wornMaterial 物料
* @return 结果
*/
public int insertWornMaterial(WornMaterial wornMaterial);
/**
* 修改物料
*
* @param wornMaterial 物料
* @return 结果
*/
public int updateWornMaterial(WornMaterial wornMaterial);
/**
* 删除物料
*
* @param id 物料主键
* @return 结果
*/
public int deleteWornMaterialById(Long id);
/**
* 批量删除物料
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWornMaterialByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.shzg.project.worn.mapper;
import java.util.List;
import com.shzg.project.worn.domain.WornMaterialType;
/**
* 废旧系统物料类型支持父子级树结构Mapper接口
*
* @author shzg
* @date 2026-03-11
*/
public interface WornMaterialTypeMapper
{
/**
* 查询废旧系统物料类型(支持父子级树结构)
*
* @param id 废旧系统物料类型(支持父子级树结构)主键
* @return 废旧系统物料类型(支持父子级树结构)
*/
public WornMaterialType selectWornMaterialTypeById(Long id);
/**
* 查询废旧系统物料类型(支持父子级树结构)列表
*
* @param wornMaterialType 废旧系统物料类型(支持父子级树结构)
* @return 废旧系统物料类型(支持父子级树结构)集合
*/
public List<WornMaterialType> selectWornMaterialTypeList(WornMaterialType wornMaterialType);
/**
* 新增废旧系统物料类型(支持父子级树结构)
*
* @param wornMaterialType 废旧系统物料类型(支持父子级树结构)
* @return 结果
*/
public int insertWornMaterialType(WornMaterialType wornMaterialType);
/**
* 修改废旧系统物料类型(支持父子级树结构)
*
* @param wornMaterialType 废旧系统物料类型(支持父子级树结构)
* @return 结果
*/
public int updateWornMaterialType(WornMaterialType wornMaterialType);
/**
* 删除废旧系统物料类型(支持父子级树结构)
*
* @param id 废旧系统物料类型(支持父子级树结构)主键
* @return 结果
*/
public int deleteWornMaterialTypeById(Long id);
/**
* 批量删除废旧系统物料类型(支持父子级树结构)
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWornMaterialTypeByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.shzg.project.worn.mapper;
import java.util.List;
import com.shzg.project.worn.domain.WornMaterialUnit;
/**
* 物料单位Mapper接口
*
* @author shzg
* @date 2026-03-11
*/
public interface WornMaterialUnitMapper
{
/**
* 查询物料单位
*
* @param id 物料单位主键
* @return 物料单位
*/
public WornMaterialUnit selectWornMaterialUnitById(Long id);
/**
* 查询物料单位列表
*
* @param wornMaterialUnit 物料单位
* @return 物料单位集合
*/
public List<WornMaterialUnit> selectWornMaterialUnitList(WornMaterialUnit wornMaterialUnit);
/**
* 新增物料单位
*
* @param wornMaterialUnit 物料单位
* @return 结果
*/
public int insertWornMaterialUnit(WornMaterialUnit wornMaterialUnit);
/**
* 修改物料单位
*
* @param wornMaterialUnit 物料单位
* @return 结果
*/
public int updateWornMaterialUnit(WornMaterialUnit wornMaterialUnit);
/**
* 删除物料单位
*
* @param id 物料单位主键
* @return 结果
*/
public int deleteWornMaterialUnitById(Long id);
/**
* 批量删除物料单位
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWornMaterialUnitByIds(Long[] ids);
}

View File

@@ -1,8 +1,8 @@
package com.shzg.worn.mqtt.dispatcher; package com.shzg.project.worn.mqtt.dispatcher;
import com.shzg.worn.mqtt.handler.HumiSensorHandler; import com.shzg.project.worn.mqtt.handler.HumiSensorHandler;
import com.shzg.worn.mqtt.handler.SmokeSensorHandler; import com.shzg.project.worn.mqtt.handler.SmokeSensorHandler;
import com.shzg.worn.mqtt.handler.TempSensorHandler; import com.shzg.project.worn.mqtt.handler.TempSensorHandler;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@@ -1,4 +1,4 @@
package com.shzg.worn.mqtt.handler; package com.shzg.project.worn.mqtt.handler;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@@ -1,4 +1,4 @@
package com.shzg.worn.mqtt.handler; package com.shzg.project.worn.mqtt.handler;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@@ -1,4 +1,4 @@
package com.shzg.worn.mqtt.handler; package com.shzg.project.worn.mqtt.handler;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@@ -0,0 +1,61 @@
package com.shzg.project.worn.service;
import java.util.List;
import com.shzg.project.worn.domain.WornMaterial;
/**
* 物料Service接口
*
* @author shzg
* @date 2026-03-11
*/
public interface IWornMaterialService
{
/**
* 查询物料
*
* @param id 物料主键
* @return 物料
*/
public WornMaterial selectWornMaterialById(Long id);
/**
* 查询物料列表
*
* @param wornMaterial 物料
* @return 物料集合
*/
public List<WornMaterial> selectWornMaterialList(WornMaterial wornMaterial);
/**
* 新增物料
*
* @param wornMaterial 物料
* @return 结果
*/
public int insertWornMaterial(WornMaterial wornMaterial);
/**
* 修改物料
*
* @param wornMaterial 物料
* @return 结果
*/
public int updateWornMaterial(WornMaterial wornMaterial);
/**
* 批量删除物料
*
* @param ids 需要删除的物料主键集合
* @return 结果
*/
public int deleteWornMaterialByIds(Long[] ids);
/**
* 删除物料信息
*
* @param id 物料主键
* @return 结果
*/
public int deleteWornMaterialById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.shzg.project.worn.service;
import java.util.List;
import com.shzg.project.worn.domain.WornMaterialType;
/**
* 废旧系统物料类型支持父子级树结构Service接口
*
* @author shzg
* @date 2026-03-11
*/
public interface IWornMaterialTypeService
{
/**
* 查询废旧系统物料类型(支持父子级树结构)
*
* @param id 废旧系统物料类型(支持父子级树结构)主键
* @return 废旧系统物料类型(支持父子级树结构)
*/
public WornMaterialType selectWornMaterialTypeById(Long id);
/**
* 查询废旧系统物料类型(支持父子级树结构)列表
*
* @param wornMaterialType 废旧系统物料类型(支持父子级树结构)
* @return 废旧系统物料类型(支持父子级树结构)集合
*/
public List<WornMaterialType> selectWornMaterialTypeList(WornMaterialType wornMaterialType);
/**
* 新增废旧系统物料类型(支持父子级树结构)
*
* @param wornMaterialType 废旧系统物料类型(支持父子级树结构)
* @return 结果
*/
public int insertWornMaterialType(WornMaterialType wornMaterialType);
/**
* 修改废旧系统物料类型(支持父子级树结构)
*
* @param wornMaterialType 废旧系统物料类型(支持父子级树结构)
* @return 结果
*/
public int updateWornMaterialType(WornMaterialType wornMaterialType);
/**
* 批量删除废旧系统物料类型(支持父子级树结构)
*
* @param ids 需要删除的废旧系统物料类型(支持父子级树结构)主键集合
* @return 结果
*/
public int deleteWornMaterialTypeByIds(Long[] ids);
/**
* 删除废旧系统物料类型(支持父子级树结构)信息
*
* @param id 废旧系统物料类型(支持父子级树结构)主键
* @return 结果
*/
public int deleteWornMaterialTypeById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.shzg.project.worn.service;
import java.util.List;
import com.shzg.project.worn.domain.WornMaterialUnit;
/**
* 物料单位Service接口
*
* @author shzg
* @date 2026-03-11
*/
public interface IWornMaterialUnitService
{
/**
* 查询物料单位
*
* @param id 物料单位主键
* @return 物料单位
*/
public WornMaterialUnit selectWornMaterialUnitById(Long id);
/**
* 查询物料单位列表
*
* @param wornMaterialUnit 物料单位
* @return 物料单位集合
*/
public List<WornMaterialUnit> selectWornMaterialUnitList(WornMaterialUnit wornMaterialUnit);
/**
* 新增物料单位
*
* @param wornMaterialUnit 物料单位
* @return 结果
*/
public int insertWornMaterialUnit(WornMaterialUnit wornMaterialUnit);
/**
* 修改物料单位
*
* @param wornMaterialUnit 物料单位
* @return 结果
*/
public int updateWornMaterialUnit(WornMaterialUnit wornMaterialUnit);
/**
* 批量删除物料单位
*
* @param ids 需要删除的物料单位主键集合
* @return 结果
*/
public int deleteWornMaterialUnitByIds(Long[] ids);
/**
* 删除物料单位信息
*
* @param id 物料单位主键
* @return 结果
*/
public int deleteWornMaterialUnitById(Long id);
}

View File

@@ -0,0 +1,96 @@
package com.shzg.project.worn.service.impl;
import java.util.List;
import com.shzg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shzg.project.worn.mapper.WornMaterialMapper;
import com.shzg.project.worn.domain.WornMaterial;
import com.shzg.project.worn.service.IWornMaterialService;
/**
* 物料Service业务层处理
*
* @author shzg
* @date 2026-03-11
*/
@Service
public class WornMaterialServiceImpl implements IWornMaterialService
{
@Autowired
private WornMaterialMapper wornMaterialMapper;
/**
* 查询物料
*
* @param id 物料主键
* @return 物料
*/
@Override
public WornMaterial selectWornMaterialById(Long id)
{
return wornMaterialMapper.selectWornMaterialById(id);
}
/**
* 查询物料列表
*
* @param wornMaterial 物料
* @return 物料
*/
@Override
public List<WornMaterial> selectWornMaterialList(WornMaterial wornMaterial)
{
return wornMaterialMapper.selectWornMaterialList(wornMaterial);
}
/**
* 新增物料
*
* @param wornMaterial 物料
* @return 结果
*/
@Override
public int insertWornMaterial(WornMaterial wornMaterial)
{
wornMaterial.setCreateTime(DateUtils.getNowDate());
return wornMaterialMapper.insertWornMaterial(wornMaterial);
}
/**
* 修改物料
*
* @param wornMaterial 物料
* @return 结果
*/
@Override
public int updateWornMaterial(WornMaterial wornMaterial)
{
wornMaterial.setUpdateTime(DateUtils.getNowDate());
return wornMaterialMapper.updateWornMaterial(wornMaterial);
}
/**
* 批量删除物料
*
* @param ids 需要删除的物料主键
* @return 结果
*/
@Override
public int deleteWornMaterialByIds(Long[] ids)
{
return wornMaterialMapper.deleteWornMaterialByIds(ids);
}
/**
* 删除物料信息
*
* @param id 物料主键
* @return 结果
*/
@Override
public int deleteWornMaterialById(Long id)
{
return wornMaterialMapper.deleteWornMaterialById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.shzg.project.worn.service.impl;
import java.util.List;
import com.shzg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shzg.project.worn.mapper.WornMaterialTypeMapper;
import com.shzg.project.worn.domain.WornMaterialType;
import com.shzg.project.worn.service.IWornMaterialTypeService;
/**
* 废旧系统物料类型支持父子级树结构Service业务层处理
*
* @author shzg
* @date 2026-03-11
*/
@Service
public class WornMaterialTypeServiceImpl implements IWornMaterialTypeService
{
@Autowired
private WornMaterialTypeMapper wornMaterialTypeMapper;
/**
* 查询废旧系统物料类型(支持父子级树结构)
*
* @param id 废旧系统物料类型(支持父子级树结构)主键
* @return 废旧系统物料类型(支持父子级树结构)
*/
@Override
public WornMaterialType selectWornMaterialTypeById(Long id)
{
return wornMaterialTypeMapper.selectWornMaterialTypeById(id);
}
/**
* 查询废旧系统物料类型(支持父子级树结构)列表
*
* @param wornMaterialType 废旧系统物料类型(支持父子级树结构)
* @return 废旧系统物料类型(支持父子级树结构)
*/
@Override
public List<WornMaterialType> selectWornMaterialTypeList(WornMaterialType wornMaterialType)
{
return wornMaterialTypeMapper.selectWornMaterialTypeList(wornMaterialType);
}
/**
* 新增废旧系统物料类型(支持父子级树结构)
*
* @param wornMaterialType 废旧系统物料类型(支持父子级树结构)
* @return 结果
*/
@Override
public int insertWornMaterialType(WornMaterialType wornMaterialType)
{
wornMaterialType.setCreateTime(DateUtils.getNowDate());
return wornMaterialTypeMapper.insertWornMaterialType(wornMaterialType);
}
/**
* 修改废旧系统物料类型(支持父子级树结构)
*
* @param wornMaterialType 废旧系统物料类型(支持父子级树结构)
* @return 结果
*/
@Override
public int updateWornMaterialType(WornMaterialType wornMaterialType)
{
wornMaterialType.setUpdateTime(DateUtils.getNowDate());
return wornMaterialTypeMapper.updateWornMaterialType(wornMaterialType);
}
/**
* 批量删除废旧系统物料类型(支持父子级树结构)
*
* @param ids 需要删除的废旧系统物料类型(支持父子级树结构)主键
* @return 结果
*/
@Override
public int deleteWornMaterialTypeByIds(Long[] ids)
{
return wornMaterialTypeMapper.deleteWornMaterialTypeByIds(ids);
}
/**
* 删除废旧系统物料类型(支持父子级树结构)信息
*
* @param id 废旧系统物料类型(支持父子级树结构)主键
* @return 结果
*/
@Override
public int deleteWornMaterialTypeById(Long id)
{
return wornMaterialTypeMapper.deleteWornMaterialTypeById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.shzg.project.worn.service.impl;
import java.util.List;
import com.shzg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shzg.project.worn.mapper.WornMaterialUnitMapper;
import com.shzg.project.worn.domain.WornMaterialUnit;
import com.shzg.project.worn.service.IWornMaterialUnitService;
/**
* 物料单位Service业务层处理
*
* @author shzg
* @date 2026-03-11
*/
@Service
public class WornMaterialUnitServiceImpl implements IWornMaterialUnitService
{
@Autowired
private WornMaterialUnitMapper wornMaterialUnitMapper;
/**
* 查询物料单位
*
* @param id 物料单位主键
* @return 物料单位
*/
@Override
public WornMaterialUnit selectWornMaterialUnitById(Long id)
{
return wornMaterialUnitMapper.selectWornMaterialUnitById(id);
}
/**
* 查询物料单位列表
*
* @param wornMaterialUnit 物料单位
* @return 物料单位
*/
@Override
public List<WornMaterialUnit> selectWornMaterialUnitList(WornMaterialUnit wornMaterialUnit)
{
return wornMaterialUnitMapper.selectWornMaterialUnitList(wornMaterialUnit);
}
/**
* 新增物料单位
*
* @param wornMaterialUnit 物料单位
* @return 结果
*/
@Override
public int insertWornMaterialUnit(WornMaterialUnit wornMaterialUnit)
{
wornMaterialUnit.setCreateTime(DateUtils.getNowDate());
return wornMaterialUnitMapper.insertWornMaterialUnit(wornMaterialUnit);
}
/**
* 修改物料单位
*
* @param wornMaterialUnit 物料单位
* @return 结果
*/
@Override
public int updateWornMaterialUnit(WornMaterialUnit wornMaterialUnit)
{
wornMaterialUnit.setUpdateTime(DateUtils.getNowDate());
return wornMaterialUnitMapper.updateWornMaterialUnit(wornMaterialUnit);
}
/**
* 批量删除物料单位
*
* @param ids 需要删除的物料单位主键
* @return 结果
*/
@Override
public int deleteWornMaterialUnitByIds(Long[] ids)
{
return wornMaterialUnitMapper.deleteWornMaterialUnitByIds(ids);
}
/**
* 删除物料单位信息
*
* @param id 物料单位主键
* @return 结果
*/
@Override
public int deleteWornMaterialUnitById(Long id)
{
return wornMaterialUnitMapper.deleteWornMaterialUnitById(id);
}
}

View File

@@ -0,0 +1,142 @@
<?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.shzg.project.worn.mapper.WornMaterialMapper">
<resultMap type="WornMaterial" id="WornMaterialResult">
<result property="id" column="id" />
<result property="materialName" column="material_name" />
<result property="materialShortName" column="material_short_name" />
<result property="materialCode" column="material_code" />
<result property="typeId" column="type_id" />
<result property="unitId" column="unit_id" />
<result property="materialCategory" column="material_category" />
<result property="kgFactor" column="kg_factor" />
<result property="specification" column="specification" />
<result property="model" column="model" />
<result property="barcode" column="barcode" />
<result property="weight" column="weight" />
<result property="description" column="description" />
<result property="orderNum" column="order_num" />
<result property="status" column="status" />
<result property="isDelete" column="is_delete" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWornMaterialVo">
select id, material_name, material_short_name, material_code, type_id, unit_id, material_category, kg_factor, specification, model, barcode, weight, description, order_num, status, is_delete, create_by, create_time, update_by, update_time from worn_material
</sql>
<select id="selectWornMaterialList" parameterType="WornMaterial" resultMap="WornMaterialResult">
<include refid="selectWornMaterialVo"/>
<where>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="materialShortName != null and materialShortName != ''"> and material_short_name like concat('%', #{materialShortName}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="typeId != null "> and type_id = #{typeId}</if>
<if test="unitId != null "> and unit_id = #{unitId}</if>
<if test="materialCategory != null and materialCategory != ''"> and material_category = #{materialCategory}</if>
<if test="kgFactor != null "> and kg_factor = #{kgFactor}</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="model != null and model != ''"> and model = #{model}</if>
<if test="barcode != null and barcode != ''"> and barcode = #{barcode}</if>
<if test="weight != null "> and weight = #{weight}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
</where>
</select>
<select id="selectWornMaterialById" parameterType="Long" resultMap="WornMaterialResult">
<include refid="selectWornMaterialVo"/>
where id = #{id}
</select>
<insert id="insertWornMaterial" parameterType="WornMaterial" useGeneratedKeys="true" keyProperty="id">
insert into worn_material
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialName != null and materialName != ''">material_name,</if>
<if test="materialShortName != null">material_short_name,</if>
<if test="materialCode != null and materialCode != ''">material_code,</if>
<if test="typeId != null">type_id,</if>
<if test="unitId != null">unit_id,</if>
<if test="materialCategory != null">material_category,</if>
<if test="kgFactor != null">kg_factor,</if>
<if test="specification != null">specification,</if>
<if test="model != null">model,</if>
<if test="barcode != null">barcode,</if>
<if test="weight != null">weight,</if>
<if test="description != null">description,</if>
<if test="orderNum != null">order_num,</if>
<if test="status != null">status,</if>
<if test="isDelete != null">is_delete,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialName != null and materialName != ''">#{materialName},</if>
<if test="materialShortName != null">#{materialShortName},</if>
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
<if test="typeId != null">#{typeId},</if>
<if test="unitId != null">#{unitId},</if>
<if test="materialCategory != null">#{materialCategory},</if>
<if test="kgFactor != null">#{kgFactor},</if>
<if test="specification != null">#{specification},</if>
<if test="model != null">#{model},</if>
<if test="barcode != null">#{barcode},</if>
<if test="weight != null">#{weight},</if>
<if test="description != null">#{description},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="status != null">#{status},</if>
<if test="isDelete != null">#{isDelete},</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>
</trim>
</insert>
<update id="updateWornMaterial" parameterType="WornMaterial">
update worn_material
<trim prefix="SET" suffixOverrides=",">
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
<if test="materialShortName != null">material_short_name = #{materialShortName},</if>
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
<if test="typeId != null">type_id = #{typeId},</if>
<if test="unitId != null">unit_id = #{unitId},</if>
<if test="materialCategory != null">material_category = #{materialCategory},</if>
<if test="kgFactor != null">kg_factor = #{kgFactor},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="model != null">model = #{model},</if>
<if test="barcode != null">barcode = #{barcode},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="description != null">description = #{description},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="status != null">status = #{status},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWornMaterialById" parameterType="Long">
delete from worn_material where id = #{id}
</delete>
<delete id="deleteWornMaterialByIds" parameterType="String">
delete from worn_material where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,117 @@
<?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.shzg.project.worn.mapper.WornMaterialTypeMapper">
<resultMap type="WornMaterialType" id="WornMaterialTypeResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="typeCode" column="type_code" />
<result property="typeName" column="type_name" />
<result property="firstLetter" column="first_letter" />
<result property="description" column="description" />
<result property="level" column="level" />
<result property="orderNum" column="order_num" />
<result property="status" column="status" />
<result property="isDelete" column="is_delete" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWornMaterialTypeVo">
select id, parent_id, ancestors, type_code, type_name, first_letter, description, level, order_num, status, is_delete, create_by, create_time, update_by, update_time from worn_material_type
</sql>
<select id="selectWornMaterialTypeList" parameterType="WornMaterialType" resultMap="WornMaterialTypeResult">
<include refid="selectWornMaterialTypeVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="typeCode != null and typeCode != ''"> and type_code = #{typeCode}</if>
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
<if test="firstLetter != null and firstLetter != ''"> and first_letter = #{firstLetter}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="level != null "> and level = #{level}</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
</where>
</select>
<select id="selectWornMaterialTypeById" parameterType="Long" resultMap="WornMaterialTypeResult">
<include refid="selectWornMaterialTypeVo"/>
where id = #{id}
</select>
<insert id="insertWornMaterialType" parameterType="WornMaterialType" useGeneratedKeys="true" keyProperty="id">
insert into worn_material_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="ancestors != null">ancestors,</if>
<if test="typeCode != null and typeCode != ''">type_code,</if>
<if test="typeName != null and typeName != ''">type_name,</if>
<if test="firstLetter != null">first_letter,</if>
<if test="description != null">description,</if>
<if test="level != null">level,</if>
<if test="orderNum != null">order_num,</if>
<if test="status != null">status,</if>
<if test="isDelete != null">is_delete,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},</if>
<if test="ancestors != null">#{ancestors},</if>
<if test="typeCode != null and typeCode != ''">#{typeCode},</if>
<if test="typeName != null and typeName != ''">#{typeName},</if>
<if test="firstLetter != null">#{firstLetter},</if>
<if test="description != null">#{description},</if>
<if test="level != null">#{level},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="status != null">#{status},</if>
<if test="isDelete != null">#{isDelete},</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>
</trim>
</insert>
<update id="updateWornMaterialType" parameterType="WornMaterialType">
update worn_material_type
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="ancestors != null">ancestors = #{ancestors},</if>
<if test="typeCode != null and typeCode != ''">type_code = #{typeCode},</if>
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
<if test="firstLetter != null">first_letter = #{firstLetter},</if>
<if test="description != null">description = #{description},</if>
<if test="level != null">level = #{level},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="status != null">status = #{status},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWornMaterialTypeById" parameterType="Long">
delete from worn_material_type where id = #{id}
</delete>
<delete id="deleteWornMaterialTypeByIds" parameterType="String">
delete from worn_material_type where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,92 @@
<?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.shzg.project.worn.mapper.WornMaterialUnitMapper">
<resultMap type="WornMaterialUnit" id="WornMaterialUnitResult">
<result property="id" column="id" />
<result property="unitName" column="unit_name" />
<result property="description" column="description" />
<result property="orderNum" column="order_num" />
<result property="status" column="status" />
<result property="isDelete" column="is_delete" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWornMaterialUnitVo">
select id, unit_name, description, order_num, status, is_delete, create_by, create_time, update_by, update_time from worn_material_unit
</sql>
<select id="selectWornMaterialUnitList" parameterType="WornMaterialUnit" resultMap="WornMaterialUnitResult">
<include refid="selectWornMaterialUnitVo"/>
<where>
<if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
</where>
</select>
<select id="selectWornMaterialUnitById" parameterType="Long" resultMap="WornMaterialUnitResult">
<include refid="selectWornMaterialUnitVo"/>
where id = #{id}
</select>
<insert id="insertWornMaterialUnit" parameterType="WornMaterialUnit" useGeneratedKeys="true" keyProperty="id">
insert into worn_material_unit
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="unitName != null and unitName != ''">unit_name,</if>
<if test="description != null">description,</if>
<if test="orderNum != null">order_num,</if>
<if test="status != null">status,</if>
<if test="isDelete != null">is_delete,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="unitName != null and unitName != ''">#{unitName},</if>
<if test="description != null">#{description},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="status != null">#{status},</if>
<if test="isDelete != null">#{isDelete},</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>
</trim>
</insert>
<update id="updateWornMaterialUnit" parameterType="WornMaterialUnit">
update worn_material_unit
<trim prefix="SET" suffixOverrides=",">
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
<if test="description != null">description = #{description},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="status != null">status = #{status},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWornMaterialUnitById" parameterType="Long">
delete from worn_material_unit where id = #{id}
</delete>
<delete id="deleteWornMaterialUnitByIds" parameterType="String">
delete from worn_material_unit where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>