FundCoordinationMapper.xml 3.84 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" property="orderingUnit"/>
        <result column="customer_short_id" property="customerShortId"/>
        <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="requirement_specification" property="requirementSpecification"/>
        <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,
            tb.customer_short_id,
            cs.short_name AS customer_short_name,
            tb.customer_type,
            tb.unlimited_guarantee_letter,
            tb.settlement_period,
            tb.credit_limit,
            tb.order_date,
            tb.order_quantity,
            tb.requirement_specification,
            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 base_data_customer_short cs on cs.id = tb.customer_short_id
        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.orderingUnit != null and vo.orderingUnit != ''">
                AND tb.ordering_unit LIKE CONCAT('%', #{vo.orderingUnit})
            </if>
            <if test="vo.shortName != null and vo.shortName != ''">
                AND cs.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>