change - add产线、工位

main
yinq 6 months ago
parent 3d49b9774d
commit 72f5419739

@ -46,6 +46,16 @@ public class BaseFactoryController extends BaseController
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getBaseFactoryList")
public AjaxResult getBaseFactoryList(BaseFactory baseFactory)
{
List<BaseFactory> list = baseFactoryService.selectBaseFactoryList(baseFactory);
return success(list);
}
/**
*
*/

@ -0,0 +1,116 @@
package com.os.mes.base.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.base.domain.BaseProductLine;
import com.os.mes.base.service.IBaseProductLineService;
import com.os.common.utils.poi.ExcelUtil;
import com.os.common.core.page.TableDataInfo;
/**
* 线/Controller
*
* @author Yinq
* @date 2024-05-10
*/
@RestController
@RequestMapping("/mes/base/baseProductLine")
public class BaseProductLineController extends BaseController
{
@Autowired
private IBaseProductLineService baseProductLineService;
/**
* 线/
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseProductLine:list')")
@GetMapping("/list")
public TableDataInfo list(BaseProductLine baseProductLine)
{
startPage();
List<BaseProductLine> list = baseProductLineService.selectBaseProductLineList(baseProductLine);
return getDataTable(list);
}
/**
* 线/
*/
@GetMapping("/getBaseProductLineList")
public AjaxResult getBaseProductLineList(BaseProductLine baseProductLine)
{
List<BaseProductLine> list = baseProductLineService.selectBaseProductLineList(baseProductLine);
return success(list);
}
/**
* 线/
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseProductLine:export')")
@Log(title = "产线/工位信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseProductLine baseProductLine)
{
List<BaseProductLine> list = baseProductLineService.selectBaseProductLineList(baseProductLine);
ExcelUtil<BaseProductLine> util = new ExcelUtil<BaseProductLine>(BaseProductLine.class);
util.exportExcel(response, list, "产线/工位信息数据");
}
/**
* 线/
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseProductLine:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId)
{
return success(baseProductLineService.selectBaseProductLineByObjId(objId));
}
/**
* 线/
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseProductLine:add')")
@Log(title = "产线/工位信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseProductLine baseProductLine)
{
baseProductLine.setCreateBy(getUsername());
return toAjax(baseProductLineService.insertBaseProductLine(baseProductLine));
}
/**
* 线/
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseProductLine:edit')")
@Log(title = "产线/工位信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseProductLine baseProductLine)
{
baseProductLine.setUpdateBy(getUsername());
return toAjax(baseProductLineService.updateBaseProductLine(baseProductLine));
}
/**
* 线/
*/
@PreAuthorize("@ss.hasPermi('mes/base:baseProductLine:remove')")
@Log(title = "产线/工位信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds)
{
return toAjax(baseProductLineService.deleteBaseProductLineByObjIds(objIds));
}
}

@ -1,7 +1,5 @@
package com.os.mes.base.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.os.common.annotation.Excel;
@ -36,24 +34,6 @@ public class BaseFactory extends BaseEntity
@Excel(name = "工厂状态", readConverterExp = "0=启用,1=停用")
private String factoryStatus;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/** 更新人 */
@Excel(name = "更新人")
private String updatedBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
public void setObjId(Long objId)
{
this.objId = objId;
@ -99,42 +79,7 @@ public class BaseFactory extends BaseEntity
{
return factoryStatus;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
public void setUpdatedBy(String updatedBy)
{
this.updatedBy = updatedBy;
}
public String getUpdatedBy()
{
return updatedBy;
}
public void setUpdatedTime(Date updatedTime)
{
this.updatedTime = updatedTime;
}
public Date getUpdatedTime()
{
return updatedTime;
}
@Override
public String toString() {
@ -145,10 +90,6 @@ public class BaseFactory extends BaseEntity
.append("factoryName", getFactoryName())
.append("factoryStatus", getFactoryStatus())
.append("remark", getRemark())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.toString();
}
}

@ -0,0 +1,302 @@
package com.os.mes.base.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
* 线/ base_product_line
*
* @author Yinq
* @date 2024-05-10
*/
public class BaseProductLine extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long objId;
/** 所属工厂编号 */
@Excel(name = "所属工厂编号")
private String plantCode;
/** 所属工厂名称 */
@Excel(name = "所属工厂名称")
private String factoryName;
/** 产线编号 */
@Excel(name = "产线编号")
private String productLineCode;
/** 产线名称 */
@Excel(name = "产线名称")
private String productLineName;
/** 工位编号 */
@Excel(name = "工位编号")
private String stationCode;
/** 工位名称 */
@Excel(name = "工位名称")
private String stationName;
/** 类别1产线 2工位 */
@Excel(name = "类别", readConverterExp = "1=产线,2=工位")
private String productLineType;
/** 启用标识0启用 1停用 */
@Excel(name = "启用标识", readConverterExp = "0=启用,1=停用")
private String isFlag;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/** 更新人 */
@Excel(name = "更新人")
private String updatedBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
/** 父级编号 */
@Excel(name = "父级编号")
private String parentId;
/** 工位类型1生产工位 2质检工位 */
@Excel(name = "工位类型", readConverterExp = "1=生产工位,2=质检工位")
private String stationType;
/** SAP工作中心编号 */
@Excel(name = "SAP工作中心编号")
private String workCenterCode;
/** SAP工作中心描述 */
@Excel(name = "SAP工作中心描述")
private String workCenterName;
/** 执行顺序 */
@Excel(name = "执行顺序")
private String executionSort;
/** 日产能(米) */
@Excel(name = "日产能(米)")
private BigDecimal capacityDay;
/** 月产能(米) */
@Excel(name = "月产能(米)")
private BigDecimal capacityMonth;
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public String getStationCode() {
return stationCode;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public void setObjId(Long objId)
{
this.objId = objId;
}
public Long getObjId()
{
return objId;
}
public void setProductLineCode(String productLineCode)
{
this.productLineCode = productLineCode;
}
public String getProductLineCode()
{
return productLineCode;
}
public void setProductLineName(String productLineName)
{
this.productLineName = productLineName;
}
public String getProductLineName()
{
return productLineName;
}
public void setProductLineType(String productLineType)
{
this.productLineType = productLineType;
}
public String getProductLineType()
{
return productLineType;
}
public void setPlantCode(String plantCode)
{
this.plantCode = plantCode;
}
public String getPlantCode()
{
return plantCode;
}
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
{
return isFlag;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
public void setUpdatedBy(String updatedBy)
{
this.updatedBy = updatedBy;
}
public String getUpdatedBy()
{
return updatedBy;
}
public void setUpdatedTime(Date updatedTime)
{
this.updatedTime = updatedTime;
}
public Date getUpdatedTime()
{
return updatedTime;
}
public void setParentId(String parentId)
{
this.parentId = parentId;
}
public String getParentId()
{
return parentId;
}
public void setStationType(String stationType)
{
this.stationType = stationType;
}
public String getStationType()
{
return stationType;
}
public void setWorkCenterCode(String workCenterCode)
{
this.workCenterCode = workCenterCode;
}
public String getWorkCenterCode()
{
return workCenterCode;
}
public void setWorkCenterName(String workCenterName)
{
this.workCenterName = workCenterName;
}
public String getWorkCenterName()
{
return workCenterName;
}
public void setExecutionSort(String executionSort)
{
this.executionSort = executionSort;
}
public String getExecutionSort()
{
return executionSort;
}
public void setCapacityDay(BigDecimal capacityDay)
{
this.capacityDay = capacityDay;
}
public BigDecimal getCapacityDay()
{
return capacityDay;
}
public void setCapacityMonth(BigDecimal capacityMonth)
{
this.capacityMonth = capacityMonth;
}
public BigDecimal getCapacityMonth()
{
return capacityMonth;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("productLineCode", getProductLineCode())
.append("productLineName", getProductLineName())
.append("productLineType", getProductLineType())
.append("plantCode", getPlantCode())
.append("isFlag", getIsFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("parentId", getParentId())
.append("stationType", getStationType())
.append("workCenterCode", getWorkCenterCode())
.append("workCenterName", getWorkCenterName())
.append("executionSort", getExecutionSort())
.append("capacityDay", getCapacityDay())
.append("capacityMonth", getCapacityMonth())
.toString();
}
}

@ -0,0 +1,61 @@
package com.os.mes.base.mapper;
import java.util.List;
import com.os.mes.base.domain.BaseProductLine;
/**
* 线/Mapper
*
* @author Yinq
* @date 2024-05-10
*/
public interface BaseProductLineMapper
{
/**
* 线/
*
* @param objId 线/
* @return 线/
*/
public BaseProductLine selectBaseProductLineByObjId(Long objId);
/**
* 线/
*
* @param baseProductLine 线/
* @return 线/
*/
public List<BaseProductLine> selectBaseProductLineList(BaseProductLine baseProductLine);
/**
* 线/
*
* @param baseProductLine 线/
* @return
*/
public int insertBaseProductLine(BaseProductLine baseProductLine);
/**
* 线/
*
* @param baseProductLine 线/
* @return
*/
public int updateBaseProductLine(BaseProductLine baseProductLine);
/**
* 线/
*
* @param objId 线/
* @return
*/
public int deleteBaseProductLineByObjId(Long objId);
/**
* 线/
*
* @param objIds
* @return
*/
public int deleteBaseProductLineByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.os.mes.base.service;
import java.util.List;
import com.os.mes.base.domain.BaseProductLine;
/**
* 线/Service
*
* @author Yinq
* @date 2024-05-10
*/
public interface IBaseProductLineService
{
/**
* 线/
*
* @param objId 线/
* @return 线/
*/
public BaseProductLine selectBaseProductLineByObjId(Long objId);
/**
* 线/
*
* @param baseProductLine 线/
* @return 线/
*/
public List<BaseProductLine> selectBaseProductLineList(BaseProductLine baseProductLine);
/**
* 线/
*
* @param baseProductLine 线/
* @return
*/
public int insertBaseProductLine(BaseProductLine baseProductLine);
/**
* 线/
*
* @param baseProductLine 线/
* @return
*/
public int updateBaseProductLine(BaseProductLine baseProductLine);
/**
* 线/
*
* @param objIds 线/
* @return
*/
public int deleteBaseProductLineByObjIds(Long[] objIds);
/**
* 线/
*
* @param objId 线/
* @return
*/
public int deleteBaseProductLineByObjId(Long objId);
}

@ -1,6 +1,8 @@
package com.os.mes.base.service.impl;
import java.util.List;
import com.os.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.base.mapper.BaseFactoryMapper;
@ -52,6 +54,7 @@ public class BaseFactoryServiceImpl implements IBaseFactoryService
@Override
public int insertBaseFactory(BaseFactory baseFactory)
{
baseFactory.setCreateTime(DateUtils.getNowDate());
return baseFactoryMapper.insertBaseFactory(baseFactory);
}
@ -64,6 +67,7 @@ public class BaseFactoryServiceImpl implements IBaseFactoryService
@Override
public int updateBaseFactory(BaseFactory baseFactory)
{
baseFactory.setUpdateTime(DateUtils.getNowDate());
return baseFactoryMapper.updateBaseFactory(baseFactory);
}

@ -0,0 +1,97 @@
package com.os.mes.base.service.impl;
import java.util.List;
import com.os.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.base.mapper.BaseProductLineMapper;
import com.os.mes.base.domain.BaseProductLine;
import com.os.mes.base.service.IBaseProductLineService;
/**
* 线/Service
*
* @author Yinq
* @date 2024-05-10
*/
@Service
public class BaseProductLineServiceImpl implements IBaseProductLineService
{
@Autowired
private BaseProductLineMapper baseProductLineMapper;
/**
* 线/
*
* @param objId 线/
* @return 线/
*/
@Override
public BaseProductLine selectBaseProductLineByObjId(Long objId)
{
return baseProductLineMapper.selectBaseProductLineByObjId(objId);
}
/**
* 线/
*
* @param baseProductLine 线/
* @return 线/
*/
@Override
public List<BaseProductLine> selectBaseProductLineList(BaseProductLine baseProductLine)
{
return baseProductLineMapper.selectBaseProductLineList(baseProductLine);
}
/**
* 线/
*
* @param baseProductLine 线/
* @return
*/
@Override
public int insertBaseProductLine(BaseProductLine baseProductLine)
{
baseProductLine.setCreateTime(DateUtils.getNowDate());
return baseProductLineMapper.insertBaseProductLine(baseProductLine);
}
/**
* 线/
*
* @param baseProductLine 线/
* @return
*/
@Override
public int updateBaseProductLine(BaseProductLine baseProductLine)
{
baseProductLine.setUpdateTime(DateUtils.getNowDate());
return baseProductLineMapper.updateBaseProductLine(baseProductLine);
}
/**
* 线/
*
* @param objIds 线/
* @return
*/
@Override
public int deleteBaseProductLineByObjIds(Long[] objIds)
{
return baseProductLineMapper.deleteBaseProductLineByObjIds(objIds);
}
/**
* 线/
*
* @param objId 线/
* @return
*/
@Override
public int deleteBaseProductLineByObjId(Long objId)
{
return baseProductLineMapper.deleteBaseProductLineByObjId(objId);
}
}

@ -11,10 +11,10 @@
<result property="factoryName" column="factory_name"/>
<result property="factoryStatus" column="factory_status"/>
<result property="remark" column="remark"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
<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="selectBaseFactoryVo">
@ -24,10 +24,10 @@
factory_name,
factory_status,
remark,
created_by,
created_time,
updated_by,
updated_time
create_by,
create_time,
update_by,
update_time
from base_factory
</sql>
@ -42,10 +42,10 @@
'%')
</if>
<if test="factoryStatus != null and factoryStatus != ''">and factory_status = #{factoryStatus}</if>
<if test="createdBy != null and createdBy != ''">and created_by = #{createdBy}</if>
<if test="createdTime != null ">and created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and updated_time = #{updatedTime}</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>
@ -62,10 +62,10 @@
<if test="factoryName != null">factory_name,</if>
<if test="factoryStatus != null">factory_status,</if>
<if test="remark != null">remark,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</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="companyName != null">#{companyName},</if>
@ -73,10 +73,10 @@
<if test="factoryName != null">#{factoryName},</if>
<if test="factoryStatus != null">#{factoryStatus},</if>
<if test="remark != null">#{remark},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</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>
@ -88,10 +88,10 @@
<if test="factoryName != null">factory_name = #{factoryName},</if>
<if test="factoryStatus != null">factory_status = #{factoryStatus},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</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>

@ -0,0 +1,164 @@
<?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.base.mapper.BaseProductLineMapper">
<resultMap type="BaseProductLine" id="BaseProductLineResult">
<result property="objId" column="obj_id"/>
<result property="productLineCode" column="product_line_code"/>
<result property="productLineName" column="product_line_name"/>
<result property="stationCode" column="station_code"/>
<result property="stationName" column="station_name"/>
<result property="productLineType" column="product_line_type"/>
<result property="plantCode" column="plant_code"/>
<result property="factoryName" column="factory_name"/>
<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"/>
<result property="parentId" column="parent_id"/>
<result property="stationType" column="station_type"/>
<result property="workCenterCode" column="work_center_code"/>
<result property="workCenterName" column="work_center_name"/>
<result property="executionSort" column="execution_sort"/>
<result property="capacityDay" column="capacity_day"/>
<result property="capacityMonth" column="capacity_month"/>
</resultMap>
<sql id="selectBaseProductLineVo">
select pl1.obj_id,
pl1.product_line_code,
pl1.product_line_name,
pl2.product_line_code station_code,
pl2.product_line_name station_name,
pl1.product_line_type,
pl1.plant_code,
bf.factory_name,
pl1.is_flag,
pl1.create_by,
pl1.create_time,
pl1.update_by,
pl1.update_time,
pl1.parent_id,
pl1.station_type,
pl1.work_center_code,
pl1.work_center_name,
pl1.execution_sort,
pl1.capacity_day,
pl1.capacity_month
from base_product_line pl1
left join base_product_line pl2 on pl2.product_line_code = pl1.parent_id
left join base_factory bf on bf.factory_code = pl1.plant_code
</sql>
<select id="selectBaseProductLineList" parameterType="BaseProductLine" resultMap="BaseProductLineResult">
<include refid="selectBaseProductLineVo"/>
<where>
<if test="productLineCode != null and productLineCode != ''">and pl1.product_line_code = #{productLineCode}
</if>
<if test="productLineName != null and productLineName != ''">and pl1.product_line_name like concat('%',
#{productLineName}, '%')
</if>
<if test="productLineType != null and productLineType != ''">and pl1.product_line_type = #{productLineType}
</if>
<if test="plantCode != null and plantCode != ''">and pl1.plant_code = #{plantCode}</if>
<if test="isFlag != null and isFlag != ''">and pl1.is_flag = #{isFlag}</if>
<if test="createBy != null and createBy != ''">and pl1.create_by = #{createBy}</if>
<if test="createTime != null ">and pl1.create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and pl1.update_by = #{updateBy}</if>
<if test="updateTime != null ">and pl1.update_time = #{updateTime}</if>
<if test="parentId != null and parentId != ''">and pl1.parent_id = #{parentId}</if>
<if test="stationType != null and stationType != ''">and pl1.station_type = #{stationType}</if>
<if test="workCenterCode != null and workCenterCode != ''">and pl1.work_center_code = #{workCenterCode}</if>
<if test="workCenterName != null and workCenterName != ''">and pl1.work_center_name like concat('%',
#{workCenterName}, '%')
</if>
<if test="executionSort != null and executionSort != ''">and pl1.execution_sort = #{executionSort}</if>
<if test="capacityDay != null ">and pl1.capacity_day = #{capacityDay}</if>
<if test="capacityMonth != null ">and pl1.capacity_month = #{capacityMonth}</if>
</where>
</select>
<select id="selectBaseProductLineByObjId" parameterType="Long" resultMap="BaseProductLineResult">
<include refid="selectBaseProductLineVo"/>
where pl1.obj_id = #{objId}
</select>
<insert id="insertBaseProductLine" parameterType="BaseProductLine" useGeneratedKeys="true" keyProperty="objId">
insert into base_product_line
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productLineCode != null">product_line_code,</if>
<if test="productLineName != null">product_line_name,</if>
<if test="productLineType != null">product_line_type,</if>
<if test="plantCode != null">plant_code,</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>
<if test="parentId != null">parent_id,</if>
<if test="stationType != null">station_type,</if>
<if test="workCenterCode != null">work_center_code,</if>
<if test="workCenterName != null">work_center_name,</if>
<if test="executionSort != null">execution_sort,</if>
<if test="capacityDay != null">capacity_day,</if>
<if test="capacityMonth != null">capacity_month,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productLineCode != null">#{productLineCode},</if>
<if test="productLineName != null">#{productLineName},</if>
<if test="productLineType != null">#{productLineType},</if>
<if test="plantCode != null">#{plantCode},</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>
<if test="parentId != null">#{parentId},</if>
<if test="stationType != null">#{stationType},</if>
<if test="workCenterCode != null">#{workCenterCode},</if>
<if test="workCenterName != null">#{workCenterName},</if>
<if test="executionSort != null">#{executionSort},</if>
<if test="capacityDay != null">#{capacityDay},</if>
<if test="capacityMonth != null">#{capacityMonth},</if>
</trim>
</insert>
<update id="updateBaseProductLine" parameterType="BaseProductLine">
update base_product_line
<trim prefix="SET" suffixOverrides=",">
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
<if test="productLineName != null">product_line_name = #{productLineName},</if>
<if test="productLineType != null">product_line_type = #{productLineType},</if>
<if test="plantCode != null">plant_code = #{plantCode},</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>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="stationType != null">station_type = #{stationType},</if>
<if test="workCenterCode != null">work_center_code = #{workCenterCode},</if>
<if test="workCenterName != null">work_center_name = #{workCenterName},</if>
<if test="executionSort != null">execution_sort = #{executionSort},</if>
<if test="capacityDay != null">capacity_day = #{capacityDay},</if>
<if test="capacityMonth != null">capacity_month = #{capacityMonth},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteBaseProductLineByObjId" parameterType="Long">
delete
from base_product_line
where obj_id = #{objId}
</delete>
<delete id="deleteBaseProductLineByObjIds" parameterType="String">
delete from base_product_line where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save