liurunyu
2024-12-05 0cbe3bf67b051b6e66861ea97da2aea08e1fb2ad
pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeWorkOrderMapper.xml
@@ -242,10 +242,14 @@
    WHERE ord.deleted = 0 AND ord.id = #{workOrderId}
  </select>
  <!--获取指定派单人的指定未删除工单,删除工单前判断使用使用-->
  <!--获取指定派单人的、未上报的指定未删除工单,删除工单前判断使用使用-->
  <select id="getWorkOrder" resultType="com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder">
    SELECT * FROM ope_work_order
    WHERE deleted = 0 AND id = #{workOrderId} AND dispatcher_id = #{dispatcherId} LIMIT 1
    SELECT
        *
    FROM ope_work_order ord
    WHERE deleted = 0
        AND NOT EXISTS(SELECT * FROM ope_processing_result res WHERE res.work_order_id = ord.id)
        AND id = #{workOrderId} AND dispatcher_id = #{dispatcherId} LIMIT 1
  </select>
  <!--逻辑删除一个未删除的工单-->
@@ -265,12 +269,24 @@
    <where>
      AND ord.deleted = 0
      <if test = "dispatcherId != null">
        AND ord.dispatcher_id = #{dispatcherId}
      </if>
      <if test = "inspectorId != null">
        AND ord.inspector_id = #{inspectorId}
      </if>
      <if test = "dispatcher != null and dispatcher !=''">
        AND us1.name like CONCAT('%',#{dispatcher},'%')
      </if>
      <if test = "inspector != null and inspector !=''">
        AND us2.name like CONCAT('%',#{inspector},'%')
      </if>
      <if test = "state != null">
        AND ord.state = #{state}
      </if>
      <if test = "timeStart != null and timeStop != null">
@@ -304,7 +320,8 @@
            WHEN res.state = 2 THEN   '已通过'
            WHEN res.state = 3 THEN   '已驳回'
            ELSE '未上报'
        END AS processingState
        END AS processingState,
        res.id AS proResultId
    FROM ope_work_order ord
        INNER JOIN ba_user us1 ON us1.id = ord.dispatcher_id
        INNER JOIN ba_user us2 ON us2.id = ord.inspector_id
@@ -313,6 +330,14 @@
    <where>
      AND ord.deleted = 0
      <if test = "dispatcherId != null">
        AND ord.dispatcher_id = #{dispatcherId}
      </if>
      <if test = "inspectorId != null">
        AND ord.inspector_id = #{inspectorId}
      </if>
      <if test = "dispatcher != null and dispatcher !=''">
        AND us1.name like CONCAT('%',#{dispatcher},'%')
      </if>
@@ -321,6 +346,10 @@
        AND us2.name like CONCAT('%',#{inspector},'%')
      </if>
      <if test = "state != null">
        AND ord.state = #{state}
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND ord.dispatch_time BETWEEN #{timeStart} AND #{timeStop}
      </if>