<?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.yiqi.settlement.mapper.SettlementFactoryRateMapper">


    <select id="queryList" resultType="com.yiqi.settlement.domain.vo.SettlementFactoryRateListVO">
        select f.id as factoryId, f.factory_name as 'factoryName', fr.*
        from manage_factory f
        left join settlement_factory_rate fr on f.id = fr.factory_id
        where f.del_flag = '0'
        <if test="factoryId != null">
            and f.id = #{factoryId}
        </if>
        order by f.id desc
    </select>
</mapper>