<?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="cn.superdesk.uniorder.dao.mapper.unified.settlement.UnifiedSettlementProgrammeRangeRuleMapperEx">

    <select id="getByType" resultType="cn.superdesk.uniorder.dto.vo.unified.settlement.RangeRuleVo">
        SELECT
            t.`id`,
            t.`type`,
            t.`programme_id`,
            t.`display`,
            t.`way`,
            t.`not_joining_range`,
            t.`not_joining_range_json`
        FROM
            unified_settlement_programme_range_rule t
        WHERE
            t.deleted = 0
        <if test="type != null">
            AND t.type = #{type}
        </if>
        <if test="programmeId != null">
            AND t.programme_id = #{programmeId}
        </if>

    </select>
</mapper>