sfd
2025-05-26 2a64b537e8e3bce9ce030585a3da17d48379c0ad
aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipingPlanMapper.xml
@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aps.core.mapper.ApsGasPipingPlanMapper">
    
    <resultMap type="ApsGasPipingPlan" id="ApsGasPipingPlanResult">
    <resultMap type="com.aps.core.domain.ApsGasPipingPlan" id="ApsGasPipingPlanResult">
        <result property="id"    column="id"    />
        <result property="masterPlanner"    column="master_planner"    />
        <result property="weekDay"    column="week_day"    />
@@ -43,6 +43,10 @@
        <result property="planType"    column="plan_type"    />
        <result property="opStatus"    column="op_status"    />
        <result property="nextOpName"    column="next_op_name"    />
        <result property="orderCreateTime"    column="order_create_time"    />
        <result property="approveOn"    column="approve_on"    />
        <result property="startWorkDate"    column="start_work_date"    />
        <result property="lowOrderCode"    column="low_order_code"    />
<!--        <collection property="apsProcessRoutes" javaType="java.util.ArrayList" ofType="com.aps.core.domain.ApsProcessRoute">-->
<!--            <result property="id"    column="id"    />-->
<!--            <result property="itemNo"    column="item_no"    />-->
@@ -71,16 +75,19 @@
<!--        </collection>-->
    </resultMap>
    <resultMap type="ApsGasPipingPlan" id="ApsGasPipingPlanResultWithProcess">
    <resultMap type="com.aps.core.domain.ApsGasPipingPlan" id="ApsGasPipingPlanResultWithProcess">
        <result property="documentNumber"    column="document_number"    />
        <result property="itemNumber"    column="item_number"    />
        <result property="productionQuantity"    column="production_quantity"    />
        <result property="processNumber"    column="process_number"    />
        <result property="planType"    column="plan_type"    />
        <result property="planEndDay"    column="plan_end_day"    />
        <result property="stdOp"    column="std_op"    />
        <collection property="apsProcessRoutes" javaType="java.util.ArrayList" ofType="com.aps.core.domain.ApsProcessRoute">
            <result property="processNumber"    column="process_number_sub"    />
            <result property="processName"    column="process_name"    />
            <result property="processPlanStartDay"    column="process_plan_start_day"    />
            <result property="processPlanEndDay"    column="process_plan_end_day"    />
            <result property="standardTime"    column="standard_time"    />
        </collection>
    </resultMap>
@@ -92,11 +99,11 @@
               department, plan_start_day, plan_end_day, standby_number, standby_name, standby_stock,
               next_process_deparment, is_suspended, is_outsourcing, account, advanced_materials,
               advanced_document_number, advanced_requirement_day, is_plan_complete, is_stock_complete,
               has_turnback, has_risk ,plan_type, op_status, next_op_name
               has_turnback, has_risk ,plan_type, op_status, next_op_name, order_create_time, approve_on, start_work_date, low_order_code
        from aps_gas_piping_plan
    </sql>
    <select id="selectApsGasPipingPlanList" parameterType="ApsGasPipingPlan" resultMap="ApsGasPipingPlanResult">
    <select id="selectApsGasPipingPlanList" parameterType="com.aps.core.domain.ApsGasPipingPlan" resultMap="ApsGasPipingPlanResult">
        <include refid="selectApsGasPipingPlanVo"/>
        <where>  
            <if test="masterPlanner != null  and masterPlanner != ''"> and master_planner like concat('%', #{masterPlanner}, '%')</if>
@@ -130,8 +137,8 @@
            <if test="hasTurnback != null "> and has_turnback = #{hasTurnback}</if>
            <if test="hasRisk != null "> and has_risk = #{hasRisk}</if>
            <if test="planType != null "> and plan_type = #{planType}</if>
             <if test="opStatus != null "> and op_status = #{opStatus}</if>
              <if test="nextOpName != null "> and next_op_name = #{nextOpName}</if>
            <if test="opStatus != null "> and op_status = #{opStatus}</if>
            <if test="nextOpName != null "> and next_op_name = #{nextOpName}</if>
           and del_flag ='0'
        </where>
    </select>
@@ -141,7 +148,7 @@
        where id = #{id}
    </select>
    <insert id="insertApsGasPipingPlan" parameterType="ApsGasPipingPlan">
    <insert id="insertApsGasPipingPlan" parameterType="com.aps.core.domain.ApsGasPipingPlan">
        insert into aps_gas_piping_plan
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null and id != ''">id,</if>
@@ -182,6 +189,10 @@
            <if test="planType != null">plan_type,</if>
            <if test="opStatus != null">op_status,</if>
            <if test="nextOpName != null">next_op_name,</if>
            <if test="orderCreateTime != null">order_create_time,</if>
            <if test="approveOn != null">approve_on,</if>
            <if test="startWorkDate != null">start_work_date,</if>
            <if test="lowOrderCode != null">low_order_code,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null and id != ''">#{id},</if>
@@ -222,10 +233,14 @@
            <if test="planType != null">#{planType},</if>
            <if test="opStatus != null">#{opStatus},</if>
            <if test="nextOpName != null">#{nextOpName},</if>
            <if test="orderCreateTime != null">#{orderCreateTime},</if>
            <if test="approveOn != null">#{approveOn},</if>
            <if test="startWorkDate != null">#{startWorkDate},</if>
            <if test="lowOrderCode != null">#{lowOrderCode},</if>
         </trim>
    </insert>
    <update id="updateApsGasPipingPlan" parameterType="ApsGasPipingPlan">
    <update id="updateApsGasPipingPlan" parameterType="com.aps.core.domain.ApsGasPipingPlan">
        update aps_gas_piping_plan
        <trim prefix="SET" suffixOverrides=",">
            <if test="masterPlanner != null">master_planner = #{masterPlanner},</if>
@@ -265,6 +280,10 @@
            <if test="planType != null">plan_type = #{planType},</if>
            <if test="opStatus != null">op_status = #{opStatus},</if>
            <if test="nextOpName != null">next_op_name = #{nextOpName},</if>
            <if test="orderCreateTime != null">order_create_time = #{orderCreateTime},</if>
            <if test="approveOn != null">approve_on = #{approveOn},</if>
            <if test="startWorkDate != null">start_work_date = #{startWorkDate},</if>
            <if test="lowOrderCode != null">low_order_code = #{lowOrderCode},</if>
        </trim>
        where id = #{id}
    </update>
@@ -284,10 +303,10 @@
        update  aps_gas_piping_plan  set del_flag='1' where del_flag ='0'
    </update>
    <select id="selectApsGasPipingPlanWithProcess" parameterType="ApsGasPipingPlan" resultMap="ApsGasPipingPlanResultWithProcess">
        select c.* from (select a.document_number,a.item_number,a.process_number,a.production_quantity,a.plan_type,b.process_name,b.process_number as process_number_sub,b.standard_time,b.process_plan_start_day from aps_gas_piping_plan a
            left join aps_process_route b on a.document_number = b.work_order_no
            where a.document_status in ('0','1','2','4') and b.process_plan_start_day is not null ORDER BY a.document_number,b.process_number) c GROUP BY c.document_number,c.item_number,c.process_number,c.production_quantity,c.process_name,c.process_number_sub,c.standard_time,c.process_plan_start_day,c.plan_type
    <select id="selectApsGasPipingPlanWithProcess" parameterType="com.aps.core.domain.ApsGasPipingPlan" resultMap="ApsGasPipingPlanResultWithProcess">
        select c.* from (select a.document_number,a.item_number,a.process_number,a.production_quantity,a.plan_type,a.plan_end_day,a.std_op,b.process_name,b.process_number as process_number_sub,b.standard_time,b.process_plan_start_day,b.process_plan_end_day from aps_gas_piping_plan a
           left join aps_process_route b on a.document_number = b.work_order_no
        where a.document_status in ('0','1','2','4') and a.op_status!='完工' and b.process_plan_start_day is not null and b.process_name in(select process_name from aps_standard_process where major='气柜' or major='管路') ORDER BY a.document_number,b.process_number) c GROUP BY c.document_number,c.item_number,c.process_number,c.production_quantity,c.process_name,c.process_number_sub,c.standard_time,c.process_plan_start_day,c.plan_type,c.process_plan_end_day,c.plan_end_day,c.std_op
    </select>
</mapper>