linwe
2024-05-28 0ae58361b572a82a8ff1be2256c0d25fa5ec3ea4
src/main/java/org/springblade/modules/eCallEventTwo/mapper/EcOrderMapper.xml
@@ -137,44 +137,403 @@
      <if test="applicantGrid != null  and applicantGrid != ''"> and applicant_grid = #{applicantGrid}</if>
      <if test="applicantDistrict != null  and applicantDistrict != ''"> and applicant_district = #{applicantDistrict}</if>
      <if test="sceneAddr != null  and sceneAddr != ''"> and scene_addr = #{sceneAddr}</if>
      <if test="sceneAddrGrid != null  and sceneAddrGrid != ''"> and scene_addr_grid = #{sceneAddrGrid}</if>
      <if test="sceneDistrict != null  and sceneDistrict != ''"> and scene_district = #{sceneDistrict}</if>
      <if test="scenePlace != null  and scenePlace != ''"> and scene_place = #{scenePlace}</if>
      <if test="sceneGeoLat != null "> and scene_geo_lat = #{sceneGeoLat}</if>
      <if test="sceneGeoLng != null "> and scene_geo_lng = #{sceneGeoLng}</if>
      <if test="sceneAddrCor != null  and sceneAddrCor != ''"> and scene_addr_cor = #{sceneAddrCor}</if>
      <if test="sceneGeoLatCor != null "> and scene_geo_lat_cor = #{sceneGeoLatCor}</if>
      <if test="sceneGeoLngCor != null "> and scene_geo_lng_cor = #{sceneGeoLngCor}</if>
      <if test="isSecret != null  and isSecret != ''"> and is_secret = #{isSecret}</if>
      <if test="isRepeat != null  and isRepeat != ''"> and is_repeat = #{isRepeat}</if>
      <if test="issueType != null  and issueType != ''"> and issue_type = #{issueType}</if>
      <if test="issueClazz != null  and issueClazz != ''"> and issue_clazz = #{issueClazz}</if>
      <if test="issueLevel != null  and issueLevel != ''"> and issue_level = #{issueLevel}</if>
      <if test="deadline != null "> and deadline = #{deadline}</if>
      <if test="linkOrders != null  and linkOrders != ''"> and link_orders = #{linkOrders}</if>
      <if test="linkOrdersCode != null  and linkOrdersCode != ''"> and link_orders_code = #{linkOrdersCode}</if>
      <if test="wikiRef != null  and wikiRef != ''"> and wiki_ref = #{wikiRef}</if>
      <if test="acptOrgCode != null  and acptOrgCode != ''"> and acpt_org_code = #{acptOrgCode}</if>
      <if test="acptOrgName != null  and acptOrgName != ''"> and acpt_org_name = #{acptOrgName}</if>
      <if test="handleWay != null  and handleWay != ''"> and handle_way = #{handleWay}</if>
      <if test="externalHandleWay != null  and externalHandleWay != ''"> and external_handle_way = #{externalHandleWay}</if>
      <if test="directFeed != null  and directFeed != ''"> and direct_feed = #{directFeed}</if>
      <if test="directFeedHandler != null  and directFeedHandler != ''"> and direct_feed_handler = #{directFeedHandler}</if>
      <if test="directFeedTime != null "> and direct_feed_time = #{directFeedTime}</if>
      <if test="images != null  and images != ''"> and images = #{images}</if>
      <if test="flagVaild != null  and flagVaild != ''"> and flag_vaild = #{flagVaild}</if>
      <if test="invalidNote != null  and invalidNote != ''"> and invalid_note = #{invalidNote}</if>
      <if test="invalidTime != null "> and invalid_time = #{invalidTime}</if>
      <if test="invalidUserName != null  and invalidUserName != ''"> and invalid_user_name = #{invalidUserName}</if>
      <if test="status != null  and status != ''"> and status = #{status}</if>
      <if test="tagApply != null  and tagApply != ''"> and tag_apply = #{tagApply}</if>
      <if test="tagDelay != null  and tagDelay != ''"> and tag_delay = #{tagDelay}</if>
      <if test="tagDoing != null  and tagDoing != ''"> and tag_doing = #{tagDoing}</if>
      <if test="tagResp != null  and tagResp != ''"> and tag_resp = #{tagResp}</if>
      <if test="tagDone != null  and tagDone != ''"> and tag_done = #{tagDone}</if>
      <if test="tagCheck != null  and tagCheck != ''"> and tag_check = #{tagCheck}</if>
      <if test="tagChkTel != null  and tagChkTel != ''"> and tag_chk_tel = #{tagChkTel}</if>
      <if test="tagRedo != null  and tagRedo != ''"> and tag_redo = #{tagRedo}</if>
            <if test="sceneAddrGrid != null  and sceneAddrGrid != ''">and scene_addr_grid = #{sceneAddrGrid}</if>
            <if test="sceneDistrict != null  and sceneDistrict != ''">and scene_district = #{sceneDistrict}</if>
            <if test="scenePlace != null  and scenePlace != ''">and scene_place = #{scenePlace}</if>
            <if test="sceneGeoLat != null ">and scene_geo_lat = #{sceneGeoLat}</if>
            <if test="sceneGeoLng != null ">and scene_geo_lng = #{sceneGeoLng}</if>
            <if test="sceneAddrCor != null  and sceneAddrCor != ''">and scene_addr_cor = #{sceneAddrCor}</if>
            <if test="sceneGeoLatCor != null ">and scene_geo_lat_cor = #{sceneGeoLatCor}</if>
            <if test="sceneGeoLngCor != null ">and scene_geo_lng_cor = #{sceneGeoLngCor}</if>
            <if test="isSecret != null  and isSecret != ''">and is_secret = #{isSecret}</if>
            <if test="isRepeat != null  and isRepeat != ''">and is_repeat = #{isRepeat}</if>
            <if test="issueType != null  and issueType != ''">and issue_type = #{issueType}</if>
            <if test="issueClazz != null  and issueClazz != ''">and issue_clazz = #{issueClazz}</if>
            <if test="issueLevel != null  and issueLevel != ''">and issue_level = #{issueLevel}</if>
            <if test="deadline != null ">and deadline = #{deadline}</if>
            <if test="linkOrders != null  and linkOrders != ''">and link_orders = #{linkOrders}</if>
            <if test="linkOrdersCode != null  and linkOrdersCode != ''">and link_orders_code = #{linkOrdersCode}</if>
            <if test="wikiRef != null  and wikiRef != ''">and wiki_ref = #{wikiRef}</if>
            <if test="acptOrgCode != null  and acptOrgCode != ''">and acpt_org_code = #{acptOrgCode}</if>
            <if test="acptOrgName != null  and acptOrgName != ''">and acpt_org_name = #{acptOrgName}</if>
            <if test="handleWay != null  and handleWay != ''">and handle_way = #{handleWay}</if>
            <if test="externalHandleWay != null  and externalHandleWay != ''">and external_handle_way =
                #{externalHandleWay}
            </if>
            <if test="directFeed != null  and directFeed != ''">and direct_feed = #{directFeed}</if>
            <if test="directFeedHandler != null  and directFeedHandler != ''">and direct_feed_handler =
                #{directFeedHandler}
            </if>
            <if test="directFeedTime != null ">and direct_feed_time = #{directFeedTime}</if>
            <if test="images != null  and images != ''">and images = #{images}</if>
            <if test="flagVaild != null  and flagVaild != ''">and flag_vaild = #{flagVaild}</if>
            <if test="invalidNote != null  and invalidNote != ''">and invalid_note = #{invalidNote}</if>
            <if test="invalidTime != null ">and invalid_time = #{invalidTime}</if>
            <if test="invalidUserName != null  and invalidUserName != ''">and invalid_user_name = #{invalidUserName}
            </if>
            <if test="status != null  and status != ''">and status = #{status}</if>
            <if test="tagApply != null  and tagApply != ''">and tag_apply = #{tagApply}</if>
            <if test="tagDelay != null  and tagDelay != ''">and tag_delay = #{tagDelay}</if>
            <if test="tagDoing != null  and tagDoing != ''">and tag_doing = #{tagDoing}</if>
            <if test="tagResp != null  and tagResp != ''">and tag_resp = #{tagResp}</if>
            <if test="tagDone != null  and tagDone != ''">and tag_done = #{tagDone}</if>
            <if test="tagCheck != null  and tagCheck != ''">and tag_check = #{tagCheck}</if>
            <if test="tagChkTel != null  and tagChkTel != ''">and tag_chk_tel = #{tagChkTel}</if>
            <if test="tagRedo != null  and tagRedo != ''">and tag_redo = #{tagRedo}</if>
        </where>
    </select>
    <select id="selectEcOrderCount" parameterType="org.springblade.modules.eCallEventTwo.dto.EcOrderDTO"
            resultType="java.lang.Integer">
        SELECT
        COUNT(DISTINCT(eo.order_id))
        FROM
        ec_order_cti eoc
        LEFT JOIN ec_order eo on eo.order_id= eoc.order_id
        LEFT JOIN ec_dispatch ed ON eo.order_id = ed.order_id
        <where>
            <if test="tagMain != null and tagMain != ''">and ed.tag_main = #{tagMain}</if>
            <if test="objectOrgCode != null and objectOrgCode != ''">and ed.object_org_code = #{objectOrgCode}</if>
            <if test="sinkOrgCode != null and sinkOrgCode != ''">and ed.sink_org_code = #{sinkOrgCode}</if>
            <if test="startTime != null and endTime != null">and eoc.callin_time BETWEEN #{startTime} AND #{endTime}
            </if>
            <if test="orderId != null ">and eo.order_id = #{orderId}</if>
            <if test="orderCode != null  and orderCode != ''">and eo.order_code = #{orderCode}</if>
            <if test="issueOrigin != null  and issueOrigin != ''">and eo.issue_origin = #{issueOrigin}</if>
            <if test="issueTitle != null  and issueTitle != ''">and eo.issue_title = #{issueTitle}</if>
            <if test="issueContent != null  and issueContent != ''">and eo.issue_content = #{issueContent}</if>
            <if test="applicantType != null  and applicantType != ''">and eo.applicant_type = #{applicantType}</if>
            <if test="applicantName != null  and applicantName != ''">and eo.applicant_name = #{applicantName}</if>
            <if test="applicantGender != null  and applicantGender != ''">and eo.applicant_gender = #{applicantGender}
            </if>
            <if test="applicantHomeaddr != null  and applicantHomeaddr != ''">and eo.applicant_homeaddr =
                #{applicantHomeaddr}
            </if>
            <if test="applicantPhone != null  and applicantPhone != ''">and eo.applicant_phone = #{applicantPhone}</if>
            <if test="applicantGrid != null  and applicantGrid != ''">and eo.applicant_grid = #{applicantGrid}</if>
            <if test="applicantDistrict != null  and applicantDistrict != ''">and eo.applicant_district =
                #{applicantDistrict}
            </if>
            <if test="sceneAddr != null  and sceneAddr != ''">and eo.scene_addr = #{sceneAddr}</if>
            <if test="sceneAddrGrid != null  and sceneAddrGrid != ''">and eo.scene_addr_grid = #{sceneAddrGrid}</if>
            <if test="sceneDistrict != null  and sceneDistrict != ''">and eo.scene_district = #{sceneDistrict}</if>
            <if test="scenePlace != null  and scenePlace != ''">and eo.scene_place = #{scenePlace}</if>
            <if test="sceneGeoLat != null ">and eo.scene_geo_lat = #{sceneGeoLat}</if>
            <if test="sceneGeoLng != null ">and eo.scene_geo_lng = #{sceneGeoLng}</if>
            <if test="sceneAddrCor != null  and sceneAddrCor != ''">and eo.scene_addr_cor = #{sceneAddrCor}</if>
            <if test="sceneGeoLatCor != null ">and eo.scene_geo_lat_cor = #{sceneGeoLatCor}</if>
            <if test="sceneGeoLngCor != null ">and eo.scene_geo_lng_cor = #{sceneGeoLngCor}</if>
            <if test="isSecret != null  and isSecret != ''">and eo.is_secret = #{isSecret}</if>
            <if test="isRepeat != null  and isRepeat != ''">and eo.is_repeat = #{isRepeat}</if>
            <if test="issueType != null  and issueType != ''">and eo.issue_type = #{issueType}</if>
            <if test="issueClazz != null  and issueClazz != ''">and eo.issue_clazz = #{issueClazz}</if>
            <if test="issueLevel != null  and issueLevel != ''">and eo.issue_level = #{issueLevel}</if>
            <if test="deadline != null ">and eo.deadline = #{deadline}</if>
            <if test="linkOrders != null  and linkOrders != ''">and eo.link_orders = #{linkOrders}</if>
            <if test="linkOrdersCode != null  and linkOrdersCode != ''">and eo.link_orders_code = #{linkOrdersCode}</if>
            <if test="wikiRef != null  and wikiRef != ''">and eo.wiki_ref = #{wikiRef}</if>
            <if test="acptOrgCode != null  and acptOrgCode != ''">and eo.acpt_org_code = #{acptOrgCode}</if>
            <if test="acptOrgName != null  and acptOrgName != ''">and eo.acpt_org_name = #{acptOrgName}</if>
            <if test="handleWay != null  and handleWay != ''">and eo.handle_way = #{handleWay}</if>
            <if test="externalHandleWay != null  and externalHandleWay != ''">and eo.external_handle_way =
                #{externalHandleWay}
            </if>
            <if test="directFeed != null  and directFeed != ''">and eo.direct_feed = #{directFeed}</if>
            <if test="directFeedHandler != null  and directFeedHandler != ''">and eo.direct_feed_handler =
                #{directFeedHandler}
            </if>
            <if test="directFeedTime != null ">and eo.direct_feed_time = #{directFeedTime}</if>
            <if test="images != null  and images != ''">and eo.images = #{images}</if>
            <if test="flagVaild != null  and flagVaild != ''">and eo.flag_vaild = #{flagVaild}</if>
            <if test="invalidNote != null  and invalidNote != ''">and eo.invalid_note = #{invalidNote}</if>
            <if test="invalidTime != null ">and eo.invalid_time = #{invalidTime}</if>
            <if test="invalidUserName != null  and invalidUserName != ''">and eo.invalid_user_name = #{invalidUserName}
            </if>
            <if test="status != null  and status != ''">and eo.status = #{status}</if>
            <if test="tagApply != null  and tagApply != ''">and eo.tag_apply = #{tagApply}</if>
            <if test="tagDelay != null  and tagDelay != ''">and eo.tag_delay = #{tagDelay}</if>
            <if test="tagDoing != null  and tagDoing != ''">and eo.tag_doing = #{tagDoing}</if>
            <if test="tagResp != null  and tagResp != ''">and eo.tag_resp = #{tagResp}</if>
            <if test="tagDone != null  and tagDone != ''">and eo.tag_done = #{tagDone}</if>
            <if test="tagCheck != null  and tagCheck != ''">and eo.tag_check = #{tagCheck}</if>
            <if test="tagChkTel != null  and tagChkTel != ''">and eo.tag_chk_tel = #{tagChkTel}</if>
            <if test="tagRedo != null  and tagRedo != ''">and eo.tag_redo = #{tagRedo}</if>
        </where>
    </select>
    <select id="selectEcDispatchCount" parameterType="org.springblade.modules.eCallEventTwo.dto.EcDispatchDTO"
            resultType="java.lang.Integer">
        SELECT
        COUNT(
        DISTINCT ( eo.order_id ))
        FROM
        ec_dispatch ed
        LEFT JOIN ec_order eo ON eo.order_id = ed.order_id
        <where>
            <if test="tagMain != null and tagMain != ''">and ed.tag_main = #{tagMain}</if>
            <if test="objectOrgCode != null and objectOrgCode != ''">and ed.object_org_code = #{objectOrgCode}</if>
            <if test="sinkOrgCode != null and sinkOrgCode != ''">and ed.sink_org_code = #{sinkOrgCode}</if>
            <if test="startTime != null and endTime != null">and ed.dispatch_time BETWEEN #{startTime} AND #{endTime}
            </if>
            <if test="dispatchId != null ">and dispatch_id = #{dispatchId}</if>
            <if test="orderId != null ">and order_id = #{orderId}</if>
            <if test="dispatchCode != null  and dispatchCode != ''">and dispatch_code = #{dispatchCode}</if>
            <if test="dispatchTime != null ">and dispatch_time = #{dispatchTime}</if>
            <if test="dispatchNote != null  and dispatchNote != ''">and dispatch_note = #{dispatchNote}</if>
            <if test="dispatchImages != null  and dispatchImages != ''">and dispatch_images = #{dispatchImages}</if>
            <if test="subjectOrgCode != null  and subjectOrgCode != ''">and subject_org_code = #{subjectOrgCode}</if>
            <if test="subjectOrgName != null  and subjectOrgName != ''">and subject_org_name = #{subjectOrgName}</if>
            <if test="subjectUserName != null  and subjectUserName != ''">and subject_user_name = #{subjectUserName}
            </if>
            <if test="subjectUserCnname != null  and subjectUserCnname != ''">and subject_user_cnname =
                #{subjectUserCnname}
            </if>
            <if test="objectOrgCode != null  and objectOrgCode != ''">and object_org_code = #{objectOrgCode}</if>
            <if test="objectOrgName != null  and objectOrgName != ''">and object_org_name = #{objectOrgName}</if>
            <if test="sinkOrgCode != null  and sinkOrgCode != ''">and sink_org_code = #{sinkOrgCode}</if>
            <if test="sinkOrgName != null  and sinkOrgName != ''">and sink_org_name = #{sinkOrgName}</if>
            <if test="tagMain != null  and tagMain != ''">and tag_main = #{tagMain}</if>
            <if test="tagCc != null  and tagCc != ''">and tag_cc = #{tagCc}</if>
            <if test="tagCti != null  and tagCti != ''">and tag_cti = #{tagCti}</if>
            <if test="tagTrans != null  and tagTrans != ''">and tag_trans = #{tagTrans}</if>
            <if test="upDispatchId != null ">and up_dispatch_id = #{upDispatchId}</if>
            <if test="ackOrgCode != null  and ackOrgCode != ''">and ack_org_code = #{ackOrgCode}</if>
            <if test="ackOrgName != null  and ackOrgName != ''">and ack_org_name = #{ackOrgName}</if>
            <if test="ackUserName != null  and ackUserName != ''">and ack_user_name = #{ackUserName}</if>
            <if test="ackUserCnname != null  and ackUserCnname != ''">and ack_user_cnname = #{ackUserCnname}</if>
            <if test="ackTime != null ">and ack_time = #{ackTime}</if>
            <if test="rejectUserName != null  and rejectUserName != ''">and reject_user_name = #{rejectUserName}</if>
            <if test="rejectUserCnname != null  and rejectUserCnname != ''">and reject_user_cnname =
                #{rejectUserCnname}
            </if>
            <if test="rejectOrgCode != null  and rejectOrgCode != ''">and reject_org_code = #{rejectOrgCode}</if>
            <if test="rejectOrgName != null  and rejectOrgName != ''">and reject_org_name = #{rejectOrgName}</if>
            <if test="rejectTime != null ">and reject_time = #{rejectTime}</if>
            <if test="rejectNote != null  and rejectNote != ''">and reject_note = #{rejectNote}</if>
            <if test="rejectImages != null  and rejectImages != ''">and reject_images = #{rejectImages}</if>
            <if test="tagReject != null  and tagReject != ''">and tag_reject = #{tagReject}</if>
            <if test="rejectType != null  and rejectType != ''">and reject_type = #{rejectType}</if>
        </where>
    </select>
    <select id="selectEcHandleCount" parameterType="org.springblade.modules.eCallEventTwo.dto.EcHandleDTO"
            resultType="java.lang.Integer">
        SELECT
        COUNT(DISTINCT(eo.order_id))
        FROM
        ec_handle eh
        LEFT JOIN ec_order eo on eh.order_id = eo.order_id
        LEFT JOIN ec_dispatch ed ON eo.order_id = ed.order_id
        <where>
            <if test="tagMain != null and tagMain != ''">and ed.tag_main = #{tagMain}</if>
            <if test="objectOrgCode != null and objectOrgCode != ''">and ed.object_org_code = #{objectOrgCode}</if>
            <if test="sinkOrgCode != null and sinkOrgCode != ''">and ed.sink_org_code = #{sinkOrgCode}</if>
            <if test="startTime != null and endTime != null">and eh.remote_hdl_time BETWEEN #{startTime} AND
                #{endTime}
            </if>
            <if test="handleId != null ">and handle_id = #{handleId}</if>
            <if test="orderId != null ">and order_id = #{orderId}</if>
            <if test="dispatchId != null ">and dispatch_id = #{dispatchId}</if>
            <if test="handleCode != null  and handleCode != ''">and handle_code = #{handleCode}</if>
            <if test="hdlOrgCode != null  and hdlOrgCode != ''">and hdl_org_code = #{hdlOrgCode}</if>
            <if test="hdlOrgName != null  and hdlOrgName != ''">and hdl_org_name = #{hdlOrgName}</if>
            <if test="arriveLoc != null  and arriveLoc != ''">and arrive_loc = #{arriveLoc}</if>
            <if test="arriveLocLat != null ">and arrive_loc_lat = #{arriveLocLat}</if>
            <if test="arriveLocLng != null ">and arrive_loc_lng = #{arriveLocLng}</if>
            <if test="arriveBizTime != null ">and arrive_biz_time = #{arriveBizTime}</if>
            <if test="remoteHdlTime != null ">and remote_hdl_time = #{remoteHdlTime}</if>
            <if test="remoteHdlNote != null  and remoteHdlNote != ''">and remote_hdl_note = #{remoteHdlNote}</if>
            <if test="remoteHdlImages != null  and remoteHdlImages != ''">and remote_hdl_images = #{remoteHdlImages}
            </if>
            <if test="nosopHdlNote != null  and nosopHdlNote != ''">and nosop_hdl_note = #{nosopHdlNote}</if>
            <if test="nosopHdlImages != null  and nosopHdlImages != ''">and nosop_hdl_images = #{nosopHdlImages}</if>
            <if test="limitTime != null ">and limit_time = #{limitTime}</if>
            <if test="delayTime != null ">and delay_time = #{delayTime}</if>
            <if test="tagHdlDoing != null  and tagHdlDoing != ''">and tag_hdl_doing = #{tagHdlDoing}</if>
        </where>
    </select>
    <select id="selectEcOrderCheckCount" parameterType="org.springblade.modules.eCallEventTwo.dto.EcOrderCheckDTO"
            resultType="java.lang.Integer">
        SELECT
        COUNT(DISTINCT(eo.order_id))
        FROM
        ec_order_check eoc
        LEFT JOIN ec_order eo on eoc.order_id = eo.order_id
        LEFT JOIN ec_dispatch ed ON eo.order_id = ed.order_id
        LEFT JOIN ec_order_check_tel eoct on eoct.order_id = eo.order_id
        <where>
            <if test="tagMain != null and tagMain != ''">and ed.tag_main = #{tagMain}</if>
            <if test="objectOrgCode != null and objectOrgCode != ''">and ed.object_org_code = #{objectOrgCode}</if>
            <if test="sinkOrgCode != null and sinkOrgCode != ''">and ed.sink_org_code = #{sinkOrgCode}</if>
            <if test="startTime != null and endTime != null">and eoct.chk_time BETWEEN #{startTime} AND #{endTime}</if>
            <if test="orderId != null ">and order_id = #{orderId}</if>
            <if test="checkCode != null  and checkCode != ''">and check_code = #{checkCode}</if>
            <if test="checkOrgCode != null  and checkOrgCode != ''">and check_org_code = #{checkOrgCode}</if>
            <if test="checkOrgName != null  and checkOrgName != ''">and check_org_name = #{checkOrgName}</if>
            <if test="limitStartTime != null ">and limit_start_time = #{limitStartTime}</if>
            <if test="limitEndTime != null ">and limit_end_time = #{limitEndTime}</if>
        </where>
    </select>
    <select id="selectEcOrderDoneCount" parameterType="org.springblade.modules.eCallEventTwo.dto.EcOrderDoneDTO"
            resultType="java.lang.Integer">
        SELECT
        COUNT(DISTINCT(eo.order_id))
        FROM
        ec_order_done eod
        LEFT JOIN ec_order eo on eod.order_id = eo.order_id
        LEFT JOIN ec_dispatch ed ON eo.order_id = ed.order_id
        <where>
            <if test="tagMain != null and tagMain != ''">and ed.tag_main = #{tagMain}</if>
            <if test="objectOrgCode != null and objectOrgCode != ''">and ed.object_org_code = #{objectOrgCode}</if>
            <if test="sinkOrgCode != null and sinkOrgCode != ''">and ed.sink_org_code = #{sinkOrgCode}</if>
            <if test="startTime != null and endTime != null">and eod.first_done_apply_time BETWEEN #{startTime} AND
                #{endTime}
            </if>
            <if test="orderId != null ">and order_id = #{orderId}</if>
            <if test="doneCode != null  and doneCode != ''">and done_code = #{doneCode}</if>
            <if test="firstDoneApplyTime != null ">and first_done_apply_time = #{firstDoneApplyTime}</if>
            <if test="firstDoneAuditYesTime != null ">and first_done_audit_yes_time = #{firstDoneAuditYesTime}</if>
        </where>
    </select>
    <select id="selectEcOrderRespCount" parameterType="org.springblade.modules.eCallEventTwo.dto.EcOrderRespDTO"
            resultType="java.lang.Integer">
        SELECT
        COUNT(DISTINCT(eo.order_id))
        FROM
        ec_order_resp eor
        LEFT JOIN ec_order eo on eor.order_id = eo.order_id
        LEFT JOIN ec_dispatch ed ON eo.order_id = ed.order_id
        LEFT JOIN ec_order_resp_log eorl on eorl.order_id = eor.order_id
        <where>
            <if test="tagMain != null and tagMain != ''">and ed.tag_main = #{tagMain}</if>
            <if test="objectOrgCode != null and objectOrgCode != ''">and ed.object_org_code = #{objectOrgCode}</if>
            <if test="sinkOrgCode != null and sinkOrgCode != ''">and ed.sink_org_code = #{sinkOrgCode}</if>
            <if test="startTime != null and endTime != null">and eorl.resp_time BETWEEN #{startTime} AND #{endTime}</if>
            <if test="orderId != null ">and order_id = #{orderId}</if>
            <if test="respCode != null  and respCode != ''">and resp_code = #{respCode}</if>
        </where>
    </select>
    <select id="selectEcOrderReviewCount" parameterType="org.springblade.modules.eCallEventTwo.dto.EcOrderReviewDTO"
            resultType="java.lang.Integer">
        SELECT
        COUNT(DISTINCT(eo.order_id))
        FROM
        ec_order_review eor
        LEFT JOIN ec_order eo on eor.order_id = eo.order_id
        LEFT JOIN ec_dispatch ed ON eo.order_id = ed.order_id
        <where>
            <if test="tagMain != null and tagMain != ''">and ed.tag_main = #{tagMain}</if>
            <if test="objectOrgCode != null and objectOrgCode != ''">and ed.object_org_code = #{objectOrgCode}</if>
            <if test="sinkOrgCode != null and sinkOrgCode != ''">and ed.sink_org_code = #{sinkOrgCode}</if>
            <if test="startTime != null and endTime != null">and eor.review_time BETWEEN #{startTime} AND #{endTime}
            </if>
            <if test="orderId != null ">and order_id = #{orderId}</if>
            <if test="reviewCode != null  and reviewCode != ''">and review_code = #{reviewCode}</if>
            <if test="orderCode != null  and orderCode != ''">and order_code = #{orderCode}</if>
            <if test="telChkId != null ">and tel_chk_id = #{telChkId}</if>
            <if test="reviewTime != null ">and review_time = #{reviewTime}</if>
            <if test="reviewUserCnname != null  and reviewUserCnname != ''">and review_user_cnname =
                #{reviewUserCnname}
            </if>
            <if test="reviewUserName != null  and reviewUserName != ''">and review_user_name = #{reviewUserName}</if>
            <if test="reviewUserPhone != null  and reviewUserPhone != ''">and review_user_phone = #{reviewUserPhone}
            </if>
            <if test="reviewOrgCode != null  and reviewOrgCode != ''">and review_org_code = #{reviewOrgCode}</if>
            <if test="reviewOrgName != null  and reviewOrgName != ''">and review_org_name = #{reviewOrgName}</if>
            <if test="reviewIssuer != null  and reviewIssuer != ''">and review_issuer = #{reviewIssuer}</if>
            <if test="reviewIssuerPhone != null  and reviewIssuerPhone != ''">and review_issuer_phone =
                #{reviewIssuerPhone}
            </if>
            <if test="reviewNote != null  and reviewNote != ''">and review_note = #{reviewNote}</if>
            <if test="reviewYesno != null  and reviewYesno != ''">and review_yesno = #{reviewYesno}</if>
            <if test="reviewImages != null  and reviewImages != ''">and review_images = #{reviewImages}</if>
            <if test="ctiVoiceRecordId != null  and ctiVoiceRecordId != ''">and cti_voice_record_id =
                #{ctiVoiceRecordId}
            </if>
            <if test="ctiVoiceRecordUrl != null  and ctiVoiceRecordUrl != ''">and cti_voice_record_url =
                #{ctiVoiceRecordUrl}
            </if>
            <if test="redoOrgCode != null  and redoOrgCode != ''">and redo_org_code = #{redoOrgCode}</if>
            <if test="redoOrgName != null  and redoOrgName != ''">and redo_org_name = #{redoOrgName}</if>
            <if test="redoUserName != null  and redoUserName != ''">and redo_user_name = #{redoUserName}</if>
            <if test="redoUserCnname != null  and redoUserCnname != ''">and redo_user_cnname = #{redoUserCnname}</if>
            <if test="redoTime != null ">and redo_time = #{redoTime}</if>
            <if test="redoNote != null  and redoNote != ''">and redo_note = #{redoNote}</if>
            <if test="redoImages != null  and redoImages != ''">and redo_images = #{redoImages}</if>
        </where>
    </select>
    <select id="selectEcOrderSuperviseCount"
            parameterType="org.springblade.modules.eCallEventTwo.dto.EcOrderSuperviseDTO"
            resultType="java.lang.Integer">
        SELECT
        COUNT(DISTINCT(eo.order_id))
        FROM
        ec_order_supervise eos
        LEFT JOIN ec_order eo on eos.order_id = eo.order_id
        LEFT JOIN ec_dispatch ed ON eo.order_id = ed.order_id
        <where>
            <if test="tagMain != null and tagMain != ''">and ed.tag_main = #{tagMain}</if>
            <if test="objectOrgCode != null and objectOrgCode != ''">and ed.object_org_code = #{objectOrgCode}</if>
            <if test="sinkOrgCode != null and sinkOrgCode != ''">and ed.sink_org_code = #{sinkOrgCode}</if>
            <if test="startTime != null and endTime != null">and eos.supervise_time BETWEEN #{startTime} AND
                #{endTime}
            </if>
            <if test="orderId != null ">and order_id = #{orderId}</if>
            <if test="superviseCode != null  and superviseCode != ''">and supervise_code = #{superviseCode}</if>
            <if test="orderCode != null  and orderCode != ''">and order_code = #{orderCode}</if>
            <if test="telChkId != null ">and tel_chk_id = #{telChkId}</if>
            <if test="superviseTime != null ">and supervise_time = #{superviseTime}</if>
            <if test="supervisorName != null  and supervisorName != ''">and supervisor_name = #{supervisorName}</if>
            <if test="supervisorCnname != null  and supervisorCnname != ''">and supervisor_cnname =
                #{supervisorCnname}
            </if>
            <if test="superviseNote != null  and superviseNote != ''">and supervise_note = #{superviseNote}</if>
            <if test="superviseImages != null  and superviseImages != ''">and supervise_images = #{superviseImages}</if>
            <if test="supervisorOrgCode != null  and supervisorOrgCode != ''">and supervisor_org_code =
                #{supervisorOrgCode}
            </if>
            <if test="supervisorOrgName != null  and supervisorOrgName != ''">and supervisor_org_name =
                #{supervisorOrgName}
            </if>
            <if test="redoOrgCode != null  and redoOrgCode != ''">and redo_org_code = #{redoOrgCode}</if>
            <if test="redoOrgName != null  and redoOrgName != ''">and redo_org_name = #{redoOrgName}</if>
            <if test="redoUserName != null  and redoUserName != ''">and redo_user_name = #{redoUserName}</if>
            <if test="redoUserCnname != null  and redoUserCnname != ''">and redo_user_cnname = #{redoUserCnname}</if>
            <if test="redoTime != null ">and redo_time = #{redoTime}</if>
            <if test="redoNote != null  and redoNote != ''">and redo_note = #{redoNote}</if>
            <if test="redoImages != null  and redoImages != ''">and redo_images = #{redoImages}</if>
        </where>
    </select>