<?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.crm.manager.dao.mapper.ActivityRequiteRebateMapper">

    <select id="countList" resultType="integer"
            parameterType="com.crm.rely.backend.core.entity.activity.requite.ActivityRequiteRebateSearchEntity">
        select count(*) from activity_requite_rebate
        <where>
            <if test="ibNo!=null and ibNo != ''">
                and `ib_no` = #{ibNo}
            </if>
            <if test="rebate!=null">
                and `rebate` = #{rebate}
            </if>

        </where>
    </select>

    <select id="pageList" resultType="com.crm.rely.backend.core.pojo.table.ActivityRequiteRebateTable"
            parameterType="com.crm.rely.backend.core.entity.activity.requite.ActivityRequiteRebateSearchEntity">
        select * from activity_requite_rebate
        <where>
            <if test="ibNo!=null and ibNo != ''">
                and `ib_no` = #{ibNo}
            </if>
            <if test="rebate!=null">
                and `rebate` = #{rebate}
            </if>

        </where>
        order by id desc
        limit #{page.offset},#{page.row}
    </select>

</mapper>