feat(production): 添加子件物料周需求和周排产计划功能
- 新增子件物料周需求数据模型MrpComponentWeeklyReq - 新增子件物料周需求服务接口和实现类 - 新增子件物料周需求控制器提供CRUD和导入导出功能 - 新增子件物料周需求数据访问层和SQL映射 - 新增周排产计划数据模型MrpProdWeeklyPlan - 新增周排产计划服务接口提供基本操作功能 - 实现异步数据导入功能支持大批量数据处理 - 添加数据导入模板下载和批量更新功能 - 集成Excel导入导出功能支持数据批量处理master
parent
6d3cacf8c6
commit
74ed26c643
@ -0,0 +1,69 @@
|
||||
package com.aucma.production.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.production.domain.MrpComponentWeeklyReq;
|
||||
|
||||
/**
|
||||
* 子件物料周需求Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2026-01-05
|
||||
*/
|
||||
public interface MrpComponentWeeklyReqMapper
|
||||
{
|
||||
/**
|
||||
* 查询子件物料周需求
|
||||
*
|
||||
* @param id 子件物料周需求主键
|
||||
* @return 子件物料周需求
|
||||
*/
|
||||
public MrpComponentWeeklyReq selectMrpComponentWeeklyReqById(Long id);
|
||||
|
||||
/**
|
||||
* 查询子件物料周需求列表
|
||||
*
|
||||
* @param mrpComponentWeeklyReq 子件物料周需求
|
||||
* @return 子件物料周需求集合
|
||||
*/
|
||||
public List<MrpComponentWeeklyReq> selectMrpComponentWeeklyReqList(MrpComponentWeeklyReq mrpComponentWeeklyReq);
|
||||
|
||||
/**
|
||||
* 新增子件物料周需求
|
||||
*
|
||||
* @param mrpComponentWeeklyReq 子件物料周需求
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMrpComponentWeeklyReq(MrpComponentWeeklyReq mrpComponentWeeklyReq);
|
||||
|
||||
/**
|
||||
* 修改子件物料周需求
|
||||
*
|
||||
* @param mrpComponentWeeklyReq 子件物料周需求
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMrpComponentWeeklyReq(MrpComponentWeeklyReq mrpComponentWeeklyReq);
|
||||
|
||||
/**
|
||||
* 删除子件物料周需求
|
||||
*
|
||||
* @param id 子件物料周需求主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMrpComponentWeeklyReqById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除子件物料周需求
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMrpComponentWeeklyReqByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量插入子件物料周需求
|
||||
*
|
||||
* @param list 子件物料周需求列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsert(List<MrpComponentWeeklyReq> list);
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.aucma.production.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.production.domain.MrpProdWeeklyPlan;
|
||||
|
||||
/**
|
||||
* 周排产计划Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2026-01-05
|
||||
*/
|
||||
public interface MrpProdWeeklyPlanMapper
|
||||
{
|
||||
/**
|
||||
* 查询周排产计划
|
||||
*
|
||||
* @param id 周排产计划主键
|
||||
* @return 周排产计划
|
||||
*/
|
||||
public MrpProdWeeklyPlan selectMrpProdWeeklyPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 查询周排产计划列表
|
||||
*
|
||||
* @param mrpProdWeeklyPlan 周排产计划
|
||||
* @return 周排产计划集合
|
||||
*/
|
||||
public List<MrpProdWeeklyPlan> selectMrpProdWeeklyPlanList(MrpProdWeeklyPlan mrpProdWeeklyPlan);
|
||||
|
||||
/**
|
||||
* 新增周排产计划
|
||||
*
|
||||
* @param mrpProdWeeklyPlan 周排产计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMrpProdWeeklyPlan(MrpProdWeeklyPlan mrpProdWeeklyPlan);
|
||||
|
||||
/**
|
||||
* 修改周排产计划
|
||||
*
|
||||
* @param mrpProdWeeklyPlan 周排产计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMrpProdWeeklyPlan(MrpProdWeeklyPlan mrpProdWeeklyPlan);
|
||||
|
||||
/**
|
||||
* 删除周排产计划
|
||||
*
|
||||
* @param id 周排产计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMrpProdWeeklyPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除周排产计划
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMrpProdWeeklyPlanByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量插入周排产计划
|
||||
*
|
||||
* @param list 周排产计划列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsert(List<MrpProdWeeklyPlan> list);
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
<?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.aucma.production.mapper.MrpComponentWeeklyReqMapper">
|
||||
|
||||
<resultMap type="MrpComponentWeeklyReq" id="MrpComponentWeeklyReqResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="yearWeek" column="year_week" />
|
||||
<result property="weekStartDate" column="week_start_date" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemDesc" column="item_desc" />
|
||||
<result property="reqMon" column="req_mon" />
|
||||
<result property="reqTue" column="req_tue" />
|
||||
<result property="reqWed" column="req_wed" />
|
||||
<result property="reqThu" column="req_thu" />
|
||||
<result property="reqFri" column="req_fri" />
|
||||
<result property="reqSat" column="req_sat" />
|
||||
<result property="reqSun" column="req_sun" />
|
||||
<result property="reqWeekTotal" column="req_week_total" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMrpComponentWeeklyReqVo">
|
||||
select id, year_week, week_start_date, item_code, item_desc, req_mon, req_tue, req_wed, req_thu, req_fri, req_sat, req_sun, req_week_total, created_at, updated_at from mrp_component_weekly_req
|
||||
</sql>
|
||||
|
||||
<select id="selectMrpComponentWeeklyReqList" parameterType="MrpComponentWeeklyReq" resultMap="MrpComponentWeeklyReqResult">
|
||||
<include refid="selectMrpComponentWeeklyReqVo"/>
|
||||
<where>
|
||||
<if test="yearWeek != null and yearWeek != ''"> and year_week = #{yearWeek}</if>
|
||||
<if test="weekStartDate != null "> and week_start_date = #{weekStartDate}</if>
|
||||
<if test="params != null and params.beginWeekStartDate != null and params.beginWeekStartDate != ''"> and week_start_date >= to_date(#{params.beginWeekStartDate}, 'yyyy-mm-dd')</if>
|
||||
<if test="params != null and params.endWeekStartDate != null and params.endWeekStartDate != ''"> and week_start_date <= to_date(#{params.endWeekStartDate}, 'yyyy-mm-dd')</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemDesc != null and itemDesc != ''"> and item_desc = #{itemDesc}</if>
|
||||
<if test="reqMon != null "> and req_mon = #{reqMon}</if>
|
||||
<if test="reqTue != null "> and req_tue = #{reqTue}</if>
|
||||
<if test="reqWed != null "> and req_wed = #{reqWed}</if>
|
||||
<if test="reqThu != null "> and req_thu = #{reqThu}</if>
|
||||
<if test="reqFri != null "> and req_fri = #{reqFri}</if>
|
||||
<if test="reqSat != null "> and req_sat = #{reqSat}</if>
|
||||
<if test="reqSun != null "> and req_sun = #{reqSun}</if>
|
||||
<if test="reqWeekTotal != null "> and req_week_total = #{reqWeekTotal}</if>
|
||||
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMrpComponentWeeklyReqById" parameterType="Long" resultMap="MrpComponentWeeklyReqResult">
|
||||
<include refid="selectMrpComponentWeeklyReqVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMrpComponentWeeklyReq" parameterType="MrpComponentWeeklyReq">
|
||||
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
||||
SELECT seq_mrp_component_weekly_req.NEXTVAL as id FROM DUAL
|
||||
</selectKey>
|
||||
insert into mrp_component_weekly_req
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="yearWeek != null and yearWeek != ''">year_week,</if>
|
||||
<if test="weekStartDate != null">week_start_date,</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code,</if>
|
||||
<if test="itemDesc != null">item_desc,</if>
|
||||
<if test="reqMon != null">req_mon,</if>
|
||||
<if test="reqTue != null">req_tue,</if>
|
||||
<if test="reqWed != null">req_wed,</if>
|
||||
<if test="reqThu != null">req_thu,</if>
|
||||
<if test="reqFri != null">req_fri,</if>
|
||||
<if test="reqSat != null">req_sat,</if>
|
||||
<if test="reqSun != null">req_sun,</if>
|
||||
<if test="reqWeekTotal != null">req_week_total,</if>
|
||||
<if test="createdAt != null">created_at,</if>
|
||||
<if test="updatedAt != null">updated_at,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="yearWeek != null and yearWeek != ''">#{yearWeek},</if>
|
||||
<if test="weekStartDate != null">#{weekStartDate},</if>
|
||||
<if test="itemCode != null and itemCode != ''">#{itemCode},</if>
|
||||
<if test="itemDesc != null">#{itemDesc},</if>
|
||||
<if test="reqMon != null">#{reqMon},</if>
|
||||
<if test="reqTue != null">#{reqTue},</if>
|
||||
<if test="reqWed != null">#{reqWed},</if>
|
||||
<if test="reqThu != null">#{reqThu},</if>
|
||||
<if test="reqFri != null">#{reqFri},</if>
|
||||
<if test="reqSat != null">#{reqSat},</if>
|
||||
<if test="reqSun != null">#{reqSun},</if>
|
||||
<if test="reqWeekTotal != null">#{reqWeekTotal},</if>
|
||||
<if test="createdAt != null">#{createdAt},</if>
|
||||
<if test="updatedAt != null">#{updatedAt},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMrpComponentWeeklyReq" parameterType="MrpComponentWeeklyReq">
|
||||
update mrp_component_weekly_req
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="yearWeek != null and yearWeek != ''">year_week = #{yearWeek},</if>
|
||||
<if test="weekStartDate != null">week_start_date = #{weekStartDate},</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code = #{itemCode},</if>
|
||||
<if test="itemDesc != null">item_desc = #{itemDesc},</if>
|
||||
<if test="reqMon != null">req_mon = #{reqMon},</if>
|
||||
<if test="reqTue != null">req_tue = #{reqTue},</if>
|
||||
<if test="reqWed != null">req_wed = #{reqWed},</if>
|
||||
<if test="reqThu != null">req_thu = #{reqThu},</if>
|
||||
<if test="reqFri != null">req_fri = #{reqFri},</if>
|
||||
<if test="reqSat != null">req_sat = #{reqSat},</if>
|
||||
<if test="reqSun != null">req_sun = #{reqSun},</if>
|
||||
<!-- req_week_total 是虚拟列,不能更新 -->
|
||||
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMrpComponentWeeklyReqById" parameterType="Long">
|
||||
delete from mrp_component_weekly_req where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMrpComponentWeeklyReqByIds" parameterType="String">
|
||||
delete from mrp_component_weekly_req where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id,jdbcType=NUMERIC}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT ALL
|
||||
<foreach collection="list" item="item" separator=" ">
|
||||
INTO mrp_component_weekly_req (id, year_week, week_start_date, item_code, item_desc, req_mon, req_tue, req_wed, req_thu, req_fri, req_sat, req_sun, created_at)
|
||||
VALUES (seq_mrp_component_weekly_req.NEXTVAL, #{item.yearWeek,jdbcType=VARCHAR}, #{item.weekStartDate,jdbcType=DATE}, #{item.itemCode,jdbcType=VARCHAR}, #{item.itemDesc,jdbcType=VARCHAR}, #{item.reqMon,jdbcType=NUMERIC}, #{item.reqTue,jdbcType=NUMERIC}, #{item.reqWed,jdbcType=NUMERIC}, #{item.reqThu,jdbcType=NUMERIC}, #{item.reqFri,jdbcType=NUMERIC}, #{item.reqSat,jdbcType=NUMERIC}, #{item.reqSun,jdbcType=NUMERIC}, #{item.createdAt,jdbcType=TIMESTAMP})
|
||||
</foreach>
|
||||
SELECT 1 FROM DUAL
|
||||
</insert>
|
||||
</mapper>
|
||||
@ -0,0 +1,157 @@
|
||||
<?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.aucma.production.mapper.MrpProdWeeklyPlanMapper">
|
||||
|
||||
<resultMap type="MrpProdWeeklyPlan" id="MrpProdWeeklyPlanResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="yearWeek" column="year_week" />
|
||||
<result property="weekStartDate" column="week_start_date" />
|
||||
<result property="seqNo" column="seq_no" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemDesc" column="item_desc" />
|
||||
<result property="plantCode" column="plant_code" />
|
||||
<result property="orderNo" column="order_no" />
|
||||
<result property="orderLineNo" column="order_line_no" />
|
||||
<result property="planD1" column="plan_d1" />
|
||||
<result property="planD2" column="plan_d2" />
|
||||
<result property="planD3" column="plan_d3" />
|
||||
<result property="planD4" column="plan_d4" />
|
||||
<result property="planD5" column="plan_d5" />
|
||||
<result property="planD6" column="plan_d6" />
|
||||
<result property="planD7" column="plan_d7" />
|
||||
<result property="planWeekTotal" column="plan_week_total" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMrpProdWeeklyPlanVo">
|
||||
select id, year_week, week_start_date, seq_no, item_code, item_desc, plant_code, order_no, order_line_no, plan_d1, plan_d2, plan_d3, plan_d4, plan_d5, plan_d6, plan_d7, plan_week_total, created_at, updated_at from mrp_prod_weekly_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectMrpProdWeeklyPlanList" parameterType="MrpProdWeeklyPlan" resultMap="MrpProdWeeklyPlanResult">
|
||||
<include refid="selectMrpProdWeeklyPlanVo"/>
|
||||
<where>
|
||||
<if test="yearWeek != null and yearWeek != ''"> and year_week = #{yearWeek}</if>
|
||||
<if test="weekStartDate != null "> and week_start_date = #{weekStartDate}</if>
|
||||
<if test="params != null and params.beginWeekStartDate != null and params.beginWeekStartDate != ''"> and week_start_date >= to_date(#{params.beginWeekStartDate}, 'yyyy-mm-dd')</if>
|
||||
<if test="params != null and params.endWeekStartDate != null and params.endWeekStartDate != ''"> and week_start_date <= to_date(#{params.endWeekStartDate}, 'yyyy-mm-dd')</if>
|
||||
<if test="seqNo != null "> and seq_no = #{seqNo}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemDesc != null and itemDesc != ''"> and item_desc = #{itemDesc}</if>
|
||||
<if test="plantCode != null and plantCode != ''"> and plant_code = #{plantCode}</if>
|
||||
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
|
||||
<if test="orderLineNo != null and orderLineNo != ''"> and order_line_no = #{orderLineNo}</if>
|
||||
<if test="planD1 != null "> and plan_d1 = #{planD1}</if>
|
||||
<if test="planD2 != null "> and plan_d2 = #{planD2}</if>
|
||||
<if test="planD3 != null "> and plan_d3 = #{planD3}</if>
|
||||
<if test="planD4 != null "> and plan_d4 = #{planD4}</if>
|
||||
<if test="planD5 != null "> and plan_d5 = #{planD5}</if>
|
||||
<if test="planD6 != null "> and plan_d6 = #{planD6}</if>
|
||||
<if test="planD7 != null "> and plan_d7 = #{planD7}</if>
|
||||
<if test="planWeekTotal != null "> and plan_week_total = #{planWeekTotal}</if>
|
||||
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMrpProdWeeklyPlanById" parameterType="Long" resultMap="MrpProdWeeklyPlanResult">
|
||||
<include refid="selectMrpProdWeeklyPlanVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMrpProdWeeklyPlan" parameterType="MrpProdWeeklyPlan">
|
||||
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
||||
SELECT seq_mrp_prod_weekly_plan.NEXTVAL as id FROM DUAL
|
||||
</selectKey>
|
||||
insert into mrp_prod_weekly_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="yearWeek != null">year_week,</if>
|
||||
<if test="weekStartDate != null">week_start_date,</if>
|
||||
<if test="seqNo != null">seq_no,</if>
|
||||
<if test="itemCode != null">item_code,</if>
|
||||
<if test="itemDesc != null">item_desc,</if>
|
||||
<if test="plantCode != null">plant_code,</if>
|
||||
<if test="orderNo != null">order_no,</if>
|
||||
<if test="orderLineNo != null">order_line_no,</if>
|
||||
<if test="planD1 != null">plan_d1,</if>
|
||||
<if test="planD2 != null">plan_d2,</if>
|
||||
<if test="planD3 != null">plan_d3,</if>
|
||||
<if test="planD4 != null">plan_d4,</if>
|
||||
<if test="planD5 != null">plan_d5,</if>
|
||||
<if test="planD6 != null">plan_d6,</if>
|
||||
<if test="planD7 != null">plan_d7,</if>
|
||||
<if test="planWeekTotal != null">plan_week_total,</if>
|
||||
<if test="createdAt != null">created_at,</if>
|
||||
<if test="updatedAt != null">updated_at,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="yearWeek != null">#{yearWeek},</if>
|
||||
<if test="weekStartDate != null">#{weekStartDate},</if>
|
||||
<if test="seqNo != null">#{seqNo},</if>
|
||||
<if test="itemCode != null">#{itemCode},</if>
|
||||
<if test="itemDesc != null">#{itemDesc},</if>
|
||||
<if test="plantCode != null">#{plantCode},</if>
|
||||
<if test="orderNo != null">#{orderNo},</if>
|
||||
<if test="orderLineNo != null">#{orderLineNo},</if>
|
||||
<if test="planD1 != null">#{planD1},</if>
|
||||
<if test="planD2 != null">#{planD2},</if>
|
||||
<if test="planD3 != null">#{planD3},</if>
|
||||
<if test="planD4 != null">#{planD4},</if>
|
||||
<if test="planD5 != null">#{planD5},</if>
|
||||
<if test="planD6 != null">#{planD6},</if>
|
||||
<if test="planD7 != null">#{planD7},</if>
|
||||
<if test="planWeekTotal != null">#{planWeekTotal},</if>
|
||||
<if test="createdAt != null">#{createdAt},</if>
|
||||
<if test="updatedAt != null">#{updatedAt},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMrpProdWeeklyPlan" parameterType="MrpProdWeeklyPlan">
|
||||
update mrp_prod_weekly_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="yearWeek != null">year_week = #{yearWeek},</if>
|
||||
<if test="weekStartDate != null">week_start_date = #{weekStartDate},</if>
|
||||
<if test="seqNo != null">seq_no = #{seqNo},</if>
|
||||
<if test="itemCode != null">item_code = #{itemCode},</if>
|
||||
<if test="itemDesc != null">item_desc = #{itemDesc},</if>
|
||||
<if test="plantCode != null">plant_code = #{plantCode},</if>
|
||||
<if test="orderNo != null">order_no = #{orderNo},</if>
|
||||
<if test="orderLineNo != null">order_line_no = #{orderLineNo},</if>
|
||||
<if test="planD1 != null">plan_d1 = #{planD1},</if>
|
||||
<if test="planD2 != null">plan_d2 = #{planD2},</if>
|
||||
<if test="planD3 != null">plan_d3 = #{planD3},</if>
|
||||
<if test="planD4 != null">plan_d4 = #{planD4},</if>
|
||||
<if test="planD5 != null">plan_d5 = #{planD5},</if>
|
||||
<if test="planD6 != null">plan_d6 = #{planD6},</if>
|
||||
<if test="planD7 != null">plan_d7 = #{planD7},</if>
|
||||
<!-- plan_week_total 是虚拟列,不能更新 -->
|
||||
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMrpProdWeeklyPlanById" parameterType="Long">
|
||||
delete from mrp_prod_weekly_plan where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMrpProdWeeklyPlanByIds" parameterType="String">
|
||||
delete from mrp_prod_weekly_plan where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id,jdbcType=NUMERIC}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT ALL
|
||||
<foreach collection="list" item="item" separator=" ">
|
||||
INTO mrp_prod_weekly_plan (id, year_week, week_start_date, seq_no, item_code, item_desc, plant_code, order_no, order_line_no, plan_d1, plan_d2, plan_d3, plan_d4, plan_d5, plan_d6, plan_d7, created_at)
|
||||
VALUES (seq_mrp_prod_weekly_plan.NEXTVAL, #{item.yearWeek,jdbcType=VARCHAR}, #{item.weekStartDate,jdbcType=DATE}, #{item.seqNo,jdbcType=NUMERIC}, #{item.itemCode,jdbcType=VARCHAR}, #{item.itemDesc,jdbcType=VARCHAR}, #{item.plantCode,jdbcType=VARCHAR}, #{item.orderNo,jdbcType=VARCHAR}, #{item.orderLineNo,jdbcType=VARCHAR}, #{item.planD1,jdbcType=NUMERIC}, #{item.planD2,jdbcType=NUMERIC}, #{item.planD3,jdbcType=NUMERIC}, #{item.planD4,jdbcType=NUMERIC}, #{item.planD5,jdbcType=NUMERIC}, #{item.planD6,jdbcType=NUMERIC}, #{item.planD7,jdbcType=NUMERIC}, #{item.createdAt,jdbcType=TIMESTAMP})
|
||||
</foreach>
|
||||
SELECT 1 FROM DUAL
|
||||
</insert>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue