XiaoRuby
2023-09-04 f1400115f582ae795913e360c0f5a70ea4513544
production-server/src/main/resources/mapper/ManufactureOrderMapper.xml
@@ -12,11 +12,12 @@
        specifications,
        unit,
        number,
        DATE_FORMAT(downTime, '%Y-%m-%d') '下单日期',
        DATE_FORMAT(delTime, '%Y-%m-%d') '交货日期',
        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>
@@ -27,7 +28,40 @@
            and customer_code like concat('%',#{customerCode},'%')
        </if>
        <if test="type!=null">
            and type=#{type}
            and go_state=#{type}
        </if>
        ORDER BY create_time DESC
    </select>
</mapper>
    <update id="deleteManufacture">
        UPDATE manufacture_order m
        SET m.`state` = 0
        WHERE m.id IN
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </update>
    <resultMap id="towTreeFirstMap" type="map">
        <id property="orderCode" column="order_code"/>
        <collection property="children" javaType="list" resultMap="towTreeSecondMap"/>
    </resultMap>
    <resultMap id="towTreeSecondMap" type="map">
        <id property="manufactureId" column="id"/>
        <result property="manufactureName" column="name"/>
    </resultMap>
    <select id="towTree" resultMap="towTreeFirstMap">
        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.`go_state` = 0, m.`scheduled_production` = IFNULL(m.`scheduled_production`, 0) + #{schedulingNumber}
        where m.id = #{manufactureOrderId}
    </update>
</mapper>