<?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.artfess.report.bigScreen.dao.BladeVisualDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.artfess.report.bigScreen.model.BladeVisual">
        <id column="id_" property="id"/>
        <result column="title_" property="title"/>
        <result column="background_url_" property="backgroundUrl"/>
        <result column="category_" property="category"/>
        <result column="password_" property="password"/>
        <result column="create_by_" property="createBy"/>
        <result column="create_org_id_" property="createOrgId"/>
        <result column="create_time_" property="createTime"/>
        <result column="update_by_" property="updateBy"/>
        <result column="update_time_" property="updateTime"/>
        <result column="status_" property="status"/>
        <result column="is_dele_" property="isDele"/>
        <result column="tenant_id_" property="tenantId"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id_, title_, background_url_, category_, password_, create_by_, create_org_id_, create_time_, update_by_, update_time_, status_, is_dele_, tenant_id_
    </sql>
    <select id="queryPage" resultType="com.artfess.report.bigScreen.model.BladeVisual">
        SELECT A
        .*,
        b.category_key_,
        b.category_value_,
        b.tenant_id_
        FROM
        blade_visual
        A INNER JOIN blade_visual_category b ON A.category_ = b.category_value_
        <if test="ew.customSqlSegment!=null">
            ${ew.customSqlSegment}
        </if>
    </select>

</mapper>
