实现BOM管理增删改查

master
baogq 6 years ago
parent d7c1081508
commit 7e7974efb7

@ -129,6 +129,9 @@ public class BaseBomInfoController extends BaseController
@ResponseBody
public AjaxResult addSave(BaseBomInfo baseBomInfo)
{
BaseBomInfo pbaseBomInfo = new BaseBomInfo();
pbaseBomInfo = baseBomInfoService.selectBaseBomInfoBymaterialName(baseBomInfo);
baseBomInfo.setpId(pbaseBomInfo.getBomId());
return toAjax(baseBomInfoService.insertBaseBomInfo(baseBomInfo));
}
@ -139,6 +142,8 @@ public class BaseBomInfoController extends BaseController
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
{
BaseBomInfo baseBomInfo = baseBomInfoService.selectBaseBomInfoById(objid);
mmap.put("cbmaterialtypeInfo",baseMaterialtypeInfoService.selectEditBaseMaterialtypeInfoList(baseBomInfo.getMaterialTypeId()));
mmap.put("cbmaterialInfo",baseMaterialInfoService.selectEditBaseMaterialInfoList(baseBomInfo.getMaterialId()));
mmap.put("baseBomInfo", baseBomInfo);
return prefix + "/edit";
}
@ -158,12 +163,16 @@ public class BaseBomInfoController extends BaseController
/**
* BOM
*/
@RequiresPermissions("baseinfo:bominfo:remove")
@Log(title = "BOM基础信息", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@RequiresPermissions("system:dept:remove")
@GetMapping("/remove/{bomId}")
@ResponseBody
public AjaxResult remove(String ids)
public AjaxResult remove(@PathVariable("bomId") Long bomId)
{
return toAjax(baseBomInfoService.deleteBaseBomInfoByIds(ids));
if (baseBomInfoService.selectBomCount(bomId) > 0)
{
return AjaxResult.warn("存在下级节点,不允许删除");
}
return toAjax(baseBomInfoService.deleteBaseBomInfoById(bomId));
}
}

@ -23,19 +23,19 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料类型ID</label>
<label class="col-sm-3 control-label">物料类型名称</label>
<div class="col-sm-8">
<select name="materialTypeId" id="workingProcedureId" class="form-control ">
<option value="">--请选择物料类型--</option>
<option value="">--请选择物料类型名称--</option>
<option name="cbmaterialtypeInfo" th:each="materialTypeId:${cbmaterialtypeInfo}" th:value="${materialTypeId.materialTypeId}" th:text="${materialTypeId.materialTypeName}" th:disabled="${materialTypeId.status == '1'}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料ID</label>
<label class="col-sm-3 control-label">物料名称</label>
<div class="col-sm-8">
<select name="materialId" id="materialId" class="form-control ">
<option value="">--请选择物料类型--</option>
<option value="">--请选择物料名称--</option>
<option name="cbmaterialInfo" th:each="materialId:${cbmaterialInfo}" th:value="${materialId.materialId}" th:text="${materialId.materialName}" th:disabled="${materialId.status == '1'}"></option>
</select>
</div>

@ -10,10 +10,10 @@
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>父节点ID</label>
<input type="text" name="pId"/>
</li>
<!-- <li>-->
<!-- <label>父节点ID</label>-->
<!-- <input type="text" name="pId"/>-->
<!-- </li>-->
<li>
<label>物料类型:</label>
<select name="materialTypeId">
@ -114,8 +114,8 @@
align: "left",
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.bomId + '\')"><i class="fa fa-plus"></i>新增物料</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.bomId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.bomId + '\')"><i class="fa fa-plus"></i>新增</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.bomId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}

