<?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.bank.message.mapper.MessageMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="messageResultMap" type="org.springblade.bank.message.entity.Message">
        <result column="id" property="id"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="title" property="title"/>
        <result column="content" property="content"/>
        <result column="file" property="file"/>
        <result column="person_id" property="personId"/>
        <result column="person_name" property="personName"/>
        <result column="approve_time" property="approveTime"/>
        <result column="process" property="process"/>
        <result column="is_completed" property="isCompleted"/>
        <result column="dept_id" property="deptId"/>

        <result column="domain" property="domain"/>
        <result column="name" property="name"/>
        <result column="original_name" property="originalName"/>
        <result column="extension" property="extension"/>
        <result column="attach_size" property="attachSize"/>
    </resultMap>


    <select id="selectMessagePage" resultMap="messageResultMap">
        select * from zh_message where is_deleted = 0
        <if test="message!=null">
            <if test="message.createUser!=null">
                AND create_user like '%${message.createUser}%'
            </if>
        </if>
        ORDER BY create_time DESC
    </select>

</mapper>
