<?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.CustomGroupInterestFreeMapper">
    <select id="countList" resultType="integer"
            parameterType="com.crm.rely.backend.core.entity.custom.group.free.CustomGroupInterestFreeSearchEntity">
        select count(*) from custom_group_interest_free
        <where>
            <if test="groupName!=null and groupName!=''">
                and `group_name` = like concat(#{groupName},'%')
            </if>
            <if test="groupType!=null">
                and `gruop_type` = #{groupType}
            </if>
        </where>
    </select>

    <select id="pageList" resultType="com.crm.rely.backend.core.pojo.table.CustomGroupInterestFreeTable"
            parameterType="com.crm.rely.backend.core.entity.custom.group.free.CustomGroupInterestFreeSearchEntity">
        select * from custom_group_interest_free
        <where>
            <if test="groupName!=null and groupName!=''">
                and `group_name` = like concat(#{groupName},'%')
            </if>
            <if test="groupType!=null">
                and `gruop_type` = #{groupType}
            </if>
        </where>
        order by id desc
        limit #{page.offset},#{page.row}
    </select>
</mapper>