@ -2,11 +2,13 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改BOM基础信息')" />
<th:block th:include="include :: jasny-bootstrap-css" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-bominfo-edit" th:object="${baseBomInfo}">
<input name="objid" th:field="*{objid}" type="hidden">
<input name="bomId" th:field="*{bomId}" type="hidden">
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">父节点ID</label>-->
<!-- <div class="col-sm-8">-->
@ -14,21 +16,27 @@
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">物料类型ID</label>
<label class="col-sm-3 control-label">物料类型名称</label>
<div class="col-sm-8">
<select name="materialTypeId" class="form-control m-b">
<option value="">所有</option>
<select name="materialTypeId" th:id="materialTypeId" class="form-control m-b">
<option name="cbmaterialtypeInfo" th:each="materialTypeId:${cbmaterialtypeInfo}" th:value="${materialTypeId.materialTypeId}" th:text="${materialTypeId.materialTypeName}" th:selected="${materialTypeId.flag}" th:disabled="${materialTypeId.status == '1'}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料ID</label>
<label class="col-sm-3 control-label">物料名称</label>
<div class="col-sm-8">
<select name="materialId" class="form-control m-b">
<option value="">所有</option>
<select name="materialId" th:id="materialId" class="form-control m-b">
<option name="cbmaterialInfo" th:each="materialId:${cbmaterialInfo}" th:value="${materialId.materialId}" th:text="${materialId.materialName}" th:selected="${materialId.flag}" th:disabled="${materialId.status == '1'}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态标志:</label>
<div class="col-sm-8">
@ -41,6 +49,8 @@
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script th:inline="javascript">
var prefix = ctx + "baseinfo/bominfo";
$("#form-bominfo-edit").validate({

@ -1,73 +1,77 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改设备基础信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-deviceinfo-edit" th:object="${baseDeviceInfo}">
<input name="objid" th:field="*{objid}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">设备ID</label>
<div class="col-sm-8">
<input name="deviceId" th:field="*{deviceId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">设备名称:</label>
<div class="col-sm-8">
<input name="deviceName" th:field="*{deviceName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属工序:</label>
<div class="col-sm-8">
<select name="workingProcedureId" id="workingProcedureId" th:id="postId" class="form-control m-b">
<option name="cbEditWorkingProcedureInfo" th:each="workingProcedureId:${cbEditWorkingProcedureInfo}" th:value="${workingProcedureId.workingProcedureId}" th:text="${workingProcedureId.workingProcedureName}" th:selected="${workingProcedureId.flag}" th:disabled="${workingProcedureId.status == '1'}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">价格:</label>
<div class="col-sm-8">
<input name="price" th:field="*{price}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">设备规格型号:</label>
<div class="col-sm-8">
<input name="deviceType" th:field="*{deviceType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态标志:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_status_info')}">
<input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "baseinfo/deviceinfo";
$("#form-deviceinfo-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-deviceinfo-edit').serialize());
}
}
</script>
</body>
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改设备基础信息')" />
<th:block th:include="include :: jasny-bootstrap-css" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-deviceinfo-edit" th:object="${baseDeviceInfo}">
<input name="objid" th:field="*{objid}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">设备ID</label>
<div class="col-sm-8">
<input name="deviceId" th:field="*{deviceId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">设备名称:</label>
<div class="col-sm-8">
<input name="deviceName" th:field="*{deviceName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属工序:</label>
<div class="col-sm-8">
<select name="workingProcedureId" id="workingProcedureId" th:id="postId" class="form-control m-b">
<option name="cbEditWorkingProcedureInfo" th:each="workingProcedureId:${cbEditWorkingProcedureInfo}" th:value="${workingProcedureId.workingProcedureId}" th:text="${workingProcedureId.workingProcedureName}" th:selected="${workingProcedureId.flag}" th:disabled="${workingProcedureId.status == '1'}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">价格:</label>
<div class="col-sm-8">
<input name="price" th:field="*{price}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">设备规格型号:</label>
<div class="col-sm-8">
<input name="deviceType" th:field="*{deviceType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态标志:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_status_info')}">
<input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script th:inline="javascript">
var prefix = ctx + "baseinfo/deviceinfo";
$("#form-deviceinfo-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-deviceinfo-edit').serialize());
}
}
</script>
</body>
</html>

