parent
75f30e13d3
commit
ef7fd0dfb5
@ -0,0 +1,122 @@
|
|||||||
|
package com.hw.mes.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.hw.common.core.annotation.Excel;
|
||||||
|
import com.hw.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产统计明细使用物料情况;车间生产派工对象 mes_produce_statistics_detail_material
|
||||||
|
*
|
||||||
|
* @author xins
|
||||||
|
* @date 2024-11-07
|
||||||
|
*/
|
||||||
|
public class MesProduceStatisticsDetailMaterial extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键标识 */
|
||||||
|
private Long statisticsDetailMaterialId;
|
||||||
|
|
||||||
|
/** 生产统计明细ID */
|
||||||
|
@Excel(name = "生产统计明细ID")
|
||||||
|
private Long statisticsDetailId;
|
||||||
|
|
||||||
|
/** 物料ID */
|
||||||
|
@Excel(name = "物料ID")
|
||||||
|
private Long materialId;
|
||||||
|
|
||||||
|
/** 物料编码 */
|
||||||
|
@Excel(name = "物料编码")
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
/** 物料名称 */
|
||||||
|
@Excel(name = "物料名称")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/** 物料规格 */
|
||||||
|
@Excel(name = "物料规格")
|
||||||
|
private String materialSpec;
|
||||||
|
|
||||||
|
/** 使用数量 */
|
||||||
|
@Excel(name = "使用数量")
|
||||||
|
private BigDecimal usedAmount;
|
||||||
|
|
||||||
|
public void setStatisticsDetailMaterialId(Long statisticsDetailMaterialId)
|
||||||
|
{
|
||||||
|
this.statisticsDetailMaterialId = statisticsDetailMaterialId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getStatisticsDetailMaterialId()
|
||||||
|
{
|
||||||
|
return statisticsDetailMaterialId;
|
||||||
|
}
|
||||||
|
public void setStatisticsDetailId(Long statisticsDetailId)
|
||||||
|
{
|
||||||
|
this.statisticsDetailId = statisticsDetailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getStatisticsDetailId()
|
||||||
|
{
|
||||||
|
return statisticsDetailId;
|
||||||
|
}
|
||||||
|
public void setMaterialId(Long materialId)
|
||||||
|
{
|
||||||
|
this.materialId = materialId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMaterialId()
|
||||||
|
{
|
||||||
|
return materialId;
|
||||||
|
}
|
||||||
|
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 setMaterialSpec(String materialSpec)
|
||||||
|
{
|
||||||
|
this.materialSpec = materialSpec;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialSpec()
|
||||||
|
{
|
||||||
|
return materialSpec;
|
||||||
|
}
|
||||||
|
public void setUsedAmount(BigDecimal usedAmount)
|
||||||
|
{
|
||||||
|
this.usedAmount = usedAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getUsedAmount()
|
||||||
|
{
|
||||||
|
return usedAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("statisticsDetailMaterialId", getStatisticsDetailMaterialId())
|
||||||
|
.append("statisticsDetailId", getStatisticsDetailId())
|
||||||
|
.append("materialId", getMaterialId())
|
||||||
|
.append("materialCode", getMaterialCode())
|
||||||
|
.append("materialName", getMaterialName())
|
||||||
|
.append("materialSpec", getMaterialSpec())
|
||||||
|
.append("usedAmount", getUsedAmount())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.hw.mes.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.hw.mes.domain.MesProduceStatisticsDetail;
|
||||||
|
import com.hw.mes.domain.MesProduceStatisticsDetailMaterial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产统计明细Mapper接口
|
||||||
|
*
|
||||||
|
* @author xins
|
||||||
|
* @date 2024-11-07
|
||||||
|
*/
|
||||||
|
public interface MesProduceStatisticsDetailMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询生产统计明细
|
||||||
|
*
|
||||||
|
* @param statisticsDetailId 生产统计明细主键
|
||||||
|
* @return 生产统计明细
|
||||||
|
*/
|
||||||
|
public MesProduceStatisticsDetail selectMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询生产统计明细列表
|
||||||
|
*
|
||||||
|
* @param mesProduceStatisticsDetail 生产统计明细
|
||||||
|
* @return 生产统计明细集合
|
||||||
|
*/
|
||||||
|
public List<MesProduceStatisticsDetail> selectMesProduceStatisticsDetailList(MesProduceStatisticsDetail mesProduceStatisticsDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增生产统计明细
|
||||||
|
*
|
||||||
|
* @param mesProduceStatisticsDetail 生产统计明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改生产统计明细
|
||||||
|
*
|
||||||
|
* @param mesProduceStatisticsDetail 生产统计明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除生产统计明细
|
||||||
|
*
|
||||||
|
* @param statisticsDetailId 生产统计明细主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除生产统计明细
|
||||||
|
*
|
||||||
|
* @param statisticsDetailIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesProduceStatisticsDetailByStatisticsDetailIds(Long[] statisticsDetailIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除生产统计明细使用物料情况;车间生产派工
|
||||||
|
*
|
||||||
|
* @param statisticsDetailIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesProduceStatisticsDetailMaterialByStatisticsDetailIds(Long[] statisticsDetailIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增生产统计明细使用物料情况;车间生产派工
|
||||||
|
*
|
||||||
|
* @param mesProduceStatisticsDetailMaterialList 生产统计明细使用物料情况;车间生产派工列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchMesProduceStatisticsDetailMaterial(List<MesProduceStatisticsDetailMaterial> mesProduceStatisticsDetailMaterialList);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过生产统计明细主键删除生产统计明细使用物料情况;车间生产派工信息
|
||||||
|
*
|
||||||
|
* @param statisticsDetailId 生产统计明细ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesProduceStatisticsDetailMaterialByStatisticsDetailId(Long statisticsDetailId);
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.hw.mes.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.hw.mes.domain.MesStatusChangeInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态变化信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author xins
|
||||||
|
* @date 2024-11-07
|
||||||
|
*/
|
||||||
|
public interface MesStatusChangeInfoMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询状态变化信息
|
||||||
|
*
|
||||||
|
* @param statusChangeInfoId 状态变化信息主键
|
||||||
|
* @return 状态变化信息
|
||||||
|
*/
|
||||||
|
public MesStatusChangeInfo selectMesStatusChangeInfoByStatusChangeInfoId(Long statusChangeInfoId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询状态变化信息列表
|
||||||
|
*
|
||||||
|
* @param mesStatusChangeInfo 状态变化信息
|
||||||
|
* @return 状态变化信息集合
|
||||||
|
*/
|
||||||
|
public List<MesStatusChangeInfo> selectMesStatusChangeInfoList(MesStatusChangeInfo mesStatusChangeInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增状态变化信息
|
||||||
|
*
|
||||||
|
* @param mesStatusChangeInfo 状态变化信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMesStatusChangeInfo(MesStatusChangeInfo mesStatusChangeInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改状态变化信息
|
||||||
|
*
|
||||||
|
* @param mesStatusChangeInfo 状态变化信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMesStatusChangeInfo(MesStatusChangeInfo mesStatusChangeInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除状态变化信息
|
||||||
|
*
|
||||||
|
* @param statusChangeInfoId 状态变化信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesStatusChangeInfoByStatusChangeInfoId(Long statusChangeInfoId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除状态变化信息
|
||||||
|
*
|
||||||
|
* @param statusChangeInfoIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesStatusChangeInfoByStatusChangeInfoIds(Long[] statusChangeInfoIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询状态变化信息列表,根据productOrderId和planDetailId
|
||||||
|
*
|
||||||
|
* @param mesStatusChangeInfo 状态变化信息
|
||||||
|
* @return 状态变化信息集合
|
||||||
|
*/
|
||||||
|
public List<MesStatusChangeInfo> selectMesStatusChangeInfoListByProduce(MesStatusChangeInfo mesStatusChangeInfo);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,190 @@
|
|||||||
|
<?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.hw.mes.mapper.MesProduceStatisticsDetailMapper">
|
||||||
|
|
||||||
|
<resultMap type="MesProduceStatisticsDetail" id="MesProduceStatisticsDetailResult">
|
||||||
|
<result property="statisticsDetailId" column="statistics_detail_id" />
|
||||||
|
<result property="productOrderId" column="product_order_id" />
|
||||||
|
<result property="saleOrderId" column="sale_order_id" />
|
||||||
|
<result property="saleorderCode" column="saleorder_code" />
|
||||||
|
<result property="planId" column="plan_id" />
|
||||||
|
<result property="planCode" column="plan_code" />
|
||||||
|
<result property="planDetailId" column="plan_detail_id" />
|
||||||
|
<result property="planDetailCode" column="plan_detail_code" />
|
||||||
|
<result property="productId" column="product_id" />
|
||||||
|
<result property="productCode" column="product_code" />
|
||||||
|
<result property="productName" column="product_name" />
|
||||||
|
<result property="productSpec" column="product_spec" />
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
<result property="nickName" column="nick_name" />
|
||||||
|
<result property="processId" column="process_id" />
|
||||||
|
<result property="processName" column="process_name" />
|
||||||
|
<result property="planBeginTime" column="plan_begin_time" />
|
||||||
|
<result property="planEndTime" column="plan_end_time" />
|
||||||
|
<result property="realBeginTime" column="real_begin_time" />
|
||||||
|
<result property="realEndTime" column="real_end_time" />
|
||||||
|
<result property="produceTime" column="produce_time" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="MesProduceStatisticsDetailMesProduceStatisticsDetailMaterialResult" type="MesProduceStatisticsDetail" extends="MesProduceStatisticsDetailResult">
|
||||||
|
<collection property="mesProduceStatisticsDetailMaterialList" notNullColumn="sub_statistics_detail_material_id" javaType="java.util.List" resultMap="MesProduceStatisticsDetailMaterialResult" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="MesProduceStatisticsDetailMaterial" id="MesProduceStatisticsDetailMaterialResult">
|
||||||
|
<result property="statisticsDetailMaterialId" column="sub_statistics_detail_material_id" />
|
||||||
|
<result property="statisticsDetailId" column="sub_statistics_detail_id" />
|
||||||
|
<result property="materialId" column="sub_material_id" />
|
||||||
|
<result property="materialCode" column="sub_material_code" />
|
||||||
|
<result property="materialName" column="sub_material_name" />
|
||||||
|
<result property="materialSpec" column="sub_material_spec" />
|
||||||
|
<result property="usedAmount" column="sub_used_amount" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectMesProduceStatisticsDetailVo">
|
||||||
|
select statistics_detail_id, product_order_id, sale_order_id, saleorder_code, plan_id, plan_code, plan_detail_id, plan_detail_code, product_id, product_code, product_name, product_spec, user_id, nick_name, process_id, process_name, plan_begin_time, plan_end_time, real_begin_time, real_end_time, produce_time, create_time from mes_produce_statistics_detail
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectMesProduceStatisticsDetailList" parameterType="MesProduceStatisticsDetail" resultMap="MesProduceStatisticsDetailResult">
|
||||||
|
<include refid="selectMesProduceStatisticsDetailVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="productOrderId != null "> and product_order_id = #{productOrderId}</if>
|
||||||
|
<if test="saleOrderId != null "> and sale_order_id = #{saleOrderId}</if>
|
||||||
|
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code = #{saleorderCode}</if>
|
||||||
|
<if test="planId != null "> and plan_id = #{planId}</if>
|
||||||
|
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
|
||||||
|
<if test="planDetailId != null "> and plan_detail_id = #{planDetailId}</if>
|
||||||
|
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
|
||||||
|
<if test="productId != null "> and product_id = #{productId}</if>
|
||||||
|
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
||||||
|
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||||
|
<if test="productSpec != null and productSpec != ''"> and product_spec = #{productSpec}</if>
|
||||||
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
|
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||||
|
<if test="processId != null "> and process_id = #{processId}</if>
|
||||||
|
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||||
|
<if test="planBeginTime != null "> and plan_begin_time = #{planBeginTime}</if>
|
||||||
|
<if test="planEndTime != null "> and plan_end_time = #{planEndTime}</if>
|
||||||
|
<if test="realBeginTime != null "> and real_begin_time = #{realBeginTime}</if>
|
||||||
|
<if test="realEndTime != null "> and real_end_time = #{realEndTime}</if>
|
||||||
|
<if test="produceTime != null "> and produce_time = #{produceTime}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMesProduceStatisticsDetailByStatisticsDetailId" parameterType="Long" resultMap="MesProduceStatisticsDetailMesProduceStatisticsDetailMaterialResult">
|
||||||
|
select a.statistics_detail_id, a.product_order_id, a.sale_order_id, a.saleorder_code, a.plan_id, a.plan_code, a.plan_detail_id, a.plan_detail_code, a.product_id, a.product_code, a.product_name, a.product_spec, a.user_id, a.nick_name, a.process_id, a.process_name, a.plan_begin_time, a.plan_end_time, a.real_begin_time, a.real_end_time, a.produce_time, a.create_time,
|
||||||
|
b.statistics_detail_material_id as sub_statistics_detail_material_id, b.statistics_detail_id as sub_statistics_detail_id, b.material_id as sub_material_id, b.material_code as sub_material_code, b.material_name as sub_material_name, b.material_spec as sub_material_spec, b.used_amount as sub_used_amount
|
||||||
|
from mes_produce_statistics_detail a
|
||||||
|
left join mes_produce_statistics_detail_material b on b.statistics_detail_id = a.statistics_detail_id
|
||||||
|
where a.statistics_detail_id = #{statisticsDetailId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertMesProduceStatisticsDetail" parameterType="MesProduceStatisticsDetail" useGeneratedKeys="true" keyProperty="statisticsDetailId">
|
||||||
|
insert into mes_produce_statistics_detail
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="productOrderId != null">product_order_id,</if>
|
||||||
|
<if test="saleOrderId != null">sale_order_id,</if>
|
||||||
|
<if test="saleorderCode != null">saleorder_code,</if>
|
||||||
|
<if test="planId != null">plan_id,</if>
|
||||||
|
<if test="planCode != null and planCode != ''">plan_code,</if>
|
||||||
|
<if test="planDetailId != null">plan_detail_id,</if>
|
||||||
|
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code,</if>
|
||||||
|
<if test="productId != null">product_id,</if>
|
||||||
|
<if test="productCode != null">product_code,</if>
|
||||||
|
<if test="productName != null">product_name,</if>
|
||||||
|
<if test="productSpec != null">product_spec,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="nickName != null">nick_name,</if>
|
||||||
|
<if test="processId != null">process_id,</if>
|
||||||
|
<if test="processName != null">process_name,</if>
|
||||||
|
<if test="planBeginTime != null">plan_begin_time,</if>
|
||||||
|
<if test="planEndTime != null">plan_end_time,</if>
|
||||||
|
<if test="realBeginTime != null">real_begin_time,</if>
|
||||||
|
<if test="realEndTime != null">real_end_time,</if>
|
||||||
|
<if test="produceTime != null">produce_time,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="productOrderId != null">#{productOrderId},</if>
|
||||||
|
<if test="saleOrderId != null">#{saleOrderId},</if>
|
||||||
|
<if test="saleorderCode != null">#{saleorderCode},</if>
|
||||||
|
<if test="planId != null">#{planId},</if>
|
||||||
|
<if test="planCode != null and planCode != ''">#{planCode},</if>
|
||||||
|
<if test="planDetailId != null">#{planDetailId},</if>
|
||||||
|
<if test="planDetailCode != null and planDetailCode != ''">#{planDetailCode},</if>
|
||||||
|
<if test="productId != null">#{productId},</if>
|
||||||
|
<if test="productCode != null">#{productCode},</if>
|
||||||
|
<if test="productName != null">#{productName},</if>
|
||||||
|
<if test="productSpec != null">#{productSpec},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="nickName != null">#{nickName},</if>
|
||||||
|
<if test="processId != null">#{processId},</if>
|
||||||
|
<if test="processName != null">#{processName},</if>
|
||||||
|
<if test="planBeginTime != null">#{planBeginTime},</if>
|
||||||
|
<if test="planEndTime != null">#{planEndTime},</if>
|
||||||
|
<if test="realBeginTime != null">#{realBeginTime},</if>
|
||||||
|
<if test="realEndTime != null">#{realEndTime},</if>
|
||||||
|
<if test="produceTime != null">#{produceTime},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateMesProduceStatisticsDetail" parameterType="MesProduceStatisticsDetail">
|
||||||
|
update mes_produce_statistics_detail
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="productOrderId != null">product_order_id = #{productOrderId},</if>
|
||||||
|
<if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if>
|
||||||
|
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
|
||||||
|
<if test="planId != null">plan_id = #{planId},</if>
|
||||||
|
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
|
||||||
|
<if test="planDetailId != null">plan_detail_id = #{planDetailId},</if>
|
||||||
|
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code = #{planDetailCode},</if>
|
||||||
|
<if test="productId != null">product_id = #{productId},</if>
|
||||||
|
<if test="productCode != null">product_code = #{productCode},</if>
|
||||||
|
<if test="productName != null">product_name = #{productName},</if>
|
||||||
|
<if test="productSpec != null">product_spec = #{productSpec},</if>
|
||||||
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
|
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||||
|
<if test="processId != null">process_id = #{processId},</if>
|
||||||
|
<if test="processName != null">process_name = #{processName},</if>
|
||||||
|
<if test="planBeginTime != null">plan_begin_time = #{planBeginTime},</if>
|
||||||
|
<if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
|
||||||
|
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
|
||||||
|
<if test="realEndTime != null">real_end_time = #{realEndTime},</if>
|
||||||
|
<if test="produceTime != null">produce_time = #{produceTime},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
where statistics_detail_id = #{statisticsDetailId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteMesProduceStatisticsDetailByStatisticsDetailId" parameterType="Long">
|
||||||
|
delete from mes_produce_statistics_detail where statistics_detail_id = #{statisticsDetailId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMesProduceStatisticsDetailByStatisticsDetailIds" parameterType="String">
|
||||||
|
delete from mes_produce_statistics_detail where statistics_detail_id in
|
||||||
|
<foreach item="statisticsDetailId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{statisticsDetailId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMesProduceStatisticsDetailMaterialByStatisticsDetailIds" parameterType="String">
|
||||||
|
delete from mes_produce_statistics_detail_material where statistics_detail_id in
|
||||||
|
<foreach item="statisticsDetailId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{statisticsDetailId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMesProduceStatisticsDetailMaterialByStatisticsDetailId" parameterType="Long">
|
||||||
|
delete from mes_produce_statistics_detail_material where statistics_detail_id = #{statisticsDetailId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchMesProduceStatisticsDetailMaterial">
|
||||||
|
insert into mes_produce_statistics_detail_material( statistics_detail_material_id, statistics_detail_id, material_id, material_code, material_name, material_spec, used_amount) values
|
||||||
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
|
( #{item.statisticsDetailMaterialId}, #{item.statisticsDetailId}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.materialSpec}, #{item.usedAmount})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
@ -0,0 +1,89 @@
|
|||||||
|
<?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.hw.mes.mapper.MesStatusChangeInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="MesStatusChangeInfo" id="MesStatusChangeInfoResult">
|
||||||
|
<result property="statusChangeInfoId" column="status_change_info_id" />
|
||||||
|
<result property="changeType" column="change_type" />
|
||||||
|
<result property="changeId" column="change_id" />
|
||||||
|
<result property="oldStatus" column="old_status" />
|
||||||
|
<result property="newStatus" column="new_status" />
|
||||||
|
<result property="changeBy" column="change_by" />
|
||||||
|
<result property="changeTime" column="change_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectMesStatusChangeInfoVo">
|
||||||
|
select status_change_info_id, change_type, change_id, old_status, new_status, change_by, change_time from mes_status_change_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectMesStatusChangeInfoList" parameterType="MesStatusChangeInfo" resultMap="MesStatusChangeInfoResult">
|
||||||
|
<include refid="selectMesStatusChangeInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="changeType != null and changeType != ''"> and change_type = #{changeType}</if>
|
||||||
|
<if test="changeId != null "> and change_id = #{changeId}</if>
|
||||||
|
<if test="oldStatus != null and oldStatus != ''"> and old_status = #{oldStatus}</if>
|
||||||
|
<if test="newStatus != null and newStatus != ''"> and new_status = #{newStatus}</if>
|
||||||
|
<if test="changeBy != null and changeBy != ''"> and change_by = #{changeBy}</if>
|
||||||
|
<if test="changeTime != null "> and change_time = #{changeTime}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMesStatusChangeInfoByStatusChangeInfoId" parameterType="Long" resultMap="MesStatusChangeInfoResult">
|
||||||
|
<include refid="selectMesStatusChangeInfoVo"/>
|
||||||
|
where status_change_info_id = #{statusChangeInfoId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertMesStatusChangeInfo" parameterType="MesStatusChangeInfo" useGeneratedKeys="true" keyProperty="statusChangeInfoId">
|
||||||
|
insert into mes_status_change_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="changeType != null and changeType != ''">change_type,</if>
|
||||||
|
<if test="changeId != null">change_id,</if>
|
||||||
|
<if test="oldStatus != null">old_status,</if>
|
||||||
|
<if test="newStatus != null and newStatus != ''">new_status,</if>
|
||||||
|
<if test="changeBy != null">change_by,</if>
|
||||||
|
<if test="changeTime != null">change_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="changeType != null and changeType != ''">#{changeType},</if>
|
||||||
|
<if test="changeId != null">#{changeId},</if>
|
||||||
|
<if test="oldStatus != null">#{oldStatus},</if>
|
||||||
|
<if test="newStatus != null and newStatus != ''">#{newStatus},</if>
|
||||||
|
<if test="changeBy != null">#{changeBy},</if>
|
||||||
|
<if test="changeTime != null">#{changeTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateMesStatusChangeInfo" parameterType="MesStatusChangeInfo">
|
||||||
|
update mes_status_change_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="changeType != null and changeType != ''">change_type = #{changeType},</if>
|
||||||
|
<if test="changeId != null">change_id = #{changeId},</if>
|
||||||
|
<if test="oldStatus != null">old_status = #{oldStatus},</if>
|
||||||
|
<if test="newStatus != null and newStatus != ''">new_status = #{newStatus},</if>
|
||||||
|
<if test="changeBy != null">change_by = #{changeBy},</if>
|
||||||
|
<if test="changeTime != null">change_time = #{changeTime},</if>
|
||||||
|
</trim>
|
||||||
|
where status_change_info_id = #{statusChangeInfoId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteMesStatusChangeInfoByStatusChangeInfoId" parameterType="Long">
|
||||||
|
delete from mes_status_change_info where status_change_info_id = #{statusChangeInfoId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMesStatusChangeInfoByStatusChangeInfoIds" parameterType="String">
|
||||||
|
delete from mes_status_change_info where status_change_info_id in
|
||||||
|
<foreach item="statusChangeInfoId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{statusChangeInfoId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectMesStatusChangeInfoListByProduce" parameterType="MesStatusChangeInfo" resultMap="MesStatusChangeInfoResult">
|
||||||
|
select status_change_info_id, change_type, change_id, old_status, new_status, change_by, change_time from mes_status_change_info
|
||||||
|
where (change_type='1' and change_id=#{productOrderId}) or (change_type='2' and change_id=#{planDetailId})
|
||||||
|
order by change_time
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue