<?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.examine.dao.ExamMaterialInfoDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.artfess.examine.model.ExamMaterialInfo">
        <id column="id_" property="id" />
        <result column="type_id_" property="typeId" />
        <result column="title_" property="title" />
        <result column="keyword_" property="keyword" />
        <result column="memo_" property="memo" />
        <result column="sn_" property="sn" />
        <result column="version_" property="version" />
        <result column="last_time_" property="lastTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id_, type_id_, title_, keyword_, memo_, sn_, memo_2, is_dele_, create_by_, create_org_id_, create_time_, update_by_, update_time_, version_, last_time_
    </sql>
    <select id="queryPage" resultType="com.artfess.examine.model.ExamMaterialInfo">
        SELECT
            s.*,
            t.name_ AS typeName
        FROM
            exam_material_info s
        LEFT JOIN exam_material_type t ON t.id_ = s.type_id_
        <if test="ew.customSqlSegment!=null">
            ${ew.customSqlSegment}
        </if>
        <if test="@com.artfess.base.ognl.Ognl@isEmpty(ew.customSqlSegment)"> WHERE </if>
        <if test="@com.artfess.base.ognl.Ognl@isNotEmpty(ew.customSqlSegment)"> AND </if>
        s.IS_DELE_ = '0'

    </select>

</mapper>