@ -1,161 +1,162 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<th:block th:include="include :: header('多级联动下拉')" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>多级联动下拉<small>https://github.com/ciaoca/cxSelect</small></h5>
</div>
<div class="ibox-content">
<p>简单联动示例。</p>
<div id="element" class="row">
<div class="col-sm-2">
<select class="type form-control m-b" data-first-title="请选择">
<option value="">请选择</option>
</select>
</div>
<div class="col-sm-2">
<select class="router form-control m-b" data-first-title="请选择">
<option value="">请选择</option>
</select>
</div>
</div>
<hr>
<p>国内省市区联动。</p>
<div id="element1" class="row">
<div class="col-sm-2">
<select class="province form-control m-b" data-first-title="选择省">
<option value="">请选择</option>
<option value="广东省" selected>广东省</option>
</select>
</div>
<div class="col-sm-2">
<select class="city form-control m-b" data-first-title="选择市">
<option value="">请选择</option>
<option value="深圳市" selected>深圳市</option>
</select>
</div>
<div class="col-sm-2">
<select class="area form-control m-b" data-first-title="选择地区">
<option value="">请选择</option>
<option value="南山区" selected>南山区</option>
</select>
</div>
</div>
<hr>
<p>自定义选项。</p>
<div id="element2" class="row">
<div class="col-sm-2">
<select class="first form-control m-b"></select>
</div>
<div class="col-sm-2">
<select class="second form-control m-b"></select>
</div>
<div class="col-sm-2">
<select class="third form-control m-b"></select>
</div>
<div class="col-sm-2">
<select class="fourth form-control m-b"></select>
</div>
<div class="col-sm-2">
<select class="fifth form-control m-b"></select>
</div>
</div>
<hr>
<div class="form-group">
<label class="font-noraml">相关参数详细信息</label>
<div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: jquery-cxselect-js" />
<script th:inline="javascript">
// 直接返回获取
var data = [[${data}]];
$('#element').cxSelect({
selects: ['type', 'router'],
jsonValue: 'v',
data: data
});
// 通过默认url获取
var urlChina = 'cityData';
$.cxSelect.defaults.url = urlChina;
$('#element1').cxSelect({
selects: ['province', 'city', 'area'],
nodata: 'none'
});
// 固定值获取
$('#element2').cxSelect({
selects: ['first', 'second', 'third', 'fourth', 'fifth'],
required: true,
jsonValue: 'v',
data: [
{'v': '1', 'n': '第一级 >', 's': [
{'v': '2', 'n': '第二级 >', 's': [
{'v': '3', 'n': '第三级 >', 's': [
{'v': '4', 'n': '第四级 >', 's': [
{'v': '5', 'n': '第五级 >', 's': [
{'v': '6', 'n': '第六级 >'}
]}
]}
]}
]}
]},
{'v': 'test number', 'n': '测试数字', 's': [
{'v': 'text', 'n': '文本类型', 's': [
{'v': '4', 'n': '4'},
{'v': '5', 'n': '5'},
{'v': '6', 'n': '6'},
{'v': '7', 'n': '7'},
{'v': '8', 'n': '8'},
{'v': '9', 'n': '9'},
{'v': '10', 'n': '10'}
]},
{'v': 'number', 'n': '数值类型', 's': [
{'v': 11, 'n': 11},
{'v': 12, 'n': 12},
{'v': 13, 'n': 13},
{'v': 14, 'n': 14},
{'v': 15, 'n': 15},
{'v': 16, 'n': 16},
{'v': 17, 'n': 17}
]}
]},
{'v': 'test boolean','n': '测试 Boolean 类型', 's': [
{'v': true ,'n': true},
{'v': false ,'n': false}
]},
{v: 'test quotes', n: '测试属性不加引号', s: [
{v: 'quotes', n: '引号'}
]},
{v: 'test other', n: '测试奇怪的值', s: [
{v: '[]', n: '数组(空)'},
{v: [1,2,3], n: '数组(数值)'},
{v: ['a','b','c'], n: '数组(文字)'},
{v: new Date(), n: '日期'},
{v: new RegExp('\\d+'), n: '正则对象'},
{v: /\d+/, n: '正则直接量'},
{v: {}, n: '对象'},
{v: document.getElementById('custom_data'), n: 'DOM'},
{v: null, n: 'Null'},
{n: '未设置 value'}
]},
{'v': '' , 'n': '无子级'}
]
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh">
<head>
<th:block th:include="include :: header('多级联动下拉')" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>多级联动下拉<small>https://github.com/ciaoca/cxSelect</small></h5>
</div>
<div class="ibox-content">
<p>简单联动示例。</p>
<div id="element" class="row">
<div class="col-sm-2">
<select class="type form-control m-b" data-first-title="请选择">
<option value="">请选择</option>
</select>
</div>
<div class="col-sm-2">
<select class="router form-control m-b" data-first-title="请选择">
<option value="">请选择</option>
</select>
</div>
</div>
<hr>
<p>国内省市区联动。</p>
<div id="element1" class="row">
<div class="col-sm-2">
<select class="province form-control m-b" data-first-title="选择省">
<option value="">请选择</option>
<option value="广东省" selected>广东省</option>
</select>
</div>
<div class="col-sm-2">
<select class="city form-control m-b" data-first-title="选择市">
<option value="">请选择</option>
<option value="深圳市" selected>深圳市</option>
</select>
</div>
<div class="col-sm-2">
<select class="area form-control m-b" data-first-title="选择地区">
<option value="">请选择</option>
<option value="南山区" selected>南山区</option>
</select>
</div>
</div>
<hr>
<p>自定义选项。</p>
<div id="element2" class="row">
<div class="col-sm-2">
<select class="first form-control m-b"></select>
</div>
<div class="col-sm-2">
<select class="second form-control m-b"></select>
</div>
<div class="col-sm-2">
<select class="third form-control m-b"></select>
</div>
<div class="col-sm-2">
<select class="fourth form-control m-b"></select>
</div>
<div class="col-sm-2">
<select class="fifth form-control m-b"></select>
</div>
</div>
<hr>
<div class="form-group">
<label class="font-noraml">相关参数详细信息</label>
<div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: jquery-cxselect-js" />
<script th:inline="javascript">
// 直接返回获取
var data = [[${data}]];
console.log(data);
$('#element').cxSelect({
selects: ['type', 'router'],
jsonValue: 'v',
data: data
});
// 通过默认url获取
var urlChina = 'cityData';
$.cxSelect.defaults.url = urlChina;
$('#element1').cxSelect({
selects: ['province', 'city', 'area'],
nodata: 'none'
});
// 固定值获取
$('#element2').cxSelect({
selects: ['first', 'second', 'third', 'fourth', 'fifth'],
required: true,
jsonValue: 'v',
data: [
{'v': '1', 'n': '第一级 >', 's': [
{'v': '2', 'n': '第二级 >', 's': [
{'v': '3', 'n': '第三级 >', 's': [
{'v': '4', 'n': '第四级 >', 's': [
{'v': '5', 'n': '第五级 >', 's': [
{'v': '6', 'n': '第六级 >'}
]}
]}
]}
]}
]},
{'v': 'test number', 'n': '测试数字', 's': [
{'v': 'text', 'n': '文本类型', 's': [
{'v': '4', 'n': '4'},
{'v': '5', 'n': '5'},
{'v': '6', 'n': '6'},
{'v': '7', 'n': '7'},
{'v': '8', 'n': '8'},
{'v': '9', 'n': '9'},
{'v': '10', 'n': '10'}
]},
{'v': 'number', 'n': '数值类型', 's': [
{'v': 11, 'n': 11},
{'v': 12, 'n': 12},
{'v': 13, 'n': 13},
{'v': 14, 'n': 14},
{'v': 15, 'n': 15},
{'v': 16, 'n': 16},
{'v': 17, 'n': 17}
]}
]},
{'v': 'test boolean','n': '测试 Boolean 类型', 's': [
{'v': true ,'n': true},
{'v': false ,'n': false}
]},
{v: 'test quotes', n: '测试属性不加引号', s: [
{v: 'quotes', n: '引号'}
]},
{v: 'test other', n: '测试奇怪的值', s: [
{v: '[]', n: '数组(空)'},
{v: [1,2,3], n: '数组(数值)'},
{v: ['a','b','c'], n: '数组(文字)'},
{v: new Date(), n: '日期'},
{v: new RegExp('\\d+'), n: '正则对象'},
{v: /\d+/, n: '正则直接量'},
{v: {}, n: '对象'},
{v: document.getElementById('custom_data'), n: 'DOM'},
{v: null, n: 'Null'},
{n: '未设置 value'}
]},
{'v': '' , 'n': '无子级'}
]
});
</script>
</body>
</html>

@ -58,4 +58,20 @@ public interface BaseBomInfoMapper
* @return
*/
public int deleteBaseBomInfoByIds(String[] objids);
/**
* BOM
*
* @param materialName BOM
* @return
*/
public BaseBomInfo selectBaseBomInfoBymaterialName(BaseBomInfo baseBomInfo);
/**
* BOM
*
* @param parentId ID
* @return
*/
public int selectBomCount(BaseBomInfo baseBomInfo);
}

@ -58,4 +58,20 @@ public interface IBaseBomInfoService
* @return
*/
public int deleteBaseBomInfoById(Long objid);
/**
* BOM
*
* @param baseBomInfo BOM
* @return
*/
public BaseBomInfo selectBaseBomInfoBymaterialName(BaseBomInfo baseBomInfo);
/**
* BOM
*
* @param parentId ID
* @return
*/
public int selectBomCount(Long parentId);
}

