物料基本信息管理修改

This commit is contained in:
liuhanqing
2025-09-11 16:15:55 +08:00
parent fd797fe91d
commit e98b7969c7
8 changed files with 336 additions and 421 deletions

View File

@@ -1,25 +1,31 @@
package com.ruoyi.bas.BasProduct.controller;
import cn.hutool.core.util.IdUtil;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import com.ruoyi.bas.BasProduct.service.IBasProductService;
import java.util.List;
import jakarta.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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import com.ruoyi.bas.BasProduct.service.IBasProductService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.page.TableDataInfo;
import java.util.List;
/**
* 物料管理Controller
*
* @author ruoyi
* @date 2025-05-20
* 物料信息Controller
*
* @author gw
* @date 2025-09-11
*/
@RestController
@RequestMapping("/bas/BasProduct")
@@ -29,7 +35,7 @@ public class BasProductController extends BaseController
private IBasProductService basProductService;
/**
* 查询物料管理列表
* 查询物料信息列表
*/
@PreAuthorize("@ss.hasPermi('bas:BasProduct:list')")
@GetMapping("/list")
@@ -41,20 +47,20 @@ public class BasProductController extends BaseController
}
/**
* 导出物料管理列表
* 导出物料信息列表
*/
@PreAuthorize("@ss.hasPermi('bas:BasProduct:export')")
@Log(title = "物料管理", businessType = BusinessType.EXPORT)
@Log(title = "物料信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BasProduct basProduct)
{
List<BasProduct> list = basProductService.selectBasProductList(basProduct);
ExcelUtil<BasProduct> util = new ExcelUtil<BasProduct>(BasProduct.class);
util.exportExcel(response, list, "物料管理数据");
util.exportExcel(response, list, "物料信息数据");
}
/**
* 获取物料管理详细信息
* 获取物料信息详细信息
*/
@PreAuthorize("@ss.hasPermi('bas:BasProduct:query')")
@GetMapping(value = "/{productGuid}")
@@ -64,23 +70,21 @@ public class BasProductController extends BaseController
}
/**
* 新增物料管理
* 新增物料信息
*/
@PreAuthorize("@ss.hasPermi('bas:BasProduct:add')")
@Log(title = "物料管理", businessType = BusinessType.INSERT)
@Log(title = "物料信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BasProduct basProduct)
{
// 使用雪花算法生成ID并转为字符串
basProduct.setProductGuid(String.valueOf(IdUtil.getSnowflake().nextId()));
return toAjax(basProductService.insertBasProduct(basProduct));
}
/**
* 修改物料管理
* 修改物料信息
*/
@PreAuthorize("@ss.hasPermi('bas:BasProduct:edit')")
@Log(title = "物料管理", businessType = BusinessType.UPDATE)
@Log(title = "物料信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BasProduct basProduct)
{
@@ -88,10 +92,10 @@ public class BasProductController extends BaseController
}
/**
* 删除物料管理
* 删除物料信息
*/
@PreAuthorize("@ss.hasPermi('bas:BasProduct:remove')")
@Log(title = "物料管理", businessType = BusinessType.DELETE)
@Log(title = "物料信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{productGuids}")
public AjaxResult remove(@PathVariable String[] productGuids)
{

View File

@@ -1,18 +1,22 @@
package com.ruoyi.bas.BasProduct.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 物料管理对象 bas_product
* 物料信息对象 bas_product
*
* @author ruoyi
* @date 2025-05-20
* @author gw
* @date 2025-09-11
*/
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BasProduct extends BaseEntity
{
private static final long serialVersionUID = 1L;
@@ -21,85 +25,66 @@ public class BasProduct extends BaseEntity
private String productGuid;
/** 物料编码 */
@Excel(name = "${bas.Product.productId}")
@Excel(name = "物料编码")
private String productId;
/** 物料名称 */
@Excel(name = "${bas.Product.productName}")
@Excel(name = "物料名称")
private String productName;
/** 英文描述 */
@Excel(name = "${bas.Product.spare1}")
private String spare1;
/** 单位 */
@Excel(name = "${bas.Product.unit}")
private String unit;
/** 单件净重KG */
@Excel(name = "${bas.Product.spare2}")
private String spare2;
/** 长MM */
@Excel(name = "${bas.Product.spare5}")
private String spare5;
/** 宽MM */
@Excel(name = "${bas.Product.spare6}")
private String spare6;
/** 高MM */
@Excel(name = "${bas.Product.spare7}")
private String spare7;
/** 体积m³ */
@Excel(name = "${bas.Product.spare8}")
private String spare8;
/** 价格 */
@Excel(name = "${bas.Product.price}")
private String price;
/** 描述 */
@Excel(name = "${bas.Product.remark}")
private String remark;
/** 父节点id */
// @Excel(name = "${bas.Product.parentId}")
private String parentId;
/** 品牌 */
// @Excel(name = "${bas.Product.cargoNo}")
private String cargoNo;
/** 规格 */
// @Excel(name = "${bas.Product.spec}")
private String spec;
/** 备用字段3 */
// @Excel(name = "${bas.Product.spare3}")
private String spare3;
/** 备用字段4 */
// @Excel(name = "${bas.Product.spare4}")
/** 序列号 */
@Excel(name = "序列号")
private String spare4;
/** 相位 */
@Excel(name = "相位")
private String spare7;
/** 备用字段6 */
// @Excel(name = "${bas.Product.spare9}")
/** 型号 */
@Excel(name = "型号")
private String spare1;
/** 净重 */
@Excel(name = "净重")
private String spare2;
/** 毛重 */
@Excel(name = "毛重")
private String spare8;
/** 颜色 */
@Excel(name = "颜色")
private String spare3;
/** 电压 */
@Excel(name = "电压")
private String spare5;
/** 功率 */
@Excel(name = "功率")
private String spare6;
/** $column.columnComment */
private String parentId;
/** $column.columnComment */
private String price;
/** $column.columnComment */
private String cargoNo;
/** $column.columnComment */
private String unit;
/** $column.columnComment */
private String spec;
/** $column.columnComment */
private String spare9;
/**
* 数量
*/
private String quantity;
/**
* 批号
*/
private String lotNo;
private String totalNetWeight;
private String netWeight;
private String grossWeight;
}

View File

@@ -1,74 +1,61 @@
package com.ruoyi.bas.BasProduct.mapper;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
/**
* 物料管理Mapper接口
*
* @author ruoyi
* @date 2025-05-20
* 物料信息Mapper接口
*
* @author gw
* @date 2025-09-11
*/
public interface BasProductMapper
public interface BasProductMapper
{
/**
* 查询物料管理
*
* @param productGuid 物料管理主键
* @return 物料管理
* 查询物料信息
*
* @param productGuid 物料信息主键
* @return 物料信息
*/
public BasProduct selectBasProductByProductGuid(String productGuid);
/**
* 查询物料管理列表
*
* @param basProduct 物料管理
* @return 物料管理集合
* 查询物料信息列表
*
* @param basProduct 物料信息
* @return 物料信息集合
*/
public List<BasProduct> selectBasProductList(BasProduct basProduct);
/**
* 新增物料管理
*
* @param basProduct 物料管理
* 新增物料信息
*
* @param basProduct 物料信息
* @return 结果
*/
public int insertBasProduct(BasProduct basProduct);
/**
* 修改物料管理
*
* @param basProduct 物料管理
* 修改物料信息
*
* @param basProduct 物料信息
* @return 结果
*/
public int updateBasProduct(BasProduct basProduct);
/**
* 删除物料管理
*
* @param productGuid 物料管理主键
* 删除物料信息
*
* @param productGuid 物料信息主键
* @return 结果
*/
public int deleteBasProductByProductGuid(String productGuid);
/**
* 批量删除物料管理
*
* 批量删除物料信息
*
* @param productGuids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBasProductByProductGuids(String[] productGuids);
/**
* 通过物料id列表批量查询物料信息
* @param collect
* @return
*/
List<BasProduct> selectBasProductListByProductGuids(@Param("productGuids") List<String> collect);
BasProduct selectBasProductByProductId(String productId);
List<BasProduct> selectBasProductListByProductIds(@Param("productIds") List<String> collect);
}

View File

@@ -1,73 +1,65 @@
package com.ruoyi.bas.BasProduct.service;
import java.util.List;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import java.util.List;
/**
* 物料管理Service接口
*
* @author ruoyi
* @date 2025-05-20
* 物料信息Service接口
*
* @author gw
* @date 2025-09-11
*/
public interface IBasProductService
public interface IBasProductService
{
/**
* 查询物料管理
*
* @param productGuid 物料管理主键
* @return 物料管理
* 查询物料信息
*
* @param productGuid 物料信息主键
* @return 物料信息
*/
public BasProduct selectBasProductByProductGuid(String productGuid);
public BasProduct selectBasProductByProductId(String productId);
/**
* 查询物料管理列表
*
* @param basProduct 物料管理
* @return 物料管理集合
* 查询物料信息列表
*
* @param basProduct 物料信息
* @return 物料信息集合
*/
public List<BasProduct> selectBasProductList(BasProduct basProduct);
/**
* 新增物料管理
*
* @param basProduct 物料管理
* 新增物料信息
*
* @param basProduct 物料信息
* @return 结果
*/
public int insertBasProduct(BasProduct basProduct);
/**
* 修改物料管理
*
* @param basProduct 物料管理
* 修改物料信息
*
* @param basProduct 物料信息
* @return 结果
*/
public int updateBasProduct(BasProduct basProduct);
/**
* 批量删除物料管理
*
* @param productGuids 需要删除的物料管理主键集合
* 批量删除物料信息
*
* @param productGuids 需要删除的物料信息主键集合
* @return 结果
*/
public int deleteBasProductByProductGuids(String[] productGuids);
/**
* 删除物料管理信息
*
* @param productGuid 物料管理主键
* 删除物料信息信息
*
* @param productGuid 物料信息主键
* @return 结果
*/
public int deleteBasProductByProductGuid(String productGuid);
/**
* 通过物料id列表查询物料信息
* @param collect
* @return
*/
List<BasProduct> selectBasProductListByProductGuids(List<String> collect);
BasProduct selectBasProductByProductId(String productId);
List<BasProduct> selectBasProductListByProductIds(List<String> collect);
}

View File

@@ -1,20 +1,17 @@
package com.ruoyi.bas.BasProduct.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
import com.ruoyi.bas.BasProduct.service.IBasProductService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import com.ruoyi.bas.BasProduct.service.IBasProductService;
/**
* 物料管理Service业务层处理
* 物料信息Service业务层处理
*
* @author ruoyi
* @date 2025-05-20
* @author gw
* @date 2025-09-11
*/
@Service
public class BasProductServiceImpl implements IBasProductService
@@ -23,10 +20,10 @@ public class BasProductServiceImpl implements IBasProductService
private BasProductMapper basProductMapper;
/**
* 查询物料管理
* 查询物料信息
*
* @param productGuid 物料管理主键
* @return 物料管理
* @param productGuid 物料信息主键
* @return 物料信息
*/
@Override
public BasProduct selectBasProductByProductGuid(String productGuid)
@@ -34,16 +31,11 @@ public class BasProductServiceImpl implements IBasProductService
return basProductMapper.selectBasProductByProductGuid(productGuid);
}
@Override
public BasProduct selectBasProductByProductId(String productId) {
return basProductMapper.selectBasProductByProductId(productId);
}
/**
* 查询物料管理列表
* 查询物料信息列表
*
* @param basProduct 物料管理
* @return 物料管理
* @param basProduct 物料信息
* @return 物料信息
*/
@Override
public List<BasProduct> selectBasProductList(BasProduct basProduct)
@@ -52,9 +44,9 @@ public class BasProductServiceImpl implements IBasProductService
}
/**
* 新增物料管理
* 新增物料信息
*
* @param basProduct 物料管理
* @param basProduct 物料信息
* @return 结果
*/
@Override
@@ -64,9 +56,9 @@ public class BasProductServiceImpl implements IBasProductService
}
/**
* 修改物料管理
* 修改物料信息
*
* @param basProduct 物料管理
* @param basProduct 物料信息
* @return 结果
*/
@Override
@@ -76,9 +68,9 @@ public class BasProductServiceImpl implements IBasProductService
}
/**
* 批量删除物料管理
* 批量删除物料信息
*
* @param productGuids 需要删除的物料管理主键
* @param productGuids 需要删除的物料信息主键
* @return 结果
*/
@Override
@@ -88,9 +80,9 @@ public class BasProductServiceImpl implements IBasProductService
}
/**
* 删除物料管理信息
* 删除物料信息信息
*
* @param productGuid 物料管理主键
* @param productGuid 物料信息主键
* @return 结果
*/
@Override
@@ -98,24 +90,14 @@ public class BasProductServiceImpl implements IBasProductService
{
return basProductMapper.deleteBasProductByProductGuid(productGuid);
}
/**
* 通过物料id列表查询物料信息
* @param collect
* @return
*/
@Override
public List<BasProduct> selectBasProductListByProductGuids(List<String> collect) {
if (CollUtil.isEmpty(collect)){
return new ArrayList<>();
}
return basProductMapper.selectBasProductListByProductGuids(collect);
public BasProduct selectBasProductByProductId(String productId) {
return null;
}
@Override
public List<BasProduct> selectBasProductListByProductIds(List<String> collect) {
if (CollUtil.isEmpty(collect)){
return new ArrayList<>();
}
return basProductMapper.selectBasProductListByProductIds(collect);
return List.of();
}
}

View File

@@ -3,142 +3,117 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.bas.BasProduct.mapper.BasProductMapper">
<resultMap type="BasProduct" id="BasProductResult">
<result property="productGuid" column="product_guid" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="spare4" column="spare4" />
<result property="spare7" column="spare7" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare8" column="spare8" />
<result property="spare3" column="spare3" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="remark" column="remark" />
<result property="parentId" column="parent_id" />
<result property="price" column="price" />
<result property="cargoNo" column="cargo_no" />
<result property="unit" column="unit" />
<result property="spec" column="spec" />
<result property="remark" column="remark" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="spare7" column="spare7" />
<result property="spare8" column="spare8" />
<result property="spare9" column="spare9" />
<result property="productName" column="product_name" />
</resultMap>
<sql id="selectBasProductVo">
select product_guid, product_id, parent_id, price, cargo_no, unit, spec, remark, spare1, spare2, spare3, spare4, spare5, spare6, product_name, spare7, spare8, spare9 from bas_product
select product_guid, product_id, product_name, spare4, spare7, spare1, spare2, spare8, spare3, spare5, spare6, remark, parent_id, price, cargo_no, unit, spec, spare9 from bas_product
</sql>
<select id="selectBasProductList" parameterType="BasProduct" resultMap="BasProductResult">
<include refid="selectBasProductVo"/>
<where>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="parentId != null and parentId != ''"> and parent_id like concat('%', #{parentId}, '%')</if>
<if test="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no like concat('%', #{cargoNo}, '%')</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="spec != null and spec != ''"> and spec like concat('%', #{spec}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare3 != null and spare3 != ''"> and spare3 like concat('%', #{spare3}, '%')</if>
<if test="spare4 != null and spare4 != ''"> and spare4 like concat('%', #{spare4}, '%')</if>
<if test="spare5 != null and spare5 != ''"> and spare5 like concat('%', #{spare5}, '%')</if>
<if test="spare6 != null and spare6 != ''"> and spare6 like concat('%', #{spare6}, '%')</if>
<if test="spare7 != null and spare7 != ''"> and spare7 like concat('%', #{spare7}, '%')</if>
<if test="spare8 != null and spare8 != ''"> and spare8 like concat('%', #{spare8}, '%')</if>
<if test="spare9 != null and spare9 != ''"> and spare9 like concat('%', #{spare9}, '%')</if>
<where>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare8 != null and spare8 != ''"> and spare8 = #{spare8}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
</where>
</select>
<select id="selectBasProductByProductGuid" parameterType="String" resultMap="BasProductResult">
<include refid="selectBasProductVo"/>
where product_guid = #{productGuid}
</select>
<select id="selectBasProductListByProductGuids" resultMap="BasProductResult">
<include refid="selectBasProductVo"/>
where product_guid in
<foreach collection="productGuids" item="productGuid" open="(" separator="," close=")">
#{productGuid}
</foreach>
</select>
<select id="selectBasProductByProductId" resultType="com.ruoyi.bas.BasProduct.domain.BasProduct">
<include refid="selectBasProductVo"/>
where product_id = #{productId}
</select>
<select id="selectBasProductListByProductIds" resultType="com.ruoyi.bas.BasProduct.domain.BasProduct">
<include refid="selectBasProductVo"/>
where product_id in
<foreach collection="productIds" item="productId" open="(" separator="," close=")">
#{productId}
</foreach>
</select>
<insert id="insertBasProduct" parameterType="BasProduct">
insert into bas_product
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productGuid != null">product_guid,</if>
<if test="productId != null and productId != ''">product_id,</if>
<if test="parentId != null and parentId != ''">parent_id,</if>
<if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare7 != null">spare7,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare8 != null">spare8,</if>
<if test="spare3 != null">spare3,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare6 != null">spare6,</if>
<if test="remark != null">remark,</if>
<if test="parentId != null">parent_id,</if>
<if test="price != null">price,</if>
<if test="cargoNo != null">cargo_no,</if>
<if test="unit != null">unit,</if>
<if test="spec != null">spec,</if>
<if test="remark != null">remark,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare3 != null">spare3,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare6 != null">spare6,</if>
<if test="spare7 != null">spare7,</if>
<if test="spare8 != null">spare8,</if>
<if test="spare9 != null">spare9,</if>
<if test="productName != null and productName != ''">product_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productGuid != null">#{productGuid},</if>
<if test="productId != null and productId != ''">#{productId},</if>
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare7 != null">#{spare7},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare8 != null">#{spare8},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare6 != null">#{spare6},</if>
<if test="remark != null">#{remark},</if>
<if test="parentId != null">#{parentId},</if>
<if test="price != null">#{price},</if>
<if test="cargoNo != null">#{cargoNo},</if>
<if test="unit != null">#{unit},</if>
<if test="spec != null">#{spec},</if>
<if test="remark != null">#{remark},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare6 != null">#{spare6},</if>
<if test="spare7 != null">#{spare7},</if>
<if test="spare8 != null">#{spare8},</if>
<if test="spare9 != null">#{spare9},</if>
<if test="productName != null and productName != ''">#{productName},</if>
</trim>
</insert>
<update id="updateBasProduct" parameterType="BasProduct">
update bas_product
<trim prefix="SET" suffixOverrides=",">
<if test="productId != null and productId != ''">product_id = #{productId},</if>
<if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare7 != null">spare7 = #{spare7},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare8 != null">spare8 = #{spare8},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="price != null">price = #{price},</if>
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
<if test="spare7 != null">spare7 = #{spare7},</if>
<if test="spare8 != null">spare8 = #{spare8},</if>
<if test="spare9 != null">spare9 = #{spare9},</if>
<if test="productName != null and productName != ''">product_name = #{productName},</if>
</trim>
where product_guid = #{productGuid}
</update>
@@ -148,9 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteBasProductByProductGuids" parameterType="String">
delete from bas_product where product_guid in
delete from bas_product where product_guid in
<foreach item="productGuid" collection="array" open="(" separator="," close=")">
#{productGuid}
</foreach>
</delete>
</mapper>
</mapper>