实现主计划下添加子计划;未实现删除的业务逻辑
parent
1acbb27d25
commit
624dcac7f0
@ -0,0 +1,159 @@
|
||||
package com.ruoyi.web.controller.baseinfo;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.ruoyi.baseinfo.domain.BaseDeviceInfo;
|
||||
import com.ruoyi.baseinfo.domain.BaseShiftInfo;
|
||||
import com.ruoyi.baseinfo.service.IBaseDeviceInfoService;
|
||||
import com.ruoyi.baseinfo.service.IBasePlandetailInfoService;
|
||||
import com.ruoyi.baseinfo.service.IBaseShiftInfoService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.baseinfo.domain.BasePlanInfo;
|
||||
import com.ruoyi.baseinfo.service.IBasePlanInfoService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 计划信息Controller
|
||||
*
|
||||
* @author CaesarBao
|
||||
* @date 2020-10-23
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/baseinfo/planinfo")
|
||||
public class BasePlanInfoController extends BaseController
|
||||
{
|
||||
private String prefix = "baseinfo/planinfo";
|
||||
|
||||
@Autowired
|
||||
private IBasePlanInfoService basePlanInfoService;
|
||||
@Autowired
|
||||
private IBaseDeviceInfoService baseDeviceInfoService;
|
||||
@Autowired
|
||||
private IBaseShiftInfoService baseShiftInfoService;
|
||||
@Autowired
|
||||
private IBasePlandetailInfoService basePlandetailInfoService;
|
||||
|
||||
@RequiresPermissions("baseinfo:planinfo:view")
|
||||
@GetMapping()
|
||||
public String planinfo(ModelMap mmap)
|
||||
{
|
||||
BaseDeviceInfo baseDeviceInfo = new BaseDeviceInfo();
|
||||
BaseShiftInfo baseShiftInfo = new BaseShiftInfo();
|
||||
mmap.put("cbdeviceInfo",baseDeviceInfoService.selectBaseDeviceInfoList(baseDeviceInfo));
|
||||
mmap.put("cbshitfInfo",baseShiftInfoService.selectBaseShiftInfoList(baseShiftInfo));
|
||||
return prefix + "/planinfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划信息列表
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:planinfo:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BasePlanInfo basePlanInfo)
|
||||
{
|
||||
startPage();
|
||||
List<BasePlanInfo> list = basePlanInfoService.selectBasePlanInfoList(basePlanInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计划信息列表
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:planinfo:export")
|
||||
@Log(title = "计划信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BasePlanInfo basePlanInfo)
|
||||
{
|
||||
List<BasePlanInfo> list = basePlanInfoService.selectBasePlanInfoList(basePlanInfo);
|
||||
ExcelUtil<BasePlanInfo> util = new ExcelUtil<BasePlanInfo>(BasePlanInfo.class);
|
||||
return util.exportExcel(list, "planinfo");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划信息
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap mmap)
|
||||
{
|
||||
BaseDeviceInfo baseDeviceInfo = new BaseDeviceInfo();
|
||||
BaseShiftInfo baseShiftInfo = new BaseShiftInfo();
|
||||
mmap.put("cbdeviceInfo",baseDeviceInfoService.selectBaseDeviceInfoList(baseDeviceInfo));
|
||||
mmap.put("cbshitfInfo",baseShiftInfoService.selectBaseShiftInfoList(baseShiftInfo));
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存计划信息
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:planinfo:add")
|
||||
@Log(title = "计划信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BasePlanInfo basePlanInfo)
|
||||
{
|
||||
Random rand = new Random();
|
||||
String code = new SimpleDateFormat("yyMMddHHmmss").format(new Date()) + (rand.nextInt(9));
|
||||
basePlanInfo.setPlanid(code);
|
||||
basePlanInfo.setCreateBy(ShiroUtils.getLoginName());
|
||||
basePlanInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return toAjax(basePlanInfoService.insertBasePlanInfo(basePlanInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划信息
|
||||
*/
|
||||
@GetMapping("/edit/{planid}")
|
||||
public String edit(@PathVariable("planid") String planid, ModelMap mmap)
|
||||
{
|
||||
BasePlanInfo basePlanInfo = basePlanInfoService.selectBasePlanInfoById(planid);
|
||||
mmap.put("cbdeviceInfo",baseDeviceInfoService.selectEditBaseDeviceInfoList(basePlanInfo.getDeviceid()));
|
||||
mmap.put("cbshitfInfo",baseShiftInfoService.selectEditBaseShiftInfoList(basePlanInfo.getPlanShiftId()));
|
||||
mmap.put("basePlanInfo", basePlanInfo);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存计划信息
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:planinfo:edit")
|
||||
@Log(title = "计划信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BasePlanInfo basePlanInfo)
|
||||
{
|
||||
return toAjax(basePlanInfoService.updateBasePlanInfo(basePlanInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划信息
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:planinfo:remove")
|
||||
@Log(title = "计划信息", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(basePlanInfoService.deleteBasePlanInfoByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,158 @@
|
||||
package com.ruoyi.web.controller.baseinfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.baseinfo.domain.BaseGroupInfo;
|
||||
import com.ruoyi.baseinfo.domain.BaseMaterialInfo;
|
||||
import com.ruoyi.baseinfo.domain.BasePlanInfo;
|
||||
import com.ruoyi.baseinfo.service.IBaseGroupInfoService;
|
||||
import com.ruoyi.baseinfo.service.IBaseMaterialInfoService;
|
||||
import com.ruoyi.baseinfo.service.IBasePlanInfoService;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.baseinfo.domain.BasePlandetailInfo;
|
||||
import com.ruoyi.baseinfo.service.IBasePlandetailInfoService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 计划明细Controller
|
||||
*
|
||||
* @author CaesarBao
|
||||
* @date 2020-10-23
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/baseinfo/plandetailinfo")
|
||||
public class BasePlandetailInfoController extends BaseController
|
||||
{
|
||||
private String prefix = "baseinfo/plandetailinfo";
|
||||
|
||||
@Autowired
|
||||
private IBasePlandetailInfoService basePlandetailInfoService;
|
||||
@Autowired
|
||||
private IBasePlanInfoService basePlanInfoService;
|
||||
@Autowired
|
||||
private IBaseMaterialInfoService baseMaterialInfoService;
|
||||
@Autowired
|
||||
private IBaseGroupInfoService baseGroupInfoService;
|
||||
|
||||
@RequiresPermissions("baseinfo:plandetailinfo:view")
|
||||
@GetMapping()
|
||||
public String plandetailinfo()
|
||||
{
|
||||
return prefix + "/plandetailinfo";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划明细列表
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:plandetailinfo:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BasePlandetailInfo basePlandetailInfo)
|
||||
{
|
||||
startPage();
|
||||
List<BasePlandetailInfo> list = basePlandetailInfoService.selectBasePlandetailInfoList(basePlandetailInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计划明细列表
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:plandetailinfo:export")
|
||||
@Log(title = "计划明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BasePlandetailInfo basePlandetailInfo)
|
||||
{
|
||||
List<BasePlandetailInfo> list = basePlandetailInfoService.selectBasePlandetailInfoList(basePlandetailInfo);
|
||||
ExcelUtil<BasePlandetailInfo> util = new ExcelUtil<BasePlandetailInfo>(BasePlandetailInfo.class);
|
||||
return util.exportExcel(list, "plandetailinfo");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划明细
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存计划明细
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:plandetailinfo:add")
|
||||
@Log(title = "计划明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BasePlandetailInfo basePlandetailInfo)
|
||||
{
|
||||
basePlandetailInfo.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(basePlandetailInfoService.insertBasePlandetailInfo(basePlandetailInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划明细
|
||||
*/
|
||||
@GetMapping("/edit/{objid}")
|
||||
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
|
||||
{
|
||||
BasePlandetailInfo basePlandetailInfo = basePlandetailInfoService.selectBasePlandetailInfoById(objid);
|
||||
mmap.put("basePlandetailInfo", basePlandetailInfo);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存计划明细
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:plandetailinfo:edit")
|
||||
@Log(title = "计划明细", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BasePlandetailInfo basePlandetailInfo)
|
||||
{
|
||||
return toAjax(basePlandetailInfoService.updateBasePlandetailInfo(basePlandetailInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划明细
|
||||
*/
|
||||
@RequiresPermissions("baseinfo:plandetailinfo:remove")
|
||||
@Log(title = "计划明细", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(basePlandetailInfoService.deleteBasePlandetailInfoByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划信息
|
||||
*/
|
||||
@GetMapping("/plandetail/{planid}")
|
||||
public String planedit(@PathVariable("planid") String planid, ModelMap mmap)
|
||||
{
|
||||
// BasePlanInfo basePlanInfo = basePlanInfoService.selectBasePlanInfoById(planid);
|
||||
// mmap.put("basePlanInfo", basePlanInfo);
|
||||
BaseMaterialInfo baseMaterialInfo = new BaseMaterialInfo();
|
||||
BaseGroupInfo baseGroupInfo = new BaseGroupInfo();
|
||||
mmap.put("cbmaterialInfo",baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo));
|
||||
mmap.put("cbGroupInfo",baseGroupInfoService.selectBaseGroupInfoList(baseGroupInfo));
|
||||
|
||||
mmap.put("planid", planid);
|
||||
return prefix + "/add";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
<!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-planinfo-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备基台:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="deviceid" id="deviceid" class="form-control ">
|
||||
<option value="">--请选择设备基台--</option>
|
||||
<option name="cbdeviceInfo" th:each="deviceid:${cbdeviceInfo}" th:value="${deviceid.deviceId}" th:text="${deviceid.deviceName}" th:disabled="${deviceid.status == '1'}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">计划班次:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="planShiftId" id="planShiftId" class="form-control ">
|
||||
<option value="">--请选择计划班次--</option>
|
||||
<option name="cbshitfInfo" th:each="planShiftId:${cbshitfInfo}" th:value="${planShiftId.shiftid}" th:text="${planShiftId.shiftname}" th:disabled="${planShiftId.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" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "baseinfo/planinfo"
|
||||
$("#form-planinfo-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-planinfo-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,206 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('计划信息列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>设备基台:</label>
|
||||
<select name="deviceid" class="form-control ">
|
||||
<option value="">--请选择设备基台--</option>
|
||||
<option name="cbdeviceInfo" th:each="deviceid:${cbdeviceInfo}" th:value="${deviceid.deviceId}" th:text="${deviceid.deviceName}" th:disabled="${deviceid.status == '1'}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>计划班次:</label>
|
||||
<select name="planShiftId" class="form-control ">
|
||||
<option value="">--请选择计划班次--</option>
|
||||
<option name="cbshitfInfo" th:each="planShiftId:${cbshitfInfo}" th:value="${planShiftId.shiftid}" th:text="${planShiftId.shiftname}" th:disabled="${planShiftId.status == '1'}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>计划状态:</label>
|
||||
<select name="planStateId" th:with="type=${@dict.getType('sys_planstate_info')}" class="form-control ">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>状态标志:</label>
|
||||
<select name="status" th:with="type=${@dict.getType('sys_status_info')}" class="form-control ">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="baseinfo:planinfo:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="baseinfo:planinfo:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="baseinfo:planinfo:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="baseinfo:planinfo:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('baseinfo:planinfo:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('baseinfo:planinfo:remove')}]];
|
||||
var planStateIdDatas = [[${@dict.getType('sys_planstate_info')}]];
|
||||
var unitIdDatas = [[${@dict.getType('sys_unit_info')}]];
|
||||
var statusDatas = [[${@dict.getType('sys_status_info')}]];
|
||||
var prefix = ctx + "baseinfo/planinfo";
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
striped: true,//隔行变色
|
||||
detailView: true,
|
||||
onExpandRow: function(index, row, $detail) {
|
||||
initChildTable(index, row, $detail);
|
||||
},
|
||||
modalName: "计划信息",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'planid',
|
||||
title: '计划ID',
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
field: 'deviceName',
|
||||
title: '设备基台'
|
||||
},
|
||||
{
|
||||
field: 'shiftname',
|
||||
title: '计划班次'
|
||||
},
|
||||
{
|
||||
field: 'planStateId',
|
||||
title: '计划状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(planStateIdDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态标志',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(statusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="addPlanDetailInfo(\'' + row.planid + '\')"><i class="fa fa-edit"></i>新增计划明细</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.planid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.planid + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
function addPlanDetailInfo(row) {
|
||||
console.log(row);
|
||||
$.modal.open("计划明细", ctx +"baseinfo/plandetailinfo/plandetail/"+row);
|
||||
};
|
||||
initChildTable = function(index, row, $detail) {
|
||||
var parentid = row.planid;
|
||||
console.log(parentid)
|
||||
var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
|
||||
$(childTable).bootstrapTable({
|
||||
url: ctx + "baseinfo/plandetailinfo/list",
|
||||
method: 'post',
|
||||
sidePagination: "server",
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
queryParams : {
|
||||
planid: row.planid
|
||||
},
|
||||
columns: [{
|
||||
field : 'objid',
|
||||
title : '子计划ID'
|
||||
},
|
||||
{
|
||||
field : 'materialId',
|
||||
title : '物料ID'
|
||||
},
|
||||
{
|
||||
field : 'planAmount',
|
||||
title : '计划产量'
|
||||
},
|
||||
{
|
||||
field : 'realAmount',
|
||||
title : '实际产量'
|
||||
},
|
||||
{
|
||||
field: 'unitId',
|
||||
title: '单位',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(unitIdDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'groupId',
|
||||
title: '班组ID'
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态标志',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(statusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objid + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.baseinfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.baseinfo.domain.BasePlanInfo;
|
||||
|
||||
/**
|
||||
* 计划信息Mapper接口
|
||||
*
|
||||
* @author CaesarBao
|
||||
* @date 2020-10-23
|
||||
*/
|
||||
public interface BasePlanInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询计划信息
|
||||
*
|
||||
* @param planid 计划信息ID
|
||||
* @return 计划信息
|
||||
*/
|
||||
public BasePlanInfo selectBasePlanInfoById(String planid);
|
||||
|
||||
/**
|
||||
* 查询计划信息列表
|
||||
*
|
||||
* @param basePlanInfo 计划信息
|
||||
* @return 计划信息集合
|
||||
*/
|
||||
public List<BasePlanInfo> selectBasePlanInfoList(BasePlanInfo basePlanInfo);
|
||||
|
||||
/**
|
||||
* 新增计划信息
|
||||
*
|
||||
* @param basePlanInfo 计划信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasePlanInfo(BasePlanInfo basePlanInfo);
|
||||
|
||||
/**
|
||||
* 修改计划信息
|
||||
*
|
||||
* @param basePlanInfo 计划信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasePlanInfo(BasePlanInfo basePlanInfo);
|
||||
|
||||
/**
|
||||
* 删除计划信息
|
||||
*
|
||||
* @param planid 计划信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasePlanInfoById(String planid);
|
||||
|
||||
/**
|
||||
* 批量删除计划信息
|
||||
*
|
||||
* @param planids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasePlanInfoByIds(String[] planids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.baseinfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.baseinfo.domain.BasePlandetailInfo;
|
||||
|
||||
/**
|
||||
* 计划明细Mapper接口
|
||||
*
|
||||
* @author CaesarBao
|
||||
* @date 2020-10-23
|
||||
*/
|
||||
public interface BasePlandetailInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询计划明细
|
||||
*
|
||||
* @param objid 计划明细ID
|
||||
* @return 计划明细
|
||||
*/
|
||||
public BasePlandetailInfo selectBasePlandetailInfoById(Long objid);
|
||||
|
||||
/**
|
||||
* 查询计划明细列表
|
||||
*
|
||||
* @param basePlandetailInfo 计划明细
|
||||
* @return 计划明细集合
|
||||
*/
|
||||
public List<BasePlandetailInfo> selectBasePlandetailInfoList(BasePlandetailInfo basePlandetailInfo);
|
||||
|
||||
/**
|
||||
* 新增计划明细
|
||||
*
|
||||
* @param basePlandetailInfo 计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasePlandetailInfo(BasePlandetailInfo basePlandetailInfo);
|
||||
|
||||
/**
|
||||
* 修改计划明细
|
||||
*
|
||||
* @param basePlandetailInfo 计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasePlandetailInfo(BasePlandetailInfo basePlandetailInfo);
|
||||
|
||||
/**
|
||||
* 删除计划明细
|
||||
*
|
||||
* @param objid 计划明细ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasePlandetailInfoById(Long objid);
|
||||
|
||||
/**
|
||||
* 批量删除计划明细
|
||||
*
|
||||
* @param objids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasePlandetailInfoByIds(String[] objids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.baseinfo.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.baseinfo.domain.BasePlanInfo;
|
||||
|
||||
/**
|
||||
* 计划信息Service接口
|
||||
*
|
||||
* @author CaesarBao
|
||||
* @date 2020-10-23
|
||||
*/
|
||||
public interface IBasePlanInfoService
|
||||
{
|
||||
/**
|
||||
* 查询计划信息
|
||||
*
|
||||
* @param planid 计划信息ID
|
||||
* @return 计划信息
|
||||
*/
|
||||
public BasePlanInfo selectBasePlanInfoById(String planid);
|
||||
|
||||
/**
|
||||
* 查询计划信息列表
|
||||
*
|
||||
* @param basePlanInfo 计划信息
|
||||
* @return 计划信息集合
|
||||
*/
|
||||
public List<BasePlanInfo> selectBasePlanInfoList(BasePlanInfo basePlanInfo);
|
||||
|
||||
/**
|
||||
* 新增计划信息
|
||||
*
|
||||
* @param basePlanInfo 计划信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasePlanInfo(BasePlanInfo basePlanInfo);
|
||||
|
||||
/**
|
||||
* 修改计划信息
|
||||
*
|
||||
* @param basePlanInfo 计划信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasePlanInfo(BasePlanInfo basePlanInfo);
|
||||
|
||||
/**
|
||||
* 批量删除计划信息
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasePlanInfoByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除计划信息信息
|
||||
*
|
||||
* @param planid 计划信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasePlanInfoById(String planid);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.baseinfo.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.baseinfo.domain.BasePlandetailInfo;
|
||||
|
||||
/**
|
||||
* 计划明细Service接口
|
||||
*
|
||||
* @author CaesarBao
|
||||
* @date 2020-10-23
|
||||
*/
|
||||
public interface IBasePlandetailInfoService
|
||||
{
|
||||
/**
|
||||
* 查询计划明细
|
||||
*
|
||||
* @param objid 计划明细ID
|
||||
* @return 计划明细
|
||||
*/
|
||||
public BasePlandetailInfo selectBasePlandetailInfoById(Long objid);
|
||||
|
||||
/**
|
||||
* 查询计划明细列表
|
||||
*
|
||||
* @param basePlandetailInfo 计划明细
|
||||
* @return 计划明细集合
|
||||
*/
|
||||
public List<BasePlandetailInfo> selectBasePlandetailInfoList(BasePlandetailInfo basePlandetailInfo);
|
||||
|
||||
/**
|
||||
* 新增计划明细
|
||||
*
|
||||
* @param basePlandetailInfo 计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasePlandetailInfo(BasePlandetailInfo basePlandetailInfo);
|
||||
|
||||
/**
|
||||
* 修改计划明细
|
||||
*
|
||||
* @param basePlandetailInfo 计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasePlandetailInfo(BasePlandetailInfo basePlandetailInfo);
|
||||
|
||||
/**
|
||||
* 批量删除计划明细
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasePlandetailInfoByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除计划明细信息
|
||||
*
|
||||
* @param objid 计划明细ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasePlandetailInfoById(Long objid);
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.ruoyi.baseinfo.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.baseinfo.mapper.BasePlanInfoMapper;
|
||||
import com.ruoyi.baseinfo.domain.BasePlanInfo;
|
||||
import com.ruoyi.baseinfo.service.IBasePlanInfoService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 计划信息Service业务层处理
|
||||
*
|
||||
* @author CaesarBao
|
||||
* @date 2020-10-23
|
||||
*/
|
||||
@Service
|
||||
public class BasePlanInfoServiceImpl implements IBasePlanInfoService
|
||||
{
|
||||
@Autowired
|
||||
private BasePlanInfoMapper basePlanInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询计划信息
|
||||
*
|
||||
* @param planid 计划信息ID
|
||||
* @return 计划信息
|
||||
*/
|
||||
@Override
|
||||
public BasePlanInfo selectBasePlanInfoById(String planid)
|
||||
{
|
||||
return basePlanInfoMapper.selectBasePlanInfoById(planid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划信息列表
|
||||
*
|
||||
* @param basePlanInfo 计划信息
|
||||
* @return 计划信息
|
||||
*/
|
||||
@Override
|
||||
public List<BasePlanInfo> selectBasePlanInfoList(BasePlanInfo basePlanInfo)
|
||||
{
|
||||
return basePlanInfoMapper.selectBasePlanInfoList(basePlanInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划信息
|
||||
*
|
||||
* @param basePlanInfo 计划信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasePlanInfo(BasePlanInfo basePlanInfo)
|
||||
{
|
||||
basePlanInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return basePlanInfoMapper.insertBasePlanInfo(basePlanInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划信息
|
||||
*
|
||||
* @param basePlanInfo 计划信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasePlanInfo(BasePlanInfo basePlanInfo)
|
||||
{
|
||||
basePlanInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return basePlanInfoMapper.updateBasePlanInfo(basePlanInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划信息对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasePlanInfoByIds(String ids)
|
||||
{
|
||||
return basePlanInfoMapper.deleteBasePlanInfoByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划信息信息
|
||||
*
|
||||
* @param planid 计划信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasePlanInfoById(String planid)
|
||||
{
|
||||
return basePlanInfoMapper.deleteBasePlanInfoById(planid);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.ruoyi.baseinfo.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.baseinfo.mapper.BasePlandetailInfoMapper;
|
||||
import com.ruoyi.baseinfo.domain.BasePlandetailInfo;
|
||||
import com.ruoyi.baseinfo.service.IBasePlandetailInfoService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 计划明细Service业务层处理
|
||||
*
|
||||
* @author CaesarBao
|
||||
* @date 2020-10-23
|
||||
*/
|
||||
@Service
|
||||
public class BasePlandetailInfoServiceImpl implements IBasePlandetailInfoService
|
||||
{
|
||||
@Autowired
|
||||
private BasePlandetailInfoMapper basePlandetailInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询计划明细
|
||||
*
|
||||
* @param objid 计划明细ID
|
||||
* @return 计划明细
|
||||
*/
|
||||
@Override
|
||||
public BasePlandetailInfo selectBasePlandetailInfoById(Long objid)
|
||||
{
|
||||
return basePlandetailInfoMapper.selectBasePlandetailInfoById(objid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划明细列表
|
||||
*
|
||||
* @param basePlandetailInfo 计划明细
|
||||
* @return 计划明细
|
||||
*/
|
||||
@Override
|
||||
public List<BasePlandetailInfo> selectBasePlandetailInfoList(BasePlandetailInfo basePlandetailInfo)
|
||||
{
|
||||
return basePlandetailInfoMapper.selectBasePlandetailInfoList(basePlandetailInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划明细
|
||||
*
|
||||
* @param basePlandetailInfo 计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasePlandetailInfo(BasePlandetailInfo basePlandetailInfo)
|
||||
{
|
||||
basePlandetailInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return basePlandetailInfoMapper.insertBasePlandetailInfo(basePlandetailInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划明细
|
||||
*
|
||||
* @param basePlandetailInfo 计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasePlandetailInfo(BasePlandetailInfo basePlandetailInfo)
|
||||
{
|
||||
basePlandetailInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return basePlandetailInfoMapper.updateBasePlandetailInfo(basePlandetailInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划明细对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasePlandetailInfoByIds(String ids)
|
||||
{
|
||||
return basePlandetailInfoMapper.deleteBasePlandetailInfoByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划明细信息
|
||||
*
|
||||
* @param objid 计划明细ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasePlandetailInfoById(Long objid)
|
||||
{
|
||||
return basePlandetailInfoMapper.deleteBasePlandetailInfoById(objid);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
<?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.ruoyi.baseinfo.mapper.BasePlanInfoMapper">
|
||||
|
||||
<resultMap type="BasePlanInfo" id="BasePlanInfoResult">
|
||||
<result property="planid" column="planid" />
|
||||
<result property="deviceid" column="deviceid" />
|
||||
<result property="planShiftId" column="plan_shift_id" />
|
||||
<result property="planStateId" column="plan_state_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<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="delFlag" column="del_flag" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="shiftname" column="shiftname" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasePlanInfoVo">
|
||||
select planid, deviceid, plan_shift_id, plan_state_id, status, remark, create_by, create_time, update_by, update_time, del_flag from base_plan_info
|
||||
</sql>
|
||||
|
||||
<select id="selectBasePlanInfoList" parameterType="BasePlanInfo" resultMap="BasePlanInfoResult">
|
||||
select t1.planid, t1.deviceid,t2.device_name, t1.plan_shift_id,t3.shiftname, t1.plan_state_id, t1.status, t1.remark, t1.create_by, t1.create_time, t1.update_by, t1.update_time, t1.del_flag from base_plan_info t1
|
||||
left join base_device_info t2 on t1.deviceid = t2.device_id
|
||||
left join base_shift_info t3 on t1.plan_shift_id = t3.shiftid
|
||||
<where>
|
||||
<if test="deviceid != null and deviceid != ''"> and deviceid = #{deviceid}</if>
|
||||
<if test="planShiftId != null and planShiftId != ''"> and plan_shift_id = #{planShiftId}</if>
|
||||
<if test="planStateId != null and planStateId != ''"> and plan_state_id = #{planStateId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBasePlanInfoById" parameterType="String" resultMap="BasePlanInfoResult">
|
||||
<include refid="selectBasePlanInfoVo"/>
|
||||
where planid = #{planid}
|
||||
</select>
|
||||
|
||||
<insert id="insertBasePlanInfo" parameterType="BasePlanInfo">
|
||||
insert into base_plan_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planid != null">planid,</if>
|
||||
<if test="deviceid != null">deviceid,</if>
|
||||
<if test="planShiftId != null">plan_shift_id,</if>
|
||||
<if test="planStateId != null">plan_state_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</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="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="planid != null">#{planid},</if>
|
||||
<if test="deviceid != null">#{deviceid},</if>
|
||||
<if test="planShiftId != null">#{planShiftId},</if>
|
||||
<if test="planStateId != null">#{planStateId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</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="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBasePlanInfo" parameterType="BasePlanInfo">
|
||||
update base_plan_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deviceid != null">deviceid = #{deviceid},</if>
|
||||
<if test="planShiftId != null">plan_shift_id = #{planShiftId},</if>
|
||||
<if test="planStateId != null">plan_state_id = #{planStateId},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</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="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where planid = #{planid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasePlanInfoById" parameterType="String">
|
||||
delete from base_plan_info where planid = #{planid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasePlanInfoByIds" parameterType="String">
|
||||
delete from base_plan_info where planid in
|
||||
<foreach item="planid" collection="array" open="(" separator="," close=")">
|
||||
#{planid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,113 @@
|
||||
<?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.ruoyi.baseinfo.mapper.BasePlandetailInfoMapper">
|
||||
|
||||
<resultMap type="BasePlandetailInfo" id="BasePlandetailInfoResult">
|
||||
<result property="objid" column="objid" />
|
||||
<result property="planid" column="planid" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="planAmount" column="plan_amount" />
|
||||
<result property="realAmount" column="real_amount" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="status" column="status" />
|
||||
<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="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasePlandetailInfoVo">
|
||||
select objid, planid, material_id, plan_amount, real_amount, unit_id, group_id, remark, status, create_by, create_time, update_by, update_time, del_flag from base_plandetail_info
|
||||
</sql>
|
||||
|
||||
<select id="selectBasePlandetailInfoList" parameterType="BasePlandetailInfo" resultMap="BasePlandetailInfoResult">
|
||||
<include refid="selectBasePlandetailInfoVo"/>
|
||||
<where>
|
||||
<if test="planid != null and planid != ''"> and planid = #{planid}</if>
|
||||
<if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
|
||||
<if test="planAmount != null "> and plan_amount = #{planAmount}</if>
|
||||
<if test="realAmount != null "> and real_amount = #{realAmount}</if>
|
||||
<if test="unitId != null and unitId != ''"> and unit_id = #{unitId}</if>
|
||||
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBasePlandetailInfoById" parameterType="Long" resultMap="BasePlandetailInfoResult">
|
||||
<include refid="selectBasePlandetailInfoVo"/>
|
||||
where objid = #{objid}
|
||||
</select>
|
||||
|
||||
<insert id="insertBasePlandetailInfo" parameterType="BasePlandetailInfo">
|
||||
insert into base_plandetail_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objid != null">objid,</if>
|
||||
<if test="planid != null">planid,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="planAmount != null">plan_amount,</if>
|
||||
<if test="realAmount != null">real_amount,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="groupId != null">group_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="status != null">status,</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="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objid != null">#{objid},</if>
|
||||
<if test="planid != null">#{planid},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="planAmount != null">#{planAmount},</if>
|
||||
<if test="realAmount != null">#{realAmount},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="status != null">#{status},</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="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBasePlandetailInfo" parameterType="BasePlandetailInfo">
|
||||
update base_plandetail_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planid != null">planid = #{planid},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="planAmount != null">plan_amount = #{planAmount},</if>
|
||||
<if test="realAmount != null">real_amount = #{realAmount},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
<if test="groupId != null">group_id = #{groupId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="status != null">status = #{status},</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="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where objid = #{objid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasePlandetailInfoById" parameterType="Long">
|
||||
delete from base_plandetail_info where objid = #{objid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasePlandetailInfoByIds" parameterType="String">
|
||||
delete from base_plandetail_info where objid in
|
||||
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||
#{objid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue