|
|
@ -48,7 +48,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</resultMap> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectRollingPlanVo"> |
|
|
|
<sql id="selectRollingPlanVo"> |
|
|
|
select plan_id, plan_number, machine_code, plan_year, version_week, production_mode, status, sales_area_code, country_code, sales_coordinator, customer_name, production_version, brand_code, sales_model, production_base, is_zero_execution, schedule_time, last_adjust_time, adjust_time, last_week_qty, current_week_qty, qty_difference, order_stage, order_type, packing_method, plan_sequence, is_first_order, is_direct_delivery, screen_requirement, panel_manufacturer, panel_requirement, core_requirement, product_category, product_size, remark, lock_week, create_by, create_time, update_by, update_time from rolling_plan |
|
|
|
select plan_id, plan_number, machine_code, plan_year, version_week, production_mode, status, |
|
|
|
|
|
|
|
audit_status, audit_by, audit_time, audit_remark, |
|
|
|
|
|
|
|
sales_area_code, country_code, sales_coordinator, customer_name, production_version, |
|
|
|
|
|
|
|
brand_code, sales_model, production_base, is_zero_execution, schedule_time, |
|
|
|
|
|
|
|
last_adjust_time, adjust_time, last_week_qty, current_week_qty, qty_difference, |
|
|
|
|
|
|
|
order_stage, order_type, packing_method, plan_sequence, is_first_order, |
|
|
|
|
|
|
|
is_direct_delivery, screen_requirement, panel_manufacturer, panel_requirement, |
|
|
|
|
|
|
|
core_requirement, product_category, product_size, remark, lock_week, |
|
|
|
|
|
|
|
create_by, create_time, update_by, update_time |
|
|
|
|
|
|
|
from rolling_plan |
|
|
|
</sql> |
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectRollingPlanList" parameterType="RollingPlan" resultMap="RollingPlanResult"> |
|
|
|
<select id="selectRollingPlanList" parameterType="RollingPlan" resultMap="RollingPlanResult"> |
|
|
@ -59,11 +68,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="planYear != null "> and plan_year = #{planYear}</if> |
|
|
|
<if test="planYear != null "> and plan_year = #{planYear}</if> |
|
|
|
<if test="versionWeek != null and versionWeek != ''"> and version_week = #{versionWeek}</if> |
|
|
|
<if test="versionWeek != null and versionWeek != ''"> and version_week = #{versionWeek}</if> |
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if> |
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if> |
|
|
|
|
|
|
|
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if> |
|
|
|
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if> |
|
|
|
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if> |
|
|
|
</where> |
|
|
|
</where> |
|
|
|
order by create_time desc |
|
|
|
order by create_time desc |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 在 insert 和 update 语句中添加审核相关字段 --> |
|
|
|
|
|
|
|
<insert id="insertRollingPlan" parameterType="RollingPlan" useGeneratedKeys="true" keyProperty="planId"> |
|
|
|
|
|
|
|
<!-- 已有字段保持不变 --> |
|
|
|
|
|
|
|
<if test="auditStatus != null">audit_status,</if> |
|
|
|
|
|
|
|
<if test="auditBy != null">audit_by,</if> |
|
|
|
|
|
|
|
<if test="auditTime != null">audit_time,</if> |
|
|
|
|
|
|
|
<if test="auditRemark != null">audit_remark,</if> |
|
|
|
|
|
|
|
<!-- values部分也需要添加对应的值 --> |
|
|
|
|
|
|
|
<if test="auditStatus != null">#{auditStatus},</if> |
|
|
|
|
|
|
|
<if test="auditBy != null">#{auditBy},</if> |
|
|
|
|
|
|
|
<if test="auditTime != null">#{auditTime},</if> |
|
|
|
|
|
|
|
<if test="auditRemark != null">#{auditRemark},</if> |
|
|
|
|
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 修改滚动计划 --> |
|
|
|
|
|
|
|
<update id="updateRollingPlan" parameterType="RollingPlan"> |
|
|
|
|
|
|
|
update rolling_plan |
|
|
|
|
|
|
|
<set> |
|
|
|
|
|
|
|
<if test="planNumber != null">plan_number = #{planNumber},</if> |
|
|
|
|
|
|
|
<if test="machineCode != null">machine_code = #{machineCode},</if> |
|
|
|
|
|
|
|
<if test="planYear != null">plan_year = #{planYear},</if> |
|
|
|
|
|
|
|
<if test="versionWeek != null">version_week = #{versionWeek},</if> |
|
|
|
|
|
|
|
<if test="productionMode != null">production_mode = #{productionMode},</if> |
|
|
|
|
|
|
|
<if test="status != null">status = #{status},</if> |
|
|
|
|
|
|
|
<if test="salesAreaCode != null">sales_area_code = #{salesAreaCode},</if> |
|
|
|
|
|
|
|
<if test="countryCode != null">country_code = #{countryCode},</if> |
|
|
|
|
|
|
|
<if test="salesCoordinator != null">sales_coordinator = #{salesCoordinator},</if> |
|
|
|
|
|
|
|
<if test="customerName != null">customer_name = #{customerName},</if> |
|
|
|
|
|
|
|
<if test="productionVersion != null">production_version = #{productionVersion},</if> |
|
|
|
|
|
|
|
<if test="brandCode != null">brand_code = #{brandCode},</if> |
|
|
|
|
|
|
|
<if test="salesModel != null">sales_model = #{salesModel},</if> |
|
|
|
|
|
|
|
<if test="productionBase != null">production_base = #{productionBase},</if> |
|
|
|
|
|
|
|
<if test="isZeroExecution != null">is_zero_execution = #{isZeroExecution},</if> |
|
|
|
|
|
|
|
<if test="currentWeekQty != null">current_week_qty = #{currentWeekQty},</if> |
|
|
|
|
|
|
|
<if test="lastWeekQty != null">last_week_qty = #{lastWeekQty},</if> |
|
|
|
|
|
|
|
<if test="qtyDifference != null">qty_difference = #{qtyDifference},</if> |
|
|
|
|
|
|
|
<if test="orderStage != null">order_stage = #{orderStage},</if> |
|
|
|
|
|
|
|
<if test="orderType != null">order_type = #{orderType},</if> |
|
|
|
|
|
|
|
<if test="packingMethod != null">packing_method = #{packingMethod},</if> |
|
|
|
|
|
|
|
<if test="planSequence != null">plan_sequence = #{planSequence},</if> |
|
|
|
|
|
|
|
<if test="isFirstOrder != null">is_first_order = #{isFirstOrder},</if> |
|
|
|
|
|
|
|
<if test="isDirectDelivery != null">is_direct_delivery = #{isDirectDelivery},</if> |
|
|
|
|
|
|
|
<if test="screenRequirement != null">screen_requirement = #{screenRequirement},</if> |
|
|
|
|
|
|
|
<if test="panelManufacturer != null">panel_manufacturer = #{panelManufacturer},</if> |
|
|
|
|
|
|
|
<if test="panelRequirement != null">panel_requirement = #{panelRequirement},</if> |
|
|
|
|
|
|
|
<if test="coreRequirement != null">core_requirement = #{coreRequirement},</if> |
|
|
|
|
|
|
|
<if test="productCategory != null">product_category = #{productCategory},</if> |
|
|
|
|
|
|
|
<if test="productSize != null">product_size = #{productSize},</if> |
|
|
|
|
|
|
|
<if test="lockWeek != null">lock_week = #{lockWeek},</if> |
|
|
|
|
|
|
|
<if test="scheduleTime != null">schedule_time = #{scheduleTime},</if> |
|
|
|
|
|
|
|
<if test="adjustTime != null">adjust_time = #{adjustTime},</if> |
|
|
|
|
|
|
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if> |
|
|
|
|
|
|
|
<if test="auditBy != null">audit_by = #{auditBy},</if> |
|
|
|
|
|
|
|
<if test="auditTime != null">audit_time = #{auditTime},</if> |
|
|
|
|
|
|
|
<if test="auditRemark != null">audit_remark = #{auditRemark},</if> |
|
|
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if> |
|
|
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
|
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if> |
|
|
|
|
|
|
|
</set> |
|
|
|
|
|
|
|
where plan_id = #{planId} |
|
|
|
|
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectRollingPlanByPlanId" parameterType="Long" resultMap="RollingPlanResult"> |
|
|
|
<select id="selectRollingPlanByPlanId" parameterType="Long" resultMap="RollingPlanResult"> |
|
|
|
<include refid="selectRollingPlanVo"/> |
|
|
|
<include refid="selectRollingPlanVo"/> |
|
|
|
where plan_id = #{planId} |
|
|
|
where plan_id = #{planId} |
|
|
|