龚焕茏
2024-04-30 36e5600e3497d97b42376c5f096d85891f1ad94b
ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
@@ -14,5 +14,49 @@
        <result column="yw_condition" property="ywCondition" />
        <result column="yw_check_result" property="ywCheckResult" />
    </resultMap>
    <select id="page" resultType="com.ycl.platform.domain.vo.WorkOrderVO">
        SELECT
        wo.*,
        u.unit_name,
        p.yw_person_name
        FROM
        t_work_order wo
        LEFT JOIN t_yw_unit u ON wo.unit_id = u.id and u.deleted = '0'
        LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id and p.deleted = '0'
        where
            wo.deleted = '0'
            <if test="query.workOrderNo != null and query.workOrderNo != ''">
                AND wo.work_order_no = #{query.workOrderNo}
            </if>
            <if test="query.status != null">
                AND wo.status = #{query.status}
            </if>
            <if test="query.errorType != null and query.errType != ''">
                AND wo.error_type = #{query.errorType}
            </if>
            <if test="query.start != null">
                AND wo.yw_handle_time BETWEEN #{query.start} AND #{query.end}
            </if>
        ORDER BY wo.create_time DESC
    </select>
    <select id="distributePage" resultType="com.ycl.platform.domain.vo.WorkOrderVO">
        SELECT
        wo.*,
        u.unit_name,
        p.yw_person_name
        FROM
        t_work_order wo
        LEFT JOIN t_yw_unit u ON wo.unit_id = u.id and u.deleted = '0'
        LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id and p.deleted = '0'
        where
        wo.deleted = '0'
        and wo.status = 'WAIT_DISTRIBUTE'
        <if test="query.unitId != null">
            AND wo.unit_id = #{query.unitId}
        </if>
        ORDER BY wo.create_time DESC
    </select>
</mapper>