change - add物料信息、自定义数据
parent
ca32fb9b7e
commit
9b0c7b7636
@ -0,0 +1,100 @@
|
||||
package com.os.mes.base.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.os.common.annotation.Log;
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.enums.BusinessType;
|
||||
import com.os.mes.base.domain.BaseCustomData;
|
||||
import com.os.mes.base.service.IBaseCustomDataService;
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 自定义数据维护Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/base/baseCustomData")
|
||||
public class BaseCustomDataController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseCustomDataService baseCustomDataService;
|
||||
|
||||
/**
|
||||
* 查询自定义数据维护列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseCustomData baseCustomData) {
|
||||
startPage();
|
||||
List<BaseCustomData> list = baseCustomDataService.selectBaseCustomDataList(baseCustomData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出自定义数据维护列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:export')")
|
||||
@Log(title = "自定义数据维护", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseCustomData baseCustomData) {
|
||||
List<BaseCustomData> list = baseCustomDataService.selectBaseCustomDataList(baseCustomData);
|
||||
ExcelUtil<BaseCustomData> util = new ExcelUtil<BaseCustomData>(BaseCustomData.class);
|
||||
util.exportExcel(response, list, "自定义数据维护数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自定义数据维护详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||
return success(baseCustomDataService.selectBaseCustomDataByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增自定义数据维护
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:add')")
|
||||
@Log(title = "自定义数据维护", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseCustomData baseCustomData) {
|
||||
baseCustomData.setCreateBy(getUsername());
|
||||
return toAjax(baseCustomDataService.insertBaseCustomData(baseCustomData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改自定义数据维护
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:edit')")
|
||||
@Log(title = "自定义数据维护", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseCustomData baseCustomData) {
|
||||
baseCustomData.setUpdateBy(getUsername());
|
||||
return toAjax(baseCustomDataService.updateBaseCustomData(baseCustomData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自定义数据维护
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:remove')")
|
||||
@Log(title = "自定义数据维护", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(baseCustomDataService.deleteBaseCustomDataByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package com.os.mes.base.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.os.common.annotation.Log;
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.enums.BusinessType;
|
||||
import com.os.mes.base.domain.BaseMaterialInfo;
|
||||
import com.os.mes.base.service.IBaseMaterialInfoService;
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物料信息Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/base/baseMaterialInfo")
|
||||
public class BaseMaterialInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBaseMaterialInfoService baseMaterialInfoService;
|
||||
|
||||
/**
|
||||
* 查询物料信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseMaterialInfo baseMaterialInfo)
|
||||
{
|
||||
startPage();
|
||||
List<BaseMaterialInfo> list = baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:export')")
|
||||
@Log(title = "物料信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseMaterialInfo baseMaterialInfo)
|
||||
{
|
||||
List<BaseMaterialInfo> list = baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo);
|
||||
ExcelUtil<BaseMaterialInfo> util = new ExcelUtil<BaseMaterialInfo>(BaseMaterialInfo.class);
|
||||
util.exportExcel(response, list, "物料信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId)
|
||||
{
|
||||
return success(baseMaterialInfoService.selectBaseMaterialInfoByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:add')")
|
||||
@Log(title = "物料信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseMaterialInfo baseMaterialInfo)
|
||||
{
|
||||
baseMaterialInfo.setCreateBy(getUsername());
|
||||
return toAjax(baseMaterialInfoService.insertBaseMaterialInfo(baseMaterialInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:edit')")
|
||||
@Log(title = "物料信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseMaterialInfo baseMaterialInfo)
|
||||
{
|
||||
baseMaterialInfo.setUpdateBy(getUsername());
|
||||
return toAjax(baseMaterialInfoService.updateBaseMaterialInfo(baseMaterialInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:remove')")
|
||||
@Log(title = "物料信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds)
|
||||
{
|
||||
return toAjax(baseMaterialInfoService.deleteBaseMaterialInfoByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.mes.base.domain.BaseCustomData;
|
||||
|
||||
/**
|
||||
* 自定义数据维护Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
public interface BaseCustomDataMapper {
|
||||
/**
|
||||
* 查询自定义数据维护
|
||||
*
|
||||
* @param objId 自定义数据维护主键
|
||||
* @return 自定义数据维护
|
||||
*/
|
||||
public BaseCustomData selectBaseCustomDataByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询自定义数据维护列表
|
||||
*
|
||||
* @param baseCustomData 自定义数据维护
|
||||
* @return 自定义数据维护集合
|
||||
*/
|
||||
public List<BaseCustomData> selectBaseCustomDataList(BaseCustomData baseCustomData);
|
||||
|
||||
/**
|
||||
* 新增自定义数据维护
|
||||
*
|
||||
* @param baseCustomData 自定义数据维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseCustomData(BaseCustomData baseCustomData);
|
||||
|
||||
/**
|
||||
* 修改自定义数据维护
|
||||
*
|
||||
* @param baseCustomData 自定义数据维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseCustomData(BaseCustomData baseCustomData);
|
||||
|
||||
/**
|
||||
* 删除自定义数据维护
|
||||
*
|
||||
* @param objId 自定义数据维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCustomDataByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除自定义数据维护
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCustomDataByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.mes.base.domain.BaseMaterialInfo;
|
||||
|
||||
/**
|
||||
* 物料信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
public interface BaseMaterialInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询物料信息
|
||||
*
|
||||
* @param objId 物料信息主键
|
||||
* @return 物料信息
|
||||
*/
|
||||
public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询物料信息列表
|
||||
*
|
||||
* @param baseMaterialInfo 物料信息
|
||||
* @return 物料信息集合
|
||||
*/
|
||||
public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo);
|
||||
|
||||
/**
|
||||
* 新增物料信息
|
||||
*
|
||||
* @param baseMaterialInfo 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
|
||||
|
||||
/**
|
||||
* 修改物料信息
|
||||
*
|
||||
* @param baseMaterialInfo 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
|
||||
|
||||
/**
|
||||
* 删除物料信息
|
||||
*
|
||||
* @param objId 物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMaterialInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除物料信息
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMaterialInfoByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.base.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.mes.base.domain.BaseCustomData;
|
||||
|
||||
/**
|
||||
* 自定义数据维护Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
public interface IBaseCustomDataService {
|
||||
/**
|
||||
* 查询自定义数据维护
|
||||
*
|
||||
* @param objId 自定义数据维护主键
|
||||
* @return 自定义数据维护
|
||||
*/
|
||||
public BaseCustomData selectBaseCustomDataByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询自定义数据维护列表
|
||||
*
|
||||
* @param baseCustomData 自定义数据维护
|
||||
* @return 自定义数据维护集合
|
||||
*/
|
||||
public List<BaseCustomData> selectBaseCustomDataList(BaseCustomData baseCustomData);
|
||||
|
||||
/**
|
||||
* 新增自定义数据维护
|
||||
*
|
||||
* @param baseCustomData 自定义数据维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseCustomData(BaseCustomData baseCustomData);
|
||||
|
||||
/**
|
||||
* 修改自定义数据维护
|
||||
*
|
||||
* @param baseCustomData 自定义数据维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseCustomData(BaseCustomData baseCustomData);
|
||||
|
||||
/**
|
||||
* 批量删除自定义数据维护
|
||||
*
|
||||
* @param objIds 需要删除的自定义数据维护主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCustomDataByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除自定义数据维护信息
|
||||
*
|
||||
* @param objId 自定义数据维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCustomDataByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.base.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.mes.base.domain.BaseMaterialInfo;
|
||||
|
||||
/**
|
||||
* 物料信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
public interface IBaseMaterialInfoService
|
||||
{
|
||||
/**
|
||||
* 查询物料信息
|
||||
*
|
||||
* @param objId 物料信息主键
|
||||
* @return 物料信息
|
||||
*/
|
||||
public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询物料信息列表
|
||||
*
|
||||
* @param baseMaterialInfo 物料信息
|
||||
* @return 物料信息集合
|
||||
*/
|
||||
public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo);
|
||||
|
||||
/**
|
||||
* 新增物料信息
|
||||
*
|
||||
* @param baseMaterialInfo 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
|
||||
|
||||
/**
|
||||
* 修改物料信息
|
||||
*
|
||||
* @param baseMaterialInfo 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
|
||||
|
||||
/**
|
||||
* 批量删除物料信息
|
||||
*
|
||||
* @param objIds 需要删除的物料信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMaterialInfoByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除物料信息信息
|
||||
*
|
||||
* @param objId 物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMaterialInfoByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.os.mes.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.os.mes.base.mapper.BaseCustomDataMapper;
|
||||
import com.os.mes.base.domain.BaseCustomData;
|
||||
import com.os.mes.base.service.IBaseCustomDataService;
|
||||
|
||||
/**
|
||||
* 自定义数据维护Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
@Service
|
||||
public class BaseCustomDataServiceImpl implements IBaseCustomDataService {
|
||||
@Autowired
|
||||
private BaseCustomDataMapper baseCustomDataMapper;
|
||||
|
||||
/**
|
||||
* 查询自定义数据维护
|
||||
*
|
||||
* @param objId 自定义数据维护主键
|
||||
* @return 自定义数据维护
|
||||
*/
|
||||
@Override
|
||||
public BaseCustomData selectBaseCustomDataByObjId(Long objId) {
|
||||
return baseCustomDataMapper.selectBaseCustomDataByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询自定义数据维护列表
|
||||
*
|
||||
* @param baseCustomData 自定义数据维护
|
||||
* @return 自定义数据维护
|
||||
*/
|
||||
@Override
|
||||
public List<BaseCustomData> selectBaseCustomDataList(BaseCustomData baseCustomData) {
|
||||
return baseCustomDataMapper.selectBaseCustomDataList(baseCustomData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增自定义数据维护
|
||||
*
|
||||
* @param baseCustomData 自定义数据维护
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseCustomData(BaseCustomData baseCustomData) {
|
||||
baseCustomData.setCreateTime(DateUtils.getNowDate());
|
||||
return baseCustomDataMapper.insertBaseCustomData(baseCustomData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改自定义数据维护
|
||||
*
|
||||
* @param baseCustomData 自定义数据维护
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseCustomData(BaseCustomData baseCustomData) {
|
||||
baseCustomData.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseCustomDataMapper.updateBaseCustomData(baseCustomData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除自定义数据维护
|
||||
*
|
||||
* @param objIds 需要删除的自定义数据维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseCustomDataByObjIds(Long[] objIds) {
|
||||
return baseCustomDataMapper.deleteBaseCustomDataByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自定义数据维护信息
|
||||
*
|
||||
* @param objId 自定义数据维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseCustomDataByObjId(Long objId) {
|
||||
return baseCustomDataMapper.deleteBaseCustomDataByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.os.mes.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.os.mes.base.mapper.BaseMaterialInfoMapper;
|
||||
import com.os.mes.base.domain.BaseMaterialInfo;
|
||||
import com.os.mes.base.service.IBaseMaterialInfoService;
|
||||
|
||||
/**
|
||||
* 物料信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
@Service
|
||||
public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService
|
||||
{
|
||||
@Autowired
|
||||
private BaseMaterialInfoMapper baseMaterialInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询物料信息
|
||||
*
|
||||
* @param objId 物料信息主键
|
||||
* @return 物料信息
|
||||
*/
|
||||
@Override
|
||||
public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId)
|
||||
{
|
||||
return baseMaterialInfoMapper.selectBaseMaterialInfoByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料信息列表
|
||||
*
|
||||
* @param baseMaterialInfo 物料信息
|
||||
* @return 物料信息
|
||||
*/
|
||||
@Override
|
||||
public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo)
|
||||
{
|
||||
return baseMaterialInfoMapper.selectBaseMaterialInfoList(baseMaterialInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料信息
|
||||
*
|
||||
* @param baseMaterialInfo 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo)
|
||||
{
|
||||
baseMaterialInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return baseMaterialInfoMapper.insertBaseMaterialInfo(baseMaterialInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料信息
|
||||
*
|
||||
* @param baseMaterialInfo 物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo)
|
||||
{
|
||||
baseMaterialInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseMaterialInfoMapper.updateBaseMaterialInfo(baseMaterialInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料信息
|
||||
*
|
||||
* @param objIds 需要删除的物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseMaterialInfoByObjIds(Long[] objIds)
|
||||
{
|
||||
return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料信息信息
|
||||
*
|
||||
* @param objId 物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseMaterialInfoByObjId(Long objId)
|
||||
{
|
||||
return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
<?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.os.mes.base.mapper.BaseCustomDataMapper">
|
||||
|
||||
<resultMap type="BaseCustomData" id="BaseCustomDataResult">
|
||||
<result property="objId" column="obj_id"/>
|
||||
<result property="customType" column="custom_type"/>
|
||||
<result property="customFunction" column="custom_function"/>
|
||||
<result property="customCode" column="custom_code"/>
|
||||
<result property="customData" column="custom_data"/>
|
||||
<result property="customSort" column="custom_sort"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isFlag" column="is_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"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseCustomDataVo">
|
||||
select obj_id,
|
||||
custom_type,
|
||||
custom_function,
|
||||
custom_code,
|
||||
custom_data,
|
||||
custom_sort,
|
||||
remark,
|
||||
is_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from base_custom_data
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseCustomDataList" parameterType="BaseCustomData" resultMap="BaseCustomDataResult">
|
||||
<include refid="selectBaseCustomDataVo"/>
|
||||
<where>
|
||||
<if test="customType != null and customType != ''">and custom_type = #{customType}</if>
|
||||
<if test="customFunction != null and customFunction != ''">and custom_function = #{customFunction}</if>
|
||||
<if test="customCode != null and customCode != ''">and custom_code = #{customCode}</if>
|
||||
<if test="customData != null and customData != ''">and custom_data = #{customData}</if>
|
||||
<if test="customSort != null ">and custom_sort = #{customSort}</if>
|
||||
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseCustomDataByObjId" parameterType="Long" resultMap="BaseCustomDataResult">
|
||||
<include refid="selectBaseCustomDataVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseCustomData" parameterType="BaseCustomData" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into base_custom_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customType != null">custom_type,</if>
|
||||
<if test="customFunction != null">custom_function,</if>
|
||||
<if test="customCode != null">custom_code,</if>
|
||||
<if test="customData != null">custom_data,</if>
|
||||
<if test="customSort != null">custom_sort,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isFlag != null">is_flag,</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="customType != null">#{customType},</if>
|
||||
<if test="customFunction != null">#{customFunction},</if>
|
||||
<if test="customCode != null">#{customCode},</if>
|
||||
<if test="customData != null">#{customData},</if>
|
||||
<if test="customSort != null">#{customSort},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isFlag != null">#{isFlag},</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="updateBaseCustomData" parameterType="BaseCustomData">
|
||||
update base_custom_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customType != null">custom_type = #{customType},</if>
|
||||
<if test="customFunction != null">custom_function = #{customFunction},</if>
|
||||
<if test="customCode != null">custom_code = #{customCode},</if>
|
||||
<if test="customData != null">custom_data = #{customData},</if>
|
||||
<if test="customSort != null">custom_sort = #{customSort},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</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 obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseCustomDataByObjId" parameterType="Long">
|
||||
delete
|
||||
from base_custom_data
|
||||
where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseCustomDataByObjIds" parameterType="String">
|
||||
delete from base_custom_data where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,137 @@
|
||||
<?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.os.mes.base.mapper.BaseMaterialInfoMapper">
|
||||
|
||||
<resultMap type="BaseMaterialInfo" id="BaseMaterialInfoResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialCategories" column="material_categories" />
|
||||
<result property="materialSubclass" column="material_subclass" />
|
||||
<result property="materialType" column="material_type" />
|
||||
<result property="materialUnit" column="material_unit" />
|
||||
<result property="unitPrice" column="unit_price" />
|
||||
<result property="materialSpecifications" column="material_specifications" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="productLineCode" column="product_line_code" />
|
||||
<result property="isFlag" column="is_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="incrementDate" column="increment_date" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="productName" column="product_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseMaterialInfoVo">
|
||||
select obj_id, material_code, material_name, material_categories, material_subclass, material_type, material_unit, unit_price, material_specifications, factory_code, product_line_code, is_flag, create_by, create_time, update_by, update_time, increment_date, product_code, product_name from base_material_info
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseMaterialInfoList" parameterType="BaseMaterialInfo" resultMap="BaseMaterialInfoResult">
|
||||
<include refid="selectBaseMaterialInfoVo"/>
|
||||
<where>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="materialCategories != null and materialCategories != ''"> and material_categories = #{materialCategories}</if>
|
||||
<if test="materialSubclass != null and materialSubclass != ''"> and material_subclass = #{materialSubclass}</if>
|
||||
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
|
||||
<if test="materialUnit != null and materialUnit != ''"> and material_unit = #{materialUnit}</if>
|
||||
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
|
||||
<if test="materialSpecifications != null and materialSpecifications != ''"> and material_specifications = #{materialSpecifications}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
|
||||
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
|
||||
<if test="incrementDate != null "> and increment_date = #{incrementDate}</if>
|
||||
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseMaterialInfoByObjId" parameterType="Long" resultMap="BaseMaterialInfoResult">
|
||||
<include refid="selectBaseMaterialInfoVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseMaterialInfo" parameterType="BaseMaterialInfo" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into base_material_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialCategories != null">material_categories,</if>
|
||||
<if test="materialSubclass != null">material_subclass,</if>
|
||||
<if test="materialType != null">material_type,</if>
|
||||
<if test="materialUnit != null">material_unit,</if>
|
||||
<if test="unitPrice != null">unit_price,</if>
|
||||
<if test="materialSpecifications != null">material_specifications,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="productLineCode != null">product_line_code,</if>
|
||||
<if test="isFlag != null">is_flag,</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="incrementDate != null">increment_date,</if>
|
||||
<if test="productCode != null">product_code,</if>
|
||||
<if test="productName != null">product_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialCategories != null">#{materialCategories},</if>
|
||||
<if test="materialSubclass != null">#{materialSubclass},</if>
|
||||
<if test="materialType != null">#{materialType},</if>
|
||||
<if test="materialUnit != null">#{materialUnit},</if>
|
||||
<if test="unitPrice != null">#{unitPrice},</if>
|
||||
<if test="materialSpecifications != null">#{materialSpecifications},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="productLineCode != null">#{productLineCode},</if>
|
||||
<if test="isFlag != null">#{isFlag},</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="incrementDate != null">#{incrementDate},</if>
|
||||
<if test="productCode != null">#{productCode},</if>
|
||||
<if test="productName != null">#{productName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseMaterialInfo" parameterType="BaseMaterialInfo">
|
||||
update base_material_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialCategories != null">material_categories = #{materialCategories},</if>
|
||||
<if test="materialSubclass != null">material_subclass = #{materialSubclass},</if>
|
||||
<if test="materialType != null">material_type = #{materialType},</if>
|
||||
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
|
||||
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
||||
<if test="materialSpecifications != null">material_specifications = #{materialSpecifications},</if>
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</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>
|
||||
<if test="incrementDate != null">increment_date = #{incrementDate},</if>
|
||||
<if test="productCode != null">product_code = #{productCode},</if>
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseMaterialInfoByObjId" parameterType="Long">
|
||||
delete from base_material_info where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseMaterialInfoByObjIds" parameterType="String">
|
||||
delete from base_material_info where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue