change - add生产BOM
parent
9b0c7b7636
commit
208f07eeb9
@ -0,0 +1,100 @@
|
||||
package com.os.ems.record.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.os.common.annotation.Log;
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.enums.BusinessType;
|
||||
import com.os.ems.record.domain.EmsRecordDnbInstant;
|
||||
import com.os.ems.record.service.IEmsRecordDnbInstantService;
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 电实时数据Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/record/recordDnbInstant")
|
||||
public class EmsRecordDnbInstantController extends BaseController {
|
||||
@Autowired
|
||||
private IEmsRecordDnbInstantService emsRecordDnbInstantService;
|
||||
|
||||
/**
|
||||
* 查询电实时数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordDnbInstant:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmsRecordDnbInstant emsRecordDnbInstant) {
|
||||
startPage();
|
||||
List<EmsRecordDnbInstant> list = emsRecordDnbInstantService.selectEmsRecordDnbInstantList(emsRecordDnbInstant);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出电实时数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordDnbInstant:export')")
|
||||
@Log(title = "电实时数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsRecordDnbInstant emsRecordDnbInstant) {
|
||||
List<EmsRecordDnbInstant> list = emsRecordDnbInstantService.selectEmsRecordDnbInstantList(emsRecordDnbInstant);
|
||||
ExcelUtil<EmsRecordDnbInstant> util = new ExcelUtil<EmsRecordDnbInstant>(EmsRecordDnbInstant.class);
|
||||
util.exportExcel(response, list, "电实时数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电实时数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordDnbInstant:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||
return success(emsRecordDnbInstantService.selectEmsRecordDnbInstantByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电实时数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordDnbInstant:add')")
|
||||
@Log(title = "电实时数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsRecordDnbInstant emsRecordDnbInstant) {
|
||||
emsRecordDnbInstant.setCreateBy(getUsername());
|
||||
return toAjax(emsRecordDnbInstantService.insertEmsRecordDnbInstant(emsRecordDnbInstant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电实时数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordDnbInstant:edit')")
|
||||
@Log(title = "电实时数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsRecordDnbInstant emsRecordDnbInstant) {
|
||||
emsRecordDnbInstant.setUpdateBy(getUsername());
|
||||
return toAjax(emsRecordDnbInstantService.updateEmsRecordDnbInstant(emsRecordDnbInstant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电实时数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordDnbInstant:remove')")
|
||||
@Log(title = "电实时数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(emsRecordDnbInstantService.deleteEmsRecordDnbInstantByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.ems.record.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.ems.record.domain.EmsRecordDnbInstant;
|
||||
|
||||
/**
|
||||
* 电实时数据Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-11
|
||||
*/
|
||||
public interface EmsRecordDnbInstantMapper
|
||||
{
|
||||
/**
|
||||
* 查询电实时数据
|
||||
*
|
||||
* @param objId 电实时数据主键
|
||||
* @return 电实时数据
|
||||
*/
|
||||
public EmsRecordDnbInstant selectEmsRecordDnbInstantByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询电实时数据列表
|
||||
*
|
||||
* @param emsRecordDnbInstant 电实时数据
|
||||
* @return 电实时数据集合
|
||||
*/
|
||||
public List<EmsRecordDnbInstant> selectEmsRecordDnbInstantList(EmsRecordDnbInstant emsRecordDnbInstant);
|
||||
|
||||
/**
|
||||
* 新增电实时数据
|
||||
*
|
||||
* @param emsRecordDnbInstant 电实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsRecordDnbInstant(EmsRecordDnbInstant emsRecordDnbInstant);
|
||||
|
||||
/**
|
||||
* 修改电实时数据
|
||||
*
|
||||
* @param emsRecordDnbInstant 电实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsRecordDnbInstant(EmsRecordDnbInstant emsRecordDnbInstant);
|
||||
|
||||
/**
|
||||
* 删除电实时数据
|
||||
*
|
||||
* @param objId 电实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsRecordDnbInstantByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除电实时数据
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsRecordDnbInstantByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.ems.record.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.ems.record.domain.EmsRecordDnbInstant;
|
||||
|
||||
/**
|
||||
* 电实时数据Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-11
|
||||
*/
|
||||
public interface IEmsRecordDnbInstantService {
|
||||
/**
|
||||
* 查询电实时数据
|
||||
*
|
||||
* @param objId 电实时数据主键
|
||||
* @return 电实时数据
|
||||
*/
|
||||
public EmsRecordDnbInstant selectEmsRecordDnbInstantByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询电实时数据列表
|
||||
*
|
||||
* @param emsRecordDnbInstant 电实时数据
|
||||
* @return 电实时数据集合
|
||||
*/
|
||||
public List<EmsRecordDnbInstant> selectEmsRecordDnbInstantList(EmsRecordDnbInstant emsRecordDnbInstant);
|
||||
|
||||
/**
|
||||
* 新增电实时数据
|
||||
*
|
||||
* @param emsRecordDnbInstant 电实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsRecordDnbInstant(EmsRecordDnbInstant emsRecordDnbInstant);
|
||||
|
||||
/**
|
||||
* 修改电实时数据
|
||||
*
|
||||
* @param emsRecordDnbInstant 电实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsRecordDnbInstant(EmsRecordDnbInstant emsRecordDnbInstant);
|
||||
|
||||
/**
|
||||
* 批量删除电实时数据
|
||||
*
|
||||
* @param objIds 需要删除的电实时数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsRecordDnbInstantByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除电实时数据信息
|
||||
*
|
||||
* @param objId 电实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsRecordDnbInstantByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.os.ems.record.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.os.ems.record.mapper.EmsRecordDnbInstantMapper;
|
||||
import com.os.ems.record.domain.EmsRecordDnbInstant;
|
||||
import com.os.ems.record.service.IEmsRecordDnbInstantService;
|
||||
|
||||
/**
|
||||
* 电实时数据Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-11
|
||||
*/
|
||||
@Service
|
||||
public class EmsRecordDnbInstantServiceImpl implements IEmsRecordDnbInstantService {
|
||||
@Autowired
|
||||
private EmsRecordDnbInstantMapper emsRecordDnbInstantMapper;
|
||||
|
||||
/**
|
||||
* 查询电实时数据
|
||||
*
|
||||
* @param objId 电实时数据主键
|
||||
* @return 电实时数据
|
||||
*/
|
||||
@Override
|
||||
public EmsRecordDnbInstant selectEmsRecordDnbInstantByObjId(Long objId) {
|
||||
return emsRecordDnbInstantMapper.selectEmsRecordDnbInstantByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电实时数据列表
|
||||
*
|
||||
* @param emsRecordDnbInstant 电实时数据
|
||||
* @return 电实时数据
|
||||
*/
|
||||
@Override
|
||||
public List<EmsRecordDnbInstant> selectEmsRecordDnbInstantList(EmsRecordDnbInstant emsRecordDnbInstant) {
|
||||
return emsRecordDnbInstantMapper.selectEmsRecordDnbInstantList(emsRecordDnbInstant);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电实时数据
|
||||
*
|
||||
* @param emsRecordDnbInstant 电实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEmsRecordDnbInstant(EmsRecordDnbInstant emsRecordDnbInstant) {
|
||||
return emsRecordDnbInstantMapper.insertEmsRecordDnbInstant(emsRecordDnbInstant);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电实时数据
|
||||
*
|
||||
* @param emsRecordDnbInstant 电实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmsRecordDnbInstant(EmsRecordDnbInstant emsRecordDnbInstant) {
|
||||
return emsRecordDnbInstantMapper.updateEmsRecordDnbInstant(emsRecordDnbInstant);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除电实时数据
|
||||
*
|
||||
* @param objIds 需要删除的电实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsRecordDnbInstantByObjIds(Long[] objIds) {
|
||||
return emsRecordDnbInstantMapper.deleteEmsRecordDnbInstantByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电实时数据信息
|
||||
*
|
||||
* @param objId 电实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsRecordDnbInstantByObjId(Long objId) {
|
||||
return emsRecordDnbInstantMapper.deleteEmsRecordDnbInstantByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.os.ems.record.mapper.EmsRecordDnbInstantMapper">
|
||||
|
||||
<resultMap type="EmsRecordDnbInstant" id="EmsRecordDnbInstantResult">
|
||||
<result property="objId" column="obj_id"/>
|
||||
<result property="monitorId" column="monitor_id"/>
|
||||
<result property="collectTime" column="collect_time"/>
|
||||
<result property="vA" column="v_a"/>
|
||||
<result property="vB" column="v_b"/>
|
||||
<result property="vC" column="v_c"/>
|
||||
<result property="iA" column="i_a"/>
|
||||
<result property="iB" column="i_b"/>
|
||||
<result property="iC" column="i_c"/>
|
||||
<result property="recordTime" column="record_time"/>
|
||||
<result property="glys" column="glys"/>
|
||||
<result property="zxyg" column="zxyg"/>
|
||||
<result property="activePower" column="active_power"/>
|
||||
<result property="reactivePower" column="reactive_power"/>
|
||||
<result property="collectType" column="collect_type"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsRecordDnbInstantVo">
|
||||
select obj_id,
|
||||
monitor_id,
|
||||
collect_time,
|
||||
v_a,
|
||||
v_b,
|
||||
v_c,
|
||||
i_a,
|
||||
i_b,
|
||||
i_c,
|
||||
record_time,
|
||||
glys,
|
||||
zxyg,
|
||||
active_power,
|
||||
reactive_power,
|
||||
collect_type
|
||||
from ems_record_dnb_instant
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsRecordDnbInstantList" parameterType="EmsRecordDnbInstant"
|
||||
resultMap="EmsRecordDnbInstantResult">
|
||||
<include refid="selectEmsRecordDnbInstantVo"/>
|
||||
<where>
|
||||
<if test="monitorId != null and monitorId != ''">and monitor_id = #{monitorId}</if>
|
||||
<if test="collectTime != null ">and collect_time = #{collectTime}</if>
|
||||
<if test="vA != null ">and v_a = #{vA}</if>
|
||||
<if test="vB != null ">and v_b = #{vB}</if>
|
||||
<if test="vC != null ">and v_c = #{vC}</if>
|
||||
<if test="iA != null ">and i_a = #{iA}</if>
|
||||
<if test="iB != null ">and i_b = #{iB}</if>
|
||||
<if test="iC != null ">and i_c = #{iC}</if>
|
||||
<if test="recordTime != null ">and record_time = #{recordTime}</if>
|
||||
<if test="glys != null ">and glys = #{glys}</if>
|
||||
<if test="zxyg != null ">and zxyg = #{zxyg}</if>
|
||||
<if test="activePower != null ">and active_power = #{activePower}</if>
|
||||
<if test="reactivePower != null ">and reactive_power = #{reactivePower}</if>
|
||||
<if test="collectType != null ">and collect_type = #{collectType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsRecordDnbInstantByObjId" parameterType="Long" resultMap="EmsRecordDnbInstantResult">
|
||||
<include refid="selectEmsRecordDnbInstantVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsRecordDnbInstant" parameterType="EmsRecordDnbInstant" useGeneratedKeys="true"
|
||||
keyProperty="objId">
|
||||
insert into ems_record_dnb_instant
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="monitorId != null">monitor_id,</if>
|
||||
<if test="collectTime != null">collect_time,</if>
|
||||
<if test="vA != null">v_a,</if>
|
||||
<if test="vB != null">v_b,</if>
|
||||
<if test="vC != null">v_c,</if>
|
||||
<if test="iA != null">i_a,</if>
|
||||
<if test="iB != null">i_b,</if>
|
||||
<if test="iC != null">i_c,</if>
|
||||
<if test="recordTime != null">record_time,</if>
|
||||
<if test="glys != null">glys,</if>
|
||||
<if test="zxyg != null">zxyg,</if>
|
||||
<if test="activePower != null">active_power,</if>
|
||||
<if test="reactivePower != null">reactive_power,</if>
|
||||
<if test="collectType != null">collect_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="monitorId != null">#{monitorId},</if>
|
||||
<if test="collectTime != null">#{collectTime},</if>
|
||||
<if test="vA != null">#{vA},</if>
|
||||
<if test="vB != null">#{vB},</if>
|
||||
<if test="vC != null">#{vC},</if>
|
||||
<if test="iA != null">#{iA},</if>
|
||||
<if test="iB != null">#{iB},</if>
|
||||
<if test="iC != null">#{iC},</if>
|
||||
<if test="recordTime != null">#{recordTime},</if>
|
||||
<if test="glys != null">#{glys},</if>
|
||||
<if test="zxyg != null">#{zxyg},</if>
|
||||
<if test="activePower != null">#{activePower},</if>
|
||||
<if test="reactivePower != null">#{reactivePower},</if>
|
||||
<if test="collectType != null">#{collectType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsRecordDnbInstant" parameterType="EmsRecordDnbInstant">
|
||||
update ems_record_dnb_instant
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="monitorId != null">monitor_id = #{monitorId},</if>
|
||||
<if test="collectTime != null">collect_time = #{collectTime},</if>
|
||||
<if test="vA != null">v_a = #{vA},</if>
|
||||
<if test="vB != null">v_b = #{vB},</if>
|
||||
<if test="vC != null">v_c = #{vC},</if>
|
||||
<if test="iA != null">i_a = #{iA},</if>
|
||||
<if test="iB != null">i_b = #{iB},</if>
|
||||
<if test="iC != null">i_c = #{iC},</if>
|
||||
<if test="recordTime != null">record_time = #{recordTime},</if>
|
||||
<if test="glys != null">glys = #{glys},</if>
|
||||
<if test="zxyg != null">zxyg = #{zxyg},</if>
|
||||
<if test="activePower != null">active_power = #{activePower},</if>
|
||||
<if test="reactivePower != null">reactive_power = #{reactivePower},</if>
|
||||
<if test="collectType != null">collect_type = #{collectType},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsRecordDnbInstantByObjId" parameterType="Long">
|
||||
delete
|
||||
from ems_record_dnb_instant
|
||||
where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsRecordDnbInstantByObjIds" parameterType="String">
|
||||
delete from ems_record_dnb_instant where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,109 @@
|
||||
package com.os.mes.prod.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.os.common.annotation.Log;
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.enums.BusinessType;
|
||||
import com.os.mes.prod.domain.ProdBomInfo;
|
||||
import com.os.mes.prod.service.IProdBomInfoService;
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产BOMController
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/prod/prodBomInfo")
|
||||
public class ProdBomInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IProdBomInfoService prodBomInfoService;
|
||||
|
||||
/**
|
||||
* 查询生产BOM列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/prod:prodBomInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProdBomInfo prodBomInfo) {
|
||||
startPage();
|
||||
List<ProdBomInfo> list = prodBomInfoService.selectProdBomInfoList(prodBomInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产BOM列表
|
||||
*/
|
||||
@GetMapping("/findOrderBomList")
|
||||
public AjaxResult findOrderBomList(ProdBomInfo prodBomInfo) {
|
||||
List<ProdBomInfo> list = prodBomInfoService.selectProdBomInfoList(prodBomInfo);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产BOM列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/prod:prodBomInfo:export')")
|
||||
@Log(title = "生产BOM", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProdBomInfo prodBomInfo) {
|
||||
List<ProdBomInfo> list = prodBomInfoService.selectProdBomInfoList(prodBomInfo);
|
||||
ExcelUtil<ProdBomInfo> util = new ExcelUtil<ProdBomInfo>(ProdBomInfo.class);
|
||||
util.exportExcel(response, list, "生产BOM数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产BOM详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/prod:prodBomInfo:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||
return success(prodBomInfoService.selectProdBomInfoByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产BOM
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/prod:prodBomInfo:add')")
|
||||
@Log(title = "生产BOM", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProdBomInfo prodBomInfo) {
|
||||
prodBomInfo.setCreateBy(getUsername());
|
||||
return toAjax(prodBomInfoService.insertProdBomInfo(prodBomInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产BOM
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/prod:prodBomInfo:edit')")
|
||||
@Log(title = "生产BOM", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProdBomInfo prodBomInfo) {
|
||||
prodBomInfo.setUpdateBy(getUsername());
|
||||
return toAjax(prodBomInfoService.updateProdBomInfo(prodBomInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产BOM
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/prod:prodBomInfo:remove')")
|
||||
@Log(title = "生产BOM", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(prodBomInfoService.deleteProdBomInfoByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,237 @@
|
||||
package com.os.mes.prod.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.os.common.annotation.Excel;
|
||||
import com.os.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产BOM对象 prod_bom_info
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-11
|
||||
*/
|
||||
public class ProdBomInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
private Long objId;
|
||||
|
||||
/**
|
||||
* BOM编号
|
||||
*/
|
||||
@Excel(name = "BOM编号")
|
||||
private String bomCode;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@Excel(name = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 物料类别
|
||||
*/
|
||||
@Excel(name = "物料类别")
|
||||
private String materialType;
|
||||
|
||||
/**
|
||||
* 标准数量
|
||||
*/
|
||||
@Excel(name = "标准数量")
|
||||
private BigDecimal standardAmount;
|
||||
|
||||
/**
|
||||
* 父物料ID
|
||||
*/
|
||||
@Excel(name = "父物料ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 父物料名称
|
||||
*/
|
||||
@Excel(name = "父物料名称")
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 工厂编号
|
||||
*/
|
||||
@Excel(name = "工厂编号")
|
||||
private String factoryCode;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Excel(name = "排序")
|
||||
private String sort;
|
||||
|
||||
/**
|
||||
* 销售凭证
|
||||
*/
|
||||
@Excel(name = "销售凭证")
|
||||
private String vbeln;
|
||||
|
||||
/**
|
||||
* 销售单据项目
|
||||
*/
|
||||
@Excel(name = "销售单据项目")
|
||||
private String vbpos;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
@Excel(name = "祖级列表")
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 是否标识
|
||||
*/
|
||||
@Excel(name = "是否标识")
|
||||
private String isFlag;
|
||||
|
||||
public void setObjId(Long objId) {
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
public Long getObjId() {
|
||||
return objId;
|
||||
}
|
||||
|
||||
public void setBomCode(String bomCode) {
|
||||
this.bomCode = bomCode;
|
||||
}
|
||||
|
||||
public String getBomCode() {
|
||||
return bomCode;
|
||||
}
|
||||
|
||||
public void setMaterialCode(String materialCode) {
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public String getMaterialCode() {
|
||||
return materialCode;
|
||||
}
|
||||
|
||||
public void setMaterialName(String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
}
|
||||
|
||||
public void setMaterialType(String materialType) {
|
||||
this.materialType = materialType;
|
||||
}
|
||||
|
||||
public String getMaterialType() {
|
||||
return materialType;
|
||||
}
|
||||
|
||||
public void setStandardAmount(BigDecimal standardAmount) {
|
||||
this.standardAmount = standardAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getStandardAmount() {
|
||||
return standardAmount;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName) {
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
public String getParentName() {
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setFactoryCode(String factoryCode) {
|
||||
this.factoryCode = factoryCode;
|
||||
}
|
||||
|
||||
public String getFactoryCode() {
|
||||
return factoryCode;
|
||||
}
|
||||
|
||||
public void setSort(String sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setVbeln(String vbeln) {
|
||||
this.vbeln = vbeln;
|
||||
}
|
||||
|
||||
public String getVbeln() {
|
||||
return vbeln;
|
||||
}
|
||||
|
||||
public void setVbpos(String vbpos) {
|
||||
this.vbpos = vbpos;
|
||||
}
|
||||
|
||||
public String getVbpos() {
|
||||
return vbpos;
|
||||
}
|
||||
|
||||
public void setAncestors(String ancestors) {
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
|
||||
public String getAncestors() {
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
public void setIsFlag(String isFlag) {
|
||||
this.isFlag = isFlag;
|
||||
}
|
||||
|
||||
public String getIsFlag() {
|
||||
return isFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objId", getObjId())
|
||||
.append("bomCode", getBomCode())
|
||||
.append("materialCode", getMaterialCode())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("materialType", getMaterialType())
|
||||
.append("standardAmount", getStandardAmount())
|
||||
.append("parentId", getParentId())
|
||||
.append("parentName", getParentName())
|
||||
.append("factoryCode", getFactoryCode())
|
||||
.append("sort", getSort())
|
||||
.append("vbeln", getVbeln())
|
||||
.append("vbpos", getVbpos())
|
||||
.append("ancestors", getAncestors())
|
||||
.append("isFlag", getIsFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.os.mes.prod.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.mes.prod.domain.ProdBomInfo;
|
||||
import kotlin.jvm.Synchronized;
|
||||
|
||||
/**
|
||||
* 生产BOMMapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-11
|
||||
*/
|
||||
public interface ProdBomInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产BOM
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 生产BOM
|
||||
*/
|
||||
public ProdBomInfo selectProdBomInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询生产BOM列表
|
||||
*
|
||||
* @param prodBomInfo 生产BOM
|
||||
* @return 生产BOM集合
|
||||
*/
|
||||
public List<ProdBomInfo> selectProdBomInfoList(ProdBomInfo prodBomInfo);
|
||||
|
||||
/**
|
||||
* 新增生产BOM
|
||||
*
|
||||
* @param prodBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProdBomInfo(ProdBomInfo prodBomInfo);
|
||||
|
||||
/**
|
||||
* 修改生产BOM
|
||||
*
|
||||
* @param prodBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
@Synchronized
|
||||
public int updateProdBomInfo(ProdBomInfo prodBomInfo);
|
||||
|
||||
/**
|
||||
* 删除生产BOM
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProdBomInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除生产BOM
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProdBomInfoByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.prod.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.mes.prod.domain.ProdBomInfo;
|
||||
|
||||
/**
|
||||
* 生产BOMService接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-11
|
||||
*/
|
||||
public interface IProdBomInfoService {
|
||||
/**
|
||||
* 查询生产BOM
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 生产BOM
|
||||
*/
|
||||
public ProdBomInfo selectProdBomInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询生产BOM列表
|
||||
*
|
||||
* @param prodBomInfo 生产BOM
|
||||
* @return 生产BOM集合
|
||||
*/
|
||||
public List<ProdBomInfo> selectProdBomInfoList(ProdBomInfo prodBomInfo);
|
||||
|
||||
/**
|
||||
* 新增生产BOM
|
||||
*
|
||||
* @param prodBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProdBomInfo(ProdBomInfo prodBomInfo);
|
||||
|
||||
/**
|
||||
* 修改生产BOM
|
||||
*
|
||||
* @param prodBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProdBomInfo(ProdBomInfo prodBomInfo);
|
||||
|
||||
/**
|
||||
* 批量删除生产BOM
|
||||
*
|
||||
* @param objIds 需要删除的生产BOM主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProdBomInfoByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除生产BOM信息
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProdBomInfoByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.os.mes.prod.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.common.exception.base.BaseException;
|
||||
import com.os.common.utils.DateUtils;
|
||||
import com.os.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.os.mes.prod.mapper.ProdBomInfoMapper;
|
||||
import com.os.mes.prod.domain.ProdBomInfo;
|
||||
import com.os.mes.prod.service.IProdBomInfoService;
|
||||
|
||||
/**
|
||||
* 生产BOMService业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-11
|
||||
*/
|
||||
@Service
|
||||
public class ProdBomInfoServiceImpl implements IProdBomInfoService {
|
||||
@Autowired
|
||||
private ProdBomInfoMapper prodBomInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询生产BOM
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 生产BOM
|
||||
*/
|
||||
@Override
|
||||
public ProdBomInfo selectProdBomInfoByObjId(Long objId) {
|
||||
return prodBomInfoMapper.selectProdBomInfoByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产BOM列表
|
||||
*
|
||||
* @param prodBomInfo 生产BOM
|
||||
* @return 生产BOM
|
||||
*/
|
||||
@Override
|
||||
public List<ProdBomInfo> selectProdBomInfoList(ProdBomInfo prodBomInfo) {
|
||||
return prodBomInfoMapper.selectProdBomInfoList(prodBomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产BOM
|
||||
*
|
||||
* @param prodBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProdBomInfo(ProdBomInfo prodBomInfo) {
|
||||
List<ProdBomInfo> baseBomInfos = prodBomInfoMapper.selectProdBomInfoList(prodBomInfo);
|
||||
if (baseBomInfos.size() > 0) {
|
||||
throw new BaseException("该物料编号:" + prodBomInfo.getMaterialCode() + "已存在!");
|
||||
}
|
||||
ProdBomInfo info = prodBomInfoMapper.selectProdBomInfoByObjId(prodBomInfo.getParentId());
|
||||
if (StringUtils.isNull(info)) {
|
||||
prodBomInfo.setAncestors(prodBomInfo.getParentId().toString());
|
||||
} else {
|
||||
prodBomInfo.setAncestors(info.getAncestors() + "," + prodBomInfo.getParentId());
|
||||
}
|
||||
prodBomInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return prodBomInfoMapper.insertProdBomInfo(prodBomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产BOM
|
||||
*
|
||||
* @param prodBomInfo 生产BOM
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProdBomInfo(ProdBomInfo prodBomInfo) {
|
||||
prodBomInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
ProdBomInfo info = prodBomInfoMapper.selectProdBomInfoByObjId(prodBomInfo.getParentId());
|
||||
if (StringUtils.isNull(info)) {
|
||||
prodBomInfo.setAncestors(prodBomInfo.getParentId().toString());
|
||||
} else {
|
||||
prodBomInfo.setAncestors(info.getAncestors() + "," + prodBomInfo.getParentId());
|
||||
}
|
||||
return prodBomInfoMapper.updateProdBomInfo(prodBomInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产BOM
|
||||
*
|
||||
* @param objIds 需要删除的生产BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProdBomInfoByObjIds(Long[] objIds) {
|
||||
return prodBomInfoMapper.deleteProdBomInfoByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产BOM信息
|
||||
*
|
||||
* @param objId 生产BOM主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProdBomInfoByObjId(Long objId) {
|
||||
return prodBomInfoMapper.deleteProdBomInfoByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.os.mes.prod.mapper.ProdBomInfoMapper">
|
||||
|
||||
<resultMap type="ProdBomInfo" id="ProdBomInfoResult">
|
||||
<result property="objId" column="obj_id"/>
|
||||
<result property="bomCode" column="bom_code"/>
|
||||
<result property="materialCode" column="material_code"/>
|
||||
<result property="materialName" column="material_name"/>
|
||||
<result property="materialType" column="material_type"/>
|
||||
<result property="standardAmount" column="standard_amount"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="parentName" column="parent_name"/>
|
||||
<result property="factoryCode" column="factory_code"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="vbeln" column="vbeln"/>
|
||||
<result property="vbpos" column="vbpos"/>
|
||||
<result property="ancestors" column="ancestors"/>
|
||||
<result property="isFlag" column="is_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProdBomInfoVo">
|
||||
select obj_id,
|
||||
bom_code,
|
||||
material_code,
|
||||
material_name,
|
||||
material_type,
|
||||
standard_amount,
|
||||
parent_id,
|
||||
parent_name,
|
||||
factory_code,
|
||||
sort,
|
||||
vbeln,
|
||||
vbpos,
|
||||
ancestors,
|
||||
is_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from prod_bom_info
|
||||
</sql>
|
||||
|
||||
<select id="selectProdBomInfoList" parameterType="ProdBomInfo" resultMap="ProdBomInfoResult">
|
||||
<include refid="selectProdBomInfoVo"/>
|
||||
<where>
|
||||
<if test="bomCode != null and bomCode != ''">and bom_code = #{bomCode}</if>
|
||||
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
|
||||
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},
|
||||
'%')
|
||||
</if>
|
||||
<if test="materialType != null and materialType != ''">and material_type = #{materialType}</if>
|
||||
<if test="standardAmount != null ">and standard_amount = #{standardAmount}</if>
|
||||
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||
<if test="parentName != null and parentName != ''">and parent_name like concat('%', #{parentName}, '%')
|
||||
</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
|
||||
<if test="sort != null and sort != ''">and sort = #{sort}</if>
|
||||
<if test="vbeln != null and vbeln != ''">and vbeln = #{vbeln}</if>
|
||||
<if test="vbpos != null and vbpos != ''">and vbpos = #{vbpos}</if>
|
||||
<if test="ancestors != null and ancestors != ''">and ancestors = #{ancestors}</if>
|
||||
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
|
||||
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
|
||||
<if test="createTime != null ">and create_time = #{createTime}</if>
|
||||
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
|
||||
<if test="updateTime != null ">and update_time = #{updateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProdBomInfoByObjId" parameterType="Long" resultMap="ProdBomInfoResult">
|
||||
<include refid="selectProdBomInfoVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProdBomInfo" parameterType="ProdBomInfo" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into prod_bom_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="bomCode != null">bom_code,</if>
|
||||
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialType != null">material_type,</if>
|
||||
<if test="standardAmount != null">standard_amount,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="parentName != null">parent_name,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="vbeln != null">vbeln,</if>
|
||||
<if test="vbpos != null">vbpos,</if>
|
||||
<if test="ancestors != null">ancestors,</if>
|
||||
<if test="isFlag != null">is_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="bomCode != null">#{bomCode},</if>
|
||||
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialType != null">#{materialType},</if>
|
||||
<if test="standardAmount != null">#{standardAmount},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="parentName != null">#{parentName},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="vbeln != null">#{vbeln},</if>
|
||||
<if test="vbpos != null">#{vbpos},</if>
|
||||
<if test="ancestors != null">#{ancestors},</if>
|
||||
<if test="isFlag != null">#{isFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProdBomInfo" parameterType="ProdBomInfo">
|
||||
update prod_bom_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="bomCode != null">bom_code = #{bomCode},</if>
|
||||
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialType != null">material_type = #{materialType},</if>
|
||||
<if test="standardAmount != null">standard_amount = #{standardAmount},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="parentName != null">parent_name = #{parentName},</if>
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="vbeln != null">vbeln = #{vbeln},</if>
|
||||
<if test="vbpos != null">vbpos = #{vbpos},</if>
|
||||
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProdBomInfoByObjId" parameterType="Long">
|
||||
delete
|
||||
from prod_bom_info
|
||||
where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProdBomInfoByObjIds" parameterType="String">
|
||||
delete from prod_bom_info where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue