<?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.yd.csf.service.dao.RuleItemConfigMapper">

    <select id="page" resultType="com.yd.csf.feign.response.ruleItemconfig.ApiRuleItemConfigPageResponse">
        select ric.*,crc.rule_name
        from rule_item_config ric
        left join commission_rule_config crc on crc.rule_biz_id = ric.rule_biz_id and crc.is_deleted = 0
        <where>
            <if test="request.itemName != null and request.itemName != ''">
                and ric.item_name like concat('%', #{request.itemName}, '%')
            </if>
            <if test="request.calculate != null and request.calculate != ''">
                and ric.calculate = #{request.calculate}
            </if>
            and ric.is_deleted = 0
        </where>
    </select>

</mapper>