@ -2,6 +2,7 @@ package com.ruoyi.baseinfo.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SysDept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.baseinfo.mapper.BaseBomInfoMapper;
@ -94,4 +95,16 @@ public class BaseBomInfoServiceImpl implements IBaseBomInfoService
{
return baseBomInfoMapper.deleteBaseBomInfoById(objid);
}
@Override
public BaseBomInfo selectBaseBomInfoBymaterialName(BaseBomInfo baseBomInfo) {
return baseBomInfoMapper.selectBaseBomInfoBymaterialName(baseBomInfo);
}
@Override
public int selectBomCount(Long parentId) {
BaseBomInfo baseBomInfo = new BaseBomInfo();
baseBomInfo.setpId(parentId);
return baseBomInfoMapper.selectBomCount(baseBomInfo);
}
}

@ -102,4 +102,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectBaseBomInfoBymaterialName" parameterType="BaseBomInfo" resultMap="BaseBomInfoResult">
select t1.bom_id, t1.p_id, t1.material_type_id,t2.material_type_name, t1.material_id,t3.material_name, t1.status, t1.remark, t1.create_by, t1.create_time, t1.update_by, t1.update_time, t1.del_flag from base_bom_info t1
left join dbo.base_materialtype_info t2 on t1.material_type_id = t2.material_type_id
left join dbo.base_material_info t3 on t1.material_id = t3.material_id
<where>
<if test="pId != null and pId != ''"> and t1.p_id = #{pId}</if>
<if test="materialName != null and materialName != ''"> and t3.material_name = #{materialName}</if>
<if test="materialTypeId != null and materialTypeId != ''"> and t1.material_type_id = #{materialTypeId}</if>
<if test="materialId != null and materialId != ''"> and t1.material_id = #{materialId}</if>
<if test="status != null and status != ''"> and t1.status = #{status}</if>
</where>
</select>
<select id="selectBomCount" parameterType="BaseBomInfo" resultType="int">
select count(1) from base_bom_info
where del_flag = '0'
<if test="bomId != null and bomId != 0"> and bom_id = #{bomId} </if>
<if test="pId != null and pId != 0"> and p_id = #{pId} </if>
</select>
</mapper>

Loading…
Cancel
Save