lyh
20 小时以前 30e775eb9d4b20b6dbb407199f8f4d0729bf7c4e
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/AndonOrderMapper.xml
@@ -16,4 +16,61 @@
        ORDER BY
            create_time
    </select>
    <select id="untreatedAndonList" resultType="org.jeecg.modules.mdc.entity.AndonOrder">
        SELECT
            ao.*
        FROM
          andon_order ao
          INNER JOIN (
            SELECT
              equipment_id,
              MAX(create_time) AS max_create_time
            FROM
              andon_order
            WHERE order_status = 1
            GROUP BY
          equipment_id) AS latest ON ao.equipment_id = latest.equipment_id
          AND ao.create_time = latest.max_create_time
        WHERE order_status = 1
        ORDER BY
            ao.create_time
    </select>
    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.AndonOrder">
        SELECT
            id,
            equipment_id,
            andon_type,
            operator,
            operate_time,
            responder,
            response_time,
            processor,
            process_time,
            order_status,
            problem_descreption,
            resolution_descreption,
            image_files,
            del_flag,
            create_by,
            create_time,
            update_by,
            update_time,
            call_reason,
            plant_name
        FROM
            andon_order
        WHERE
            del_flag = 0
          AND (operator = #{userId} OR responder = #{userId} OR processor = #{userId})
        <if test="andonOrder.equipmentId != null and andonOrder.equipmentId != '' ">
            AND equipment_id LIKE CONCAT(CONCAT('%',#{andonOrder.equipmentId}),'%')
        </if>
        <if test="andonOrder.andonType != null and andonOrder.andonType != '' ">
            AND andon_type = #{andonOrder.andonType}
        </if>
        <if test="andonOrder.orderStatus != null and andonOrder.orderStatus != '' ">
            AND order_status = #{andonOrder.orderStatus}
        </if>
    </select>
</mapper>