<?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.com.ty.lift.ud.operation.mapper.UserRebateRuleMapper">


    <!--后台分页查询-->
    <select id="selectByQuery" resultType="cn.com.ty.lift.ud.operation.mapper.entity.UserRebateRuleEntity">
        select urr.* ,ulr.name as roleName
        from user_rebate_rule as urr
        left join user_level_rule as ulr on ulr.id = urr.role_id
        <where>
            ${ew.sqlSegment}
        </where>
        limit #{page.pageIndex},#{page.pageSize}
</select>

<!--查询总数量-->
    <select id="countByQuery" resultType="java.lang.Integer">
        select count(0)
        from user_rebate_rule as urr
        left join user_level_rule as ulr on ulr.id = urr.role_id
        <where>
            ${ew.sqlSegment}
        </where>
    </select>



</mapper>