XiaoRuby
2023-09-04 f1400115f582ae795913e360c0f5a70ea4513544
production-server/src/main/resources/mapper/ManufactureOrderMapper.xml
@@ -12,12 +12,12 @@
        specifications,
        unit,
        number,
        DATE_FORMAT(downTime, '%Y-%m-%d') '下单日期',
        DATE_FORMAT(delTime, '%Y-%m-%d') '交货日期',
        go_state,
        type
        scheduled_production,
        DATE_FORMAT(downTime, '%Y-%m-%d') downTime,
        DATE_FORMAT(delTime, '%Y-%m-%d') delTime,
        go_state
        from mom_ocean.manufacture_order
        where state=1
        where state = 1
        <if test="downTime!=null and downTime!=''">
            and downTime=#{downTime}
        </if>
@@ -28,38 +28,9 @@
            and customer_code like concat('%',#{customerCode},'%')
        </if>
        <if test="type!=null">
            and type=#{type}
            and go_state=#{type}
        </if>
    </select>
    <!--查看生产计划-->
    <select id="selectAllPlan" resultType="java.util.Map">
        select order_code,
               name,
               specifications,
               unit,
               number,
               proname,
               saleman,
               downman,
               techname,
               DATE_FORMAT(start_time, '%Y-%m-%d') '计划开始日期',
               DATE_FORMAT(end_time, '%Y-%m-%d') '计划结束日期'
        from mom_ocean.manual_technology mt
                 left join mom_ocean.manufacture_order mo
                           on mt.manufacture_order_id = mo.id
        where mo.state=1
        and go_state=1
        and device_id=#{deviceId}
        <if test="orderCode!=null and orderCode!=''">
            and order_code like concat('%',#{orderCode},'%')
        </if>
        <if test="startTime!=null and startTime!=''">
            and DATE_FORMAT(start_time, '%Y-%m-%d')=#{startTime}
        </if>
        <if test="endTime!=null and endTime!=''">
            and DATE_FORMAT(end_time, '%Y-%m-%d')=#{endTime}
        </if>
        order by start_time
        ORDER BY create_time DESC
    </select>
    <update id="deleteManufacture">
@@ -85,11 +56,12 @@
        SELECT m.`order_code`, m.`name`, m.`id`
        FROM manufacture_order m
        WHERE m.`state` = 1
        ORDER BY m.`create_time` DESC
    </select>
    <update id="updateManufacture">
        UPDATE manufacture_order m
        SET m.`type` = 1, m.`go_state` = 0, m.`scheduled_production` = m.`scheduled_production` + #{schedulingNumber}
        SET m.`go_state` = 0, m.`scheduled_production` = IFNULL(m.`scheduled_production`, 0) + #{schedulingNumber}
        where m.id = #{manufactureOrderId}
    </update>
</mapper>