<?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.yifu.cloud.plus.v1.business.mapper.system.TBusWarningMessageMapper">
    <resultMap id="tBusWarningMessageMap" type="com.yifu.cloud.plus.v1.business.entity.system.TBusWarningMessage">
        <id property="id" column="id"/>
        <result property="warningId" column="warning_id"/>
        <result property="remindType" column="remind_type"/>
        <result property="remindContent" column="remind_content"/>
        <result property="remindObject" column="remind_object"/>
        <result property="remark" column="remark"/>
        <result property="createDate" column="create_date"/>
    </resultMap>
    <sql id="Base_Column_List">
        a.id,
        a.warning_id,
        a.remind_type,
        a.remind_content,
        a.remind_object,
        a.remark,
        a.create_date
    </sql>
    <!--tBusWarningMessage简单分页查询-->
    <select id="getTBusWarningMessagePage" resultMap="tBusWarningMessageMap">
        SELECT
            <include refid="Base_Column_List"/>
        FROM t_bus_warning_message a
        where 1=1
        <if test="tBusWarningMessage != null and tBusWarningMessage.createDate != null">
             and a.create_date = #{tBusWarning.createDate}
        </if>
        <if test="roleList != null and roleList != '' ">
            and ( 1=2
            <foreach item="item" index="index" collection="roleList" >
                or locate('${item}',a.remind_object)
            </foreach>
            )
        </if>
        order by a.create_date desc
    </select>

</mapper>
