Files
nanguangszwlback/mhd-modules/mhd-system/src/main/resources/mapper/basic/ContractManageMapper.xml
T

203 lines
9.2 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mhd.basic.domain.contractManage.repository.mapper.ContractManageMapper">
<sql id="selectContractManagePo">
select
*
from contract_manage
where
del_flag = 1
</sql>
<sql id="selectContractManagePo1">
<where>
<if test="createByName != null and createByName != ''">
and create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="contractNumber != null and contractNumber != ''">
and contract_number = #{contractNumber}
</if>
<if test="contractName != null and contractName != ''">
and contract_name like concat('%', #{contractName}, '%')
</if>
<if test="commonContractFlag != null ">
and common_contract_flag = #{commonContractFlag}
</if>
<if test="contractType != null ">
and contract_type = #{contractType}
</if>
<if test="contractState != null ">
and contract_state = #{contractState}
</if>
<if test="signingUnit != null and signingUnit != ''">
and signing_unit = #{signingUnit}
</if>
<if test="settlementCustomers != null and settlementCustomers != ''">
and settlement_customers = #{settlementCustomers}
</if>
<if test="settlementCustomersId != null ">
and settlement_customers_id = #{settlementCustomersId}
</if>
<if test="settlementCustomersCode != null and settlementCustomersCode != ''">
and settlement_customers_code = #{settlementCustomersCode}
</if>
<if test="ourIdentity != null ">
and our_identity = #{ourIdentity}
</if>
<if test="accountingPeriod != null ">
and accounting_period = #{accountingPeriod}
</if>
<if test="signingDate != null ">
and signing_date = #{signingDate}
</if>
<if test="effectiveDate != null ">
and effective_date = #{effectiveDate}
</if>
<if test="expirationDate != null ">
and expiration_date = #{expirationDate}
</if>
<if test="contractOriginalUrl != null and contractOriginalUrl != ''">
and contract_original_url = #{contractOriginalUrl}
</if>
<if test="integrityAgreementUrl != null and integrityAgreementUrl != ''">
and integrity_agreement_url = #{integrityAgreementUrl}
</if>
<if test="securityProtocolUrl != null and securityProtocolUrl != ''">
and security_protocol_url = #{securityProtocolUrl}
</if>
<if test="otherAttachmentsUrl != null and otherAttachmentsUrl != ''">
and other_attachments_url = #{otherAttachmentsUrl}
</if>
<if test="ourSinged != null and ourSinged != ''">
and our_singed = #{ourSinged}
</if>
<if test="ourSingedPhone != null and ourSingedPhone != ''">
and our_singed_phone = #{ourSingedPhone}
</if>
<if test="ourOperator != null and ourOperator != ''">
and our_operator = #{ourOperator}
</if>
<if test="ourOperatorPhone != null and ourOperatorPhone != ''">
and our_operator_phone = #{ourOperatorPhone}
</if>
<if test="theySinged != null and theySinged != ''">
and they_singed = #{theySinged}
</if>
<if test="theySingedPhone != null and theySingedPhone != ''">
and they_singed_phone = #{theySingedPhone}
</if>
<if test="theyOperator != null and theyOperator != ''">
and they_operator = #{theyOperator}
</if>
<if test="theyOperatorPhone != null and theyOperatorPhone != ''">
and they_operator_phone = #{theyOperatorPhone}
</if>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.basic.domain.contractManage.repository.todo.ContractManageDO"
resultType="com.mhd.basic.domain.contractManage.repository.po.ContractManagePO">
<include refid="selectContractManagePo"/>
<include refid="common_where"/>
order by create_time desc
</select>
<select id="queryEffectiveList" resultType="com.mhd.basic.domain.contractManage.repository.po.ContractManagePO" parameterType="com.mhd.basic.domain.contractManage.repository.todo.ContractManageDO">
select
*
from contract_manage
where
del_flag = 1
</select>
<sql id="common_where">
<if test="contractManageDO.contractNumber != null and contractManageDO.contractNumber != ''">
and contract_number like concat('%', #{contractManageDO.contractNumber}, '%')
</if>
<if test="contractManageDO.originalContractNumber != null and contractManageDO.originalContractNumber != ''">
and original_contract_number like concat('%', #{contractManageDO.originalContractNumber}, '%')
</if>
<if test="contractManageDO.commonContractFlag != null">
and common_contract_flag = #{contractManageDO.commonContractFlag}
</if>
<if test="contractManageDO.contractType != null">
and contract_type = #{contractManageDO.contractType}
</if>
<if test="contractManageDO.settlementCustomers != null">
and settlement_customers like concat('%', #{contractManageDO.settlementCustomers}, '%')
</if>
<if test="contractManageDO.settlementCustomersCode != null">
and settlement_customers_code = #{contractManageDO.settlementCustomersCode}
</if>
<if test="contractManageDO.signingUnit != null and contractManageDO.signingUnit != ''">
and signing_unit like concat('%', #{contractManageDO.signingUnit}, '%')
</if>
<if test="contractManageDO.contractName != null and contractManageDO.contractName != ''">
and contract_name like concat('%', #{contractManageDO.contractName}, '%')
</if>
<if test="contractManageDO.contractState != null">
and contract_state = #{contractManageDO.contractState}
</if>
<if test="contractManageDO.signingDateStart != null and contractManageDO.signingDateStart != ''">
AND date_format(signing_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.signingDateStart}
</if>
<if test="contractManageDO.signingDateEnd != null and contractManageDO.signingDateEnd != ''">
AND date_format(signing_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.signingDateEnd}
</if>
<if test="contractManageDO.effectiveDateStart != null and contractManageDO.effectiveDateStart != ''">
AND date_format(effective_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.effectiveDateStart}
</if>
<if test="contractManageDO.effectiveDateEnd != null and contractManageDO.effectiveDateEnd != ''">
AND date_format(effective_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.effectiveDateEnd}
</if>
<if test="contractManageDO.expirationDateStart != null and contractManageDO.expirationDateStart != ''">
AND date_format(expiration_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.expirationDateStart}
</if>
<if test="contractManageDO.expirationDateEnd != null and contractManageDO.expirationDateEnd != ''">
AND date_format(expiration_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.expirationDateEnd}
</if>
<if test="contractManageDO.effectiveDateString != null and contractManageDO.effectiveDateString != ''
and contractManageDO.expirationDateString != null and contractManageDO.expirationDateString != ''">
AND (
date_format(effective_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.effectiveDateString}
OR date_format(expiration_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.expirationDateString}
)
</if>
<if test="contractManageDO.nowDateString != null and contractManageDO.nowDateString != ''">
AND (
date_format(expiration_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.nowDateString}
AND date_format(effective_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.nowDateString}
)
</if>
<if test="contractManageDO.organizationId != null">
and organization_id = #{contractManageDO.organizationId}
</if>
<if test="contractManageDO.topOrganizationId != null">
and top_organization_id = #{contractManageDO.topOrganizationId}
</if>
</sql>
</mapper>