工艺流程对应的产品
This commit is contained in:
parent
8b661d5e7b
commit
c8ca4e450a
@ -0,0 +1,134 @@
|
||||
package com.ktg.mes.pro.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
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.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.pro.domain.ProRouteProduct;
|
||||
import com.ktg.mes.pro.service.IProRouteProductService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 产品制程Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/pro/routeproduct")
|
||||
public class ProRouteProductController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProRouteProductService proRouteProductService;
|
||||
|
||||
/**
|
||||
* 查询产品制程列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:routeproduct:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProRouteProduct proRouteProduct)
|
||||
{
|
||||
startPage();
|
||||
List<ProRouteProduct> list = proRouteProductService.selectProRouteProductList(proRouteProduct);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出产品制程列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:routeproduct:export')")
|
||||
@Log(title = "产品制程", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProRouteProduct proRouteProduct)
|
||||
{
|
||||
List<ProRouteProduct> list = proRouteProductService.selectProRouteProductList(proRouteProduct);
|
||||
ExcelUtil<ProRouteProduct> util = new ExcelUtil<ProRouteProduct>(ProRouteProduct.class);
|
||||
util.exportExcel(response, list, "产品制程数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品制程详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:routeproduct:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(proRouteProductService.selectProRouteProductByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品制程
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:routeproduct:add')")
|
||||
@Log(title = "产品制程", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProRouteProduct proRouteProduct)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(proRouteProductService.checkItemUnique(proRouteProduct))){
|
||||
return AjaxResult.error("此产品已配置了工艺路线!");
|
||||
}
|
||||
return toAjax(proRouteProductService.insertProRouteProduct(proRouteProduct));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品制程
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:routeproduct:edit')")
|
||||
@Log(title = "产品制程", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProRouteProduct proRouteProduct)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(proRouteProductService.checkItemUnique(proRouteProduct))){
|
||||
return AjaxResult.error("此产品已配置了工艺路线!");
|
||||
}
|
||||
return toAjax(proRouteProductService.updateProRouteProduct(proRouteProduct));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改产品的生产路线
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:routeproduct:edit')")
|
||||
@Log(title = "产品制程", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/move")
|
||||
public AjaxResult move(@RequestBody ProRouteProduct proRouteProduct){
|
||||
ProRouteProduct param = new ProRouteProduct();
|
||||
param.setItemId(proRouteProduct.getItemId());
|
||||
param.setRouteId(proRouteProduct.getRouteId());
|
||||
List<ProRouteProduct> products = proRouteProductService.selectProRouteProductList(param);
|
||||
int ret =1;
|
||||
if(CollUtil.isNotEmpty(products)){
|
||||
ProRouteProduct product = products.get(0);
|
||||
product.setRouteId(proRouteProduct.getRouteId());
|
||||
ret =proRouteProductService.updateProRouteProduct(product);
|
||||
}
|
||||
return toAjax(ret);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除产品制程
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:routeproduct:remove')")
|
||||
@Log(title = "产品制程", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(proRouteProductService.deleteProRouteProductByRecordIds(recordIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,221 @@
|
||||
package com.ktg.mes.pro.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 产品制程对象 pro_route_product
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-14
|
||||
*/
|
||||
public class ProRouteProduct extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 工艺路线ID */
|
||||
@Excel(name = "工艺路线ID")
|
||||
private Long routeId;
|
||||
|
||||
/** 产品物料ID */
|
||||
@Excel(name = "产品物料ID")
|
||||
private Long itemId;
|
||||
|
||||
/** 产品物料编码 */
|
||||
@Excel(name = "产品物料编码")
|
||||
private String itemCode;
|
||||
|
||||
/** 产品物料名称 */
|
||||
@Excel(name = "产品物料名称")
|
||||
private String itemName;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 生产数量 */
|
||||
@Excel(name = "生产数量")
|
||||
private Long quantity;
|
||||
|
||||
/** 生产用时 */
|
||||
@Excel(name = "生产用时")
|
||||
private BigDecimal productionTime;
|
||||
|
||||
/** 时间单位 */
|
||||
@Excel(name = "时间单位")
|
||||
private String timeUnitType;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setRouteId(Long routeId)
|
||||
{
|
||||
this.routeId = routeId;
|
||||
}
|
||||
|
||||
public Long getRouteId()
|
||||
{
|
||||
return routeId;
|
||||
}
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
public void setItemCode(String itemCode)
|
||||
{
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemCode()
|
||||
{
|
||||
return itemCode;
|
||||
}
|
||||
public void setItemName(String itemName)
|
||||
{
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getItemName()
|
||||
{
|
||||
return itemName;
|
||||
}
|
||||
public void setSpecification(String specification)
|
||||
{
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public String getSpecification()
|
||||
{
|
||||
return specification;
|
||||
}
|
||||
public void setUnitOfMeasure(String unitOfMeasure)
|
||||
{
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure()
|
||||
{
|
||||
return unitOfMeasure;
|
||||
}
|
||||
public void setQuantity(Long quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Long getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
public void setProductionTime(BigDecimal productionTime)
|
||||
{
|
||||
this.productionTime = productionTime;
|
||||
}
|
||||
|
||||
public BigDecimal getProductionTime()
|
||||
{
|
||||
return productionTime;
|
||||
}
|
||||
public void setTimeUnitType(String timeUnitType)
|
||||
{
|
||||
this.timeUnitType = timeUnitType;
|
||||
}
|
||||
|
||||
public String getTimeUnitType()
|
||||
{
|
||||
return timeUnitType;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("recordId", getRecordId())
|
||||
.append("routeId", getRouteId())
|
||||
.append("itemId", getItemId())
|
||||
.append("itemCode", getItemCode())
|
||||
.append("itemName", getItemName())
|
||||
.append("specification", getSpecification())
|
||||
.append("unitOfMeasure", getUnitOfMeasure())
|
||||
.append("quantity", getQuantity())
|
||||
.append("productionTime", getProductionTime())
|
||||
.append("timeUnitType", getTimeUnitType())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.ktg.mes.pro.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProRouteProduct;
|
||||
|
||||
/**
|
||||
* 产品制程Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-14
|
||||
*/
|
||||
public interface ProRouteProductMapper
|
||||
{
|
||||
/**
|
||||
* 查询产品制程
|
||||
*
|
||||
* @param recordId 产品制程主键
|
||||
* @return 产品制程
|
||||
*/
|
||||
public ProRouteProduct selectProRouteProductByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询产品制程列表
|
||||
*
|
||||
* @param proRouteProduct 产品制程
|
||||
* @return 产品制程集合
|
||||
*/
|
||||
public List<ProRouteProduct> selectProRouteProductList(ProRouteProduct proRouteProduct);
|
||||
|
||||
public ProRouteProduct checkItemUnique(ProRouteProduct proRouteProduct);
|
||||
|
||||
/**
|
||||
* 新增产品制程
|
||||
*
|
||||
* @param proRouteProduct 产品制程
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProRouteProduct(ProRouteProduct proRouteProduct);
|
||||
|
||||
/**
|
||||
* 修改产品制程
|
||||
*
|
||||
* @param proRouteProduct 产品制程
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProRouteProduct(ProRouteProduct proRouteProduct);
|
||||
|
||||
/**
|
||||
* 删除产品制程
|
||||
*
|
||||
* @param recordId 产品制程主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRouteProductByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除产品制程
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRouteProductByRecordIds(Long[] recordIds);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.pro.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProRouteProduct;
|
||||
|
||||
/**
|
||||
* 产品制程Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-14
|
||||
*/
|
||||
public interface IProRouteProductService
|
||||
{
|
||||
/**
|
||||
* 查询产品制程
|
||||
*
|
||||
* @param recordId 产品制程主键
|
||||
* @return 产品制程
|
||||
*/
|
||||
public ProRouteProduct selectProRouteProductByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询产品制程列表
|
||||
*
|
||||
* @param proRouteProduct 产品制程
|
||||
* @return 产品制程集合
|
||||
*/
|
||||
public List<ProRouteProduct> selectProRouteProductList(ProRouteProduct proRouteProduct);
|
||||
|
||||
/**
|
||||
* 检查物料是否已经存在
|
||||
* @param proRouteProduct
|
||||
* @return
|
||||
*/
|
||||
public String checkItemUnique(ProRouteProduct proRouteProduct);
|
||||
|
||||
/**
|
||||
* 新增产品制程
|
||||
*
|
||||
* @param proRouteProduct 产品制程
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProRouteProduct(ProRouteProduct proRouteProduct);
|
||||
|
||||
/**
|
||||
* 修改产品制程
|
||||
*
|
||||
* @param proRouteProduct 产品制程
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProRouteProduct(ProRouteProduct proRouteProduct);
|
||||
|
||||
/**
|
||||
* 批量删除产品制程
|
||||
*
|
||||
* @param recordIds 需要删除的产品制程主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRouteProductByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除产品制程信息
|
||||
*
|
||||
* @param recordId 产品制程主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRouteProductByRecordId(Long recordId);
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.ktg.mes.pro.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.pro.mapper.ProRouteProductMapper;
|
||||
import com.ktg.mes.pro.domain.ProRouteProduct;
|
||||
import com.ktg.mes.pro.service.IProRouteProductService;
|
||||
|
||||
/**
|
||||
* 产品制程Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-14
|
||||
*/
|
||||
@Service
|
||||
public class ProRouteProductServiceImpl implements IProRouteProductService
|
||||
{
|
||||
@Autowired
|
||||
private ProRouteProductMapper proRouteProductMapper;
|
||||
|
||||
/**
|
||||
* 查询产品制程
|
||||
*
|
||||
* @param recordId 产品制程主键
|
||||
* @return 产品制程
|
||||
*/
|
||||
@Override
|
||||
public ProRouteProduct selectProRouteProductByRecordId(Long recordId)
|
||||
{
|
||||
return proRouteProductMapper.selectProRouteProductByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品制程列表
|
||||
*
|
||||
* @param proRouteProduct 产品制程
|
||||
* @return 产品制程
|
||||
*/
|
||||
@Override
|
||||
public List<ProRouteProduct> selectProRouteProductList(ProRouteProduct proRouteProduct)
|
||||
{
|
||||
return proRouteProductMapper.selectProRouteProductList(proRouteProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkItemUnique(ProRouteProduct proRouteProduct) {
|
||||
ProRouteProduct product = proRouteProductMapper.checkItemUnique(proRouteProduct);
|
||||
Long productId = proRouteProduct.getRecordId()==null?-1L:proRouteProduct.getRecordId();
|
||||
if(StringUtils.isNotNull(product) && product.getRecordId().longValue() != productId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品制程
|
||||
*
|
||||
* @param proRouteProduct 产品制程
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProRouteProduct(ProRouteProduct proRouteProduct)
|
||||
{
|
||||
proRouteProduct.setCreateTime(DateUtils.getNowDate());
|
||||
return proRouteProductMapper.insertProRouteProduct(proRouteProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品制程
|
||||
*
|
||||
* @param proRouteProduct 产品制程
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProRouteProduct(ProRouteProduct proRouteProduct)
|
||||
{
|
||||
proRouteProduct.setUpdateTime(DateUtils.getNowDate());
|
||||
return proRouteProductMapper.updateProRouteProduct(proRouteProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除产品制程
|
||||
*
|
||||
* @param recordIds 需要删除的产品制程主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProRouteProductByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return proRouteProductMapper.deleteProRouteProductByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品制程信息
|
||||
*
|
||||
* @param recordId 产品制程主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProRouteProductByRecordId(Long recordId)
|
||||
{
|
||||
return proRouteProductMapper.deleteProRouteProductByRecordId(recordId);
|
||||
}
|
||||
}
|
@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="defaultSufTime != null "> and default_suf_time = #{defaultSufTime}</if>
|
||||
<if test="colorCode != null and colorCode != ''"> and color_code = #{colorCode}</if>
|
||||
</where>
|
||||
order by order_num asc
|
||||
</select>
|
||||
|
||||
<select id="selectProRouteProcessByRecordId" parameterType="Long" resultMap="ProRouteProcessResult">
|
||||
|
138
ktg-mes/src/main/resources/mapper/pro/ProRouteProductMapper.xml
Normal file
138
ktg-mes/src/main/resources/mapper/pro/ProRouteProductMapper.xml
Normal file
@ -0,0 +1,138 @@
|
||||
<?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.ktg.mes.pro.mapper.ProRouteProductMapper">
|
||||
|
||||
<resultMap type="ProRouteProduct" id="ProRouteProductResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="routeId" column="route_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="specification" column="specification" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="productionTime" column="production_time" />
|
||||
<result property="timeUnitType" column="time_unit_type" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectProRouteProductVo">
|
||||
select record_id, route_id, item_id, item_code, item_name, specification, unit_of_measure, quantity, production_time, time_unit_type, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_route_product
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectProRouteProductList" parameterType="ProRouteProduct" resultMap="ProRouteProductResult">
|
||||
<include refid="selectProRouteProductVo"/>
|
||||
<where>
|
||||
<if test="routeId != null "> and route_id = #{routeId}</if>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="productionTime != null "> and production_time = #{productionTime}</if>
|
||||
<if test="timeUnitType != null and timeUnitType != ''"> and time_unit_type = #{timeUnitType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProRouteProductByRecordId" parameterType="Long" resultMap="ProRouteProductResult">
|
||||
<include refid="selectProRouteProductVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<select id="checkItemUnique" parameterType="ProRouteProduct" resultMap="ProRouteProductResult">
|
||||
<include refid="selectProRouteProductVo"/>
|
||||
where item_id = #{itemId} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertProRouteProduct" parameterType="ProRouteProduct" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into pro_route_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="routeId != null">route_id,</if>
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code,</if>
|
||||
<if test="itemName != null and itemName != ''">item_name,</if>
|
||||
<if test="specification != null">specification,</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="productionTime != null">production_time,</if>
|
||||
<if test="timeUnitType != null">time_unit_type,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</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="routeId != null">#{routeId},</if>
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">#{itemCode},</if>
|
||||
<if test="itemName != null and itemName != ''">#{itemName},</if>
|
||||
<if test="specification != null">#{specification},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">#{unitOfMeasure},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="productionTime != null">#{productionTime},</if>
|
||||
<if test="timeUnitType != null">#{timeUnitType},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</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="updateProRouteProduct" parameterType="ProRouteProduct">
|
||||
update pro_route_product
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="routeId != null">route_id = #{routeId},</if>
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code = #{itemCode},</if>
|
||||
<if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
|
||||
<if test="specification != null">specification = #{specification},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="productionTime != null">production_time = #{productionTime},</if>
|
||||
<if test="timeUnitType != null">time_unit_type = #{timeUnitType},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</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 record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProRouteProductByRecordId" parameterType="Long">
|
||||
delete from pro_route_product where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProRouteProductByRecordIds" parameterType="String">
|
||||
delete from pro_route_product where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user