<?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.corewing.app.mapper.AppModelCategoryMapper">


    <!-- 基础查询SQL片段 -->
    <sql id="selectVOSql">
        select mc.*
            from app_model_category mc
    </sql>

    <!-- 分页查询 -->
    <select id="page" resultType="com.corewing.app.entity.AppModelCategory">
        <include refid="selectVOSql"/>
        <where>
            <if test="modelCategoryPageRequest.searchKey != null and modelCategoryPageRequest.searchKey != ''">
                AND mc.name like CONCAT('%', #{modelCategoryPageRequest.searchKey}, '%')
            </if>
        </where>
    </select>

    <select id="list" resultType="com.corewing.app.entity.AppModelCategory">
        <include refid="selectVOSql"/>
        <where>
            <if test="modelCategoryListRequest.searchKey != null and modelCategoryListRequest.searchKey != ''">
                AND mc.name like CONCAT('%', #{modelCategoryListRequest.searchKey}, '%')
            </if>
        </where>
    </select>

</mapper>
