FundCoordinationMapper.xml 6.47 KB
<?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.lframework.xingyun.sc.mappers.FundCoordinationMapper">

    <resultMap id="FundCoordination" type="com.lframework.xingyun.sc.entity.FundCoordination">
        <id column="id" property="id"/>
        <result column="applicant" property="applicant"/>
        <result column="applicant_name" property="applicantName"/>
        <result column="fund_responsible_person" property="fundResponsiblePerson"/>
        <result column="dept_and_role" property="deptAndRole"/>
        <result column="application_date" property="applicationDate"/>
        <result column="ordering_unit_name" property="orderingUnitName"/>
        <result column="customer_short_name" property="customerShortName"/>
        <result column="customer_type" property="customerType"/>
        <result column="unlimited_guarantee_letter" property="unlimitedGuaranteeLetter"/>
        <result column="settlement_period" property="settlementPeriod"/>
        <result column="credit_limit" property="creditLimit"/>
        <result column="order_date" property="orderDate"/>
        <result column="order_quantity" property="orderQuantity"/>
        <result column="total_accounts_receivable" property="totalAccountsReceivable"/>
        <result column="overdue_receivables" property="overdueReceivables"/>
        <result column="agreed_internal_receivables" property="agreedInternalReceivables"/>
        <result column="requirement_specification" property="requirementSpecification"/>
        <result column="office_clerk" property="officeClerk"/>
        <result column="office_clerk_opinion" property="officeClerkOpinion"/>
        <result column="office_supervisor" property="officeSupervisor"/>
        <result column="office_supervisor_opinion" property="officeSupervisorOpinion"/>
        <result column="marketing_deputy_director" property="marketingDeputyDirector"/>
        <result column="marketing_deputy_director_opinion" property="marketingDeputyDirectorOpinion"/>
        <result column="fund_management_operation_department" property="fundManagementOperationDepartment"/>
        <result column="fund_management_operation_department_opinion" property="fundManagementOperationDepartmentOpinion"/>
        <result column="operations_department_supervisor" property="operationsDepartmentSupervisor"/>
        <result column="operations_department_supervisor_opinion" property="operationsDepartmentSupervisorOpinion"/>
        <result column="marketing_department_manager" property="marketingDepartmentManager"/>
        <result column="marketing_department_manager_opinion" property="marketingDepartmentManagerOpinion"/>
        <result column="finance_department" property="financeDepartment"/>
        <result column="finance_department_opinion" property="financeDepartmentOpinion"/>
        <result column="marketing_center_supervisor" property="marketingCenterSupervisor"/>
        <result column="marketing_center_supervisor_opinion" property="marketingCenterSupervisorOpinion"/>
        <result column="general_manager" property="generalManager"/>
        <result column="general_manager_opinion" property="generalManagerOpinion"/>
        <result column="create_by_id" property="createById"/>
        <result column="create_by" property="createBy"/>
        <result column="update_by_id" property="updateById"/>
        <result column="update_by" property="updateBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <sql id="FundCoordination_sql">
        SELECT
            tb.id,
            tb.applicant,
            u.name AS applicant_name,
            tb.fund_responsible_person,
            tb.dept_and_role,
            tb.application_date,
            tb.ordering_unit_name,
            tb.customer_short_name,
            tb.customer_type,
            tb.unlimited_guarantee_letter,
            tb.settlement_period,
            tb.credit_limit,
            tb.order_date,
            tb.order_quantity,
            tb.total_accounts_receivable,
            tb.overdue_receivables,
            tb.agreed_internal_receivables,
            tb.requirement_specification,
            tb.office_clerk,
            tb.office_clerk_opinion,
            tb.office_supervisor,
            tb.office_supervisor_opinion,
            tb.marketing_deputy_director,
            tb.marketing_deputy_director_opinion,
            tb.fund_management_operation_department,
            tb.fund_management_operation_department_opinion,
            tb.operations_department_supervisor,
            tb.operations_department_supervisor_opinion,
            tb.marketing_department_manager,
            tb.marketing_department_manager_opinion,
            tb.finance_department,
            tb.finance_department_opinion,
            tb.marketing_center_supervisor,
            tb.marketing_center_supervisor_opinion,
            tb.general_manager,
            tb.general_manager_opinion,
            tb.create_by_id,
            tb.create_by,
            tb.update_by_id,
            tb.update_by,
            tb.create_time,
            tb.update_time
        FROM fund_coordination AS tb
        left join sys_user u on u.id = tb.applicant
    </sql>

    <select id="query" resultMap="FundCoordination">
        <include refid="FundCoordination_sql"/>
        <where>
            <if test="vo.applicationDateStart != null and vo.applicationDateStart != ''">
                AND tb.application_date >= #{vo.applicationDateStart}
            </if>
            <if test="vo.applicationDateEnd != null and vo.applicationDateEnd != ''">
                <![CDATA[
                AND tb.application_date <= #{vo.applicationDateEnd}
                ]]>
            </if>
            <if test="vo.orderingUnitName != null and vo.orderingUnitName != ''">
                AND tb.ordering_unit_name LIKE CONCAT('%', #{vo.orderingUnitName}, '%')
            </if>
            <if test="vo.shortName != null and vo.shortName != ''">
                AND tb.customer_short_name LIKE CONCAT('%', #{vo.shortName}, '%')
            </if>
        </where>
        ORDER BY tb.create_time DESC
    </select>

    <select id="findById" resultType="com.lframework.xingyun.sc.entity.FundCoordination">
        <include refid="FundCoordination_sql"/>
        <where>
            <if test="id != null and id != ''">
                AND tb.id = #{id}
            </if>
        </where>
    </select>
</mapper>