<?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.lframework.xingyun.template.gen.mappers.GenCustomPageMapper">

    <sql id="GenCustomPage_sql">
      SELECT
        o.*
      FROM gen_custom_page AS o
    </sql>

    <select id="query" resultType="com.lframework.xingyun.template.gen.entity.GenCustomPage">
        <include refid="GenCustomPage_sql"/>
        <where>
            <if test="vo != null">
                <if test="vo.id != null">
                    AND o.id = #{vo.id}
                </if>
                <if test="vo.categoryId != null and vo.categoryId != ''">
                    AND o.category_id = #{vo.categoryId}
                </if>
                <if test="vo.name != null and vo.name != ''">
                    AND o.name LIKE CONCAT('%', #{vo.name}, '%')
                </if>
            </if>
        </where>
        ORDER BY o.create_time DESC
    </select>
    <select id="selector" resultType="com.lframework.xingyun.template.gen.entity.GenCustomPage">
      <include refid="GenCustomPage_sql"/>
      <where>
          <if test="vo != null">
              <if test="vo.id != null">
                  AND o.id = #{vo.id}
              </if>
              <if test="vo.categoryId != null and vo.categoryId != ''">
                  AND o.category_id = #{vo.categoryId}
              </if>
              <if test="vo.name != null and vo.name != ''">
                  AND o.name LIKE CONCAT('%', #{vo.name}, '%')
              </if>
          </if>
      </where>
      ORDER BY o.create_time DESC
    </select>

</mapper>