<?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="org.springblade.channel.mapper.BladeChannelMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="org.springblade.channel.entity.BladeChannel">
        <id column="id" property="id" />
        <result column="name" property="name" />
        <result column="BELONGTO" property="belongto" />
        <result column="CREATETIME" property="createtime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, name, BELONGTO, CREATETIME
    </sql>

    <select id="getPageByQuery" resultType="org.springblade.channel.entity.BladeChannel">
        SELECT
        *
        FROM
        blade_channel
        where 1=1
        <if test="query.channelName != null and query.channelName != ''">
            and name LIKE CONCAT('%',#{query.channelName},'%')
        </if>
        <if test="query.channelId != null and query.channelId != ''">
            and id = #{query.channelId}
        </if>
    </select>

</mapper>
