select
*
from contract_manage
where
del_flag = 1
and create_by_name like concat('%', #{createByName}, '%')
and update_by_name like concat('%', #{updateByName}, '%')
and top_organization_id = #{topOrganizationId}
and organization_id = #{organizationId}
and organization_name like concat('%', #{organizationName}, '%')
and contract_number = #{contractNumber}
and contract_name like concat('%', #{contractName}, '%')
and common_contract_flag = #{commonContractFlag}
and contract_type = #{contractType}
and contract_state = #{contractState}
and signing_unit = #{signingUnit}
and settlement_customers = #{settlementCustomers}
and settlement_customers_id = #{settlementCustomersId}
and settlement_customers_code = #{settlementCustomersCode}
and our_identity = #{ourIdentity}
and accounting_period = #{accountingPeriod}
and signing_date = #{signingDate}
and effective_date = #{effectiveDate}
and expiration_date = #{expirationDate}
and contract_original_url = #{contractOriginalUrl}
and integrity_agreement_url = #{integrityAgreementUrl}
and security_protocol_url = #{securityProtocolUrl}
and other_attachments_url = #{otherAttachmentsUrl}
and our_singed = #{ourSinged}
and our_singed_phone = #{ourSingedPhone}
and our_operator = #{ourOperator}
and our_operator_phone = #{ourOperatorPhone}
and they_singed = #{theySinged}
and they_singed_phone = #{theySingedPhone}
and they_operator = #{theyOperator}
and they_operator_phone = #{theyOperatorPhone}
and contract_number like concat('%', #{contractManageDO.contractNumber}, '%')
and original_contract_number like concat('%', #{contractManageDO.originalContractNumber}, '%')
and common_contract_flag = #{contractManageDO.commonContractFlag}
and contract_type = #{contractManageDO.contractType}
and settlement_customers like concat('%', #{contractManageDO.settlementCustomers}, '%')
and settlement_customers_code = #{contractManageDO.settlementCustomersCode}
and signing_unit like concat('%', #{contractManageDO.signingUnit}, '%')
and contract_name like concat('%', #{contractManageDO.contractName}, '%')
and contract_state = #{contractManageDO.contractState}
AND date_format(signing_date,'%Y-%m-%d') =]]> #{contractManageDO.signingDateStart}
AND date_format(signing_date,'%Y-%m-%d') #{contractManageDO.signingDateEnd}
AND date_format(effective_date,'%Y-%m-%d') =]]> #{contractManageDO.effectiveDateStart}
AND date_format(effective_date,'%Y-%m-%d') #{contractManageDO.effectiveDateEnd}
AND date_format(expiration_date,'%Y-%m-%d') =]]> #{contractManageDO.expirationDateStart}
AND date_format(expiration_date,'%Y-%m-%d') #{contractManageDO.expirationDateEnd}
AND (
date_format(effective_date,'%Y-%m-%d') =]]> #{contractManageDO.effectiveDateString}
OR date_format(expiration_date,'%Y-%m-%d') #{contractManageDO.expirationDateString}
)
AND (
date_format(expiration_date,'%Y-%m-%d') =]]> #{contractManageDO.nowDateString}
AND date_format(effective_date,'%Y-%m-%d') #{contractManageDO.nowDateString}
)
and organization_id = #{contractManageDO.organizationId}
and top_organization_id = #{contractManageDO.topOrganizationId}