ServiceCompanyFilesMapper.xml 954 Bytes
<?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.subsidy.mapper.ServiceCompanyFilesMapper">

    <select id="companyFiles" resultType="com.subsidy.model.ServiceCompanyFilesDO">
        SELECT
        *
        FROM
        service_company_files t
        left join service_company_mapping t2 on t2.id = t.service_company_id
        WHERE
        t.delete_date IS NULL
        and t2.delete_date is null
        <if test="companyId != null and companyId != ''">
            AND t2.company_id = #{companyId}
        </if>
        <if test="serviceId != null and serviceId != ''">
            and t2.service_id = #{serviceId}
        </if>
        <if test="fileName != null and fileName != ''">
            AND t.file_name  like concat('%',#{fileName} ,'%')
        </if>
        and t.file_type = #{fileType}
    </select>

</mapper>